Forum Moderators: phranque

Message Too Old, No Replies

Stubborn doc root

Hard times with virtual host

         

jmll

4:00 pm on Jul 27, 2004 (gmt 0)

10+ Year Member



I am attempting to set up virtual hosts in apache2triad on win xp for local dev but when I
point my browser to my-domain.com I never go to my index.htm file but to htdocs dir.
Here is the httpd set up, could anyone tell me what's wrong with it? Thanks jml

ServerRoot "C:/apache2triad"

ServerName localhost:80
ServerAdmin admin@localhost
DocumentRoot "C:/apache2triad/htdocs"

NameVirtualHost *

<VirtualHost *>
ServerName example.com
ServerAdmin webmaster@example.com
DocumentRoot "c:/apache2triad/htdocs/www/example"
ErrorLog "logs/example.com-error_log"
CustomLog logs/example.com-access_log common
</VirtualHost>

I've also taken care of the hosts file with:
127.0.0.1 localhost
127.0.0.1 example.com

[edited by: jdMorgan at 4:35 pm (utc) on July 27, 2004]
[edit reason] Obscured domain name per TOS [/edit]

jmll

12:36 pm on Jul 29, 2004 (gmt 0)

10+ Year Member



After restarting the computer I got the reverse problem I had described here: I did get to my index html page but I could no longer access the server control panel. I added a "default" (first on the list)virtual host:
<VirtualHost *>
ServerName localhost
ServerAdmin webmaster@localhost
DocumentRoot "c:/apache2triad/htdocs"
ErrorLog "logs/error_log"
CustomLog logs/access_log common
</VirtualHost>
restarted windows and it worked. I learned that it is not enough to restart Apache, even after setting default browser's cache content to 0.