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 implement SSL in apache. I mean the code that have to be written in virtual host file for using https. Actually I had generate dummy certificate for testing, but with my virtual host file coding it's not working. So, please give me a peace of code in virtual host file which will work for https. 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>

Is there any wronge in my virtual host file? Please replay me as soon as possible.

Thank you.

share|improve this question
Have you enabled the SSL module? – Pratik Amin Jul 4 '11 at 15:56

Place double quotes around the path entries in your SSLCertificateFile and SSLCertificateKeyFile directives (because there are spaces in the path names) or move the files into directories that don't have any spaces in them. Moving them might be the better option--I don't know how apache is going to parse the parentheses in your path name.

Also, make sure mod_ssl is loaded.

share|improve this answer

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.