ZheFrench
ZheFrench

Reputation: 1197

Reverse Proxy with Apache on Centos 6

I'm trying to forward an URL to another server using Apache. I created a virtual host in the httpd.conf. It's not working when I try to access ipServeur/test. I can't access the page.

What is wrong?

NameVirtualHost *:80 
<VirtualHost *:80>
    ServerName ipServeur
    ProxyRequests off
    ProxyPass /test http://ipOtherServeur:8080
    ProxyPassReverse /test http://ipOtherServeur:8080
</VirtualHost>

Upvotes: 5

Views: 11882

Answers (1)

cjungel
cjungel

Reputation: 3791

From apache's wiki :

This error is not really about file permissions or anything like that. What it actually means is that httpd has been denied permission to connect to that IP address and port.

The most common cause of this is SELinux not permitting httpd to make network connections.

To resolve it, you need to change an SELinux boolean value (which will automatically persist across reboots). You may also want to restart httpd to reset the proxy worker, although this isn't strictly required.

To allow apache to make network connections issue the following command.

sudo /usr/sbin/setsebool httpd_can_network_connect 1

Then restart apache.

sudo service httpd restart

Upvotes: 9

Related Questions