Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 431 lines (361 sloc) 13.356 kb
7ac679b Sam Tregar Added new installation system, removed old installation system. Also
samtregar authored
1 #!/usr/bin/perl -w
2
fd71f7e David E. Wheeler Converted all POD `=head` headers to proper case, rather than uppercase.
theory authored
3 =head1 Name
7ac679b Sam Tregar Added new installation system, removed old installation system. Also
samtregar authored
4
7c26d79 put some apache 2.0 support in place:
Scott Lanning authored
5 required.pl - installation script to probe for required software
6 and select database and Apache version
7ac679b Sam Tregar Added new installation system, removed old installation system. Also
samtregar authored
7
fd71f7e David E. Wheeler Converted all POD `=head` headers to proper case, rather than uppercase.
theory authored
8 =head1 Description
7ac679b Sam Tregar Added new installation system, removed old installation system. Also
samtregar authored
9
10 This script is called during "make" to probe for required software -
35e3382 David E. Wheeler Various changes with the goal of makeing `make dev` a hell of a lot simp...
theory authored
11 Perl, Apache/Apache2, PostgreSQL/MySQL, and Expat currently.
7c26d79 put some apache 2.0 support in place:
Scott Lanning authored
12 Output collected in "required.db".
7ac679b Sam Tregar Added new installation system, removed old installation system. Also
samtregar authored
13
fd71f7e David E. Wheeler Converted all POD `=head` headers to proper case, rather than uppercase.
theory authored
14 =head1 Author
7ac679b Sam Tregar Added new installation system, removed old installation system. Also
samtregar authored
15
16 Sam Tregar <stregar@about-inc.com>
17
7c26d79 put some apache 2.0 support in place:
Scott Lanning authored
18 database selection support added by Andrei Arsu <acidburn@asynet.ro>
19
20 apache version support added by Scott Lanning <slanning@cpan.org>
21
fd71f7e David E. Wheeler Converted all POD `=head` headers to proper case, rather than uppercase.
theory authored
22 =head1 See Also
7ac679b Sam Tregar Added new installation system, removed old installation system. Also
samtregar authored
23
24 L<Bric::Admin>
25
26 =cut
27
28
29 use strict;
30
31 # check required Perl version first, fail immediately if too old
32 BEGIN {
fb286a5 David E. Wheeler More strongly recommending 5.8.0. Doing so both in documentation and dur...
theory authored
33 eval { require 5.008 };
34 if ($@) {
47ccab0 Added $USE_DEFAULTS makefile environment variable that, when used with
Marshall Roch authored
35 print "#" x 79, "\n\n", <<END, "\n", "#" x 79, "\n";
10bf590 David E. Wheeler Require Perl 5.8.0 or newer.
theory authored
36 Bricolage requires Perl version 5.8.0 or later. Please upgrade your version
37 of Perl before re-running make. You can find the latest versions of Perl at
38 'http://perl.com/'.
fb286a5 David E. Wheeler More strongly recommending 5.8.0. Doing so both in documentation and dur...
theory authored
39
40 END
10bf590 David E. Wheeler Require Perl 5.8.0 or newer.
theory authored
41 exit 1;
fb286a5 David E. Wheeler More strongly recommending 5.8.0. Doing so both in documentation and dur...
theory authored
42 }
7ac679b Sam Tregar Added new installation system, removed old installation system. Also
samtregar authored
43 }
44
45 use FindBin;
46 use lib "$FindBin::Bin/lib";
47 use Bric::Inst qw(:all);
48 use File::Spec::Functions;
49 use Data::Dumper;
50 use Config;
51
35e3382 David E. Wheeler Various changes with the goal of makeing `make dev` a hell of a lot simp...
theory authored
52 our (%REQ, %RESULTS, %PROBES);
7ac679b Sam Tregar Added new installation system, removed old installation system. Also
samtregar authored
53
e3390f6 David E. Wheeler Added quiet parameter to Makefile. From Rod Taylor.
theory authored
54 # check to see whether we should ask questions or not
35e3382 David E. Wheeler Various changes with the goal of makeing `make dev` a hell of a lot simp...
theory authored
55 my $QUIET = ($ARGV[0] and $ARGV[0] eq 'QUIET') || $ENV{DEVELOPER};
090e0d7 This is the first in a series of fixes
Andrei Arsu authored
56 shift if $QUIET or $ARGV[0] eq 'STANDARD';
e3390f6 David E. Wheeler Added quiet parameter to Makefile. From Rod Taylor.
theory authored
57
9ac694a David E. Wheeler Make `make upgrade` smarter. It now properly detects the database and Ap...
theory authored
58 if (-e 'installed.db') {
59 # Grab the data for what's already installed (it's an upgrade).
60 %REQ = %{ do './installed.db' or die "Failed to read installed.db: $!\n" };
61 }
62
7c26d79 put some apache 2.0 support in place:
Scott Lanning authored
63 # collect data - configuration requirements data go into %REQ,
64 # boolean pass/fail go into %RESULTS.
090e0d7 This is the first in a series of fixes
Andrei Arsu authored
65
66 # setup some defaults
9ac694a David E. Wheeler Make `make upgrade` smarter. It now properly detects the database and Ap...
theory authored
67 $REQ{DB_TYPE} ||= get_default('DB_TYPE') || 'Pg';
68 $REQ{HTTPD_VERSION} ||= get_default('HTTPD_VERSION') || 'apache';
090e0d7 This is the first in a series of fixes
Andrei Arsu authored
69
70 get_probes();
71
7ac679b Sam Tregar Added new installation system, removed old installation system. Also
samtregar authored
72 print "\n\n==> Probing Required Software <==\n\n";
73
7c26d79 put some apache 2.0 support in place:
Scott Lanning authored
74 get_database();
75 get_httpd();
76
7ac679b Sam Tregar Added new installation system, removed old installation system. Also
samtregar authored
77 # run tests
7c26d79 put some apache 2.0 support in place:
Scott Lanning authored
78 $RESULTS{PG} = find_pg() if $REQ{DB_TYPE} eq 'Pg';
79 $RESULTS{MYSQL} = find_mysql() if $REQ{DB_TYPE} eq 'mysql';
80 $RESULTS{APACHE} = find_apache() if $REQ{HTTPD_VERSION} eq 'apache';
81 $RESULTS{APACHE2} = find_apache2() if $REQ{HTTPD_VERSION} eq 'apache2';
7ac679b Sam Tregar Added new installation system, removed old installation system. Also
samtregar authored
82 $RESULTS{EXPAT} = find_expat();
83
84 # print error message and fail if something not found
9ac694a David E. Wheeler Make `make upgrade` smarter. It now properly detects the database and Ap...
theory authored
85 unless (
86 ($RESULTS{PG} or $RESULTS{MYSQL})
87 and ($RESULTS{APACHE} or $RESULTS{APACHE2})
88 and $RESULTS{EXPAT}
89 ) {
90 hard_fail(
91 "Required software not found:\n\n",
ddf6bda paulorrock Added more documentation to inst/htprobe_apache2.pl and fixed inst/requi...
paulorrock authored
92 ($RESULTS{PG} or ($REQ{DB_TYPE} eq 'mysql')) ? '' :
20538d4 David E. Wheeler Require PostgreSQL 8.1 or higher.
theory authored
93 "\tPostgreSQL >= 8.1.0 (http://postgresql.org)\n",
ddf6bda paulorrock Added more documentation to inst/htprobe_apache2.pl and fixed inst/requi...
paulorrock authored
94 ($RESULTS{MYSQL} or ($REQ{DB_TYPE} eq 'Pg')) ? '' :
35e3382 David E. Wheeler Various changes with the goal of makeing `make dev` a hell of a lot simp...
theory authored
95 "\tMySQL client >= 4.1.0 (http://mysql.com)\n",
ddf6bda paulorrock Added more documentation to inst/htprobe_apache2.pl and fixed inst/requi...
paulorrock authored
96 ($RESULTS{APACHE} or ($REQ{HTTPD_VERSION} eq 'apache2')) ? '' :
341f8e0 changed fix to thwart HTTP TRACE exploit to use TraceEnable directive ra...
David Beaudet authored
97 "\tApache >= 1.3.34 && < 2.0 (http://httpd.apache.org)\n",
ddf6bda paulorrock Added more documentation to inst/htprobe_apache2.pl and fixed inst/requi...
paulorrock authored
98 ($RESULTS{APACHE2} or ($REQ{HTTPD_VERSION} eq 'apache')) ? '' :
341f8e0 changed fix to thwart HTTP TRACE exploit to use TraceEnable directive ra...
David Beaudet authored
99 "\tApache >= 2.0.55 (http://httpd.apache.org)\n",
9ac694a David E. Wheeler Make `make upgrade` smarter. It now properly detects the database and Ap...
theory authored
100 $RESULTS{EXPAT} ? '' :
7c26d79 put some apache 2.0 support in place:
Scott Lanning authored
101 "\texpat >= 1.95.0 (http://expat.sourceforge.net)\n",
9ac694a David E. Wheeler Make `make upgrade` smarter. It now properly detects the database and Ap...
theory authored
102 "\nSee INSTALL for details.\n"
103 );
7ac679b Sam Tregar Added new installation system, removed old installation system. Also
samtregar authored
104 }
105
106 # success, write out %REQ hash into required.db
9ac694a David E. Wheeler Make `make upgrade` smarter. It now properly detects the database and Ap...
theory authored
107 open OUT, '>required.db' or die "Unable to open required.db: $!\n";
7ac679b Sam Tregar Added new installation system, removed old installation system. Also
samtregar authored
108 print OUT Data::Dumper->Dump([\%REQ],['REQ']);
109 close OUT;
110
111 # all done
112 print "\n\n==> Finished Probing Required Software <==\n\n";
113 exit 0;
114
7c26d79 put some apache 2.0 support in place:
Scott Lanning authored
115
7ac679b Sam Tregar Added new installation system, removed old installation system. Also
samtregar authored
116 sub find_pg {
20538d4 David E. Wheeler Require PostgreSQL 8.1 or higher.
theory authored
117 print "Looking for PostgreSQL with version >= 8.1.0...\n";
7ac679b Sam Tregar Added new installation system, removed old installation system. Also
samtregar authored
118
47ccab0 Added $USE_DEFAULTS makefile environment variable that, when used with
Marshall Roch authored
119 # find PostgreSQL by looking for pg_config.
98d6bc4 David E. Wheeler Merged rev_1_8 changes 6415-6535. Will tag rev_1_8_merge_6535.
theory authored
120 my @paths = (split(", ", get_default("PG_CONFIG_PATH")), path);
7ac679b Sam Tregar Added new installation system, removed old installation system. Also
samtregar authored
121 foreach my $path (@paths) {
9ac694a David E. Wheeler Make `make upgrade` smarter. It now properly detects the database and Ap...
theory authored
122 if (-e catfile($path, "pg_config")) {
123 $REQ{PG_CONFIG} = catfile($path, "pg_config");
124 last;
125 }
7ac679b Sam Tregar Added new installation system, removed old installation system. Also
samtregar authored
126 }
8092c46 Sam Tregar Makefile now confirms location of Apache and PostgreSQL to allow for sys...
samtregar authored
127
128 # confirm or deny
129 if ($REQ{PG_CONFIG}) {
130 print "Found PostgreSQL's pg_config at '$REQ{PG_CONFIG}'.\n";
47ccab0 Added $USE_DEFAULTS makefile environment variable that, when used with
Marshall Roch authored
131 unless (ask_yesno("Is this correct?", 1, $QUIET)) {
8092c46 Sam Tregar Makefile now confirms location of Apache and PostgreSQL to allow for sys...
samtregar authored
132 ask_confirm("Enter path to pg_config", \$REQ{PG_CONFIG});
133 }
134 } else {
135 print "Failed to find pg_config.\n";
47ccab0 Added $USE_DEFAULTS makefile environment variable that, when used with
Marshall Roch authored
136 if (ask_yesno("Do you want to provide a path to pg_config?", 0, $QUIET)) {
8092c46 Sam Tregar Makefile now confirms location of Apache and PostgreSQL to allow for sys...
samtregar authored
137 $REQ{PG_CONFIG} = 'NONE';
138 ask_confirm("Enter path to pg_config", \$REQ{PG_CONFIG});
139 } else {
9ac694a David E. Wheeler Make `make upgrade` smarter. It now properly detects the database and Ap...
theory authored
140 return soft_fail(
141 "Failed to find pg_config. Looked in:",
142 map { "\n\t$_" } @paths
143 );
8092c46 Sam Tregar Makefile now confirms location of Apache and PostgreSQL to allow for sys...
samtregar authored
144 }
145 }
146
7ac679b Sam Tregar Added new installation system, removed old installation system. Also
samtregar authored
147 # check version
148 my $version = `$REQ{PG_CONFIG} --version`;
9ac694a David E. Wheeler Make `make upgrade` smarter. It now properly detects the database and Ap...
theory authored
149 return soft_fail(
150 "Failed to find PostgreSQL version with ",
151 "`$REQ{PG_CONFIG} --version`."
152 ) unless $version;
7ac679b Sam Tregar Added new installation system, removed old installation system. Also
samtregar authored
153 chomp $version;
154 my ($x, $y, $z) = $version =~ /(\d+)\.(\d+)(?:\.(\d+))?/;
9ac694a David E. Wheeler Make `make upgrade` smarter. It now properly detects the database and Ap...
theory authored
155 return soft_fail(
156 qq{Failed to parse PostgreSQL version from string "$version".}
157 ) unless defined $x and defined $y;
7ac679b Sam Tregar Added new installation system, removed old installation system. Also
samtregar authored
158 $z ||= 0;
9ac694a David E. Wheeler Make `make upgrade` smarter. It now properly detects the database and Ap...
theory authored
159 return soft_fail(
20538d4 David E. Wheeler Require PostgreSQL 8.1 or higher.
theory authored
160 "Found old version of Postgres: $x.$y.$z - 8.1.0 or greater required."
161 ) unless ($x > 8 or ($x == 8 and $y >= 1));
887f608 David E. Wheeler Require PostgreSQL 7.3 or later.
theory authored
162 print "Found acceptable version of Postgres: $x.$y.$z.\n";
3f52a84 David E. Wheeler Recommend PostgreSQL 7.3 or later.
theory authored
163
7ac679b Sam Tregar Added new installation system, removed old installation system. Also
samtregar authored
164 $REQ{PG_VERSION} = [$x,$y,$z];
165
166 return 1;
167 }
168
0300314 Modified instalation scripts for database probing and instalation
Andrei Arsu authored
169 sub find_mysql {
60c7e6d Modified Makefile to make it more independent
Andrei Arsu authored
170 print "Looking for MySQL client with version >= 4.1....\n";
0300314 Modified instalation scripts for database probing and instalation
Andrei Arsu authored
171
172 # find MySQL by looking for mysql_config.
173 my @paths = (split(", ", get_default("MYSQL_CONFIG_PATH")), path);
174 foreach my $path (@paths) {
9ac694a David E. Wheeler Make `make upgrade` smarter. It now properly detects the database and Ap...
theory authored
175 if (-e catfile($path, "mysql_config")) {
176 $REQ{MYSQL_CONFIG} = catfile($path, "mysql_config");
177 last;
178 }
0300314 Modified instalation scripts for database probing and instalation
Andrei Arsu authored
179 }
180
181 # confirm or deny
182 if ($REQ{MYSQL_CONFIG}) {
183 print "Found MySQL's mysql_config at '$REQ{MYSQL_CONFIG}'.\n";
184 unless (ask_yesno("Is this correct?", 1, $QUIET)) {
090e0d7 This is the first in a series of fixes
Andrei Arsu authored
185 ask_confirm("Enter path to mysql_config", \$REQ{MYSQL_CONFIG});
0300314 Modified instalation scripts for database probing and instalation
Andrei Arsu authored
186 }
187 } else {
188 print "Failed to find mysql_config.\n";
9ac694a David E. Wheeler Make `make upgrade` smarter. It now properly detects the database and Ap...
theory authored
189 if (ask_yesno("Do you want to provide a path to mysql_config?", 0, $QUIET)
190 ) {
0300314 Modified instalation scripts for database probing and instalation
Andrei Arsu authored
191 $REQ{MYSQL_CONFIG} = 'NONE';
192 ask_confirm("Enter path to mysql_config", \$REQ{MYSQL_CONFIG});
193 } else {
9ac694a David E. Wheeler Make `make upgrade` smarter. It now properly detects the database and Ap...
theory authored
194 return soft_fail(
195 "Failed to find mysql_config. Looked in:",
196 map { "\n\t$_" } @paths
197 );
0300314 Modified instalation scripts for database probing and instalation
Andrei Arsu authored
198 }
199 }
200
201 # check version
202 my $version = `$REQ{MYSQL_CONFIG} --version`;
9ac694a David E. Wheeler Make `make upgrade` smarter. It now properly detects the database and Ap...
theory authored
203 return soft_fail(
204 "Failed to find MysqlSQL version with ",
205 "`$REQ{MYSQL_CONFIG} --version`."
206 ) unless $version;
0300314 Modified instalation scripts for database probing and instalation
Andrei Arsu authored
207 chomp $version;
208 my ($x, $y, $z) = $version =~ /(\d+)\.(\d+)(?:\.(\d+))?/;
9ac694a David E. Wheeler Make `make upgrade` smarter. It now properly detects the database and Ap...
theory authored
209 return soft_fail(
210 qq{Failed to parse MySQL client version from string "$version".}
211 ) unless defined $x and defined $y;
0300314 Modified instalation scripts for database probing and instalation
Andrei Arsu authored
212 $z ||= 0;
9ac694a David E. Wheeler Make `make upgrade` smarter. It now properly detects the database and Ap...
theory authored
213 return soft_fail(
214 "Found old version of Mysql client: $x.$y.$z - 5.0.3 or greater required."
215 ) unless (
216 ($x > 5)
217 or ($x == 5 and $y >= 0)
218 or ($x == 5 and $y == 0 and $z >= 3)
219 );
220 print "Found acceptable version of MySQL: $x.$y.$z.\n";
0300314 Modified instalation scripts for database probing and instalation
Andrei Arsu authored
221
60c7e6d Modified Makefile to make it more independent
Andrei Arsu authored
222 $REQ{MYSQL_CLIENT_VERSION} = [$x,$y,$z];
0300314 Modified instalation scripts for database probing and instalation
Andrei Arsu authored
223 return 1;
224 }
225
226
7ac679b Sam Tregar Added new installation system, removed old installation system. Also
samtregar authored
227 sub find_apache {
341f8e0 changed fix to thwart HTTP TRACE exploit to use TraceEnable directive ra...
David Beaudet authored
228 print "Looking for Apache with version >= 1.3.34 && < 2.0...\n";
3f52a84 David E. Wheeler Recommend PostgreSQL 7.3 or later.
theory authored
229
230 # find Apache by looking for executables called httpd, httpsd,
231 # apache-perl or apache, in that order. First search user's
69cbe17 David E. Wheeler Committed Michael Slattery's Apache-SSL patch. This patch adds the follo...
theory authored
232 # path then some standard locations.
98d6bc4 David E. Wheeler Merged rev_1_8 changes 6415-6535. Will tag rev_1_8_merge_6535.
theory authored
233 my @paths = (split(", ", get_default("APACHE_PATH")), path);
47ccab0 Added $USE_DEFAULTS makefile environment variable that, when used with
Marshall Roch authored
234 my @exe = (split(", ", get_default("APACHE_EXE")));
7ac679b Sam Tregar Added new installation system, removed old installation system. Also
samtregar authored
235
8704e19 David E. Wheeler Prefer user-installed servers to those included with the OS.
theory authored
236 FIND:
7ac679b Sam Tregar Added new installation system, removed old installation system. Also
samtregar authored
237 foreach my $exe (@exe) {
47ccab0 Added $USE_DEFAULTS makefile environment variable that, when used with
Marshall Roch authored
238 foreach my $path (@paths) {
239 if (-e catfile($path, $exe)) {
240 $REQ{APACHE_EXE} = catfile($path, $exe);
241 last FIND;
242 }
243 }
7ac679b Sam Tregar Added new installation system, removed old installation system. Also
samtregar authored
244 }
8092c46 Sam Tregar Makefile now confirms location of Apache and PostgreSQL to allow for sys...
samtregar authored
245
246 # confirm or deny
247 if ($REQ{APACHE_EXE}) {
7c26d79 put some apache 2.0 support in place:
Scott Lanning authored
248 print "Found Apache 1.3 server binary at '$REQ{APACHE_EXE}'.\n";
47ccab0 Added $USE_DEFAULTS makefile environment variable that, when used with
Marshall Roch authored
249 unless ($QUIET or ask_yesno("Is this correct?", 1)) {
9ac694a David E. Wheeler Make `make upgrade` smarter. It now properly detects the database and Ap...
theory authored
250 ask_confirm(
251 "Enter path to Apache 1.3 server binary",
252 \$REQ{APACHE_EXE}
253 );
8092c46 Sam Tregar Makefile now confirms location of Apache and PostgreSQL to allow for sys...
samtregar authored
254 }
255 } else {
256 print "Failed to find Apache server binary.\n";
9ac694a David E. Wheeler Make `make upgrade` smarter. It now properly detects the database and Ap...
theory authored
257 if (ask_yesno(
258 "Do you want to provide a path to the Apache server binary?",
259 0,
260 $QUIET
261 )) {
8092c46 Sam Tregar Makefile now confirms location of Apache and PostgreSQL to allow for sys...
samtregar authored
262 $REQ{APACHE_EXE} = 'NONE';
9ac694a David E. Wheeler Make `make upgrade` smarter. It now properly detects the database and Ap...
theory authored
263 ask_confirm(
264 "Enter path to Apache server binary",
265 \$REQ{APACHE_EXE}
266 );
8092c46 Sam Tregar Makefile now confirms location of Apache and PostgreSQL to allow for sys...
samtregar authored
267 } else {
9ac694a David E. Wheeler Make `make upgrade` smarter. It now properly detects the database and Ap...
theory authored
268 return soft_fail(
269 "Failed to find Apache 1.3 executable. Looked for ",
270 join(', ', @exe),
271 " in:",
272 map { "\n\t$_" } @paths
273 );
7c26d79 put some apache 2.0 support in place:
Scott Lanning authored
274 }
275 }
276
277 print "Found Apache 1.3 executable at $REQ{APACHE_EXE}.\n";
278
279 # check version
280 my $version = `$REQ{APACHE_EXE} -v`;
9ac694a David E. Wheeler Make `make upgrade` smarter. It now properly detects the database and Ap...
theory authored
281 return soft_fail(
282 "Failed to find Apache 1.3 version with `$REQ{APACHE_EXE} -v`."
283 ) unless $version;
7c26d79 put some apache 2.0 support in place:
Scott Lanning authored
284 chomp $version;
285 my ($x, $y, $z) = $version =~ /(\d+)\.(\d+).(\d+)/;
9ac694a David E. Wheeler Make `make upgrade` smarter. It now properly detects the database and Ap...
theory authored
286 return soft_fail(
287 qq{Failed to parse Apache 1.3 version from string "$version".}
288 ) unless defined $x and defined $y and defined $z;
289
290 return soft_fail(
291 "Found unacceptable version of Apache: $x.$y.$z - ",
292 'version >= 1.3.34 and < 2.0 required.'
293 ) unless (($x == 1 and $y == 3 and $z >= 12) or ($x == 1 and $y > 3));
7c26d79 put some apache 2.0 support in place:
Scott Lanning authored
294
295 print "Found acceptable version of Apache: $x.$y.$z.\n";
296 $REQ{APACHE_VERSION} = [$x,$y,$z];
297 return 1;
298 }
299
300 sub find_apache2 {
341f8e0 changed fix to thwart HTTP TRACE exploit to use TraceEnable directive ra...
David Beaudet authored
301 print "Looking for Apache with version >= 2.0.55...\n";
7c26d79 put some apache 2.0 support in place:
Scott Lanning authored
302
303 # Note: be careful with the names here. The defaults have 2s in them,
304 # like APACHE2_EXE, but what's put in %REQ doesn't have a 2, so APACHE_EXE.
305 # It's so that later scripts like inst/conf.pl don't have to worry about
306 # which version it is.
307
308 my @paths = (split(", ", get_default("APACHE2_PATH")), path);
309 my @exe = (split(", ", get_default("APACHE2_EXE")));
310
311 FIND:
312 foreach my $exe (@exe) {
313 foreach my $path (@paths) {
314 if (-e catfile($path, $exe)) {
315 $REQ{APACHE_EXE} = catfile($path, $exe);
316 last FIND;
317 }
318 }
319 }
320
321 # confirm or deny
322 if ($REQ{APACHE_EXE}) {
323 print "Found Apache server binary at '$REQ{APACHE_EXE}'.\n";
324 unless ($QUIET or ask_yesno("Is this correct?", 1)) {
9ac694a David E. Wheeler Make `make upgrade` smarter. It now properly detects the database and Ap...
theory authored
325 ask_confirm(
326 'Enter path to Apache 2 server binary',
327 \$REQ{APACHE_EXE}
328 );
7c26d79 put some apache 2.0 support in place:
Scott Lanning authored
329 }
330 } else {
331 print "Failed to find Apache 2 server binary.\n";
9ac694a David E. Wheeler Make `make upgrade` smarter. It now properly detects the database and Ap...
theory authored
332 if (ask_yesno(
333 "Do you want to provide a path to the Apache 2 server binary?",
334 0,
335 $QUIET,
336 )) {
7c26d79 put some apache 2.0 support in place:
Scott Lanning authored
337 $REQ{APACHE_EXE} = 'NONE';
9ac694a David E. Wheeler Make `make upgrade` smarter. It now properly detects the database and Ap...
theory authored
338 ask_confirm(
339 "Enter path to Apache 2 server binary",
340 \$REQ{APACHE_EXE}
341 );
7c26d79 put some apache 2.0 support in place:
Scott Lanning authored
342 } else {
9ac694a David E. Wheeler Make `make upgrade` smarter. It now properly detects the database and Ap...
theory authored
343 return soft_fail(
344 "Failed to find Apache 2 executable. Looked for ",
345 join(', ', @exe),
346 " in:",
347 map { "\n\t$_" } @paths
348 );
8092c46 Sam Tregar Makefile now confirms location of Apache and PostgreSQL to allow for sys...
samtregar authored
349 }
350 }
351
7ac679b Sam Tregar Added new installation system, removed old installation system. Also
samtregar authored
352 print "Found Apache executable at $REQ{APACHE_EXE}.\n";
58e7365 David E. Wheeler The rest of the patch protecting against Apache 2.
theory authored
353
7ac679b Sam Tregar Added new installation system, removed old installation system. Also
samtregar authored
354 # check version
355 my $version = `$REQ{APACHE_EXE} -v`;
9ac694a David E. Wheeler Make `make upgrade` smarter. It now properly detects the database and Ap...
theory authored
356 return soft_fail(
357 "Failed to find Apache 2 version with `$REQ{APACHE_EXE} -v`."
358 ) unless $version;
7ac679b Sam Tregar Added new installation system, removed old installation system. Also
samtregar authored
359 chomp $version;
360 my ($x, $y, $z) = $version =~ /(\d+)\.(\d+).(\d+)/;
9ac694a David E. Wheeler Make `make upgrade` smarter. It now properly detects the database and Ap...
theory authored
361 return soft_fail(
362 qq{Failed to parse Apache 2 version from string "$version".}
363 ) unless defined $x and defined $y and defined $z;
364
365 return soft_fail(
366 "Found unacceptable version of Apache: $x.$y.$z - ",
367 "2.0.55 or greater required\n"
368 ) unless ($x == 2 and ($y > 0 or ($y == 0 and $z >= 51)));
650c688 First round of patching allowing installation of Bricolage in an Apache ...
Hadley Diaz authored
369
7ac679b Sam Tregar Added new installation system, removed old installation system. Also
samtregar authored
370 print "Found acceptable version of Apache: $x.$y.$z.\n";
371 $REQ{APACHE_VERSION} = [$x,$y,$z];
7edf5ca paulorrock Added check for prefork version of apache2 in inst/required.pl
paulorrock authored
372
7ac679b Sam Tregar Added new installation system, removed old installation system. Also
samtregar authored
373 return 1;
374 }
375
7c26d79 put some apache 2.0 support in place:
Scott Lanning authored
376
7ac679b Sam Tregar Added new installation system, removed old installation system. Also
samtregar authored
377 sub find_expat {
378 print "Looking for expat...\n";
379
926c25d Sam Tregar Omnibus spelling patch from Scott Lanning
samtregar authored
380 # find expat libary libexpat.so by looking in library paths that
7ac679b Sam Tregar Added new installation system, removed old installation system. Also
samtregar authored
381 # Perl knows about
9ac694a David E. Wheeler Make `make upgrade` smarter. It now properly detects the database and Ap...
theory authored
382 my @paths = grep { defined and length } (
383 split(' ', $Config{libsdirs}),
384 split(' ', $Config{loclibpth}),
385 split(' ', $Config{loclibpth})
386 );
c4db23d David E. Wheeler Added more directories and files to look for for libexpat and libiconv.
theory authored
387
9ac694a David E. Wheeler Make `make upgrade` smarter. It now properly detects the database and Ap...
theory authored
388 push @paths, split(', ', get_default('EXPAT_PATH'));
389 my @files = split(', ', get_default('EXPAT_FILE'));
c4db23d David E. Wheeler Added more directories and files to look for for libexpat and libiconv.
theory authored
390
9ac694a David E. Wheeler Make `make upgrade` smarter. It now properly detects the database and Ap...
theory authored
391 LOOK: foreach my $path (@paths) {
c4db23d David E. Wheeler Added more directories and files to look for for libexpat and libiconv.
theory authored
392 foreach my $file(@files) {
393 if (-e catfile($path, $file)) {
394 $REQ{EXPAT} = catfile($path, "libexpat.so");
395 last LOOK;
396 }
397 }
7ac679b Sam Tregar Added new installation system, removed old installation system. Also
samtregar authored
398 }
9ac694a David E. Wheeler Make `make upgrade` smarter. It now properly detects the database and Ap...
theory authored
399 return soft_fail(
400 "Failed to find libexpat.so. Looked in:",
401 map { "\n\t$_" } @paths
402 ) unless $REQ{EXPAT};
7ac679b Sam Tregar Added new installation system, removed old installation system. Also
samtregar authored
403 print "Found expat at $REQ{EXPAT}.\n";
404
405 # I should check that expat is >= 1.95.0. Um, how do I do that?
406 return 1;
407 }
090e0d7 This is the first in a series of fixes
Andrei Arsu authored
408
409 sub get_probes {
7c26d79 put some apache 2.0 support in place:
Scott Lanning authored
410 while (my $file = shift @ARGV) {
411 $PROBES{$1}{$2} = $file if $file =~ /(db|ht)probe_(\w+)\.pl$/;
090e0d7 This is the first in a series of fixes
Andrei Arsu authored
412 }
413 }
414
35e3382 David E. Wheeler Various changes with the goal of makeing `make dev` a hell of a lot simp...
theory authored
415 # ask the user to choose a database or
090e0d7 This is the first in a series of fixes
Andrei Arsu authored
416 sub get_database {
7c26d79 put some apache 2.0 support in place:
Scott Lanning authored
417 my $dbstring = join(', ', keys(%{ $PROBES{db} }));
418 print "\n\n==> Selecting Database <==\n\n";
090e0d7 This is the first in a series of fixes
Andrei Arsu authored
419 ask_confirm("Database ($dbstring): ", \$REQ{DB_TYPE}, $QUIET);
7c26d79 put some apache 2.0 support in place:
Scott Lanning authored
420 print "\n\n==> Finished Selecting Database <==\n\n";
090e0d7 This is the first in a series of fixes
Andrei Arsu authored
421 }
422
7c26d79 put some apache 2.0 support in place:
Scott Lanning authored
423 # ask the user to choose an apache version
424 sub get_httpd {
425 my $htstring = join(', ', keys(%{ $PROBES{ht} }));
426 print "\n\n==> Selecting Apache version <==\n\n";
427 ask_confirm("httpd version ($htstring): ", \$REQ{HTTPD_VERSION}, $QUIET);
428 print "\n\n==> Finished Selecting Apache version <==\n\n";
429 }
341f8e0 changed fix to thwart HTTP TRACE exploit to use TraceEnable directive ra...
David Beaudet authored
430
Something went wrong with that request. Please try again.