Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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?

share|improve this question
    
Error 500 means, that connect to Apache is working, but something behind it does not. What can you see in /var/log/apache2/error.log after trying to see the page? –  ddeimeke Aug 31 '10 at 4:00
    
Use wget -S hostname to see the real errorcode it returns all the headers. Or you can press Ctrl+u in chrome on the error page to see the html sent from apache if any. –  Source Lab Aug 31 '10 at 6:21

3 Answers 3

up vote 6 down vote accepted

Try performing a manual connection using telnet from a terminal window:

telnet localhost 80

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.

share|improve this answer

Could not connect is not a 500 error. It means apache is either not running or not reachable.

share|improve this answer

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.