LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-09-2008, 09:12 PM   #1
jim.thornton
Member
 
Registered: May 2007
Posts: 430

Rep: Reputation: 19
httpd restart - error msg


I just ran # service httpd restart and I'm getting this message:

Starting httpd: [Wed Jan 09 22:05:43 2008] [warn] VirtualHost 127.0.0.1:0 overlaps with VirtualHost 127.0.0.1:0, the first has precedence, perhaps you need a NameVirtualHost directive
[Wed Jan 09 22:05:43 2008] [warn] NameVirtualHost 111.111.111.111:80 has no VirtualHosts
[Wed Jan 09 22:05:43 2008] [warn] NameVirtualHost 111.111.111.111:443 has no VirtualHosts
[Wed Jan 09 22:05:43 2008] [warn] NameVirtualHost 111.111.111.111:80 has no VirtualHosts
[Wed Jan 09 22:05:43 2008] [warn] NameVirtualHost 111.111.111.111:443 has no VirtualHosts
[Wed Jan 09 22:05:43 2008] [warn] NameVirtualHost 111.111.111.111:80 has no VirtualHosts
[Wed Jan 09 22:05:43 2008] [warn] NameVirtualHost 111.111.111.111:443 has no VirtualHosts

Can anyone tell me why I'm getting this error and how I fix it?
 
Old 01-10-2008, 02:31 AM   #2
j-ray
Senior Member
 
Registered: Jan 2002
Location: germany
Distribution: ubuntu, mint, suse
Posts: 1,591

Rep: Reputation: 145Reputation: 145
A virtual host is running on the same machine, has a different configuration and needs an own name/address/port. If 2 servers have the same name/address/port apache does not know which one of them to take...

so if you need the virtual host give it a different name/address/port. If not just comment it out in httpd.conf ( start the lines with #)
#<VirtualHost.....>
#...
#</VirtualHost>

Last edited by j-ray; 01-10-2008 at 02:36 AM.
 
Old 01-10-2008, 08:23 PM   #3
jim.thornton
Member
 
Registered: May 2007
Posts: 430

Original Poster
Rep: Reputation: 19
Quote:
Originally Posted by j-ray View Post
A virtual host is running on the same machine, has a different configuration and needs an own name/address/port. If 2 servers have the same name/address/port apache does not know which one of them to take...

so if you need the virtual host give it a different name/address/port. If not just comment it out in httpd.conf ( start the lines with #)
#<VirtualHost.....>
#...
#</VirtualHost>
Here is my httpd-vhosts.conf file:

# The first VirtualHost section is used for all requests that do not
# match a ServerName or ServerAlias in any <VirtualHost> block.
#
<VirtualHost 127.0.0.1 111.111.111.111:80>
ServerAdmin webmaster@localhost
AliasMatch ^/~([^/]+)(/.*)* /home/$1/public_html$2
DocumentRoot /var/www/html
ServerName localhost
ScriptAlias /cgi-bin/ /var/www/cgi-bin/
CustomLog /var/log/httpd/homedir.log homedir
</VirtualHost>

<VirtualHost 127.0.0.1 111.111.111.111:443>
ServerAdmin webmaster@localhost
AliasMatch ^/~([^/]+)(/.*)* "/home/$1/public_html$2"
DocumentRoot /var/www/html
ServerName localhost
ScriptAlias /cgi-bin/ /var/www/cgi-bin/
CustomLog /var/log/httpd/homedir.log homedir

SSLEngine on
SSLCertificateFile /etc/httpd/conf/ssl.crt/server.crt
SSLCertificateKeyFile /etc/httpd/conf/ssl.key/server.key
</VirtualHost>

My understanding is that I need both of those don't I??
 
Old 01-10-2008, 09:11 PM   #4
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141

Rep: Reputation: 168Reputation: 168
Have you tried something like this instead?
Code:
NameVirtualHost *:80
NameVirtualHost *:443

<VirtualHost *:80>
ServerAdmin webmaster@localhost
AliasMatch ^/~([^/]+)(/.*)* /home/$1/public_html$2
DocumentRoot /var/www/html
ServerName localhost
ScriptAlias /cgi-bin/ /var/www/cgi-bin/
CustomLog /var/log/httpd/homedir.log homedir
</VirtualHost>

<VirtualHost *:443>
ServerAdmin webmaster@localhost
AliasMatch ^/~([^/]+)(/.*)* "/home/$1/public_html$2"
DocumentRoot /var/www/html
ServerName localhost
ScriptAlias /cgi-bin/ /var/www/cgi-bin/
CustomLog /var/log/httpd/homedir.log homedir

SSLEngine on
SSLCertificateFile /etc/httpd/conf/ssl.crt/server.crt
SSLCertificateKeyFile /etc/httpd/conf/ssl.key/server.key
</VirtualHost>
Alternatively, instead of <VirtualHost 127.0.0.1 111.111.111.111:80>, try <VirtualHost 127.0.0.1:80 111.111.111.111:80> and instead of <VirtualHost 127.0.0.1 111.111.111.111:443>, try <VirtualHost 127.0.0.1:443 111.111.111.111:443>
 
  


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
Starting httpd: httpd: Syntax error on line 209 of /etc/httpd/conf/httpd.conf: Syntax sethukpathi Linux - Networking 6 04-12-2008 11:26 AM
cronjob to restart httpd if httpd is dead heropage Linux - Software 1 10-31-2007 01:22 PM
httpd restart FAILED error: Could not determine the server's fqdn mcbaind Linux - Networking 8 10-06-2006 08:21 AM
httpd restart error sandeshshrestha Linux - General 4 03-27-2006 07:09 AM
slooze error: validateInputs(); $msg = $mySlooze->renderPage($vars); echo $msg; ?> rioguia Linux - Software 0 01-26-2003 08:59 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:14 AM.

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