Title: [139071] trunk
Revision
139071
Author
[email protected]
Date
2013-01-08 10:10:07 -0800 (Tue, 08 Jan 2013)

Log Message

Tools: Add Apache 2.4 support for Fedora 18
https://bugs.webkit.org/show_bug.cgi?id=104478

Reviewed by Martin Robinson.

Apache 2.4's httpd.conf is slightly incompatible with 2.2's, so we
need a separate config.

* Scripts/webkitpy/layout_tests/port/base.py:
(Port._apache_version):
(Port._apache_config_file_name_for_platform):
* Scripts/webkitpy/layout_tests/port/port_testcase.py:
* Scripts/run-webkit-httpd:
* Scripts/webkitperl/httpd.pm:
(getApacheVersion):
(getDefaultConfigForTestDirectory):
(getHTTPDConfigPathForTestDirectory):

LayoutTests: Updates for Apache 2.4
https://bugs.webkit.org/show_bug.cgi?id=104478

Reviewed by Martin Robinson.

Apache 2.4 requires a slightly different config from 2.2, so split
fedora-httpd.conf into separate 2.2 and 2.4 versions.

2.4 is also more picky about passing request headers to CGI
scripts, and will ignore headers that aren't valid according to
the HTTP grammar, so change underscores to hyphens to fix them.

* http/conf/fedora-httpd-2.2.conf: Renamed from
LayoutTests/http/conf/fedora-httpd.conf.
* http/conf/fedora-httpd-2.4.conf: Based on
LayoutTests/http/conf/fedora-httpd.conf and updated for 2.4.
* http/tests/cookies/resources/cookies-test-pre.js:
(setCookies):
(clearCookies):
* http/tests/navigation/ping-cookie.html:
* http/tests/xmlhttprequest/xmlhttprequest-setrequestheader-no-value.html:

Modified Paths

Added Paths

Removed Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (139070 => 139071)


--- trunk/LayoutTests/ChangeLog	2013-01-08 18:08:02 UTC (rev 139070)
+++ trunk/LayoutTests/ChangeLog	2013-01-08 18:10:07 UTC (rev 139071)
@@ -1,3 +1,27 @@
+2013-01-08  Dan Winship  <[email protected]>
+
+        Updates for Apache 2.4
+        https://bugs.webkit.org/show_bug.cgi?id=104478
+
+        Reviewed by Martin Robinson.
+
+        Apache 2.4 requires a slightly different config from 2.2, so split
+        fedora-httpd.conf into separate 2.2 and 2.4 versions.
+
+        2.4 is also more picky about passing request headers to CGI
+        scripts, and will ignore headers that aren't valid according to
+        the HTTP grammar, so change underscores to hyphens to fix them.
+
+        * http/conf/fedora-httpd-2.2.conf: Renamed from
+        LayoutTests/http/conf/fedora-httpd.conf.
+        * http/conf/fedora-httpd-2.4.conf: Based on
+        LayoutTests/http/conf/fedora-httpd.conf and updated for 2.4.
+        * http/tests/cookies/resources/cookies-test-pre.js:
+        (setCookies):
+        (clearCookies):
+        * http/tests/navigation/ping-cookie.html:
+        * http/tests/xmlhttprequest/xmlhttprequest-setrequestheader-no-value.html:
+
 2013-01-08  Alexis Menard  <[email protected]>
 
         transition-delay and transition-duration return incorrect values when querying using the computed style.

Copied: trunk/LayoutTests/http/conf/fedora-httpd-2.2.conf (from rev 139070, trunk/LayoutTests/http/conf/fedora-httpd.conf) (0 => 139071)


--- trunk/LayoutTests/http/conf/fedora-httpd-2.2.conf	                        (rev 0)
+++ trunk/LayoutTests/http/conf/fedora-httpd-2.2.conf	2013-01-08 18:10:07 UTC (rev 139071)
@@ -0,0 +1,158 @@
+ServerTokens OS
+ServerRoot "/etc/httpd"
+
+LockFile "/tmp/WebKit/httpd.lock"
+PidFile "/tmp/WebKit/httpd.pid"
+ScoreBoardFile "/tmp/WebKit/httpd.scoreboard"
+
+Timeout 300
+KeepAlive On
+MaxKeepAliveRequests 100
+KeepAliveTimeout 15
+
+MinSpareServers 1
+MaxSpareServers 5
+StartServers 1
+MaxClients 150
+MaxRequestsPerChild 100000
+
+LoadModule authz_host_module modules/mod_authz_host.so
+LoadModule include_module modules/mod_include.so
+LoadModule log_config_module modules/mod_log_config.so
+LoadModule headers_module modules/mod_headers.so
+LoadModule mime_module modules/mod_mime.so
+LoadModule negotiation_module modules/mod_negotiation.so
+LoadModule actions_module modules/mod_actions.so
+LoadModule alias_module modules/mod_alias.so
+LoadModule rewrite_module modules/mod_rewrite.so
+LoadModule cgi_module modules/mod_cgi.so
+LoadModule ssl_module modules/mod_ssl.so
+LoadModule php5_module modules/libphp5.so
+
+LoadModule asis_module modules/mod_asis.so
+
+User apache
+Group apache
+
+ServerAdmin root@localhost
+ServerName 127.0.0.1
+
+UseCanonicalName On
+
+<Directory />
+    Options Indexes FollowSymLinks MultiViews ExecCGI Includes
+    AllowOverride All
+    Order allow,deny
+    Allow from all
+</Directory>
+
+AccessFileName .htaccess
+
+<Files ~ "^\.([Hh][Tt]|[Dd][Ss]_[Ss])">
+    Order allow,deny
+    Deny from all
+    Satisfy All
+</Files>
+
+TypesConfig /etc/mime.types
+DefaultType text/plain
+HostnameLookups Off
+
+LogLevel warn
+LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
+LogFormat "%h %l %u %t \"%r\" %>s %b" common
+LogFormat "%{Referer}i -> %U" referer
+LogFormat "%{User-agent}i" agent
+
+ServerSignature On
+
+AddLanguage ca .ca
+AddLanguage cs .cz .cs
+AddLanguage da .dk
+AddLanguage de .de
+AddLanguage el .el
+AddLanguage en .en
+AddLanguage eo .eo
+AddLanguage es .es
+AddLanguage et .et
+AddLanguage fr .fr
+AddLanguage he .he
+AddLanguage hr .hr
+AddLanguage it .it
+AddLanguage ja .ja
+AddLanguage ko .ko
+AddLanguage ltz .ltz
+AddLanguage nl .nl
+AddLanguage nn .nn
+AddLanguage no .no
+AddLanguage pl .po
+AddLanguage pt .pt
+AddLanguage pt-BR .pt-br
+AddLanguage ru .ru
+AddLanguage sv .sv
+AddLanguage zh-CN .zh-cn
+AddLanguage zh-TW .zh-tw
+AddCharset Big5         .Big5    .big5
+AddCharset WINDOWS-1251 .cp-1251
+AddCharset CP866        .cp866
+AddCharset ISO-8859-5   .iso-ru
+AddCharset KOI8-R       .koi8-r
+AddCharset UCS-2        .ucs2
+AddCharset UCS-4        .ucs4
+AddCharset UTF-8        .utf8
+
+<IfModule mod_negotiation.c>
+    LanguagePriority en ca cs da de el eo es et fr he hr it ja ko ltz nl nn no pl pt pt-BR ru sv zh-CN zh-TW
+</IfModule>
+
+AddEncoding x-compress .Z
+AddEncoding x-gzip .gz .tgz
+
+AddType application/x-x509-ca-cert .crt
+AddType application/x-pkcs7-crl    .crl
+
+AddHandler cgi-script .cgi .pl
+
+AddType text/html .shtml
+AddOutputFilter INCLUDES .shtml
+
+AddHandler send-as-is asis
+
+<IfModule mod_php5.c>
+    AddType application/x-httpd-php .php
+    AddType application/x-httpd-php .bat
+    AddType application/x-httpd-php-source .phps
+
+    <IfModule mod_dir.c>
+        DirectoryIndex index.html index.php
+    </IfModule>
+
+    php_flag log_errors on
+    php_flag short_open_tag on
+</IfModule>
+
+<IfModule mod_rewrite.c>
+    RewriteEngine On
+    RewriteCond %{REQUEST_METHOD} ^TRACE
+    RewriteRule .* - [F]
+</IfModule>
+
+<VirtualHost *:8443>
+    ServerName 127.0.0.1
+    SSLEngine On
+</VirtualHost>
+
+#
+# Apple-specific filesystem protection.
+#
+<Files "rsrc">
+    Order allow,deny
+    Deny from all
+    Satisfy All
+</Files>
+
+<Directory  ~ ".*\.\.namedfork">
+    Order allow,deny
+    Deny from all
+    Satisfy All
+</Directory>

Copied: trunk/LayoutTests/http/conf/fedora-httpd-2.4.conf (from rev 139070, trunk/LayoutTests/http/conf/fedora-httpd.conf) (0 => 139071)


--- trunk/LayoutTests/http/conf/fedora-httpd-2.4.conf	                        (rev 0)
+++ trunk/LayoutTests/http/conf/fedora-httpd-2.4.conf	2013-01-08 18:10:07 UTC (rev 139071)
@@ -0,0 +1,152 @@
+ServerTokens OS
+ServerRoot "/etc/httpd"
+
+PidFile "/tmp/WebKit/httpd.pid"
+ScoreBoardFile "/tmp/WebKit/httpd.scoreboard"
+
+Timeout 300
+KeepAlive On
+MaxKeepAliveRequests 100
+KeepAliveTimeout 15
+
+MinSpareServers 1
+MaxSpareServers 5
+StartServers 1
+MaxClients 150
+MaxRequestsPerChild 100000
+
+LoadModule mpm_prefork_module modules/mod_mpm_prefork.so
+LoadModule authz_core_module modules/mod_authz_core.so
+LoadModule authz_host_module modules/mod_authz_host.so
+LoadModule include_module modules/mod_include.so
+LoadModule log_config_module modules/mod_log_config.so
+LoadModule headers_module modules/mod_headers.so
+LoadModule mime_module modules/mod_mime.so
+LoadModule negotiation_module modules/mod_negotiation.so
+LoadModule actions_module modules/mod_actions.so
+LoadModule alias_module modules/mod_alias.so
+LoadModule rewrite_module modules/mod_rewrite.so
+LoadModule cgi_module modules/mod_cgi.so
+LoadModule ssl_module modules/mod_ssl.so
+LoadModule unixd_module modules/mod_unixd.so
+LoadModule php5_module modules/libphp5.so
+
+LoadModule asis_module modules/mod_asis.so
+
+User apache
+Group apache
+
+ServerAdmin root@localhost
+ServerName 127.0.0.1
+
+UseCanonicalName On
+
+<Directory />
+    Options Indexes FollowSymLinks MultiViews ExecCGI Includes
+    AllowOverride All
+    Require all granted
+</Directory>
+
+AccessFileName .htaccess
+
+<Files ~ "^\.([Hh][Tt]|[Dd][Ss]_[Ss])">
+    Require all denied
+</Files>
+
+TypesConfig /etc/mime.types
+HostnameLookups Off
+
+LogLevel warn
+LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
+LogFormat "%h %l %u %t \"%r\" %>s %b" common
+LogFormat "%{Referer}i -> %U" referer
+LogFormat "%{User-agent}i" agent
+
+ServerSignature On
+
+AddLanguage ca .ca
+AddLanguage cs .cz .cs
+AddLanguage da .dk
+AddLanguage de .de
+AddLanguage el .el
+AddLanguage en .en
+AddLanguage eo .eo
+AddLanguage es .es
+AddLanguage et .et
+AddLanguage fr .fr
+AddLanguage he .he
+AddLanguage hr .hr
+AddLanguage it .it
+AddLanguage ja .ja
+AddLanguage ko .ko
+AddLanguage ltz .ltz
+AddLanguage nl .nl
+AddLanguage nn .nn
+AddLanguage no .no
+AddLanguage pl .po
+AddLanguage pt .pt
+AddLanguage pt-BR .pt-br
+AddLanguage ru .ru
+AddLanguage sv .sv
+AddLanguage zh-CN .zh-cn
+AddLanguage zh-TW .zh-tw
+AddCharset Big5         .Big5    .big5
+AddCharset WINDOWS-1251 .cp-1251
+AddCharset CP866        .cp866
+AddCharset ISO-8859-5   .iso-ru
+AddCharset KOI8-R       .koi8-r
+AddCharset UCS-2        .ucs2
+AddCharset UCS-4        .ucs4
+AddCharset UTF-8        .utf8
+
+<IfModule mod_negotiation.c>
+    LanguagePriority en ca cs da de el eo es et fr he hr it ja ko ltz nl nn no pl pt pt-BR ru sv zh-CN zh-TW
+</IfModule>
+
+AddEncoding x-compress .Z
+AddEncoding x-gzip .gz .tgz
+
+AddType application/x-x509-ca-cert .crt
+AddType application/x-pkcs7-crl    .crl
+
+AddHandler cgi-script .cgi .pl
+
+AddType text/html .shtml
+AddOutputFilter INCLUDES .shtml
+
+AddHandler send-as-is asis
+
+<IfModule mod_php5.c>
+    AddType application/x-httpd-php .php
+    AddType application/x-httpd-php .bat
+    AddType application/x-httpd-php-source .phps
+
+    <IfModule mod_dir.c>
+        DirectoryIndex index.html index.php
+    </IfModule>
+
+    php_flag log_errors on
+    php_flag short_open_tag on
+</IfModule>
+
+<IfModule mod_rewrite.c>
+    RewriteEngine On
+    RewriteCond %{REQUEST_METHOD} ^TRACE
+    RewriteRule .* - [F]
+</IfModule>
+
+<VirtualHost *:8443>
+    ServerName 127.0.0.1
+    SSLEngine On
+</VirtualHost>
+
+#
+# Apple-specific filesystem protection.
+#
+<Files "rsrc">
+    Require all denied
+</Files>
+
+<Directory  ~ ".*\.\.namedfork">
+    Require all denied
+</Directory>

Deleted: trunk/LayoutTests/http/conf/fedora-httpd.conf (139070 => 139071)


--- trunk/LayoutTests/http/conf/fedora-httpd.conf	2013-01-08 18:08:02 UTC (rev 139070)
+++ trunk/LayoutTests/http/conf/fedora-httpd.conf	2013-01-08 18:10:07 UTC (rev 139071)
@@ -1,158 +0,0 @@
-ServerTokens OS
-ServerRoot "/etc/httpd"
-
-LockFile "/tmp/WebKit/httpd.lock"
-PidFile "/tmp/WebKit/httpd.pid"
-ScoreBoardFile "/tmp/WebKit/httpd.scoreboard"
-
-Timeout 300
-KeepAlive On
-MaxKeepAliveRequests 100
-KeepAliveTimeout 15
-
-MinSpareServers 1
-MaxSpareServers 5
-StartServers 1
-MaxClients 150
-MaxRequestsPerChild 100000
-
-LoadModule authz_host_module modules/mod_authz_host.so
-LoadModule include_module modules/mod_include.so
-LoadModule log_config_module modules/mod_log_config.so
-LoadModule headers_module modules/mod_headers.so
-LoadModule mime_module modules/mod_mime.so
-LoadModule negotiation_module modules/mod_negotiation.so
-LoadModule actions_module modules/mod_actions.so
-LoadModule alias_module modules/mod_alias.so
-LoadModule rewrite_module modules/mod_rewrite.so
-LoadModule cgi_module modules/mod_cgi.so
-LoadModule ssl_module modules/mod_ssl.so
-LoadModule php5_module modules/libphp5.so
-
-LoadModule asis_module modules/mod_asis.so
-
-User apache
-Group apache
-
-ServerAdmin root@localhost
-ServerName 127.0.0.1
-
-UseCanonicalName On
-
-<Directory />
-    Options Indexes FollowSymLinks MultiViews ExecCGI Includes
-    AllowOverride All
-    Order allow,deny
-    Allow from all
-</Directory>
-
-AccessFileName .htaccess
-
-<Files ~ "^\.([Hh][Tt]|[Dd][Ss]_[Ss])">
-    Order allow,deny
-    Deny from all
-    Satisfy All
-</Files>
-
-TypesConfig /etc/mime.types
-DefaultType text/plain
-HostnameLookups Off
-
-LogLevel warn
-LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
-LogFormat "%h %l %u %t \"%r\" %>s %b" common
-LogFormat "%{Referer}i -> %U" referer
-LogFormat "%{User-agent}i" agent
-
-ServerSignature On
-
-AddLanguage ca .ca
-AddLanguage cs .cz .cs
-AddLanguage da .dk
-AddLanguage de .de
-AddLanguage el .el
-AddLanguage en .en
-AddLanguage eo .eo
-AddLanguage es .es
-AddLanguage et .et
-AddLanguage fr .fr
-AddLanguage he .he
-AddLanguage hr .hr
-AddLanguage it .it
-AddLanguage ja .ja
-AddLanguage ko .ko
-AddLanguage ltz .ltz
-AddLanguage nl .nl
-AddLanguage nn .nn
-AddLanguage no .no
-AddLanguage pl .po
-AddLanguage pt .pt
-AddLanguage pt-BR .pt-br
-AddLanguage ru .ru
-AddLanguage sv .sv
-AddLanguage zh-CN .zh-cn
-AddLanguage zh-TW .zh-tw
-AddCharset Big5         .Big5    .big5
-AddCharset WINDOWS-1251 .cp-1251
-AddCharset CP866        .cp866
-AddCharset ISO-8859-5   .iso-ru
-AddCharset KOI8-R       .koi8-r
-AddCharset UCS-2        .ucs2
-AddCharset UCS-4        .ucs4
-AddCharset UTF-8        .utf8
-
-<IfModule mod_negotiation.c>
-    LanguagePriority en ca cs da de el eo es et fr he hr it ja ko ltz nl nn no pl pt pt-BR ru sv zh-CN zh-TW
-</IfModule>
-
-AddEncoding x-compress .Z
-AddEncoding x-gzip .gz .tgz
-
-AddType application/x-x509-ca-cert .crt
-AddType application/x-pkcs7-crl    .crl
-
-AddHandler cgi-script .cgi .pl
-
-AddType text/html .shtml
-AddOutputFilter INCLUDES .shtml
-
-AddHandler send-as-is asis
-
-<IfModule mod_php5.c>
-    AddType application/x-httpd-php .php
-    AddType application/x-httpd-php .bat
-    AddType application/x-httpd-php-source .phps
-
-    <IfModule mod_dir.c>
-        DirectoryIndex index.html index.php
-    </IfModule>
-
-    php_flag log_errors on
-    php_flag short_open_tag on
-</IfModule>
-
-<IfModule mod_rewrite.c>
-    RewriteEngine On
-    RewriteCond %{REQUEST_METHOD} ^TRACE
-    RewriteRule .* - [F]
-</IfModule>
-
-<VirtualHost *:8443>
-    ServerName 127.0.0.1
-    SSLEngine On
-</VirtualHost>
-
-#
-# Apple-specific filesystem protection.
-#
-<Files "rsrc">
-    Order allow,deny
-    Deny from all
-    Satisfy All
-</Files>
-
-<Directory  ~ ".*\.\.namedfork">
-    Order allow,deny
-    Deny from all
-    Satisfy All
-</Directory>

Modified: trunk/LayoutTests/http/tests/cookies/resources/cookies-test-pre.js (139070 => 139071)


--- trunk/LayoutTests/http/tests/cookies/resources/cookies-test-pre.js	2013-01-08 18:08:02 UTC (rev 139070)
+++ trunk/LayoutTests/http/tests/cookies/resources/cookies-test-pre.js	2013-01-08 18:10:07 UTC (rev 139071)
@@ -159,7 +159,7 @@
     try {
         var xhr = new XMLHttpRequest();
         xhr.open("GET", "resources/setCookies.cgi", false);
-        xhr.setRequestHeader("SET_COOKIE", cookie);
+        xhr.setRequestHeader("SET-COOKIE", cookie);
         xhr.send(null);
         if (xhr.status == 200) {
             // This is to clear them later.
@@ -220,7 +220,7 @@
         // and "Expires" fields.
         while (cookie = cookies.pop()) {
             xhr.open("GET", "resources/clearCookies.cgi", false);
-            xhr.setRequestHeader("CLEAR_COOKIE", cookie);
+            xhr.setRequestHeader("CLEAR-COOKIE", cookie);
             xhr.send(null);
         }
     } catch (e) {

Modified: trunk/LayoutTests/http/tests/navigation/ping-cookie.html (139070 => 139071)


--- trunk/LayoutTests/http/tests/navigation/ping-cookie.html	2013-01-08 18:08:02 UTC (rev 139070)
+++ trunk/LayoutTests/http/tests/navigation/ping-cookie.html	2013-01-08 18:10:07 UTC (rev 139071)
@@ -17,7 +17,7 @@
     try {
         var xhr = new XMLHttpRequest();
         xhr.open("GET", "../cookies/resources/setCookies.cgi", false);
-        xhr.setRequestHeader("SET_COOKIE", "hello=world;path=/");
+        xhr.setRequestHeader("SET-COOKIE", "hello=world;path=/");
         xhr.send(null);
         if (xhr.status != 200) {
             document.getElementsByTagName("body")[0].appendChild(document.createTextNode("FAILED: cookie not set"));

Modified: trunk/LayoutTests/http/tests/xmlhttprequest/xmlhttprequest-setrequestheader-no-value.html (139070 => 139071)


--- trunk/LayoutTests/http/tests/xmlhttprequest/xmlhttprequest-setrequestheader-no-value.html	2013-01-08 18:08:02 UTC (rev 139070)
+++ trunk/LayoutTests/http/tests/xmlhttprequest/xmlhttprequest-setrequestheader-no-value.html	2013-01-08 18:10:07 UTC (rev 139071)
@@ -9,7 +9,7 @@
     req = new XMLHttpRequest;
     req.open("GET", "resources/print-headers.cgi", false);
 
-    req.setRequestHeader("CUSTOM_HEADER", "");
+    req.setRequestHeader("CUSTOM-HEADER", "");
     try {
         req.send("");
         if (req.responseText.indexOf("HTTP_CUSTOM_HEADER") >= 0)

Modified: trunk/Tools/ChangeLog (139070 => 139071)


--- trunk/Tools/ChangeLog	2013-01-08 18:08:02 UTC (rev 139070)
+++ trunk/Tools/ChangeLog	2013-01-08 18:10:07 UTC (rev 139071)
@@ -1,3 +1,23 @@
+2013-01-08  Dan Winship  <[email protected]>
+
+        Add Apache 2.4 support for Fedora 18
+        https://bugs.webkit.org/show_bug.cgi?id=104478
+
+        Reviewed by Martin Robinson.
+
+        Apache 2.4's httpd.conf is slightly incompatible with 2.2's, so we
+        need a separate config.
+
+        * Scripts/webkitpy/layout_tests/port/base.py:
+        (Port._apache_version):
+        (Port._apache_config_file_name_for_platform):
+        * Scripts/webkitpy/layout_tests/port/port_testcase.py:
+        * Scripts/run-webkit-httpd:
+        * Scripts/webkitperl/httpd.pm:
+        (getApacheVersion):
+        (getDefaultConfigForTestDirectory):
+        (getHTTPDConfigPathForTestDirectory):
+
 2013-01-08  Zan Dobersek  <[email protected]>
 
         Make the override-feature-defines script compatible with Python v3

Modified: trunk/Tools/Scripts/run-webkit-httpd (139070 => 139071)


--- trunk/Tools/Scripts/run-webkit-httpd	2013-01-08 18:08:02 UTC (rev 139070)
+++ trunk/Tools/Scripts/run-webkit-httpd	2013-01-08 18:10:07 UTC (rev 139071)
@@ -89,7 +89,7 @@
     "-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"
+    "-c", "KeepAlive off"
 );
 
 my @defaultArgs = getDefaultConfigForTestDirectory($testDirectory);

Modified: trunk/Tools/Scripts/webkitperl/httpd.pm (139070 => 139071)


--- trunk/Tools/Scripts/webkitperl/httpd.pm	2013-01-08 18:08:02 UTC (rev 139070)
+++ trunk/Tools/Scripts/webkitperl/httpd.pm	2013-01-08 18:10:07 UTC (rev 139071)
@@ -90,6 +90,14 @@
     return system(@command) == 0;
 }
 
+sub getApacheVersion
+{
+    my $httpdPath = getHTTPDPath();
+    my $version = `$httpdPath -v`;
+    $version =~ s/.*Server version: Apache\/(\d+\.\d+).*/\1/s;
+    return $version;
+}
+
 sub getDefaultConfigForTestDirectory
 {
     my ($testDirectory) = @_;
@@ -112,11 +120,14 @@
         "-c", "TypesConfig \"$typesConfig\"",
         # Apache wouldn't run CGIs with permissions==700 otherwise
         "-c", "User \"#$<\"",
-        "-c", "LockFile \"$httpdLockFile\"",
         "-c", "PidFile \"$httpdPidFile\"",
         "-c", "ScoreBoardFile \"$httpdScoreBoardFile\"",
     );
 
+    if (getApacheVersion() eq "2.2") {
+        push(@httpdArgs, "-c", "LockFile \"$httpdLockFile\"");
+    }
+
     # FIXME: Enable this on Windows once <rdar://problem/5345985> is fixed
     # The version of Apache we use with Cygwin does not support SSL
     my $sslCertificate = "$testDirectory/http/conf/webkit-httpd.pem";
@@ -134,6 +145,7 @@
     my $httpdConfig;
     my $httpdPath = getHTTPDPath();
     my $httpdConfDirectory = "$testDirectory/http/conf/";
+    my $apacheVersion = getApacheVersion();
 
     if (isCygwin()) {
         my $libPHP4DllPath = "/usr/lib/apache/libphp4.dll";
@@ -146,7 +158,7 @@
     } elsif (isDebianBased()) {
         $httpdConfig = "apache2-debian-httpd.conf";
     } elsif (isFedoraBased()) {
-        $httpdConfig = "fedora-httpd.conf"; # This is an apache2 config, despite the name.
+        $httpdConfig = "fedora-httpd-$apacheVersion.conf";
     } else {
         # All other ports use apache2, so just use our default apache2 config.
         $httpdConfig = "apache2-httpd.conf";

Modified: trunk/Tools/Scripts/webkitpy/layout_tests/port/base.py (139070 => 139071)


--- trunk/Tools/Scripts/webkitpy/layout_tests/port/base.py	2013-01-08 18:08:02 UTC (rev 139070)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/port/base.py	2013-01-08 18:10:07 UTC (rev 139071)
@@ -1209,13 +1209,17 @@
     def _is_debian_based(self):
         return self._filesystem.exists('/etc/debian_version')
 
+    def _apache_version(self):
+        config = self._executive.run_command([self._path_to_apache(), '-v'])
+        return re.sub(r'(?:.|\n)*Server version: Apache/(\d+\.\d+)(?:.|\n)*', r'\1', config)
+
     # We pass sys_platform into this method to make it easy to unit test.
     def _apache_config_file_name_for_platform(self, sys_platform):
         if sys_platform == 'cygwin':
             return 'cygwin-httpd.conf'  # CYGWIN is the only platform to still use Apache 1.3.
         if sys_platform.startswith('linux'):
             if self._is_redhat_based():
-                return 'fedora-httpd.conf'  # This is an Apache 2.x config file despite the naming.
+                return 'fedora-httpd-' + self._apache_version() + '.conf'
             if self._is_debian_based():
                 return 'apache2-debian-httpd.conf'
         # All platforms use apache2 except for CYGWIN (and Mac OS X Tiger and prior, which we no longer support).

Modified: trunk/Tools/Scripts/webkitpy/layout_tests/port/port_testcase.py (139070 => 139071)


--- trunk/Tools/Scripts/webkitpy/layout_tests/port/port_testcase.py	2013-01-08 18:08:02 UTC (rev 139070)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/port/port_testcase.py	2013-01-08 18:10:07 UTC (rev 139071)
@@ -589,7 +589,8 @@
         self._assert_config_file_for_platform(port, 'linux3', 'apache2-httpd.conf')
 
         port._is_redhat_based = lambda: True
-        self._assert_config_file_for_platform(port, 'linux2', 'fedora-httpd.conf')
+        port._apache_version = lambda: '2.2'
+        self._assert_config_file_for_platform(port, 'linux2', 'fedora-httpd-2.2.conf')
 
         port = TestWebKitPort()
         port._is_debian_based = lambda: True
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to