On OS/X and Apache, localhost not resolving for some ports but not others
I have an Apache setup with several virtual hosts, in order to test many copies of Drupal on my local machine, amongst other things (although it's not 100% essential to put Drupal at the root of its virtual host, various things get ugly if you don't).
Several of these have been working fine. But yesterday, I added a new one, and the system can't resolve it. In other words, the address http://127.0.0.1:7777 works fine, while the address http://localhost:7777 fails, with an HTTP error 324 (ERR_EMPTY_RESPONSE).
However, an identically set up vhost on localhost:7778 works just fine.
Any ideas?
Here is the relevant bit of Apache config:
<Directory "/Users/david/Sites/workspace/bachtrack7">
Options Inde开发者_开发百科xes MultiViews FollowSymLinks
AllowOverride All
Order deny,allow
Allow from all
</Directory>
Listen 7777
<Virtualhost *:7777>
DocumentRoot /Users/david/Sites/workspace/bachtrack7
Servername bachtrack7
</VirtualHost>
<Directory "/Users/david/Sites/workspace/Sandbox">
Options Indexes MultiViews FollowSymLinks
AllowOverride All
Order deny,allow
Allow from all
</Directory>
Listen 7778
<VirtualHost *:7778>
DocumentRoot /Users/david/Sites/workspace/Sandbox
Servername Sandbox
</VirtualHost>
Since it's a problem with your ports, there are several places where this can be happening (firewall, router, conflicting services, etc...)
The sensible solution? Just pick a different port.
精彩评论