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.

1 Answer 1

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>
4
  • 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, 2012 at 16:54
  • See my edit. To be honest it's not entirely obvious what youre trying to achieve.
    – user9517
    Mar 17, 2012 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, 2012 at 19:54
  • You check IPTables?
    – Magellan
    Mar 18, 2012 at 15:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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