Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

It seems that the most basic virtual host does not work under apache 2.2 :

# httpd.conf
Listen 80
Include /private/etc/apache2/extra/httpd-vhosts.conf

the httpd-vhosts :

# httpd-vhosts.conf
NameVirtualHost *:80

<VirtualHost *:80>

    DirectoryIndex "app.php"
    DocumentRoot "/Users/tb/workspace/project/web"
    <Directory "/Users/tb/workspace/project/web">
        AllowOverride All
        Order allow,deny
        Allow from All

    ErrorLog /var/log/apache2/project_error.log
    CustomLog /var/log/apache2/project_access.log combined

Here's what output apachectl :

apachectl -S
VirtualHost configuration:
wildcard NameVirtualHosts and _default_ servers:
*:80 is a NameVirtualHost
         default server (/private/etc/apache2/extra/httpd-vhosts.conf:21)
         port 80 namevhost (/private/etc/apache2/extra/httpd-vhosts.conf:21)
         port 80 namevhost pow (/private/etc/apache2/other/zzz_pow.conf:1)
Syntax OK

In my pow configuration :

<VirtualHost *:80> 
  ServerName pow 
  ServerAlias *.dev 
  ServerAlias * 
  ProxyPass / http://localhost:20559/ 
  ProxyPassReverse / http://localhost:20559/ 
  ProxyPreserveHost On 

Accessing to localhost defaults on the project website, but accessing to gives a 404 Not found

Thanks for your help

share|improve this question
Check your error log. – Michael Hampton Mar 9 '14 at 19:03
The error log is empty for but for the global one : [Sun Mar 09 19:40:24 2014] [warn] NameVirtualHost *:80 has no VirtualHosts – Tristan Mar 9 '14 at 19:03
@Tristan Is that during the current service start? That shouldn't be possible given the apachectl -S output. – Shane Madden Mar 9 '14 at 19:07
Yes @ShaneMadden its during service start – Tristan Mar 9 '14 at 19:09
@Tristan What's the pow vhost doing? And from your access logs, are the requests to localhost being served by the virtual host? – Shane Madden Mar 9 '14 at 19:12
up vote 1 down vote accepted

I uninstalled pow, and removed rules in firewall that pow installs, and it works like a charm. Pow was the responsible for that :/

share|improve this answer

Your pow vhost configuration defines "ServerAlias *.dev" which overlaps your other VirtualHosts.

share|improve this answer
It always double-lists the one that's being used as default - that should be normal :) – Shane Madden Mar 9 '14 at 19:07
Oh yeah, my bad, it does point to the same configuration. – ETL Mar 9 '14 at 19:09

Your Answer


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.