Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question
2  
Don't abuse local.. You don't own that domain name. As a MacOS 10 user, you should be even more aware of this than most people are. It has been well-known in the Apple world for ten years. –  JdeBP Feb 6 '12 at 16:15

1 Answer 1

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.

share|improve this answer
    
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 '12 at 3:37
    
can you see your page with foo.local:25012 in your browser ? –  kaji Feb 5 '12 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 '12 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 '12 at 4:20

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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