2

I'm in the process of migrating some applications to a new production server.

The idea is to keep the same URLs for the applications by defining ProxyPass and ProxyPassReverse directives on the old production server.

Configurationon old production server:

<VirtualHost *:80>
    ServerName some-url.prod.smething.com
    ServerAlias some-url.smething.com
    ProxyPreserveHost On
    ProxyPass / http://10.XX.XX.XX:10022/
    ProxyPassReverse / http://10.XX.XX.XX:10022/
</VirtualHost>

On the new production server:

<VirtualHost *:80>
    ServerName some-url.prod.smething.com
    ServerAlias some-url.smething.com
    ServerAlias some-url.newprod.smething.com
    ProxyPreserveHost On
    ProxyPass / http://127.0.0.1:10022/
    ProxyPassReverse / http://127.0.0.1:10022/
</VirtualHost>

I have tested this successfully between the two development servers but it does not work between the production ones. i get the following error:

503 Service Unavailable

and in the logs:

(111)Connection refused: proxy: HTTP: attempt to connect to (10.xx.xx.xx) failed
ap_proxy_connect_backend disabling worker for (10.xx.xx.xx)

I think my apache configuration on production is correct because it is the same as on dev.

Looking around for solutions, it was mentioned several times that it might not work if machines were in a different subnet range. I think this is my case, but unfortunately there was a solution provided for that.

Old production server IP: 172.XX.XX.XX
New production server IP: 10.XX.XX.XX

Any ideas how I can fix this issue ?

Didier Ghys
  • 123
  • 1
  • 6
  • Use a command line tool such as curl to request http://127.0.0.1:10022/ on the new production server, if you cannot do that then Apache cannot either. if it doesn't work then the service running on port 10022 may not be listening on the local network interface. – Unbeliever Aug 24 '16 at 06:54
  • in case you direct your proxy to localhost, port 10022, try a telnet to this port on this host if it succeeds. – gln Aug 23 '16 at 07:23
  • This returns me `Name or service not known`. But even on the development servers where the proxying works. – Didier Ghys Aug 23 '16 at 07:37

0 Answers0