Forum archive
Virtual Host Not Resolving
Hello all,
I have recently installed a new virtaul machine using the TurnKey Linux LAMP appliance. The setup was successful but I am having trouble creating virtual hosts.
I followed the advice on the post found here: /forum/support/20111129/lamp-virtualhost-name-based . My virtual host file looks like this:
<VirtualHost *:80>
ServerName test.jay
ServerAdmin webmaster@localhost
DocumentRoot /var/www/test/html
</VirtualHost>
The directory /var/ww/test/html contains one file, index.html, which has a bit of markup in it to let me know the page loaded successfully.
I ran a2ensite and my site was added to the sites-enabled directory. I restarted Apache and navigated to :
http://10.11.1.157/test.jay
but I got a file not found error. Could anyone suggest what I am doing wrong? Any suggestions are appreciated. Thanks much.
I'm certainly no expert on these things but you need to set up DNS too. You'll need to point the domain name test.jay to your server IP and then browse to http://test.jay
I think the other thing you could do if you want to use http://10.11.1.157/test.jay is set up an alias, something like this:
Alias /test.jay /var/www/test/html/