Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have the following configuration:

DocumentRoot "/var/www/"
RewriteEngine   on
RewriteCond     %{SERVER_PORT} ^80$
RewriteRule     ^(.*)$ https://%{SERVER_NAME}$1 [L,R]

DocumentRoot "/var/www/"
SSLEngine on
SSLCertificateFile /var/ssl/testing/server.crt
SSLCertificateKeyFile /var/ssl/testing/server.key
<Directory "/var/www/">
allow from all
Options +Indexes
SSLVerifyClient none

However this gives me an SSL protocol error, which I don't get if I remove the first VirtualHost.


share|improve this question
up vote 1 down vote accepted

You need to add NameVirtualHost.

Try to add the following


More information:

share|improve this answer
That gives me [warn] NameVirtualHost has no VirtualHosts – Dean Aug 16 '12 at 11:35
Check here and make sure your configuration is proper. – pkhamre Aug 16 '12 at 11:41
Umm, yeah, I don't see any problems with mine. New version is here: – Dean Aug 16 '12 at 11:44
Just to make sure, you have Listen-directives for both ports? – pkhamre Aug 16 '12 at 11:47
Yes, Listen *:443 Listen *:80 – Dean Aug 16 '12 at 11:54

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.