Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

All I wanted to do this evening was to install phpmyadmin on my debian lenny web server, and somehow after messing around with ssl and trying hundreds of different combinations of everything i can think of to get the server functional again, i got nothing. I can't think of anything that i changed that would have caused virtual hosts to no longer work, but now all of the websites that are hosted on the server are inaccessible. This is what i get after I try to restart apache:

**After running /etc/init.d/apache2 restart
Restarting web server: apache2[Sat Aug 18 19:59:02 2012] [warn] NameVirtualHost *:80     has no VirtualHosts
[Sat Aug 18 19:59:02 2012] [warn] NameVirtualHost *:80 has no VirtualHosts
[Sat Aug 18 19:59:02 2012] [warn] NameVirtualHost *:80 has no VirtualHosts
[Sat Aug 18 19:59:02 2012] [warn] NameVirtualHost *:80 has no VirtualHosts
[Sat Aug 18 19:59:02 2012] [warn] NameVirtualHost *:80 has no VirtualHosts
[Sat Aug 18 19:59:02 2012] [warn] NameVirtualHost *:443 has no VirtualHosts
[Sat Aug 18 19:59:02 2012] [warn] NameVirtualHost *:80 has no VirtualHosts
[Sat Aug 18 19:59:02 2012] [warn] NameVirtualHost *:0 has no VirtualHosts
[Sat Aug 18 19:59:02 2012] [warn] NameVirtualHost *:80 has no VirtualHosts
[Sat Aug 18 19:59:02 2012] [warn] NameVirtualHost *:80 has no VirtualHosts
[Sat Aug 18 19:59:02 2012] [warn] NameVirtualHost *:80 has no VirtualHosts
[Sat Aug 18 19:59:02 2012] [warn] NameVirtualHost *:80 has no VirtualHosts
[Sat Aug 18 19:59:02 2012] [warn] NameVirtualHost *:80 has no VirtualHosts
[Sat Aug 18 19:59:02 2012] [warn] NameVirtualHost *:80 has no VirtualHosts
[Sat Aug 18 19:59:02 2012] [warn] NameVirtualHost *:443 has no VirtualHosts
[Sat Aug 18 19:59:02 2012] [warn] NameVirtualHost *:80 has no VirtualHosts
[Sat Aug 18 19:59:02 2012] [warn] NameVirtualHost *:0 has no VirtualHosts
[Sat Aug 18 19:59:02 2012] [warn] NameVirtualHost *:80 has no VirtualHosts
 failed!

This is what one of the site-available files looks like:

NameVirtualHost *:80

<VirtualHost *:80>
    ServerAdmin admin@site.net
    ServerName  www.site.us
    ServerAlias site.us

    # Indexes + Directory Root
    DirectoryIndex index.html index.php
    DocumentRoot /var/www/site.us/

    #CGI Directory
    ScriptAlias /cgi-bin/ /var/www/site.us/cgi-bin/
    <Location /cgi-bin>
            Options +ExecCGI
    </Location>

    #Log Files
    ErrorLog /var/www/site.us/logs/error.log
    CustomLog /var/www/site.us/logs/access.log combined

</VirtualHost>

If anyone has any suggestions on something to check please let me know because I'm at a loss right now

Edit This is the result of running: /etc/apache2 tail -f /var/www/site.us/logs/error.log

jcmo:/etc/apache2# tail -f /var/www/site.us/logs/error.log
[Sat Aug 18 12:48:34 2012] [error] [client 69.69.247.18] File does not exist: /var/www/site.us/Register/images, referer: http://site.us/Register/regusr.php
[Sat Aug 18 12:48:34 2012] [error] [client 69.69.247.18] File does not exist: /var/www/site.us/Register/images, referer: http://site.us/Register/regusr.php
[Sat Aug 18 12:48:34 2012] [error] [client 69.69.247.18] File does not exist: /var/www/site.us/Register/images, referer: http://site.us/Register/regusr.php
[Sat Aug 18 12:48:34 2012] [error] [client 69.69.247.18] File does not exist: /var/www/site.us/Register/images, referer: http://site.us/Register/regusr.php
[Sat Aug 18 12:48:34 2012] [error] [client 69.69.247.18] File does not exist: /var/www/site.us/Register/images, referer: http://site.us/Register/regusr.php
[Sat Aug 18 13:56:29 2012] [error] [client 183.60.213.24] File does not exist: /var/www/site.us/bannerStyle.css
[Sat Aug 18 15:22:39 2012] [error] [client 69.69.247.18] File does not exist: /var/www/site.us/TooTip.js, referer: http://site.us/myStuff.php
[Sat Aug 18 15:22:40 2012] [error] [client 69.69.247.18] File does not exist: /var/www/site.us/TooTip.js, referer: http://site.us/myStuff.php
[Sat Aug 18 15:25:51 2012] [error] [client 69.69.247.18] File does not exist: /var/www/site.us/TooTip.js, referer: http://site.us/myStuff.php
[Sat Aug 18 15:25:51 2012] [error] [client 69.69.247.18] File does not exist: /var/www/site.us/TooTip.js, referer: http://site.us/myStuff.php
share|improve this question

migrated from stackoverflow.com Aug 23 '12 at 5:49

This question came from our site for professional and enthusiast programmers.

    
Can you paste whatever gets logged on the error file? tail -f /var/log/apache2/error.log or tail -f /var/www/site.us/logs/error.log –  martincho Aug 19 '12 at 1:33
    
I edited my original post to include the error.log file –  Jason Whitworth Aug 19 '12 at 3:06
add comment

1 Answer 1

Make sure your sites are linked into the sites-enabled directory. Apache only includes sites-enabled.

There is a convenience command for enabling sites:

a2ensite site.com

Also see man a2ensite.

You might also want to have a look at /etc/apache2/ports.conf. This file defines the listening ports and possibly also enables named virtual hosts for some/all ports.

share|improve this answer
add comment

Your Answer

 
discard

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