I have a simple LAMP stack with httpd/Apache installed on Centos 6.5. I've set my vhost up in /etc/httpd/sites-available/acute.conf like so:
<VirtualHost *:80>
ServerName acutemedical.co
ServerAlias acutemedical.co
DocumentRoot /var/www/html
ErrorLog /var/www/log/error.log
CustomLog /var/www/log/requests.log combined
Redirect permanent / https://acutemedical.co/
</VirtualHost>
<VirtualHost *:443>
ServerName acutemedical.co
ServerAlias acutemedical.co
DocumentRoot /var/www/html
ErrorLog /var/www/log/error.log
CustomLog /var/www/log/requests.log combined
SSLEngine on
SSLCertificateFile /etc/httpd/ssl/server.crt
SSLCertificateKeyFile /etc/httpd/ssl/server.key
</VirtualHost>
Also here is the output of my iptables ruleset:
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:80
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:443
When visiting the site at port 80 without the redirect the site will come up no problem. When visiting the site on port 443 it gets a connection refused. Same problem when I leave the redirect directive in the 80 vhost block.
I've tried to curl each url with http and https and only http works.
I've set this up before but it's been a year or so (I'm mostly using nginx now). So I was wondering if anyone can look at my configuration and tell me what I'm doing wrong.