Virtual Hosts

JustJ ulist at gs1.ubuntuforums.org
Fri Aug 25 08:31:18 UTC 2006


If you are trying various things and apache doesn't seem to be starting
then you are doign something right.. and just bumping into the next
problem - in my case a non-existant directory:



Check your error logs repeatedly ( mine is at
/var/logs/apache/error.log as listed at the end of ' man apache ')

I had defined my virtual host as a copy of the other:



NameVirtualHost *

<VirtualHost *>

ServerName www.site1.com

DocumentRoot /home/site1/www

ScriptAlias /cgi-bin/ /home/site1/www/cgi-bin/

ErrorLog /home/site1/logs/err.log

CustomLog /home/site1/logs/access.log common

</VirtualHost>

<VirtualHost *>

ServerName www.site2.com

DocumentRoot /home/site2/www

ScriptAlias /cgi-bin/ /home/site2/www/cgi-bin/

ErrorLog /home/site2/logs/err.log

CustomLog /home/site2/logs/access.log common

</VirtualHost>



.. but I hadn't bothered to create the /home/site2/logs directory.

note: make sure the directory also has proper permissions.

chmod -R 777 /home/site2 will do it in my case.. but probably isn't
safe... I used a chown instead.



When the Virtual hosts was not configured properly it wasn't a
problem.. but it didn't show up in the logs until after I had the
Virtual hosts fixed.. which I never realized immediately because apache
wasn't starting. The late hour might've had a bit to do with the
confusion too...



other things I was suspicious of:

I left the following defines as they were ( ie uncommented )

ServerType Standalone

Port 80



I did NOT have a 'Listen' line

I did NOT have a _default_ virtual host ( well, as above. such lines
were disabled with a #comment )

as above I DID add the:

NameVirtualHost *

line.


-- 
JustJ




More information about the ubuntu-users mailing list