Apache 2 error on restart but doesn't effect? Should I worry?
Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Apache 2 error on restart but doesn't effect? Should I worry?
I've recently made some changes to my httpd.conf file to enable the support of php5 then all of a sudden I get these error messages when I restart:
root@server1:/# /etc/init.d/apache2 restart
* Restarting web server apache2 [Sun Oct 25 23:03:50 2009] [warn] module php5_module is already loaded, skipping
[Sun Oct 25 23:03:50 2009] [error] VirtualHost *:80 -- mixing * ports and non-* ports with a NameVirtualHost address is not supported, proceeding with undefined results
[Sun Oct 25 23:03:50 2009] [error] VirtualHost *:80 -- mixing * ports and non-* ports with a NameVirtualHost address is not supported, proceeding with undefined results
[Sun Oct 25 23:03:50 2009] [error] VirtualHost *:80 -- mixing * ports and non-* ports with a NameVirtualHost address is not supported, proceeding with undefined results
[Sun Oct 25 23:03:50 2009] [warn] NameVirtualHost *:80 has no VirtualHosts
... waiting [Sun Oct 25 23:03:51 2009] [warn] module php5_module is already loaded, skipping
[Sun Oct 25 23:03:51 2009] [error] VirtualHost *:80 -- mixing * ports and non-* ports with a NameVirtualHost address is not supported, proceeding with undefined results
[Sun Oct 25 23:03:51 2009] [error] VirtualHost *:80 -- mixing * ports and non-* ports with a NameVirtualHost address is not supported, proceeding with undefined results
[Sun Oct 25 23:03:51 2009] [error] VirtualHost *:80 -- mixing * ports and non-* ports with a NameVirtualHost address is not supported, proceeding with undefined results
[Sun Oct 25 23:03:51 2009] [warn] NameVirtualHost *:80 has no VirtualHosts
Should I not concern myself with these warning? I tried googling it, but it appears that people who get this type of similar error message don't have working web pages, or php. Both work fine for me. Well the php still seems touch and go but thats just 1 page which I think I screwed up the scripting.
If the box is working and no one is complaining about it, you may want to just leave it alone. However, both errors (NameVirtualHost and php5_module already loaded) seem pretty straightforward to solve:
1. There is a mismatch of ports between NameVirtualHost and VirtualHost directives.
2. Loading of the php5 module appears twice in you config.
Ok, removing my entries in httpd.conf got ride of the php error message. I used wedmin to install the apache2 serv, and I assumed php wasn't working when I couldn't get a php site to work, (it was asking me to download the page instead of loading it), after a bit of research I realized my site address and a variable in the file didn't mach so I changed the variable and it worked fine.
As for the error messages below I still havn't sorted those out.
root@server1:/etc/apache2# /etc/init.d/apache2 restart
* Restarting web server apache2 [Mon Oct 26 17:11:01 2009] [error] VirtualHost *:80 -- mixing * ports and non-* ports with a NameVirtualHost address is not supported, proceeding with undefined results
[Mon Oct 26 17:11:01 2009] [error] VirtualHost *:80 -- mixing * ports and non-* ports with a NameVirtualHost address is not supported, proceeding with undefined results
[Mon Oct 26 17:11:01 2009] [error] VirtualHost *:80 -- mixing * ports and non-* ports with a NameVirtualHost address is not supported, proceeding with undefined results
[Mon Oct 26 17:11:01 2009] [warn] NameVirtualHost *:80 has no VirtualHosts
... waiting [Mon Oct 26 17:11:02 2009] [error] VirtualHost *:80 -- mixing * ports and non-* ports with a NameVirtualHost address is not supported, proceeding with undefined results
[Mon Oct 26 17:11:02 2009] [error] VirtualHost *:80 -- mixing * ports and non-* ports with a NameVirtualHost address is not supported, proceeding with undefined results
[Mon Oct 26 17:11:02 2009] [error] VirtualHost *:80 -- mixing * ports and non-* ports with a NameVirtualHost address is not supported, proceeding with undefined results
[Mon Oct 26 17:11:02 2009] [warn] NameVirtualHost *:80 has no VirtualHosts
[ OK ]
Looks to me like in-proper virtual host set-up or a accidental mix of IP and Named based VHosting... Can we see a couple of your virtual hosts... please remove any names/identifying features from the hosts files but paste them up in same format at least.
Also what have you set the parameter NameVirtualHost as within apache?
Looks to me like in-proper virtual host set-up or a accidental mix of IP and Named based VHosting... Can we see a couple of your virtual hosts... please remove any names/identifying features from the hosts files but paste them up in same format at least.
Also what have you set the parameter NameVirtualHost as within apache?
Well after some hard core googling I did find a mistake in on of my config files, virtual.conf, where NameVirtualHost was only set to * not *:80, I changed that then rebooted my apache2 server, now I only have 1 error message:
root@server1:/etc/apache2/conf.d# /etc/init.d/apache2 restart
* Restarting web server apache2 [Mon Oct 26 17:45:52 2009] [warn] NameVirtualHost *:80 has no VirtualHosts
... waiting [Mon Oct 26 17:45:53 2009] [warn] NameVirtualHost *:80 has no VirtualHosts
[ OK ]
So I guess that'sa step lol, from 5 or 6, down to 1 lol.
Sorry lin*x i'm new, which config file would you like me to post up?
What i'm asking to look at is you virtualhost directives.. so basically where you have set inside a config file or in many separate config files any virtual hosts. This message looks to be describing that you have no virtual hosts, are you sure you even need a virtual host?
anyways.. these virtualhost directives should look a little like the below... the error looks to be stating you haven't got anything on a virtual host relating to "VirtualHost *:80"??:-
<VirtualHost *:80>
ServerAdmin webmaster@host.foo.com
DocumentRoot /www/docs/host.foo.com
ServerName host.foo.com
ErrorLog logs/host.foo.com-error_log
TransferLog logs/host.foo.com-access_log
</VirtualHost>
These are what your looking for... if you haven't any of these or set-up any then this could well be your issue here. What your looking for is the "VirtualHost" directive then post up the rest of the info as i show it.. edit things like serveradmin and servername etc to disguise your sites... Then we'll see if there's any obvious problems...
Yes I am currently running 4 virtual hosts. The default-ssl one that came with the system, and 3 additional ones I added. I guess I should also mention that I setup the apache2 server via Webmin.
Here are my virtual hosts config's
Site 1
<VirtualHost *:80>
DocumentRoot "/var/www/mysite1"
Servername mysite1.server.net
<Directory "/var/www/mysite1">
allow from all
Options +Indexes
</Directory>
</VirtualHost>
Site2
<VirtualHost *:80>
DocumentRoot "/var/www/mysite2"
Servername mysite2.server.net
<Directory "/var/www/mysite2">
allow from all
Options +Indexes
UseCanonicalName off
</Directory>
</VirtualHost>
Site3
<VirtualHost *:80>
DocumentRoot "/var/www/mysite3"
Servername mysite3.server.net
<Directory "/var/www/mysite3">
allow from all
Options +Indexes
</Directory>
</VirtualHost>
I'm checking out your link now.
I'm wondering if the warn is trying to bring my attention specificly to NameVirtualHost which I've only found one of those, which I changed to *:80 and it resolved the actual errors. So i'm not sure of that yet.
I'm wondering if my problem is that none of the config files under /etc/apache2/site-available, none of a posting for NameVirtualHost *:80
I'm wondering if I add that ot one of my sites it might fix it.
Reflecting during all these changes I made I do recall deleting an exsisting virutal host that was not identifed with anything (it was a generic on that came along with default-ssl), I also deleted the config file cause I thought it was odd when i removed the virtual entry in webmin that it didnt deleted the link file in in the directory. But now I'm wondering if that config file house the NameVirtualHost *:80 , I will add and see.
Nope that caused more errors lol
Restarting web server apache2 [Mon Oct 26 21:23:30 2009] [warn] NameVirtualHost *:80 has no VirtualHosts
[Mon Oct 26 21:23:30 2009] [warn] NameVirtualHost *:80 has no VirtualHosts
... waiting [Mon Oct 26 21:23:31 2009] [warn] NameVirtualHost *:80 has no VirtualHosts
[Mon Oct 26 21:23:31 2009] [warn] NameVirtualHost *:80 has no VirtualHosts
[ OK ]
So more errors is not what we want. Maybe I have to configure Webmin - Apache2 to see that another site contains the NameVirtualHost entry? (or maybe I should read the entire site before I go prancing off and trying things out which I'll do now lol
after even more reseach i learned that having two locations identify the NameVirtualHost was bad, and someone suggestion just commenting out the one it ports.conf
I did this and I am now error/warning free!
Thanks much Lin*x for your ideas your links and help directed me to the answer!
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.