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.

Adding an Alias to an account in httpd.conf that will survive a rebuild?

Discussion in 'General Discussion' started by Kadence, Sep 21, 2009.

  1. Kadence

    Kadence Member

    Joined:
    Nov 25, 2006
    Messages:
    24
    Likes Received:
    0
    Trophy Points:
    1
    How can one modify an account in httpd.conf, in a way that will survive a rebuild by cPanel? For instance adding an Alias to an account.

    It might perhaps be done like
    Code:
    <VirtualHost 1.2.3.4:80>
    ServerName domain.com
    ServerAlias www.domain.com
    Include "/usr/local/apache/conf/includes/edit.conf"
    </VirtualHost>
    With edit.conf being
    Code:
    Alias /dir1 /dir2
    However I don't think that would survive a rebuild by cPanel.
     
  2. koopsta

    koopsta Registered

    Joined:
    Jan 24, 2007
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    What version of cPanel/WHM are you using? For a while now, each vhost has had a note along the lines of:


    # To customize this VirtualHost use an include file at the following location
    # Include "/usr/local/apache/conf/userdata/std/apache_major_version/username/domain/*.conf"
     
  3. Skywalk

    Skywalk Registered

    Joined:
    Oct 1, 2009
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Would this override any settings present in httpd.conf - for instance, if there is an open_basedir restriction in place, what would you place in such a file to disable it?

    Also, I have Apache/2.0.63 and cPanel 11.24.5-R38506, but I don't see a userdata folder in my /usr/local/apache/conf directory. There is a /usr/local/apache/conf/sites folder though which contains files of the type domain.com.conf and www.domain.com.conf (both of them for each domain).
     
  4. Kadence

    Kadence Member

    Joined:
    Nov 25, 2006
    Messages:
    24
    Likes Received:
    0
    Trophy Points:
    1
    Anyone know about this? It seems not every domain has .conf files in the /usr/local/apache/conf/sites folder, and also if the config differs the httpd.conf value overrides those files anyway.

    I do need to restart cPanel occassionally, and when I do the changes I've manually made to httpd.conf (e.g. adding an Alias or AliasMatch, or commenting out open_basedir restrictions) are undone by the rebuild.

    (the above poster Skywalk was me, had some trouble activating this account for a while)
     
Loading...

Share This Page