I've changed this from the original VHost but it should still work in my mind:
Listen 80
NameVirtualHost *:80
<VirtualHost *:80>
ServerName localhost
ServerAdmin ross@localhost
DocumentRoot /var/www
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
ErrorLog /var/log/apache2/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog /var/log/apache2/access.log combined
</VirtualHost>
The only difference between this and other working VHosts is that /var/www requires higher privileges to access it - I get a "Could not connect" error which I assume is a 500 error (Chrome hides the status codes and I can't remember). What can I do to make this work?
Try performing a manual connection using telnet from a terminal window:
If you receive a
connection refused
message, the daemon is not running or starting up propertly. From there it would be a good idea to inspect your Apache error log (/var/log/apache2/error.log
) to find out why.Could not connect is not a 500 error. It means apache is either not running or not reachable.
This is a guess, but I think Apache runs as the www-user login, or similar. Does it have rights to the root of /var/www? I think by default, Apache points to symlinks off an /etc/apache2/default directory or something like that. Working from memory here, and no expert though. Sorry.