I have setup a local server with debian 6 squeeze. But I cannot get virtualhosts to work. I would like to setup multiple virtualhosts but I just started with one.
I disabled the default apache virtual host
Setup the virtual host and directories /etc/apache2/sites-available/test.local
<VirtualHost *:80> ServerAdmin firstname.lastname@example.org ServerName test.local DocumentRoot /srv/www/test.local/public_html/ ErrorLog /srv/www/test.local/logs/error.log CustomLog /srv/www/test.local/logs/access.log combined </VirtualHost>
I enabled the site
Added it to /etc/hosts
When I browse to test.local, I just get a server not found error. I have also cleared all cookies. It only works, if I just go to 192.168.1.60.
Also my apache2.conf in /etc/apache2/apache2.conf has
ports.conf in /etc/apache2/ports.conf has
NameVirtualHost *:80 Listen 80 <IfModule mod_ssl.c> # If you add NameVirtualHost *:443 here, you will also have to change # the VirtualHost statement in /etc/apache2/sites-available/default-ssl # to <VirtualHost *:443> # Server Name Indication for SSL named virtual hosts is currently not # supported by MSIE on Windows XP. Listen 443 </IfModule> <IfModule mod_gnutls.c> Listen 443 </IfModule>
Am I missing anything?