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
Solved

VirtualHosts message when stopping/starting apache

Posted on 2012-04-09
13
665 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
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Using 'screen' for session sharing, The Simple Edition Step 1: user starts session with command: screen Step 2: other user (logged in with same user account) connects with command: screen -x Done. Both users are connected to the same CLI sessio…
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
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.

860 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