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.

custom httpd templates

Discussion in 'General Discussion' started by Bartuc, Sep 8, 2008.

  1. Bartuc

    Bartuc Member

    Joined:
    Jan 9, 2008
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    1
    I've created/edited following files by customizing them:

    /var/cpanel/templates/apache2/main.default
    /var/cpanel/templates/apache2/main.local
    /var/cpanel/templates/apache2/vhost.default
    /var/cpanel/templates/apache2/vhost.local
    /var/cpanel/templates/apache2/ssl_vhost.default
    /var/cpanel/templates/apache2/ssl_vhost.local

    I've modified templates. When I create a new website, I want my custom templates to be used but instead, cpanel is still using default templates. running /scripts/rebuildhttpdconf fixes httpd.conf as I customized.

    I want cpanel to use my custom templates as soon as a new website or subdomain is created.

    if there is a way to run this script after website creation, it will work for me.

    Please help me.
     
  2. trochia

    trochia Member

    Joined:
    Aug 26, 2008
    Messages:
    24
    Likes Received:
    0
    Trophy Points:
    1
    Have you rebooted?
     
  3. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,461
    Likes Received:
    22
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    The templates in /var/cpanel/templates are only used when httpd.conf is regenerated. Activities such as adding a new domain do not regenerate httpd.conf, but perform line edits. These edits are handled by the templates in /usr/local/cpanel/etc/httpdtemplates.
     
  4. Bartuc

    Bartuc Member

    Joined:
    Jan 9, 2008
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    1
    yes, reboot didn't work.
     
  5. Bartuc

    Bartuc Member

    Joined:
    Jan 9, 2008
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    1
    please help me!
    this is a bug in cpanel and no one has no solution.

    at least, please tell me how to put

    /scripts/rebuildhttpdconf
    service httpd restart

    into the post acc creation scripts.
     
  6. Bartuc

    Bartuc Member

    Joined:
    Jan 9, 2008
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    1
    root@server [/home]# cd /usr/local/cpanel/etc/httpdtemplates
    -bash: cd: /usr/local/cpanel/etc/httpdtemplates: No such file or directory

    :(
     
  7. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,461
    Likes Received:
    22
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    Sorry, that was a typo. The correct path is:

    /usr/local/cpanel/etc/httptemplates

    The following will cause the httpd.conf file to be rebuilt after account creation:

    Code:
    echo "/scripts/rebuildhttpdconf" >> /scripts/postwwwacctuser
    echo "/scripts/restartsrv_httpd" >> /scripts/postwwwacctuser
    chmod +x /scripts/postwwwacctuser
    
     
Loading...

Share This Page