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.

Apache httpd.conf keeps reverting IP address...

Discussion in 'EasyApache' started by jols, May 10, 2010.

  1. jols

    jols Well-Known Member

    Joined:
    Mar 13, 2004
    Messages:
    1,111
    Likes Received:
    2
    Trophy Points:
    38
    Hi,

    I hope someone has a solution for this.

    We've got a bit of an unusual situation in that the main "A" record for the account is directing traffic to an external server. However, they want to keep the traffic for a sub-domain (redirect) that is currently installed.

    So while www.domain.com goes to an external server, for subdomain.domain.com they want to keep the traffic going to subdomain.domain.com/subdir (which is on the local server).

    Okay, so I have everything else figured out and it works fine as long as the Apache httpd.conf VirutalHost entry does not change for the sub-domain. BUT, from time to time the httpd.conf reverts the VirutalHost entry for this sub-domain back to the external IP address and messes things up.

    Now, I understand this comment in the httpd.conf file:

    # DO NOT EDIT. AUTOMATICALLY GENERATED. IF YOU NEED TO MAKE A CHANGE PLEASE USE THE INCLUDE FILES.

    But how do I use an include file when I need to keep an IP address from changing in the VirutalHost tag?

    Anyone?

    Thanks much.
     
  2. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,458
    Likes Received:
    22
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    Rather than using an Include, you would use a custom VirtualHost template. More specifically, a custom template that will only be used by the specific domain. You can find information on that here: InsideVHost < EasyApache3 < TWiki
     
  3. Spiral

    Spiral BANNED

    Joined:
    Jun 24, 2005
    Messages:
    2,023
    Likes Received:
    7
    Trophy Points:
    0
    Forget about doing anything customized in Apache for this based on what you said in your original post above .....

    It's all utterly pointless for what you are doing! :rolleyes:

    If all that you are hosting is the subdomain (and DNS presumably else you wouldn't be running into the issue you are describing) then I would create a brand new hosting account with the "subdomain" address as the primary domain name for the hosting account itself.

    All you would need to do DNS wise is just add the base domain name as an extra DNS zone to the server (WHM -> Add a DNS zone) and add an "A" record to that zone for the subdomain and the external IP on the www.

    Setup this way, you don't have anything setup in Apache at all for the root level domain while you do have the subdomain setup locally in it's own virtualhost in Apache.

    Nothing around on the system to "overwrite" or mess up in the first place

    --- that's a whole lot cleaner there that way.
     
Loading...

Share This Page