Solved

VirtualHosts message when stopping/starting apache

Posted on 2012-04-09
13
656 Views
Last Modified: 2012-05-17
I recently changed the IP addresses for 4 of my domains on my server to 4 new IPs that I had which were not being used.  Everything seems to be working properly, but I noticed the messages below when I stop & start httpd service.

I did not have those messages previously.  I think I made a mistake or forgot to do one additional step.

I'm using WHM/cpanel - centos

root@cv2 [/etc]# service httpd stop
[Sun Apr 08 11:50:01 2012] [warn] NameVirtualHost xxx.xxx.xx.12:80 has no VirtualHosts
[Sun Apr 08 11:50:01 2012] [warn] NameVirtualHost xxx.xxx.xx.13:80 has no VirtualHosts
[Sun Apr 08 11:50:01 2012] [warn] NameVirtualHost xxx.xxx.xx.10:80 has no VirtualHosts
[Sun Apr 08 11:50:01 2012] [warn] NameVirtualHost xxx.xxx.xx.10:80 has no VirtualHosts
[Sun Apr 08 11:50:01 2012] [warn] NameVirtualHost xxx.xxx.xx.10:80 has no VirtualHosts
[Sun Apr 08 11:50:01 2012] [warn] NameVirtualHost xxx.xxx.xx.10:80 has no VirtualHosts
[Sun Apr 08 11:50:01 2012] [warn] NameVirtualHost xxx.xxx.xx.11:80 has no VirtualHosts

Also I see .10 is listed 4 times.  That also makes me think something additional is wrong.  The other domains are listed only once.

I have 4 domains:
domain1 xxx.xxx.xx.10
domain2 xxx.xxx.xx.11
domain3 xxx.xxx.xx.12
domain4 xxx.xxx.xx.13

Could someone give me some advice or direction about this?  

Thank you.
0
Comment
Question by:U_S_A
  • 6
  • 5
  • 2
13 Comments
 
LVL 28

Expert Comment

by:Jan Springer
ID: 37824278
Change all of you NameVirtualHost  statements to be just (no quotes) "NameVirtualHost *:80" and make sure that you have "Listen a.b.c.d:80" for each IP address -- or you can just do a "Listen 80".
0
 

Author Comment

by:U_S_A
ID: 37824536
Where would I make these changes, please?
0
 
LVL 28

Expert Comment

by:Jan Springer
ID: 37824588
In your httpd.conf file either found in /etc/httpd/conf or /usr/local/apache2/conf
0
 

Author Comment

by:U_S_A
ID: 37824943
Here is one entry I have in that file (I have the same type of info for each IP adress)

NameVirtualHost xxx.xxx.xx.13:80
<VirtualHost xxx.xxx.xx.13:80>
    ServerName domainname.com
    ServerAlias www.domainname.com
    DocumentRoot /home/username/public_html
    ServerAdmin webmaster@domainname.com
    UseCanonicalName Off
    CustomLog /usr/local/apache/domlogs/domainname.com combined
    CustomLog /usr/local/apache/domlogs/domainname.com-bytes_log "%{%s}t %I .\n%{%s}t %O ."
    ## User username # Needed for Cpanel::ApacheConf
    <IfModule mod_suphp.c>
        suPHP_UserGroup username username
    </IfModule>
    <IfModule !mod_disable_suexec.c>
        SuexecUserGroup username username
    </IfModule>
    ScriptAlias /cgi-bin/ /home/username/public_html/cgi-bin/


    # To customize this VirtualHost use an include file at the following location
    # Include "/usr/local/apache/conf/userdata/std/2/username/domainname.com/*.conf"

</VirtualHost>
----------
with this new info, do I need to make any changes as you suggested?


I also found this in the file

# DO NOT EDIT. AUTOMATICALLY GENERATED.  IF YOU NEED TO MAKE A CHANGE PLEASE USE THE INCLUDE FILES.
NameVirtualHost xxx.xxx.xx.186:80
NameVirtualHost xxx.xxx.xx.14:80
NameVirtualHost xxxx.xxx.xx.9:80
NameVirtualHost *
# DO NOT EDIT. AUTOMATICALLY GENERATED.  IF YOU NEED TO MAKE A CHANGE PLEASE USE THE INCLUDE FILES.
-----------

the .14 and .9 are old addresses

What do you recommend, please.  I've not yet made any changes yet.

Thank you.
0
 
LVL 28

Expert Comment

by:Jan Springer
ID: 37825254
How are you making the changes today?  The configuration file suggests that it is not done by directly writing to the httpd.conf?
0
 

Author Comment

by:U_S_A
ID: 37825266
I've not made any changes today... but I suppose that WHM is writing to that file.
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 28

Expert Comment

by:Jan Springer
ID: 37825339
What is 'WHM'?
0
 

Author Comment

by:U_S_A
ID: 37825527
0
 

Author Comment

by:U_S_A
ID: 37828346
I'm still lost.
0
 
LVL 28

Expert Comment

by:Jan Springer
ID: 37828538
I am sorry.  I am unfamiliar with cpanel and whm.
0
 
LVL 4

Expert Comment

by:senseifedon
ID: 37838308
Hi;
One week ago I had same problem. The solution was inside of the httpd.conf. First of all open httpd.conf file. Then follow this directives:

1. NameVirtualHost *:80
    NameVirtualHost *:443

2.
<VirtualHost *:80>
    ServerName domain1.xxxx
    ServerAlias www.domain1.xxxx
    DocumentRoot /var/www/html/domain1/
    ServerAdmin root@domain1.xxx
    UseCanonicalName On
    ErrorLog logs/domain1-error_log
    CustomLog logs/domain1-access_log common
</VirtualHost>

<VirtualHost *:80>
    ServerName domain2.xxxx
    ServerAlias www.domain2.xxxx
    DocumentRoot /var/www/html/domain2/
    ServerAdmin root@domain2.xxx
    UseCanonicalName On
    ErrorLog logs/domain2-error_log
    CustomLog logs/domain2-access_log common
</VirtualHost>
.
.
.
apply same config for domain3.xxx and domain4.xxxx

Most important thing NameVirtualHost and <VirtualHost *:80>.

Then restart apache. You will see there is no error.
0
 

Author Comment

by:U_S_A
ID: 37889198
I checked my settings - they already look this way.
0
 
LVL 4

Accepted Solution

by:
senseifedon earned 500 total points
ID: 37893775
Your settings is in the below lines:
NameVirtualHost xxx.xxx.xx.13:80
<VirtualHost xxx.xxx.xx.13:80>

Open in new window


But the lines should have been like these:
NameVirtualHost *:80 
<VirtualHost *:80>

Open in new window


Carefully look the lines. You should use * instead of xxx.xxx.xx.13 (ip address).
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Suggested Solutions

Over the last ten+ years I have seen Linux configuration tools come and go. In the early days there was the tried-and-true, all-powerful linuxconf that many thought would remain the one and only Linux configuration tool until the end of times. Well,…
SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now