LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 10-25-2009, 10:12 PM   #1
damteke
LQ Newbie
 
Registered: Feb 2008
Posts: 16

Rep: Reputation: 0
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.
 
Old 10-25-2009, 10:45 PM   #2
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Ubuntu 12.04, Antix19.3
Posts: 3,794

Rep: Reputation: 282Reputation: 282Reputation: 282
I would be worried. The warning indicates that you're loading php twice.

But what would worry me more are the errors. But those are not php related, so were probably already there.
 
Old 10-25-2009, 10:46 PM   #3
bmarx
Member
 
Registered: Dec 2004
Distribution: Slackware, Arch, FreeBSD
Posts: 202

Rep: Reputation: 34
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.
 
Old 10-25-2009, 11:14 PM   #4
damteke
LQ Newbie
 
Registered: Feb 2008
Posts: 16

Original Poster
Rep: Reputation: 0
I'm wondering if the edit I made to httpd.conf is loading it double. Ill try reverting back. Hmmm. Thanks for the info.
 
Old 10-26-2009, 04:16 PM   #5
damteke
LQ Newbie
 
Registered: Feb 2008
Posts: 16

Original Poster
Rep: Reputation: 0
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 ]
 
Old 10-26-2009, 04:40 PM   #6
lin*x
LQ Newbie
 
Registered: Aug 2009
Posts: 15

Rep: Reputation: 1
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?
 
Old 10-26-2009, 04:47 PM   #7
damteke
LQ Newbie
 
Registered: Feb 2008
Posts: 16

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by lin*x View Post
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?
 
Old 10-26-2009, 05:12 PM   #8
lin*x
LQ Newbie
 
Registered: Aug 2009
Posts: 15

Rep: Reputation: 1
Well done, that's good progress!

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...

And perhaps take a look here if your new and check that virtual hostsing is what your after...
http://httpd.apache.org/docs/2.2/vhosts/

Regards,
M

Last edited by lin*x; 10-26-2009 at 05:14 PM.
 
Old 10-26-2009, 08:16 PM   #9
damteke
LQ Newbie
 
Registered: Feb 2008
Posts: 16

Original Poster
Rep: Reputation: 0
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.
 
Old 10-26-2009, 08:22 PM   #10
damteke
LQ Newbie
 
Registered: Feb 2008
Posts: 16

Original Poster
Rep: Reputation: 0
Reading this sites explination: http://www.mydigitallife.info/2007/0...or-when-start/

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

Last edited by damteke; 10-26-2009 at 08:24 PM.
 
Old 10-26-2009, 08:42 PM   #11
damteke
LQ Newbie
 
Registered: Feb 2008
Posts: 16

Original Poster
Rep: Reputation: 0
wooohoo i got it!

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!
 
Old 10-27-2009, 04:06 AM   #12
lin*x
LQ Newbie
 
Registered: Aug 2009
Posts: 15

Rep: Reputation: 1
No Problem, I'm glad you've resolved the matter yourself... Well done and long may you have a prosperous Linux experience!
Regards,
M
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
xrandr effect remains until the next restart?! Leon_Amirreza Fedora 3 08-04-2009 11:16 AM
change the effect of 302 Found with apache coal-fire-ice Linux - Server 2 02-04-2008 07:35 AM
can't trace frequent apache crash/automagic restart error I_AM Linux - General 1 04-09-2005 08:13 AM
Apache can't restart Serbulent Linux - Enterprise 2 03-16-2005 02:29 AM
TAR errors - to worry or not to worry?? dudeha Linux - General 2 12-31-2002 03:09 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 06:01 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration