Forum Moderators: phranque

Message Too Old, No Replies

Problems with Virtual Hosts on Linux (Breezy Badger)

attempts at creating virtual hosts end up changing root

         

feralo

9:48 pm on Nov 24, 2005 (gmt 0)

10+ Year Member



i am trying to create virual hosts for my testing server in a LAMP setup (apache2 + PHP5) on the Ubuntu distro of Linux:
i was advised to add a line under the first line of etc/hosts to change the name of my localhost and that worked fine- However, when i added:

<VirtualHost *:80>
ServerName www.test.tv
ServerAlias *test.tv
DocumentRoot /var/www/test
</VirtualHost>

to httpd-virtual-hosts.conf (a file which i had included at the bottom of apache2.conf) it changed my localhost to map to that directory, and did not allow me to go to www.test.tv .
i know that the first virtual host entry is the default for the localhost, so i had put

NameVirtualHost *:80

<VirtualHost *:80>
ServerName www.localhost
ServerAlias loc *localhost
DocumentRoot /var/www/
</VirtualHost>

at the top of the httpd-virtual-hosts.conf file (as i had seen in the apache documentation...
(i am aware that i should re-start apache when making these kind of changes..)
does anyone have any ideas as to what is going on?

jdMorgan

6:38 pm on Nov 29, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



feralo,

Because each setup is different, all I can suggest is that you read through the documents linked on this Apache page [httpd.apache.org] and figure out which method best applies to your situation.

Jim