Cpanel ReverseProxy Traffic to Docker Container

Apache mod_proxy

On a cpanel server, i need to run a web application using docker container. Application running side docker container listening on port 8000 on localhost. For a web site to serve traffic from this docker container, we can use Apache mod_proxy, this is enabled by default on cpanel servers. You can verify it at […]

Read More…

Apache Benchmark

ab is a tool for benchmarking web servers. It is designed to give you an impression of how your web server installation performs. This especially shows you how many requests per second your web server is capable of serving. To benchmark a web site, use ab command provided by Apache.

This will start […]

Read More…

Limit Access Using htaccess

To limit access to a folder using .htaccess, create .htacess file with following content.

YOUR_IP_HERE = Replace it with your actual IP. You can white list IP range by entering CIDR notation for the IP range. Here is .htacess i use on one of my web sites admin folder.

If your server is […]

Read More…

Show X-Forwarded-For IP in Apache

When apache is running behing proxy server it shows IP of proxy server as visitor IP. To fix this, you need to enable Apache module remoteip. On Ubuntu/Debian, this can be enabled with command

Now create file


IP_OF_YOUR_PROXY_SERVER_HERE = repace with your proxy server. This can be any proxy server […]

Read More…

Run .htm files as PHP in Apache

On Ubuntu, to execute .htm files as PHP, create file

Add following content

This is similar code from your PHP configuration. In this case, it is from /etc/apache2/mods-available/php5.6.conf Now restart apache

Apache | PHP […]

Read More…

Apache Invalid command Header

On a new Debian server with Apache, web site give 500 internal server error. On checking error log, i found [Thu Jan 04 06:44:42.483932 2018] [core:alert] [pid 27583] [client] /home/user/public_html/.htaccess: Invalid command ‘Header’, perhaps misspelled or defined by a module not included in the server configuration The error is due to Apache headers module […]

Read More…


Redirect OLD site to NEW using htaccess Limit Access Using htaccess Apache Limit access to a url Disable PHP on a folder How to protect .git folder using htaccess Redirect site from www to non-www Password Protect Site using htaccess Redirect domain to SSL (HTTPS)


Redirect a Page to another

You […]

Read More…