The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Correct way listing NameVirtualHosts in httpd.conf?

Discussion in 'General Discussion' started by Jeff75, Nov 3, 2004.

  1. Jeff75

    Jeff75 Well-Known Member

    Joined:
    Apr 11, 2003
    Messages:
    555
    Likes Received:
    0
    Trophy Points:
    16
    Can someone tell me what the correct way to have NameVirtualHosts in the httpd.conf is? Each account on my server has it's own IP address. Should there be a NameVirtualHost at the very top of the VirtualHost section or right above the first VirtualHost for the domain. cPanel currently has them all over the place and it's really nasty. I'm trying to figure out how to fix the NameVirtualHost [IP] has no VirtualHost errors (about 300) and it's a PITA.
     
  2. sawbuck

    sawbuck Well-Known Member

    Joined:
    Jan 18, 2004
    Messages:
    1,367
    Likes Received:
    5
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    Usually following the SSL section.
     
  3. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
  4. PWSowner

    PWSowner Well-Known Member

    Joined:
    Nov 10, 2001
    Messages:
    2,948
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    ON, Canada
    There is no "correct" way as long as they are before the first VirtualHost entry.

    When I clean up my conf file, I put all my NameVirtualHost entries together just before the VirtualHost entries.

    When doing any changes to that file, it's good to save a backup of the original, just in case something is done wrong in the modifications. Gives a quick way to get apache back up.
     
  5. Jeff75

    Jeff75 Well-Known Member

    Joined:
    Apr 11, 2003
    Messages:
    555
    Likes Received:
    0
    Trophy Points:
    16
    Thanks for the info. If I set up my NameVirtualHosts the way like you described, would those warnings still come up when doing configtest?
     
  6. PWSowner

    PWSowner Well-Known Member

    Joined:
    Nov 10, 2001
    Messages:
    2,948
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    ON, Canada
    Nope.

    The NameVirtualHost [IP] has no VirtualHost errors means there is a NameVirtualHost entry but the IP isn't used for any accounts. List all the NameVirtualHost entries above the VirtualHost entries, then with any IP's that give that error, check to make sure there are no sites using them and remove that NameVirtualHost entry. You can just leave them there if you want. They do no harm. What happens is, if an account with a ded IP is terminated, the NameVirtualHost entry is usually left behind.
     
  7. Jeff75

    Jeff75 Well-Known Member

    Joined:
    Apr 11, 2003
    Messages:
    555
    Likes Received:
    0
    Trophy Points:
    16
    Thanks again. i'll do what you suggested and will put them all at the top.

    Would you happen to know of a way to determine why I keep getting a core dump whenever I run configtest would you? Here's my post about it if you'd like to check it out: http://forums.cpanel.net/showthread.php?t=31622
     
Loading...

Share This Page