2

httpd.conf vhost looks like this:

<VirtualHost *:9999>
    ServerAdmin admin@example.com
    ServerName  www.example.com
    ServerAlias example.com

    # Indexes + Directory Root.
    DirectoryIndex index.php
    DocumentRoot /var/www/html/example.com/wordpress

    ProxyRequests Off
    <Proxy *>
            Order deny,allow
            Allow from all
    </Proxy>
    ProxyPass / http://localhost:8888/
    ProxyPassReverse / http://www.example.com:9999/
    #ProxyPassReverseCookieDomain localhost:8888 www.example.com:9999/
    ProxyPassReverseCookiePath / /

</VirtualHost>
<VirtualHost *:80>
    ServerAdmin admin@example.com
    ServerName  www.example.com
    ServerAlias example.com

    # Indexes + Directory Root.

    DirectoryIndex index.php
    DocumentRoot /var/www/html/example.com/wordpress
</VirtualHost>

the computer (192.168.1.5) running apache itself is trying to serve wordpress from the standard example.com and proxy a localhost app on port 9999 (example.com:9999) to the internet. the wordpress site works from 192.168.1.5 from anywhere on the network, but the localhost app proxy on 192.168.1.5:9999 works on 192.168.1.5 itself but not on other computers within the network. i think if 192.168.1.5:9999 worked over the network, it would also work on the internet as a whole (port forwarding is alreadyconfigured over the router), but I can't see why it would only work on the originating server and not its peers.

inman320
  • 121
  • 1
  • 3

1 Answers1

3

Try this to access the app on port 9999 using http://www.example.com/

<VirtualHost *:80>
    ServerAdmin admin@example.com
    ServerName  www.example.com
    ServerAlias example.com

    ProxyRequests Off
    <Proxy *>
            Order deny,allow
            Allow from all
    </Proxy>
    ProxyPass / http://localhost:9999/
    ProxyPassReverse / http://localhost:9999/
    ProxyPassReverseCookiePath / /
</VirtualHost>
user9517
  • 114,104
  • 20
  • 206
  • 289
  • hi, not sure what that's supposed to do since it seems like it wouldn't be serving the localhost app at all with those settings, but in any case, with the single change you made to ProxyPass, httpd won't even restart. – inman320 Mar 17 '12 at 16:54
  • See my edit. To be honest it's not entirely obvious what youre trying to achieve. – user9517 Mar 17 '12 at 17:57
  • sorry my original post was too long - the main thing is that the site already loads correctly using the lan ip 192.168.1.5:9999 from a web browser on the server itself, but it doesn't load from other computers on the same network. – inman320 Mar 17 '12 at 19:54
  • You check IPTables? – Magellan Mar 18 '12 at 15:11