Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

First off I am running Ubuntu 11.04. I installed Apache through tasksel along with phpmyadmin, and mysql. My localhost site works and I can get into phpmyadmin. I have 5 sites setup through VHOST files. I can access 3 of them without any problems.

My problem is there are 2 other VHOSTs that I cannot access the actual site from the browser. Instead it always shows the Default "It works" page. These latest 2 sites are my new sites so I havnt figured this out since adding my fourth site to work on. The first 3 sites for some reason work and I can access the sites through the browser.

Here is what my /etc/hosts file looks like. systemcrashed dev.bac

The sites that I cannot get working are and dev.bac. was the fourth site to add a VHOST file for and recently I just added dev.bac again to try to setup another site I need.

After creating both the VHOST files I ran a2ensite to enable the site. I have checked the mod_rewrite for apache to see if it was enabled. After running a2enmod rewrite, I get the message mod-rewrite is already enabled.

Here is what my VHOST for both the sites that do not work. (Besides the paths are different)

<VirtualHost *:80>

    ServerName dev.back
    DocumentRoot /home/developmental/workspace/dev.bac/public

    <Directory /home/developmental/workspace/dev.bac/public>
            AllowOverride All
            Options All
            Order allow,deny
            Allow from all

If it makes a difference (which i don't think is does, but trying to give all relevant information) I use the Zend Framework on my projects. So the root of any site starts in the public folder. I have also ensured that there is an .htaccess file residing inside the public folder as well.

[Edited showing /usr/sbin/apache2ctl -S]

VirtualHost configuration:
wildcard NameVirtualHosts and _default_ servers:
*:80                   is a NameVirtualHost
     default server localhost (/etc/apache2/sites-enabled/000-default:1)
     port 80 namevhost localhost (/etc/apache2/sites-enabled/000-default:1)
     port 80 namevhost dev.bac (/etc/apache2/sites-enabled/dev.bac:1)
     port 80 namevhost (/etc/apache2/sites-enabled/
     port 80 namevhost (/etc/apache2/sites-enabled/
     port 80 namevhost (/etc/apache2/sites-enabled/
     port 80 namevhost (/etc/apache2/sites-enabled/
Syntax OK

[VHOST for]

<VirtualHost *:80>

    DocumentRoot /home/developmental/workspace/PW1/public

    <Directory /home/developmental/workspace/PW1/public>
            AllowOverride All
            Options All
            Order allow,deny
            Allow from all

share|improve this question

migrated from Oct 3 '11 at 13:50

This question came from our site for professional and enthusiast programmers.

You might get more useful answers, if you post your question to That place is more dedicated to server related questions. – Boldewyn Oct 3 '11 at 13:38
possible duplicate of Almost All apache VHOSTs go to the default "It Works Site" – jscott Oct 3 '11 at 13:55
Show us the output of /usr/sbin/apache2ctl -S – Iain Oct 3 '11 at 13:56
Your question is a little rambling, can you edit it down? – MikeyB Oct 3 '11 at 14:57
Can you do this: tail -f the apache transfer file and then browse through those site. – Rilindo Oct 3 '11 at 15:02
up vote 0 down vote accepted

I don't know if it is typo, but in your /etc/hosts you have: dev.bac

and in the virtual host configuration you have:

ServerName dev.back

Then, is normal that your apache redirect you to the wrong place.

share|improve this answer
I noticed that also when I ran /usr/sbin/apache2ct1 -S . dev.bac is now working but I am still having a problem . I tried to look at the same things for a typo but I am not seeing anything. – lumberjacked Oct 4 '11 at 14:55
could you post the configuration for the other virtual host? – Ivan Oct 4 '11 at 18:47
I posted the VHOST for above in my original question at the bottom (I made a mistake above and said it was wasn't working when it really is that is not working) – lumberjacked Oct 4 '11 at 19:57

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.