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.

127.0.0.1 my.dev

127.0.1.1 systemcrashed

127.0.0.1 dev.bac

127.0.0.1 vl.dev

127.0.0.1 manager.dev

127.0.0.1 pw.dev

The sites that I cannot get working are my.dev and dev.bac. my.dev 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 my.dev 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
    </Directory>
</VirtualHost>

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 manager.dev (/etc/apache2/sites-enabled/manager.dev:1)
     port 80 namevhost pw.dev (/etc/apache2/sites-enabled/pw.dev:1)
     port 80 namevhost my.dev (/etc/apache2/sites-enabled/my.dev:1)
     port 80 namevhost vl.dev (/etc/apache2/sites-enabled/vl.dev:1)
Syntax OK

[VHOST for my.dev]

<VirtualHost *:80>

    ServerName my.dev
    DocumentRoot /home/developmental/workspace/PW1/public

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

</VirtualHost>
link|improve this question
You might get more useful answers, if you post your question to Serverfault.com. 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
show 1 more comment
feedback

migrated from stackoverflow.com Oct 3 '11 at 13:50

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

1 Answer

up vote 0 down vote accepted

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

127.0.0.1 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.

link|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 pw.dev . 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 my.dev above in my original question at the bottom (I made a mistake above and said it was pw.dev wasn't working when it really is my.dev that is not working) – lumberjacked Oct 4 '11 at 19:57
feedback

Your Answer

 
or
required, but never shown

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