Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

Can anyone tell me how I can configure SSL in Apache.

I generated a dummy certificate for testing, but with my virtual host file config is not working.

Can anyone see what's wrong?

My Virtual host file:

   <IfDefine SSL>
   DocumentRoot "C:/.../My Company/My Sites/"
   #CustomLog logs/ combined
   #ErrorLog logs/

   SSLEngine on
   SSLCertificateFile C:/Program Files (x86)/ApacheSoftwareFoundation/conf/ssl.crt/server.crt 
   SSLCertificateKeyFile C:/Program Files (x86)/ApacheSoftwareFoundation/conf/ssl.key/server.key

   SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown
   CustomLog logs/ssl_request_log \
   "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"

   <Proxy balancer://Default>
        BalancerMember http://server1:8080/page-to-be-displayed retry=5
   ProxyPass /balancer-manager !
   ProxyPass / balancer://Default/
   <IfDefine SSL>
share|improve this question

migrated from Jul 4 '11 at 18:08

This question came from our site for professional and enthusiast programmers.

Why is the server name and port different to the virtual host? – Quentin Jul 4 '11 at 15:40

I currently use this for my SVN server, it all depends on how you set up the certs though.

I followed Godaddy's directions here

NameVirtualHost *:443
<virtualhost *:443>
ServerAdmin webmaster@localhost
SSLEngine On
SSLCertificateFile /etc/apache2/certs/
SSLCertificateKeyFile /etc/apache2/certs/
SSLCertificateChainFile /etc/apache2/certs/gd_bundle.crt

DocumentRoot /var/www/svn/
<Directory "/var/www/svn/">
        Options Indexes FollowSymLinks MultiViews
        AllowOverride All
        Order allow,deny
        allow from all

ErrorLog /var/log/apache2/ssl-error.log
CustomLog /var/log/apache2/ssl-access.log combined
ServerSignature On

Try adding double quotes around anything with spaces, i am not great at windows based vhost, but it seems this could be an issue.

SSLCertificateFile C:/Program Files (x86)/ApacheSoftwareFoundation/conf/ssl.crt/server.crt 
SSLCertificateKeyFile C:/Program Files (x86)/ApacheSoftwareFoundation/conf/ssl.key/server.key


SSLCertificateFile "C:/Program Files (x86)/ApacheSoftwareFoundation/conf/ssl.crt/server.crt" 
SSLCertificateKeyFile "C:/Program Files (x86)/ApacheSoftwareFoundation/conf/ssl.key/server.key"
share|improve this answer
hi, thanks for replay. I have edit my code and provide my virtual host file please tell me is there anything wronge with my code? – Lokesh Paunikar Jul 4 '11 at 15:38

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.