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.

Deleting virtualhost entries in httpd.conf?

Discussion in 'General Discussion' started by Vatoloco, Jul 18, 2005.

  1. Vatoloco

    Vatoloco Well-Known Member

    Joined:
    Jun 21, 2004
    Messages:
    100
    Likes Received:
    0
    Trophy Points:
    16
    NameVirtualHost 55.55.555.55:80


    <VirtualHost 55.55.555.55>
    BytesLog domlogs/cpanel.ev1servers.net-bytes_log
    ServerName cpanel.ev1servers.net
    DocumentRoot /usr/local/apache/htdocs
    </VirtualHost>


    NameVirtualHost 55.55.555.55:80


    <VirtualHost 55.55.555.55>
    ServerName plain.ev1servers.net
    DocumentRoot /usr/local/apache/htdocs
    </VirtualHost>



    There were multiple entries like this in /etc/httpd/conf/httpd.conf so I went through and changed them all to my host name instead. Well, now I've realized I probably don't need the duplicates so is it okay to delete them? I'm not sure what I can safely remove because both of those entries are preceded by NameVirtualHost 555.55.555.55:80. It's the same IP address and everything. Can I safely delete the duplicate NameVirtualHost entry as well?
     
  2. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    Yes, you can. Those are created when EV1 setup the server with their own hostname configured before changing it to the one you choose.
     
  3. Vatoloco

    Vatoloco Well-Known Member

    Joined:
    Jun 21, 2004
    Messages:
    100
    Likes Received:
    0
    Trophy Points:
    16
    Thanks! Do I need to leave one of the NameVirtualHost entries? There are only two in the entire file and I can't tell if they go with the ev1servers.net entries or if they are also used for my other virtualhost entries that I need to keep.
     
  4. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    You need the NameVirtualHost directives if you use an IP address more than once in a VirtulHost container. There's no harm in having them in there, but if you do, they should be before any VirtualHost statement uses it.
     
  5. Vatoloco

    Vatoloco Well-Known Member

    Joined:
    Jun 21, 2004
    Messages:
    100
    Likes Received:
    0
    Trophy Points:
    16
    Thanks! I think I'll leave them just to be safe then.
     
  6. PWSowner

    PWSowner Well-Known Member

    Joined:
    Nov 10, 2001
    Messages:
    2,948
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    ON, Canada
    I clean my conf file up once in a while by moving all NameVirtualHost lines up so they are just before the VirtualHost entries. Then it's easy to see if there are duplicates and I leave just one for each IP.
     
Loading...

Share This Page