Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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>
   <VirtualHost mydomainname.com:443>
   ServerName www.mydmainnamw.com:8080
   DocumentRoot "C:/.../My Company/My Sites/johnbokma.com/site/web"
   #CustomLog logs/lc.johnbokma.com.access.log combined
   #ErrorLog logs/lc.johnbokma.com.error.log

   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
   </Proxy>
   ProxyPass /balancer-manager !
   ProxyPass / balancer://Default/
   </VirtualHost>
   <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

1 Answer 1

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

 
discard

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.