Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Apache server no longer working after F28 upgrade

At last, I converted and backed up my specific data and could launch a F26->F28 upgrade (I didn't dive into F29 because I fear compatibility problems with some applications whose data format/scheme changed a lot). I went through the dnf system-upgrade stance and the upgrade itself completed fine.

After that, I checked my custom configuration, notably my Web servers. My main one is in mixed environment: it delivers pure HTML pages, PHP, Python and Perl generated pages. It works fine except for Perl scripts.

It took me a while to discover that the default MPM module changed from worker to event. It appears mod_perl is not compatible with event. I then adapted my configuration, essentially an .htaccess file in the Perl script directory, so that Perl scripts are served by CGI in case event is active or by mod_perl otherwise.

After that, Perl scripts were interpreted as such instead of being displayed as is on screen. However, CSS style sheets and graphical pictures (JPEG, PNG, ICO, etc.) are also considered as scripts and tentatively executed, leading to error AH01241 (tons of these in error_log).

CSS and icons are filtered with <FilesMatch> so that they don't get Options +ExecCGI which is added only in a <FilesMatch> section for the scripts.

What changed in default Apache configuration between F26 and F28?

Sorry, I didn't note the versions for httpd, mod_perl and others in F26 because I didn't anticipate problems. I think it is not an Apache problem, but a Fedora specific one. This is why I ask here. Also, not enough karma points to attach my .htaccess file.

Apache server no longer working after F28 upgrade

At last, I converted and backed up my specific data and could launch a F26->F28 upgrade (I didn't dive into F29 because I fear compatibility problems with some applications whose data format/scheme changed a lot). I went through the dnf system-upgrade stance and the upgrade itself completed fine.

After that, I checked my custom configuration, notably my Web servers. My main one is in mixed environment: it delivers pure HTML pages, PHP, Python and Perl generated pages. It works fine except for Perl scripts.

It took me a while to discover that the default MPM module changed from worker to event. It appears mod_perl is not compatible with event. I then adapted my configuration, essentially an .htaccess file in the Perl script directory, so that Perl scripts are served by CGI in case event is active or by mod_perl otherwise.

After that, Perl scripts were interpreted as such instead of being displayed as is on screen. However, CSS style sheets and graphical pictures (JPEG, PNG, ICO, etc.) are also considered as scripts and tentatively executed, leading to error AH01241 (tons of these in error_log).

CSS and icons are filtered with <FilesMatch> so that they don't get Options +ExecCGI which is added only in a <FilesMatch> section for the scripts.

What changed in default Apache configuration between F26 and F28?

Sorry, I didn't note the versions for httpd, mod_perl and others in F26 because I didn't anticipate problems. I think it is not an Apache problem, but a Fedora specific one. This is why I ask here. Also, not enough karma points to attach my here.

EDIT 2018-12-15 - Contents of .htaccess file.(unneeded comments stripped off for brevity):

File structure is a bit contorted because application should work automatically no matter Apache and mod_perl versions.

Options FollowSymlinks

<IfModule mod_version.c>
    <IfVersion < 2.4>
        Order deny,allow
    </IfVersion>
</IfModule>
<IfModule !mod_version.c>
    <IfModule !mod_authz_core.c>
        Order deny,allow
    </IfModule>
</IfModule>
# -----------    Access restrictions    -----------
Options -Indexes

# Forbid direct access to any file in LXR root and its subdirectories
<FilesMatch ".">
    <IfModule mod_version.c>
        <IfVersion < 2.4>
            Deny from all
        </IfVersion>
        <IfVersion >= 2.4>
            Require all denied
        </IfVersion>
    </IfModule>
    <IfModule !mod_version.c>
        <IfModule !mod_authz_core.c>
            Deny from all
        </IfModule>
        <IfModule mod_authz_core.c>
            Require all denied
        </IfModule>
    </IfModule>
</FilesMatch>

# But allow access to style sheets
<FilesMatch "\.css$">
    <IfModule mod_version.c>
        <IfVersion < 2.4>
            Allow from all
        </IfVersion>
        <IfVersion >= 2.4>
            Require all granted
        </IfVersion>
    </IfModule>
    <IfModule !mod_version.c>
        <IfModule !mod_authz_core.c>
            Allow from all
        </IfModule>
        <IfModule mod_authz_core.c>
            Require all granted
        </IfModule>
    </IfModule>
</FilesMatch>
# and graphic files (for icons)
<FilesMatch "\.(bmp|gif|icon?|jpe?g|png|svg|tiff?)$">
    <IfModule mod_version.c>
        <IfVersion < 2.4>
            Allow from all
        </IfVersion>
        <IfVersion >= 2.4>
            Require all granted
        </IfVersion>
    </IfModule>
    <IfModule !mod_version.c>
        <IfModule !mod_authz_core.c>
            Allow from all
        </IfModule>
        <IfModule mod_authz_core.c>
            Require all granted
        </IfModule>
    </IfModule>
</FilesMatch>

<FilesMatch "^(search|source|ident|diff|showconfig|perf)$">
# Enable CGI script execution
    Options +ExecCGI
    <IfModule mod_version.c>
        <IfVersion < 2.4>
            Allow from all
        </IfVersion>
        <IfVersion >= 2.4>
            Require all granted
        </IfVersion>
    </IfModule>
    <IfModule !mod_version.c>
        <IfModule !mod_authz_core.c>
            Allow from all
        </IfModule>
        <IfModule mod_authz_core.c>
            Require all granted
        </IfModule>
    </IfModule>

    # *** mod_perl use ***
    <IfModule mod_perl.c>
        SetHandler perl-script

        # Configuration parameters changed between mod_perl versions:
        <IfDefine MODPERL2>
            PerlOptions +ParseHeaders
        # Apache can dispatch execution according to 3 modes.
        # mod_perl initialization differs slightly:
            <IfModule prefork.c>
                PerlHandler ModPerl::RegistryPrefork
            </IfModule>
            <IfModule worker.c>
                PerlHandler ModPerl::Registry
            </IfModule>
            <IfModule mpm_event_module>
                SetHandler cgi-script
            </IfModule>
        </IfDefine>

        <IfDefine !MODPERL2>
            PerlSendHeader On
            PerlHandler Apache::Registry
        </IfDefine>

    </IfModule>

    <IfModule !mod_perl.c>
        SetHandler cgi-script
    </IfModule>

</FilesMatch>

Apache server no longer working after F28 upgrade

At last, I converted and backed up my specific data and could launch a F26->F28 upgrade (I didn't dive into F29 because I fear compatibility problems with some applications whose data format/scheme changed a lot). I went through the dnf system-upgrade stance and the upgrade itself completed fine.

After that, I checked my custom configuration, notably my Web servers. My main one is in mixed environment: it delivers pure HTML pages, PHP, Python and Perl generated pages. It works fine except for Perl scripts.

It took me a while to discover that the default MPM module changed from worker to event. It appears mod_perl is not compatible with event. I then adapted my configuration, essentially an .htaccess file in the Perl script directory, so that Perl scripts are served by CGI in case event is active or by mod_perl otherwise.

After that, Perl scripts were interpreted as such instead of being displayed as is on screen. However, CSS style sheets and graphical pictures (JPEG, PNG, ICO, etc.) are also considered as scripts and tentatively executed, leading to error AH01241 (tons of these in error_log).

CSS and icons are filtered with <FilesMatch> so that they don't get Options +ExecCGI which is added only in a <FilesMatch> section for the scripts.

What changed in default Apache configuration between F26 and F28?

Sorry, I didn't note the versions for httpd, mod_perl and others in F26 because I didn't anticipate problems. I think it is not an Apache problem, but a Fedora specific one. This is why I ask here.

EDIT 2018-12-15 - Contents of .htaccess (unneeded comments stripped off for brevity):

File structure is a bit contorted because application should work automatically no matter Apache and mod_perl versions.

Options FollowSymlinks

<IfModule mod_version.c>
    <IfVersion < 2.4>
        Order deny,allow
    </IfVersion>
</IfModule>
<IfModule !mod_version.c>
    <IfModule !mod_authz_core.c>
        Order deny,allow
    </IfModule>
</IfModule>
# -----------    Access restrictions    -----------
Options -Indexes

# Forbid direct access to any file in LXR root and its subdirectories
<FilesMatch ".">
    <IfModule mod_version.c>
        <IfVersion < 2.4>
            Deny from all
        </IfVersion>
        <IfVersion >= 2.4>
            Require all denied
        </IfVersion>
    </IfModule>
    <IfModule !mod_version.c>
        <IfModule !mod_authz_core.c>
            Deny from all
        </IfModule>
        <IfModule mod_authz_core.c>
            Require all denied
        </IfModule>
    </IfModule>
</FilesMatch>

# But allow access to style sheets
<FilesMatch "\.css$">
    <IfModule mod_version.c>
        <IfVersion < 2.4>
            Allow from all
        </IfVersion>
        <IfVersion >= 2.4>
            Require all granted
        </IfVersion>
    </IfModule>
    <IfModule !mod_version.c>
        <IfModule !mod_authz_core.c>
            Allow from all
        </IfModule>
        <IfModule mod_authz_core.c>
            Require all granted
        </IfModule>
    </IfModule>
</FilesMatch>
# and graphic files (for icons)
<FilesMatch "\.(bmp|gif|icon?|jpe?g|png|svg|tiff?)$">
    <IfModule mod_version.c>
        <IfVersion < 2.4>
            Allow from all
        </IfVersion>
        <IfVersion >= 2.4>
            Require all granted
        </IfVersion>
    </IfModule>
    <IfModule !mod_version.c>
        <IfModule !mod_authz_core.c>
            Allow from all
        </IfModule>
        <IfModule mod_authz_core.c>
            Require all granted
        </IfModule>
    </IfModule>
</FilesMatch>

<FilesMatch "^(search|source|ident|diff|showconfig|perf)$">
# Enable CGI script execution
    Options +ExecCGI
    <IfModule mod_version.c>
        <IfVersion < 2.4>
            Allow from all
        </IfVersion>
        <IfVersion >= 2.4>
            Require all granted
        </IfVersion>
    </IfModule>
    <IfModule !mod_version.c>
        <IfModule !mod_authz_core.c>
            Allow from all
        </IfModule>
        <IfModule mod_authz_core.c>
            Require all granted
        </IfModule>
    </IfModule>

    # *** mod_perl use ***
    <IfModule mod_perl.c>
        SetHandler perl-script

        # Configuration parameters changed between mod_perl versions:
        <IfDefine MODPERL2>
            PerlOptions +ParseHeaders
        # Apache can dispatch execution according to 3 modes.
        # mod_perl initialization differs slightly:
            <IfModule prefork.c>
                PerlHandler ModPerl::RegistryPrefork
            </IfModule>
            <IfModule worker.c>
                PerlHandler ModPerl::Registry
            </IfModule>
            <IfModule mpm_event_module>
                SetHandler cgi-script
            </IfModule>
        </IfDefine>

        <IfDefine !MODPERL2>
            PerlSendHeader On
            PerlHandler Apache::Registry
        </IfDefine>

    </IfModule>

    <IfModule !mod_perl.c>
        SetHandler cgi-script
    </IfModule>

</FilesMatch>
click to hide/show revision 4
None

updated 2018-12-17 05:37:51 -0600

hhlp gravatar image

Apache server no longer working after F28 upgradeupgrade [solved]

At last, I converted and backed up my specific data and could launch a F26->F28 upgrade (I didn't dive into F29 because I fear compatibility problems with some applications whose data format/scheme changed a lot). I went through the dnf system-upgrade stance and the upgrade itself completed fine.

After that, I checked my custom configuration, notably my Web servers. My main one is in mixed environment: it delivers pure HTML pages, PHP, Python and Perl generated pages. It works fine except for Perl scripts.

It took me a while to discover that the default MPM module changed from worker to event. It appears mod_perl is not compatible with event. I then adapted my configuration, essentially an .htaccess file in the Perl script directory, so that Perl scripts are served by CGI in case event is active or by mod_perl otherwise.

After that, Perl scripts were interpreted as such instead of being displayed as is on screen. However, CSS style sheets and graphical pictures (JPEG, PNG, ICO, etc.) are also considered as scripts and tentatively executed, leading to error AH01241 (tons of these in error_log).

CSS and icons are filtered with <FilesMatch> so that they don't get Options +ExecCGI which is added only in a <FilesMatch> section for the scripts.

What changed in default Apache configuration between F26 and F28?

Sorry, I didn't note the versions for httpd, mod_perl and others in F26 because I didn't anticipate problems. I think it is not an Apache problem, but a Fedora specific one. This is why I ask here.

EDIT 2018-12-15 - Contents of .htaccess (unneeded comments stripped off for brevity):

File structure is a bit contorted because application should work automatically no matter Apache and mod_perl versions.

Options FollowSymlinks

<IfModule mod_version.c>
    <IfVersion < 2.4>
        Order deny,allow
    </IfVersion>
</IfModule>
<IfModule !mod_version.c>
    <IfModule !mod_authz_core.c>
        Order deny,allow
    </IfModule>
</IfModule>
# -----------    Access restrictions    -----------
Options -Indexes

# Forbid direct access to any file in LXR root and its subdirectories
<FilesMatch ".">
    <IfModule mod_version.c>
        <IfVersion < 2.4>
            Deny from all
        </IfVersion>
        <IfVersion >= 2.4>
            Require all denied
        </IfVersion>
    </IfModule>
    <IfModule !mod_version.c>
        <IfModule !mod_authz_core.c>
            Deny from all
        </IfModule>
        <IfModule mod_authz_core.c>
            Require all denied
        </IfModule>
    </IfModule>
</FilesMatch>

# But allow access to style sheets
<FilesMatch "\.css$">
    <IfModule mod_version.c>
        <IfVersion < 2.4>
            Allow from all
        </IfVersion>
        <IfVersion >= 2.4>
            Require all granted
        </IfVersion>
    </IfModule>
    <IfModule !mod_version.c>
        <IfModule !mod_authz_core.c>
            Allow from all
        </IfModule>
        <IfModule mod_authz_core.c>
            Require all granted
        </IfModule>
    </IfModule>
</FilesMatch>
# and graphic files (for icons)
<FilesMatch "\.(bmp|gif|icon?|jpe?g|png|svg|tiff?)$">
    <IfModule mod_version.c>
        <IfVersion < 2.4>
            Allow from all
        </IfVersion>
        <IfVersion >= 2.4>
            Require all granted
        </IfVersion>
    </IfModule>
    <IfModule !mod_version.c>
        <IfModule !mod_authz_core.c>
            Allow from all
        </IfModule>
        <IfModule mod_authz_core.c>
            Require all granted
        </IfModule>
    </IfModule>
</FilesMatch>

<FilesMatch "^(search|source|ident|diff|showconfig|perf)$">
# Enable CGI script execution
    Options +ExecCGI
    <IfModule mod_version.c>
        <IfVersion < 2.4>
            Allow from all
        </IfVersion>
        <IfVersion >= 2.4>
            Require all granted
        </IfVersion>
    </IfModule>
    <IfModule !mod_version.c>
        <IfModule !mod_authz_core.c>
            Allow from all
        </IfModule>
        <IfModule mod_authz_core.c>
            Require all granted
        </IfModule>
    </IfModule>

    # *** mod_perl use ***
    <IfModule mod_perl.c>
        SetHandler perl-script

        # Configuration parameters changed between mod_perl versions:
        <IfDefine MODPERL2>
            PerlOptions +ParseHeaders
        # Apache can dispatch execution according to 3 modes.
        # mod_perl initialization differs slightly:
            <IfModule prefork.c>
                PerlHandler ModPerl::RegistryPrefork
            </IfModule>
            <IfModule worker.c>
                PerlHandler ModPerl::Registry
            </IfModule>
            <IfModule mpm_event_module>
                SetHandler cgi-script
            </IfModule>
        </IfDefine>

        <IfDefine !MODPERL2>
            PerlSendHeader On
            PerlHandler Apache::Registry
        </IfDefine>

    </IfModule>

    <IfModule !mod_perl.c>
        SetHandler cgi-script
    </IfModule>

</FilesMatch>