From: ap Date: Sat, 24 Jun 2006 15:37:54 +0000 (+0000) Subject: Reviewed by Darin. X-Git-Url: https://git.webkit.org/?p=WebKit-https.git;a=commitdiff_plain;h=dae1c26aa9502a22328a7aa47bf0e482f9353e0e 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: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@15012 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog index 2b35f094df74..9b5f3e69179f 100644 --- a/WebKitTools/ChangeLog +++ b/WebKitTools/ChangeLog @@ -1,3 +1,21 @@ +2006-06-24 Alexey Proskuryakov + + 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 Reviewed by ggaren, landed by ap. diff --git a/WebKitTools/Scripts/run-webkit-httpd b/WebKitTools/Scripts/run-webkit-httpd index 5db3ccba74af..b122d6d2abf8 100755 --- a/WebKitTools/Scripts/run-webkit-httpd +++ b/WebKitTools/Scripts/run-webkit-httpd @@ -41,36 +41,34 @@ use webkitdirs; # 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 ...\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"; @@ -79,16 +77,30 @@ my $httpdConfig = "$testDirectory/http/conf/httpd.conf"; $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 ...\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";