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.

I've tried to follow a tutorial on self-generating a SSL Certificate. I've created a file "www.mysite.com.csr" and a file "www.mysite.com.key". However, when I restart apache, it doesn't prompt me for the passphrase, as the tutorial suggests.

I also tried to configure my virtual hosts to rewrite to https and it failed.

Do I have to make a change to the httpd config file to make my certificate work?

Here is my virtual host conf:

   <IfDefine SSL> 
   <VirtualHost *:443>

    ServerName mysite.com
    ServerAlias www.mysite.com

    DocumentRoot /home/project/

    SSLEngine on
    SSLCertificateFile /usr/lib/ssl/www.mysite.com.crt
    SSLCertificateKeyFile /usr/lib/ssl/www.msyite.com.key

    #SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown

  </VirtualHost>
 </IfDefine>
share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

Please post a copy of your configuration files here (The relevant parts in httpd, or if you are using ubuntu/debian the correct virtual host in /etc/apache2/sites-enabled). Without that information it is very hard to figure out whats going on.

Are you sure that you actually told the virtual host (or httpd.conf) file to use the SSL cert? If apache does not know that the key exists it wont do anything with it. You need to have something like this in a VirtualHost

SSLEngine on
  SSLCertificateFile /path/to/www.mysite.csr
  SSLCertificateKeyFile  /path/to/www.mysite.key

Are you sure that you set a password on your SSL key? Are you sure you have enabled SSL for apache, and have port 443 running?

share|improve this answer
    
I did set a password on my SSL key. I'm not sure if I have port 443 running outside of trying http:mysite.com in my brower –  Ben Apr 23 '11 at 20:01
    
http will normally go to port 80, try going to https:// go to blogs.sitepoint.com/securing-apache-2-server-ssl, there are two parts in there which talk about enabling SSL(LoadModule part) and the 2nd is a sample virtualhost config –  Pratik Amin Apr 23 '11 at 20:04
    
right, so i followed a similar tutorial. I'm stuck. apache is telling me that SSLEngine module is not included in the server configuration –  Ben Apr 23 '11 at 20:10
    
EDIT: nevermind, try this: httpd stop httpd startssl httpd restart from linuxdoc.org/HOWTO/SSL-RedHat-HOWTO-4.html#ss4.3 –  Pratik Amin Apr 23 '11 at 20:15
    
hurray! I sort of have it now. After your wonderful suggestion about a2, I googled that term and came across a great tutorial. I made some changes and I now have SSL working. Thanks so much Pratik! –  Ben Apr 23 '11 at 20:30
show 7 more comments

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.