1

I've been trying to set up my own apache server for my website sammurphey.net Everythings been running smoothly up until SSL.

I have the following virtual hosts in my httpd.conf

<VirtualHost *:80>
    ServerName sammurphey.net:80
    ServerAlias www.sammurphey.net
    DocumentRoot /srv/http/sam.../
</VirtualHost>
<VirtualHost *:443>
    ServerName sammurphey.net:443
    ServerAlias www.sammurphey.net
    DocumentRoot /srv/http/sam.../
</VirtualHost>

and I've linked up the keys in my httpd-ssl.conf

SSLEngine on
SSLCertificateFile "/etc/httpd/.../server.cer"
SSLPrivateKey "/etc/httpd/.../server.key"
SSLCertificateChainFile "/etc/httpd/.../intermediate.cer"

When i try to enable the httpd-ssl.conf file by uncommenting it's line in httpd.conf the whole thing fails. Nothing will serve. Commenting it back out leaves HTTP working of course, but HTTPS get's weird..

Non-ssl site, serving correctly

*:80 displaying as expected

Https site, serving who know what!?

*:443 ignoring /srv/http entirely and seems to be serving a copy that somehow still exists on my old shared host? I guess? This old version of the site does not exist on my server's HD.. I'm really at a loss as to what's happening here.

Sam Murphey
  • 113
  • 3
  • Typically Apache httpd will record the reason why it fails to start in the error_log – HBruijn Aug 15 '18 at 22:40
  • @HBruijn oh thank u! I just checked it and it was a duplicate ServerName entry httpd-ssl that was left with the default value. Got it now +1 – Sam Murphey Aug 15 '18 at 23:56

1 Answers1

0

Nevermind I got it working.

Something was bad with the httpd-ssl.conf - still not sure what though..

I just moved the certificate declarations into the virtual host in httpd-conf and now it works fine.

Reference to httpd-ssl.conf is commented out.

Final/Working Virtual Host:

<VirtualHost *:443>
    ServerName sammurphey.net:443
    ServerAlias www.sammurphey.net
    DocumentRoot /srv/http/sam.../
    SSLEngine on
    SSLCertificateFile "/etc/httpd/.../server.cer"
    SSLPrivateKey "/etc/httpd/.../server.key"
    SSLCertificateChainFile "/etc/httpd/.../intermediate.cer"
</VirtualHost>
Sam Murphey
  • 113
  • 3