0

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>

1 Answer 1

0

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?

12
  • 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, 2011 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 Apr 23, 2011 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, 2011 at 20:10
  • EDIT: nevermind, try this: httpd stop httpd startssl httpd restart from linuxdoc.org/HOWTO/SSL-RedHat-HOWTO-4.html#ss4.3 Apr 23, 2011 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, 2011 at 20:30

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .