Keep Server Online
If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.
or
A donation makes a contribution towards the costs, the time and effort that's going in this site and building.
Thank You! Steffen
Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
| |
|
Topic: Site down after a2enmod headers |
|
Author |
|
phixate
Joined: 05 Dec 2018 Posts: 1 Location: USA, Montezuma
|
Posted: Thu 06 Dec '18 0:23 Post subject: Site down after a2enmod headers |
|
|
I was trying to put a redirect from http to https in my example.com.conf file like this:
<VirtualHost *:80>
[...]
ServerName example.com
Redirect permanent / https://example.com/
I saved the file and did this a2enmod headers to prepare for HSTS setup (which I'm not sure if I need Nginx for that??). After this my website no longer works. Prior to this it worked fine over http or https.
I tried a2dismod headers and removing the redirect line but the site is still down. Anyone know what I did to hose it and how to fix it?
EDIT:
I'm looking at the error log and it appears it might be a WordPress issue. I'm getting a database error after installing WooCommerce and upping the PHP memory limit to 256M, the two steps I took before installing my SSL. I'll try disabling the plugin to see if it fixes the issue.
It's still trying to redirect to https though. Are those conf files cached or something?
EDIT2: I tried changing the wordpress URL to https and renamed woocommerce directory to disable but that didn't work.
EDIT3: I reinstalled WordPress and WooCommerce and I can get into the back end but the site won't load on the front via http or https. This leads me to think it's a problem with the Apache virtualhost configuration or module. I've checked the apache2, 000-default and example.com conf files and everything looks fine. There are no redirects. I tried sudo a2dissite 000-default.conf. Nothing. Still hangs and then triese to go to https before the connection times out.
EDIT4: So I'm guessing it had something to do with my virtualhost config for my site. I added
SSLEngine on
SSLCertificateFile /etc/ssl/example.com_crt
SSLCertificateKeyFile /etc/ssl/private/example.com.key
SSLCertificateChainFile /etc/ssl/example_com.ca-bundle
and ran a apachectl -t and it says the SSLCertificateKeyFile does not exist or is empty. I put the file in the etc/ssl/private folder twice. Is this a permissions issue maybe? Oh and the file is not empty.
EDIT5: OK so I got it. I accidentally placed a / in front of my directory when moving my key file and it wound up in the root with a different name. I had to chagne the name back and chown it to root and mv it to the /etc/ssl/private directory. Now to figure out this HSTS stuff. Not sure if I want to go there just yet after all this. |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
Posted: Mon 10 Dec '18 12:03 Post subject: |
|
|
For HSTS
Code: | <If "%{SERVER_PORT} == '443'">
<IfModule mod_headers.c>
Header always set Strict-Transport-Security "max-age=15553000; preload"
</IfModule>
</If> |
|
|
Back to top |
|
|
|
|
|
|