I've been having some problems setting up my apache webserver to only serve pages over https. I think I nailed it earlier this week, but after some tinkering it seems like I broke it again and I don't know when exactly I broke it.
My setup produces this output, and thus my configuration syntax should be ok:
# apache2ctl -t -D DUMP_VHOSTS
VirtualHost configuration:
192.168.0.1:80 is a NameVirtualHost
default server cal.example.com (/etc/apache2/sites-enabled/99-davical:2)
port 80 namevhost cal.example.com (/etc/apache2/sites-enabled/99-davical:2)
port 80 namevhost proius.example.com (/etc/apache2/sites-enabled/proius:1)
port 80 namevhost slnew.example.com (/etc/apache2/sites-enabled/slnew:1)
port 80 namevhost webmail.example.com (/etc/apache2/sites-enabled/webmail:1)
192.168.0.1:443 is a NameVirtualHost
default server proius.example.com (/etc/apache2/sites-enabled/proius:10)
port 443 namevhost proius.example.com (/etc/apache2/sites-enabled/proius:10)
port 443 namevhost slnew.example.com (/etc/apache2/sites-enabled/slnew:10)
port 443 namevhost webmail.example.com (/etc/apache2/sites-enabled/webmail:10)
192.168.0.1:8443 is a NameVirtualHost
default server cal.example.com (/etc/apache2/sites-enabled/99-davical:11)
port 8443 namevhost cal.example.com (/etc/apache2/sites-enabled/99-davical:11)
Syntax OK
This is how all my virtualhosts are defined:
<VirtualHost slnew.example.com:80>
ServerName slnew.example.com
ServerAdmin vvh@example.com
DocumentRoot /var/www/slnew
RewriteEngine On
RewriteLogLevel 0
RewriteRule ^/(.*) https://slnew.example.com:443/$1 [L,R]
</VirtualHost>
<VirtualHost slnew.example.com:443>
ServerName slnew.example.com
ServerAdmin vvh@example.com
DocumentRoot /var/www/slnew
<Directory /var/www/slnew>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
LogLevel info
ErrorLog ${APACHE_LOG_DIR}/slnew_error.log
CustomLog ${APACHE_LOG_DIR}/slnew_access.log combined
SSLEngine on
SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem
SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key
SSLProtocol -all +SSLv3 +TLSv1
SSLCipherSuite SSLv3:+HIGH:+MEDIUM
<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
BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown
</VirtualHost>
When I visit my sites, I get this error in Google Chrome:
Error 107 (net::ERR_SSL_PROTOCOL_ERROR): SSL protocol error.