Category: Webservers

Determine Most Active Site

On a server with many domains it can be difficult to determine which sites are taking the most traffic. Here’s a one-line that will generate a nice report:

This assumes that (a) log files are in /var/log/httpd, (b)  log file names end with “access.log” and that each domain has it’s own access list.      

Read More »

Block By X-Forwarded-For In .htaccess

To block access except for a single IP address in the .htaccess file the code is:

If you’re behind a load balancer then you have to use the X-Forwarded-For header instead:

 

Read More »

Reverse Proxy For eScan Web Control Panel

Recently I installed “eScan for Linux Servers” on one of our client’s server. eScan has a great Linux virus scanner. In addition to a command line utility, it provides a web interface. The web interface runs on port 10443 by default. The problem is the client’s server was firewalled and I didn’t want to open a new port just for eScan. So I setup a reverse proxy in Apache on a virtual hosts. It got interesting when I discovered that the web interface was embedding internal urls in to the content so I had to add mod_filter and mod_substitute. Here’s the final config:

Similar configuration could be used to map other odd-port web interfaces into a virtual host.

Read More »

ServerAlias On Nginx

On Apache web servers, each virtual host has a “ServerName” directive and zero or more “ServerAlias” directives. When converting to Nginx there is only one directive – “server_name” which takes the place of both of the Apache directives. The “server_name” directive takes a set of space delimited arguments listing domains that should match the virtual host. So for example if you have this Apache config:

Then for Nginx use:

This is a simple example for full details see this page in the Nginx documentation: http://nginx.org/en/docs/http/server_names.html

Read More »

Trustwave Certificate Chain

Had to install an SSL certificate from Trustwave today. The cert was emailed to the customer in a zip file. that contained several formats. For plesk the “.cer” file is the one that we needed. Also for the CA certificate there was a “chain.cer” file. Unfortunately Plesk (Apache) was not happy and complained that the private key did not sign the certificate. This indicates a problem with intermediate certificates. Using the commands given here: View Contents Of SSL Certificate I looked at the certificate and found that it was signed by: C=US, ST=Illinois, L=Chicago, O=Trustwave Holdings, Inc., CN=Trustwave Organization Validation CA, Level 2/emailAddress=ca@trustwave.com The certificate in the chain file was for: C=US, ST=Illinois, L=Chicago, O=Trustwave Holdings, Inc., CN=Trustwave Organization Validation CA, Level 2/emailAddress=ca@trustwave.com and it was signed by: C=US, O=SecureTrust Corporation, CN=SecureTrust CA but there was not certificate for this signer. I found the TrustWave roots here: https://ssl.trustwave.com/support/support-root-download.php Turns out

Read More »

Categories

Get a free consultation from Reliable Penguin

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