+2006-06-24 Alexey Proskuryakov <ap@nypop.com>
+
+ Reviewed by Darin.
+
+ - http://bugzilla.opendarwin.org/show_bug.cgi?id=9564
+ A bunch of fixes to run-webkit-httpd
+
+ - Add an -all-interfaces (-a) flag to bind to all interfaces, not just
+ 127.0.0.1. Useful for testing with WinIE running on another machine;
+ - don't call checkFrameworks() - we do not need a built WebKit here;
+ - changed tabs to spaces;
+ - disable HTTP keepalive (since Apache doesn't spawn sub-processes in
+ interactive mode, they were a hassle when testing with several browsers, as one
+ had to wait for connection to expire);
+ - remove httpd.pid when done, so that Apache doesn't complain next time.
+
+ * Scripts/run-webkit-httpd:
+
2006-06-24 Jonas Witt <jonas.witt@gmail.com>
Reviewed by ggaren, landed by ap.
# Argument handling
my $httpdPort = 8000;
+my $allInterfaces = 0;
GetOptions(
'port=i' => \$httpdPort,
+ 'all-interfaces|a' => \$allInterfaces,
);
setConfiguration();
my $productDir = productDir();
chdirWebKit();
-checkFrameworks();
-
-print "Starting httpd on <http://127.0.0.1:$httpdPort/>...\n";
-print "Press Ctrl+C to stop it.\n\n";
mkdir "/tmp/WebKit";
if (-f "/tmp/WebKit/httpd.pid") {
- my $oldPid = `cat /tmp/WebKit/httpd.pid`;
- chomp $oldPid;
- if (0 != kill 0, $oldPid) {
- print "\nhttpd is already running: pid $oldPid, killing...\n";
- kill 15, $oldPid;
-
- my $retryCount = 20;
- while ((0 != kill 0, $oldPid) && $retryCount) {
- sleep 1;
- --$retryCount;
- }
-
- die "Timed out waiting for httpd to quit" unless $retryCount;
- }
+ my $oldPid = `cat /tmp/WebKit/httpd.pid`;
+ chomp $oldPid;
+ if (0 != kill 0, $oldPid) {
+ print "\nhttpd is already running: pid $oldPid, killing...\n";
+ kill 15, $oldPid;
+
+ my $retryCount = 20;
+ while ((0 != kill 0, $oldPid) && $retryCount) {
+ sleep 1;
+ --$retryCount;
+ }
+
+ die "Timed out waiting for httpd to quit" unless $retryCount;
+ }
}
my $testDirectory = getcwd() . "/LayoutTests";
$httpdConfig = "$testDirectory/http/conf/apache2-httpd.conf" if `$httpdPath -v` =~ m|Apache/2|;
my $documentRoot = "$testDirectory/http/tests";
my $typesConfig = "$testDirectory/http/conf/mime.types";
+
my $listen = "127.0.0.1:$httpdPort";
+$listen = "$httpdPort" if ($allInterfaces);
+
+if ($allInterfaces) {
+ print "Starting httpd on port $httpdPort (all interfaces)...\n";
+} else {
+ print "Starting httpd on <http://$listen/>...\n";
+}
+print "Press Ctrl+C to stop it.\n\n";
system($httpdPath,
- "-f", "$httpdConfig",
- "-C", "DocumentRoot \"$documentRoot\"",
- "-C", "Listen $listen",
- "-c", "TypesConfig \"$typesConfig\"",
- "-c", "CustomLog |/usr/bin/tee common",
- "-c", "ErrorLog |/usr/bin/tee",
- # Apache wouldn't run CGIs with permissions==700 otherwise.
- "-c", "User \"#$<\"",
- # Run in single-process mode, do not detach from the controlling terminal.
- "-X");
+ "-f", "$httpdConfig",
+ "-C", "DocumentRoot \"$documentRoot\"",
+ "-C", "Listen $listen",
+ "-c", "TypesConfig \"$typesConfig\"",
+ "-c", "CustomLog |/usr/bin/tee common",
+ "-c", "ErrorLog |/usr/bin/tee",
+ # Apache wouldn't run CGIs with permissions==700 otherwise.
+ "-c", "User \"#$<\"",
+ # Run in single-process mode, do not detach from the controlling terminal.
+ "-X",
+ # Disable Keep-Alive support. Makes testing in multiple browsers easier (no need to wait
+ # for another browser's connection to expire).
+ "-c", "KeepAlive 0");
+
+unlink "/tmp/WebKit/httpd.pid";