Bobby's Blog

Apache Reverse Proxy on a CentOS cPanel server

Apache Reverse Proxy on a CentOS cPanel server

Setting up a reverse proxy or a regular CentOS server is quite straight forward, however when you have cPanel included in the equation, you need to be aware of a few things. That is why I’ve decided to write this short post here.

Here is what you need to do in order to get the reverse proxy working on a cPanel server:

1. Make sure that mod_proxy is installed:

– if it is not installed you can install it via EasyApache

2. As this is a cPanel server you have to add the changes to a custom Vhost include at:

and

(change ‘cPanel-User’ with the actual cPanel username’)

3. Then in order to enable this custom Vhost you have to run:

(change ‘cPanel-User’ with the actual cPanel username’)

4. After that you can then add the custom rules at the custom Vhost include files:

and

5. The rules that I used are quite simple, but you can adjust those if needed:

6. Then test for any syntax errors:

7. If you get ‘Syntax OK’ then it is alright to restart apache so it could pickup the new changes at the custom include.

This pretty much it. All of this is required because you would lose all of your changes if you add them directly to your main httpd conf file.

Hope that it helps.


About the author

Bobby

Linux System Administrator