Changeset 139071 in webkit


Ignore:
Timestamp:
Jan 8, 2013 10:10:07 AM (11 years ago)
Author:
danw@gnome.org
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:
Location:
trunk
Files:
9 edited
1 copied
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r139070 r139071  
     12013-01-08  Dan Winship  <danw@gnome.org>
     2
     3        Updates for Apache 2.4
     4        https://bugs.webkit.org/show_bug.cgi?id=104478
     5
     6        Reviewed by Martin Robinson.
     7
     8        Apache 2.4 requires a slightly different config from 2.2, so split
     9        fedora-httpd.conf into separate 2.2 and 2.4 versions.
     10
     11        2.4 is also more picky about passing request headers to CGI
     12        scripts, and will ignore headers that aren't valid according to
     13        the HTTP grammar, so change underscores to hyphens to fix them.
     14
     15        * http/conf/fedora-httpd-2.2.conf: Renamed from
     16        LayoutTests/http/conf/fedora-httpd.conf.
     17        * http/conf/fedora-httpd-2.4.conf: Based on
     18        LayoutTests/http/conf/fedora-httpd.conf and updated for 2.4.
     19        * http/tests/cookies/resources/cookies-test-pre.js:
     20        (setCookies):
     21        (clearCookies):
     22        * http/tests/navigation/ping-cookie.html:
     23        * http/tests/xmlhttprequest/xmlhttprequest-setrequestheader-no-value.html:
     24
    1252013-01-08  Alexis Menard  <alexis@webkit.org>
    226
  • trunk/LayoutTests/http/conf/fedora-httpd-2.4.conf

    r139070 r139071  
    22ServerRoot "/etc/httpd"
    33
    4 LockFile "/tmp/WebKit/httpd.lock"
    54PidFile "/tmp/WebKit/httpd.pid"
    65ScoreBoardFile "/tmp/WebKit/httpd.scoreboard"
     
    1716MaxRequestsPerChild 100000
    1817
     18LoadModule mpm_prefork_module modules/mod_mpm_prefork.so
     19LoadModule authz_core_module modules/mod_authz_core.so
    1920LoadModule authz_host_module modules/mod_authz_host.so
    2021LoadModule include_module modules/mod_include.so
     
    2829LoadModule cgi_module modules/mod_cgi.so
    2930LoadModule ssl_module modules/mod_ssl.so
     31LoadModule unixd_module modules/mod_unixd.so
    3032LoadModule php5_module modules/libphp5.so
    3133
     
    4345    Options Indexes FollowSymLinks MultiViews ExecCGI Includes
    4446    AllowOverride All
    45     Order allow,deny
    46     Allow from all
     47    Require all granted
    4748</Directory>
    4849
     
    5051
    5152<Files ~ "^\.([Hh][Tt]|[Dd][Ss]_[Ss])">
    52     Order allow,deny
    53     Deny from all
    54     Satisfy All
     53    Require all denied
    5554</Files>
    5655
    5756TypesConfig /etc/mime.types
    58 DefaultType text/plain
    5957HostnameLookups Off
    6058
     
    147145#
    148146<Files "rsrc">
    149     Order allow,deny
    150     Deny from all
    151     Satisfy All
     147    Require all denied
    152148</Files>
    153149
    154150<Directory  ~ ".*\.\.namedfork">
    155     Order allow,deny
    156     Deny from all
    157     Satisfy All
     151    Require all denied
    158152</Directory>
  • trunk/LayoutTests/http/tests/cookies/resources/cookies-test-pre.js

    r120167 r139071  
    160160        var xhr = new XMLHttpRequest();
    161161        xhr.open("GET", "resources/setCookies.cgi", false);
    162         xhr.setRequestHeader("SET_COOKIE", cookie);
     162        xhr.setRequestHeader("SET-COOKIE", cookie);
    163163        xhr.send(null);
    164164        if (xhr.status == 200) {
     
    221221        while (cookie = cookies.pop()) {
    222222            xhr.open("GET", "resources/clearCookies.cgi", false);
    223             xhr.setRequestHeader("CLEAR_COOKIE", cookie);
     223            xhr.setRequestHeader("CLEAR-COOKIE", cookie);
    224224            xhr.send(null);
    225225        }
  • trunk/LayoutTests/http/tests/navigation/ping-cookie.html

    r124692 r139071  
    1818        var xhr = new XMLHttpRequest();
    1919        xhr.open("GET", "../cookies/resources/setCookies.cgi", false);
    20         xhr.setRequestHeader("SET_COOKIE", "hello=world;path=/");
     20        xhr.setRequestHeader("SET-COOKIE", "hello=world;path=/");
    2121        xhr.send(null);
    2222        if (xhr.status != 200) {
  • trunk/LayoutTests/http/tests/xmlhttprequest/xmlhttprequest-setrequestheader-no-value.html

    r120167 r139071  
    1010    req.open("GET", "resources/print-headers.cgi", false);
    1111
    12     req.setRequestHeader("CUSTOM_HEADER", "");
     12    req.setRequestHeader("CUSTOM-HEADER", "");
    1313    try {
    1414        req.send("");
  • trunk/Tools/ChangeLog

    r139065 r139071  
     12013-01-08  Dan Winship  <danw@gnome.org>
     2
     3        Add Apache 2.4 support for Fedora 18
     4        https://bugs.webkit.org/show_bug.cgi?id=104478
     5
     6        Reviewed by Martin Robinson.
     7
     8        Apache 2.4's httpd.conf is slightly incompatible with 2.2's, so we
     9        need a separate config.
     10
     11        * Scripts/webkitpy/layout_tests/port/base.py:
     12        (Port._apache_version):
     13        (Port._apache_config_file_name_for_platform):
     14        * Scripts/webkitpy/layout_tests/port/port_testcase.py:
     15        * Scripts/run-webkit-httpd:
     16        * Scripts/webkitperl/httpd.pm:
     17        (getApacheVersion):
     18        (getDefaultConfigForTestDirectory):
     19        (getHTTPDConfigPathForTestDirectory):
     20
    1212013-01-08  Zan Dobersek  <zandobersek@gmail.com>
    222
  • trunk/Tools/Scripts/run-webkit-httpd

    r130202 r139071  
    9090    # Disable Keep-Alive support. Makes testing in multiple browsers easier (no need to wait
    9191    # for another browser's connection to expire).
    92     "-c", "KeepAlive 0"
     92    "-c", "KeepAlive off"
    9393);
    9494
  • trunk/Tools/Scripts/webkitperl/httpd.pm

    r130202 r139071  
    9191}
    9292
     93sub getApacheVersion
     94{
     95    my $httpdPath = getHTTPDPath();
     96    my $version = `$httpdPath -v`;
     97    $version =~ s/.*Server version: Apache\/(\d+\.\d+).*/\1/s;
     98    return $version;
     99}
     100
    93101sub getDefaultConfigForTestDirectory
    94102{
     
    113121        # Apache wouldn't run CGIs with permissions==700 otherwise
    114122        "-c", "User \"#$<\"",
    115         "-c", "LockFile \"$httpdLockFile\"",
    116123        "-c", "PidFile \"$httpdPidFile\"",
    117124        "-c", "ScoreBoardFile \"$httpdScoreBoardFile\"",
    118125    );
     126
     127    if (getApacheVersion() eq "2.2") {
     128        push(@httpdArgs, "-c", "LockFile \"$httpdLockFile\"");
     129    }
    119130
    120131    # FIXME: Enable this on Windows once <rdar://problem/5345985> is fixed
     
    135146    my $httpdPath = getHTTPDPath();
    136147    my $httpdConfDirectory = "$testDirectory/http/conf/";
     148    my $apacheVersion = getApacheVersion();
    137149
    138150    if (isCygwin()) {
     
    147159        $httpdConfig = "apache2-debian-httpd.conf";
    148160    } elsif (isFedoraBased()) {
    149         $httpdConfig = "fedora-httpd.conf"; # This is an apache2 config, despite the name.
     161        $httpdConfig = "fedora-httpd-$apacheVersion.conf";
    150162    } else {
    151163        # All other ports use apache2, so just use our default apache2 config.
  • trunk/Tools/Scripts/webkitpy/layout_tests/port/base.py

    r138314 r139071  
    12101210        return self._filesystem.exists('/etc/debian_version')
    12111211
     1212    def _apache_version(self):
     1213        config = self._executive.run_command([self._path_to_apache(), '-v'])
     1214        return re.sub(r'(?:.|\n)*Server version: Apache/(\d+\.\d+)(?:.|\n)*', r'\1', config)
     1215
    12121216    # We pass sys_platform into this method to make it easy to unit test.
    12131217    def _apache_config_file_name_for_platform(self, sys_platform):
     
    12161220        if sys_platform.startswith('linux'):
    12171221            if self._is_redhat_based():
    1218                 return 'fedora-httpd.conf'  # This is an Apache 2.x config file despite the naming.
     1222                return 'fedora-httpd-' + self._apache_version() + '.conf'
    12191223            if self._is_debian_based():
    12201224                return 'apache2-debian-httpd.conf'
  • trunk/Tools/Scripts/webkitpy/layout_tests/port/port_testcase.py

    r138314 r139071  
    590590
    591591        port._is_redhat_based = lambda: True
    592         self._assert_config_file_for_platform(port, 'linux2', 'fedora-httpd.conf')
     592        port._apache_version = lambda: '2.2'
     593        self._assert_config_file_for_platform(port, 'linux2', 'fedora-httpd-2.2.conf')
    593594
    594595        port = TestWebKitPort()
Note: See TracChangeset for help on using the changeset viewer.