Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

here's my system:

CentOS release 5.6 (Final)
Server version: Apache/2.2.21 (Unix)
Cpanel::Easy::Apache v3.7.2 rev9999

I am trying to create a reverse proxy to load files from another server onto my server, as I explained here a while ago:

use a domain on one server to load an application on another server

However, at the time I wrote that I was thinking I would be using ubuntu but now found out it will be centos. I was going to follow this article:

But on this specific line:

"We need to make sure mod_proxy and mod_proxy_http are loaded. If the proxy modules are loaded, you’ll see them listed. If nothing is found, this means you need to create symbolic links from the mods-available folder to the mods-enabled folder."

It explains how to check if those two modules are loaded and if not, how to create symbolic links to load them. However, it explains how to do it on ubuntu.

If I even try to attempt to do that on centos:

cd /etc/apache2/
-bash: cd: /etc/apache2/: No such file or directory

there is no apache2 folder in etc.

So I am trying to figure out how to do it on centos.

thanks for response

share|improve this question
Normaly under CentOS you use httpd so the Folder is /etc/httpd/ – Stony Jan 4 '12 at 16:28
up vote 4 down vote accepted

In /etc/httpd/conf/httpd.conf make sure you have the following lines enabled (no # infront of them):

LoadModule proxy_module modules/
LoadModule proxy_http_module modules/

This link will probably be useful for you to read too:

Worth noting is that CentOS is an openly built version of the RedHat operating system, so any documentation you can find for RedHat 5 would almost always fully apply to CentOS aswell. CentOS 6 is released, btw, so you might also want to think of upgrading!

For Virtualhost configuration; put this in the end of httpd.conf:

NameVirtualHost *:80

<VirtualHost *:80>
  DocumentRoot /var/www
  ProxyRequests Off
  Order deny,allow
  Allow from all

  ProxyPass /
  ProxyPassReverse /

And see how it works. You'll ofcourse have to change for your own domain and for whatever your own infrastructure uses as IP adresses.

share|improve this answer
thanks for response. Do I also need to include these lines: NameVirtualHost * ServerName DocumentRoot /var/www/ ProxyRequests Off Order deny,allow Allow from all ProxyPass / ProxyPassReverse / – JohnMerlino Jan 4 '12 at 16:42
See updates above on VirtualHost, I hope that would do the trick for you. – Mattias Ahnberg Jan 4 '12 at 17:27
thanks for response, when i tried to restart server, i got this: /etc/httpd/conf/httpd.conf: Cannot load /etc/httpd/modules/ into server: /etc/httpd/modules/ cannot open shared object file: No such file or directory – JohnMerlino Jan 4 '12 at 17:50
I am not sure if Cpanel modifies modules or module paths, but in my system I have a link from /etc/httpd/modules pointing to /usr/lib64/httpd/modules and in there I find my properly, its listed as being installed with my httpd package. If cpanel changes this behavior I am not sure I can help you further. :/ – Mattias Ahnberg Jan 4 '12 at 18:14
hey thanks for response, I called the host and they said I need to rebuild apache and select the proxy option. But your advice has been helpful. – JohnMerlino Jan 5 '12 at 14:13

Under centos, you will not find the path /etc/apache2. You can will find /etc/httpd.

share|improve this answer

RHEL/CentOS - webSocket to use requires Apache 2.4x (not Apache 2.2)

LoadModule proxy_wstunnel_module modules/

And then:

ProxyPass / ws://
ProxyPassReverse / ws://
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.