Ubuntu – Apache and SSL Issues

Apache2ssl

I have my server set up to use SSL in a separate VirtualHost, but when I attempt to use https://my.domain, I get a connection refused error. The following is my config I'm using:

<VirtualHost 173.0.50.62:80>
    ServerName api.bb0.us
    DocumentRoot /home/tristan/bb0_www/api
</VirtualHost>

<VirtualHost 173.0.50.62:443>
    ServerName api.bb0.us
    DocumentRoot /home/tristan/bb0_www/api
    SSLEngine on
    SSLCertificateFile /etc/apache2/bb0_cert/bb0.crt
    SSLCertificateKeyFile /etc/apache2/bb0_cert/private.key
    SSLCACertificateFile /etc/apache2/bb0_cert/root.crt
</VirtualHost>

If you do try to go to http://bb0.us everything will work, but when you attempt https://bb0.us, it will not work. I don't have ufw or anything else blocking this, so I'm confused why this is not working. I've tried to add a NameVirtualHost, but that didn't do anything in fixing this.

Anyone have any ideas what may be causing this?

Best Answer

Have you enabled Apache's SSL module? If not, running the following commands should do the trick:

sudo a2enmod ssl
sudo service apache2 restart

If mod_ssl is not loaded, then Apache won't listen on port 443 by default or SSL connections.

Related Question