mod_ssl fails to load on apache restart after a2en

2019-07-24 20:37发布

问题:

I am unable to get my apache2 instance to run on https.

I have a running website that works on http with a couple of aliases. I installed a self signed certificate and added the entries to the conf file. So far so good.

At this juncture apache2ctl configtest says OK.

I run a2enmod ssl and ssl get enabled

apache2ctl configtest or a service apache2 restart both fail with this error

Syntax error on line 140 of /etc/apache2/apache2.conf: Syntax error on line 2 of /etc/apache2/mods-enabled/ssl.load: Cannot load /usr/lib/apache2/modules/mod_ssl.so into server: /usr/lib/apache2/modules/mod_ssl.so: undefined symbol: ap_map_http_request_error Action 'configtest' failed.

verified that mod_ssl.so is in the specified path verified that the ln to files in sites-enabled is correct certificate files exist in the specified path

my ssl conf files look like this:

<IfModule mod_ssl.c>
    Listen 443
    <VirtualHost *:443>
            SSLEngine on
            SSLCertificateFile      /etc/apache2/ssl/server.crt
            SSLCertificateKeyFile /etc/apache2/ssl/server.key

            ServerName www.myserver.com
            ServerAdmin webmaster@localhost
            DocumentRoot /var/www/html

          <FilesMatch "\.(cgi|shtml|phtml|php)$">
                            SSLOptions +StdEnvVars
            </FilesMatch>
            <Directory /usr/lib/cgi-bin>
                            SSLOptions +StdEnvVars
            </Directory>
            BrowserMatch "MSIE [2-6]" \
                            nokeepalive ssl-unclean-shutdown \
                            downgrade-1.0 force-response-1.0
            # MSIE 7 and newer should be able to use keepalive
            BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown

    </VirtualHost>
</IfModule>

How do I fix this?