Category: Webservers

Fixing “504 Gateway Timeout” Errors On Plesk With Nginx

If your Plesk server is configured to run Nginx in from of Apache then you may encounter “504 Gateway Timeout” errors when executing long running PHP pages.  Nginx is acting as a reverse proxy for Apache. The “proxy_read_timeout” configuration setting in Nginx controls how long Nginx will wait for Apache to return a response. The default is 60 seconds which may be too short if you have a script that takes several minutes to run. To increase this timeout, just edit /etc/nginx/nginx.conf and add the highlighted line:

Don’t forget to restart Nginx after making the change.

Read More »

Score An “A” On SSLLabs Server Test

Want an A on the SSLLabs server test? https://www.ssllabs.com/ssltest/ For Plesk create a file here:

and add the following:

For WHM/CPanel do this: a. go to Service Configuration -> Apache Configuration -> Global Configuration and set “SSL Cipher Suite” to:

b. go to Service Configuration -> Apache Configuration -> Include Editor -> Pre Main Include and add the following lines:

For a standalone Apache server try these:

For Nginx try these lines:

If you get capped at a B due to TLS Compression support you can add:

For older Apache versions this setting may not be available. In this case you can edit the init script (/etc/init.d/httpd) and add this line:

Qualys has a blog post on this subject which provided the Apache and Nginx configs: https://community.qualys.com/blogs/securitylabs/2013/08/05/configuring-apache-nginx-and-openssl-for-forward-secrecy  This forum post provided the WHM/Cpanel config: http://forums.cpanel.net/f185/cpanel-openssl-1-0-1c-higher-332001-p3.html#post1561101  

Read More »

GoAccess Web Log Analyzer

Here’s a great webserver log analysis tool. It’s lightweight, fast and runs from the command line on Linux: http://goaccess.prosoftcorp.com/ Just download, build and run with something like:

I also like generating an HTML report with something like:

Read More »

Block wp-login.php On Single Site In WordPress Multisite

Take the case where you have a WordPress multi-site with many domains pointing to a single virtual host. When the site gets hit with a wp-login.php attack you want to password protect the wp-login.php script but just for the targeted site … not for every site in the multisite.  Here’s the .htaccess rules to accomplish this:

We set an environment variable based on the Host header and then require login from requests with the matching environment variable.

Read More »

Remove Authentication From A Subfolder

Let’s say you have a directory that is password protected:

Now you want to remove the password protection from a sub-folder like:

This can be accomplished by adding another Directory block like this:

Read More »

Categories

Get a free consultation from Reliable Penguin

Submit the form—or for immediate service call 866-649-7984.