Solved

VirtualHosts message when stopping/starting apache

Posted on 2012-04-09
13
670 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 5
  • 2
13 Comments
 
LVL 29

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 29

Expert Comment

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

Synthetic Transaction Monitoring Vs. Real User Monitoring: When To Use Each Approach? In this article, we will discuss two major monitoring approaches: Synthetic Transaction and Real User Monitoring.

 

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 29

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
 
LVL 29

Expert Comment

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

Author Comment

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

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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

724 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