5

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>
Gottlieb Notschnabel
  • 9,408
  • 18
  • 74
  • 116
ZheFrench
  • 1,164
  • 3
  • 22
  • 46
  • [Thu Jul 31 12:12:41 2014] [error] (70007)The timeout specified has expired: proxy: HTTP: attempt to connect to ipOtherServeur:8080 (ipOtherServeur) failed [Thu Jul 31 12:12:41 2014] [error] ap_proxy_connect_backend disabling worker for (ipOtherServeur) – ZheFrench Jul 31 '14 at 10:14

1 Answers1

8

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
cjungel
  • 3,701
  • 1
  • 25
  • 19