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>
   <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
   ProxyPass /balancer-manager !
   ProxyPass / balancer://Default/
   <IfDefine SSL>

migrated from stackoverflow.com 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>
ServerName svn.example.com
ServerAdmin webmaster@localhost
SSLEngine On
SSLCertificateFile /etc/apache2/certs/example.com.crt
SSLCertificateKeyFile /etc/apache2/certs/example.com.key
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"
  • 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 clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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