0

I have apache2 on my Mac OS X Lion box with name-based virtual hosting turned on.

NameVirtualHost *:80
<VirtualHost *:80>
    ServerName my.puter.edu
    DocumentRoot "/path/to/Sites"
    <Directory "/path/to/Sites">
    ...
    </Directory>
</VirtualHost>
<VirtualHost *:80>
    ServerName foo.local
    ProxyPass        / http://127.0.0.1:25012/
    ProxyPassReverse / http://127.0.0.1:25012/
</VirtualHost>
<VirtualHost *:80>
    ServerName bar.local
    ProxyPass        / http://127.0.0.1:25013/
    ProxyPassReverse / http://127.0.0.1:25013/
</VirtualHost>

My /etc/hosts file has the following entries

127.0.0.1       localhost
255.255.255.255 broadcasthost
::1             localhost 
fe80::1%lo0     localhost

127.0.0.1       foo.local
127.0.0.1       bar.local
184.72.115.86   search.yahoo.com

From the command line I can successfully ping my.puter.edu, ping foo.local, and ping bar.local. But from the browser I can only reach http://my.puter.edu. The browser is unable to establish a connection to foo.local and bar.local.

Suggestions?

1

1 Answer 1

0

It could be the problem of proxy behind apache that you are using for foo.local and bar.local as per your configuration

<VirtualHost *:80>
    ServerName foo.local
    ServerAlias bar.local
    ProxyPass        / http://127.0.0.1:25012/
    ProxyPassReverse / http://127.0.0.1:25012/
</VirtualHost>

What are running behind 25012 port (Are they actually running or not ?) ? Have you checked apache logs ? Browser error output can not match the verbosity of log files when debugging.

4
  • I am running Starman (a different web server) on ports 25012 and 25013. foo.local should be served from 25012 and bar.local from 25013.
    – punkish
    Feb 5, 2012 at 3:37
  • can you see your page with foo.local:25012 in your browser ?
    – kaji
    Feb 5, 2012 at 3:38
  • no, because foo.local is not running on 25012. I can see 127.0.0.1:25012 in the browser, but foo.local is supposed to resolve to 127.0.0.1:25012 and that is not happening.
    – punkish
    Feb 5, 2012 at 4:18
  • I don't know how configuration is laid out in starman ! But foo.local should resolve to 127.0.0.1 according to your hosts file ! what does apache logs say ?
    – kaji
    Feb 5, 2012 at 4:20

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .