Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > Server Operation

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 1st February 2007, 10:29
gabrix gabrix is offline
Senior Member
 
Join Date: Sep 2006
Location: Napoli
Posts: 186
Thanks: 2
Thanked 0 Times in 0 Posts
Send a message via MSN to gabrix Send a message via Yahoo to gabrix Send a message via Skype™ to gabrix
Exclamation NameVirtualHost www.mysite.it has no VirtualHosts

I have 3 virtualhosts on an apache2 running on a debian 2.6.8 stable . I don't understand why the site still being reachable , when i restart apache2 , it shows this error:
Code:
root@www:~# /etc/init.d/apache2 restart
Forcing reload of web server: Apache2[Thu Feb 01 10:13:45 2007] [warn] NameVirtualHost x.gabrix.ath.cx:0 has no VirtualHosts
[Thu Feb 01 10:13:45 2007] [warn] NameVirtualHost x.gabrix.ath.cx:0 has no VirtualHosts
It happens only for the site above , and all sites have same virtualhost in pache2.conf and dir /etc/apache2/sites-enabled here the apache2.conf:
Code:
<VirtualHost tor.gabrix.ath.cx>
     ServerName tor.gabrix.ath.cx
     ServerAlias tor.gabrix.cx
     ServerAdmin gabrix@gabrix.ath.cx
     DocumentRoot /var/www/torgab
     ErrorLog /var/log/apache2/tor_error.log
     TransferLog /var/log/apache2/tor_access.log
<IfModule mod_security.c>
     CustomLog /var/log/apache2/tor_modsec_custom_log \
        "%h %l %u %t \"%r\" %>s %b %{mod_security-message}i" \
        env=mod_security-relevant
</IfModule>
</VirtualHost>

<VirtualHost www.gabrix.ath.cx>
     ServerName www.gabrix.ath.cx
     ServerAlias www.gabrix.cx
     ServerAdmin gabrix@gabrix.ath.cx
     DocumentRoot /var/www/gabrix
     ErrorLog /var/log/apache2/gabrix_error.log
     TransferLog /var/log/apache2/gabrix_access.log
<IfModule mod_security.c>
     CustomLog /var/log/apache2/gabrix_modsec_custom_log \
        "%h %l %u %t \"%r\" %>s %b %{mod_security-message}i" \
        env=mod_security-relevant
</IfModule>
</VirtualHost>

<VirtualHost x.gabrix.ath.cx>
     ServerName x.gabrix.ath.cx
     ServerAlias x.gabrix.cx
     ServerAdmin gabrix@gabrix.ath.cx
     DocumentRoot /var/www/ics
     ErrorLog /var/log/apache2/x_error.log
     TransferLog /var/log/apache2/x_access.log
<IfModule mod_security.c>
     CustomLog /var/log/apache2/x_modsec_custom_log \
        "%h %l %u %t \"%r\" %>s %b %{mod_security-message}i" \
        env=mod_security-relevant
</IfModule>
</VirtualHost>
And this is the /etc/apache2/sites-enabled/ics file:
Code:
NameVirtualHost x.gabrix.ath.cx
<VirtualHost x.gabrix.ath.cx>
	ServerAdmin webmaster@gabrix.ath.cx
	
	DocumentRoot /var/www/ics
	<Directory />
		Options FollowSymLinks
		AllowOverride None
                Order allow,deny
                allow from 127.0.0.1/8
                allow from 192.168.1.0/29
                deny from all
	</Directory>
	<Directory /var/www/ics/>
		Options Indexes FollowSymLinks MultiViews
		AllowOverride None
		Order allow,deny
		allow from all
		# This directive allows us to have apache2's default start page
                # in /apache2-default/, but still have / go to the right place
		#RedirectMatch ^/$ /apache2-default/
	</Directory>

	ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
	<Directory "/usr/lib/cgi-bin">
		AllowOverride None
		Options ExecCGI -MultiViews +SymLinksIfOwnerMatch
		Order allow,deny
		Allow from all
	</Directory>

	ErrorLog /var/log/apache2/x_error.log

	# Possible values include: debug, info, notice, warn, error, crit,
	# alert, emerg.
	LogLevel warn

	CustomLog /var/log/apache2/x_access.log combined
	ServerSignature Off

    Alias /doc/ "/usr/share/doc/"
    <Directory "/usr/share/doc/">
        Options Indexes MultiViews FollowSymLinks
        AllowOverride None
        Order deny,allow
        Deny from all
        Allow from 127.0.0.0/255.0.0.0 ::1/128
    </Directory>

</VirtualHost>
This morning i added the first page of content and i had back a "page not found" but maybe it's an another issue .
ciao.
__________________
http://www.gabrix.ath.cx
Reply With Quote
Sponsored Links
  #2  
Old 2nd February 2007, 13:34
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lneburg, Germany
Posts: 41,711
Thanks: 1,900
Thanked 2,702 Times in 2,545 Posts
Default

Code:
NameVirtualHost x.gabrix.ath.cx
NameVirtualHost must be followed by an IP address, not an FQDN.
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #3  
Old 2nd February 2007, 18:58
gabrix gabrix is offline
Senior Member
 
Join Date: Sep 2006
Location: Napoli
Posts: 186
Thanks: 2
Thanked 0 Times in 0 Posts
Send a message via MSN to gabrix Send a message via Yahoo to gabrix Send a message via Skype™ to gabrix
Default

Why x.gabrix.ath.cx is the only between them 3 to have an ip ? Anyway didn't work like this either ...
Quote:
root@www:~# apache2ctl restart
[Fri Feb 02 18:56:16 2007] [warn] NameVirtualHost x.gabrix.ath.cx:0 has no VirtualHosts
root@www:~# apache2ctl restart
[Fri Feb 02 18:56:19 2007] [warn] NameVirtualHost x.gabrix.ath.cx:0 has no VirtualHosts
__________________
http://www.gabrix.ath.cx
Reply With Quote
  #4  
Old 3rd February 2007, 14:36
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lneburg, Germany
Posts: 41,711
Thanks: 1,900
Thanked 2,702 Times in 2,545 Posts
Default

You must change all NameVirtualHost directives. Each of them must take an IP address.
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #5  
Old 4th February 2007, 05:50
gabrix gabrix is offline
Senior Member
 
Join Date: Sep 2006
Location: Napoli
Posts: 186
Thanks: 2
Thanked 0 Times in 0 Posts
Send a message via MSN to gabrix Send a message via Yahoo to gabrix Send a message via Skype™ to gabrix
Default

Forgive me i changed configuration in all possible maners, but i don't manaage to get it to work.Where should the ip go in the apache2.conf file or sites-enabled dir ?
Quote:
root@www:~# /etc/init.d/apache2 restart
Forcing reload of web server: Apache2[Sun Feb 04 05:44:03 2007] [warn] NameVirtualHost x.gabrix.ath.cx:0 has no VirtualHosts
[Sun Feb 04 05:44:04 2007] [warn] NameVirtualHost x.gabrix.ath.cx:0 has no VirtualHosts
Ho i sould i configure the default virtualhost ? with a * or ip ?And where does the NameVirualHost directive go ?
__________________
http://www.gabrix.ath.cx
Reply With Quote
  #6  
Old 4th February 2007, 12:19
martinfst martinfst is offline
Senior Member
 
Join Date: Dec 2006
Location: Hilversum, The Netherlands
Posts: 880
Thanks: 1
Thanked 18 Times in 17 Posts
Send a message via MSN to martinfst Send a message via Skype™ to martinfst
Default

You should update both NameVirtualHost and VirtualHost. You can use a *, and as such it will be active for every IP on your system, of you can use a single IP, in which case the block is only valid for that IP address
Code:
NameVirtualHost *
<VirtualHost *>
        ServerAdmin webmaster@localhost
        
        DocumentRoot /var/www
        <Directory />
                Options None
                Options FollowSymLinks
                AllowOverride None
        </Directory>
        <Directory /var/www/>
                Options None
                #Options Indexes FollowSymLinks MultiViews
                Options FollowSymLinks MultiViews
                AllowOverride None
                Order allow,deny
                allow from all
                # Uncomment this directive is you want to see apache2's
                # default start page (in /apache2-default) when you go to /
                #RedirectMatch ^/$ /apache2-default/
        </Directory>

        ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<snipped rest of file>
Reply With Quote
  #7  
Old 6th February 2007, 11:12
martinfst martinfst is offline
Senior Member
 
Join Date: Dec 2006
Location: Hilversum, The Netherlands
Posts: 880
Thanks: 1
Thanked 18 Times in 17 Posts
Send a message via MSN to martinfst Send a message via Skype™ to martinfst
Default

So you use
Quote:
-D SERVER_CONFIG_FILE="/etc/apache2/apache2.conf"
for you config file. Good. In your 1st post you showed us (part of?) this file. Can you check if you have a line reading
Code:
Include /etc/apache2/sites-enabled/[^.#]*
in this apache2.conf file?
Reply With Quote
  #8  
Old 6th February 2007, 14:32
gabrix gabrix is offline
Senior Member
 
Join Date: Sep 2006
Location: Napoli
Posts: 186
Thanks: 2
Thanked 0 Times in 0 Posts
Send a message via MSN to gabrix Send a message via Yahoo to gabrix Send a message via Skype™ to gabrix
Default

Here it is:
Quote:
Include /etc/apache2/sites-enabled/[^.#]*
And this is the virtualhost file:
Quote:
NameVirtualHost 192.168.1.4
<VirtualHost 192.168.1.4>
ServerAdmin webmaster@gabrix.ath.cx

DocumentRoot /var/www/ics
<Directory />
Options FollowSymLinks
AllowOverride None
Order allow,deny
allow from 127.0.0.1/8
allow from 192.168.1.0/29
deny from all
</Directory>
<Directory /var/www/ics/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
# This directive allows us to have apache2's default start page
# in /apache2-default/, but still have / go to the right place
#RedirectMatch ^/$ /apache2-default/
</Directory>

ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>

ErrorLog /var/log/apache2/x_error.log
__________________
http://www.gabrix.ath.cx
Reply With Quote
  #9  
Old 7th February 2007, 18:32
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lneburg, Germany
Posts: 41,711
Thanks: 1,900
Thanked 2,702 Times in 2,545 Posts
Default

What exactly is the problem right now? Don't your sites work now?
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP doesn't work! JimmiJames Server Operation 1 30th January 2007 12:30
apache virtualhosts permission deneid rolamento Installation/Configuration 3 23rd July 2006 01:36
Apache/Mailman/Postfix VirtualHosts Problem kisong Server Operation 1 15th July 2006 14:09
apache2 not really running blackflag Installation/Configuration 4 9th May 2006 07:50
Domain added multiple times to config adamluz Installation/Configuration 3 11th October 2005 21:52


All times are GMT +2. The time now is 05:10.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.