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 recently setup a virtual host on my local web server (per this question, Config problem with Apache 2 on Win 7).

I'm using Apache 2.2 on Win 7, as part of Zend Server.

At the moment, the root of my application's directory is accessible via either the virtual host (http://openco.local), or the local host name (http://localhost). How do I change this so that openco.local continues as is, but localhost points to it's original location (i.e. htdocs)?

Any assistance appreciated!

share|improve this question

1 Answer 1

up vote 1 down vote accepted

You should add another virtual host definition before the one for openco.local, as in:

<VirtualHost *:80>
   ServerName localhost
   DocumentRoot /var/www/htdocs
</VirtualHost>

That way open.local ceases to be the default virtual host.

share|improve this answer
    
Thanks Eduardo I, nice one. –  Kim Apr 16 '11 at 23:08

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.