If you’re running Apache 2.4 on Rocky Linux 9 and want to protect your web server against basic DoS, DDoS, or brute-force attacks, installing mod_evasive is a solid option. Unfortunately, the module isn’t included by default, and some manual work is required to get it running. Here’s a quick guide to getting it installed and […]
PROBLEM: I was seeing the following error when trying to do a plugin update, and an error in my WordPress logs: Update failed: 504 Gateway Timeout Gateway Timeout The gateway did not receive a timely response from the upstream server or application. [Tue Apr 11 22:12:01.373709 2023] [proxy_fcgi:error] [pid 26878] (70007)The timeout specified has expired: […]
This post does not cover configuring letsencrypt or ssl/https. First, make sure your LetsEncrypt configuration points to the actual WordPress document root directory cat /etc/letsencrypt/renewal/www.yourdomain.com.conf
Second, use the new macro language feature in Apache 2.4 to configure an https redirect macro which does NOT redirect to https for anything in the .well-known subdirectory. This […]
Apache 2.4 changed the security configuration directives a bit. Here is an example using basic auth:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
<Directory"/path/to/your/wordpress">
AllowOverride All
Options+FollowSymLinks+ExecCGI-Indexes
Order allow,deny
Allow from all
<RequireAll>
AuthType Basic
AuthName"Protected Resource"
AuthUserFile/path/to/your/.htpasswd
Require valid-user
</RequireAll>
</Directory>
What tripped me up for a while was that I still had the Require all granted directive inside the container, and that needed to be removed for the auth to work.
If you get this error when starting Apache or via apachectl configtest: [warn] _default_ VirtualHost overlap on port 443, the first has precedence then you must add: NameVirtualHost *:443 to /etc/httpd/conf/httpd.conf, then restart Apache
If you need to use wget to obtain the contents of a web page, but that page has either Basic or Digest Authentication enabled, use the following syntax to gain access: wget –http-user=yourUserNameHere –http-password=yourSecretPasswordHere http://example.org/desired/path/ ~or~ wget http://yourUserNameHere:yourSecretPasswordHere@yourSite.com/desired/path/