HyperFlexed
April 11th, 2010, 09:15 PM
Hi, I've set up apache2, but I'm having trouble getting virtual hosts to work
my /etc/hosts
127.0.0.1 localhost
127.0.1.1 johnny-desktop
127.0.0.1 go
# The following lines are desirable for IPv6 capable hosts
::1 localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts
my /etc/apache2/httpd.conf
NameVirtualHost *
<VirtualHost *>
DocumentRoot /var/www
ServerName localhost
</VirtualHost>
<VirtualHost *>
DocumentRoot /var/www/go/htdocs
ServerName go
</VirtualHost>
When I visit http://localhost I get /var/www/
When I visit http://go I get /var/www/go/htdocs/
The problem is when I visit http://127.0.0.1 I get the contents of /var/www/go/htdocs/. I want /var/www/ instead. Any idea? Let me know if you need more information.
my /etc/hosts
127.0.0.1 localhost
127.0.1.1 johnny-desktop
127.0.0.1 go
# The following lines are desirable for IPv6 capable hosts
::1 localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts
my /etc/apache2/httpd.conf
NameVirtualHost *
<VirtualHost *>
DocumentRoot /var/www
ServerName localhost
</VirtualHost>
<VirtualHost *>
DocumentRoot /var/www/go/htdocs
ServerName go
</VirtualHost>
When I visit http://localhost I get /var/www/
When I visit http://go I get /var/www/go/htdocs/
The problem is when I visit http://127.0.0.1 I get the contents of /var/www/go/htdocs/. I want /var/www/ instead. Any idea? Let me know if you need more information.