Community Forums
Connect with us on LinkedIn
Community Notice
+ Reply to Thread
Results 1 to 9 of 9
  1. #1
    Member
    Join Date
    Sep 2003
    Posts
    50

    Default Create account with custom vhost template

    I am trying to create new account using a customer vhost template. I have edited the /var/cpanel/templates/apache2/vhost.local file, which according to the documentation will take precedence over the vhost.default file.

    When I create a new account in WHM my custom vhost template is not used. However, if I run /usr/local/cpanel/bin/build_apache_conf my custom vhost template is used to build the httpd.conf file.

    Why when creating a new account is the vhost.local template not used and how can I get my custom templated used when creating new accounts?

    Thanks

  2. #2
    cPanel Development cpanelkenneth's Avatar
    Join Date
    Apr 2006
    Posts
    3,768
    cPanel/Enkompass Access Level

    Root Administrator

  3. #3
    Member
    Join Date
    Sep 2003
    Posts
    50

    Default

    Thanks Kenneth, any idea when this will be fixed or if there is a work around as i need to use this feature for a server I am deploying.

    Additional I have noticed another issue/bug with httpd.conf. If you add some LoadModule directives that need to be in a specific order then run distiller the LoadModule directives will not necessarily be in the original order which can cause configuration errors.

    e.g. I added these two lines to httpd.conf

    LoadModule dav_svn_module modules/mod_dav_svn.so
    LoadModule authz_svn_module modules/mod_authz_svn.so

    Then ran distiller and authz_svn_module was appearing before dav_svn_module causing an error. Is there a way to make distiller keep the correct order?

    The only work around I have found was to add the lines to /usr/local/apache/conf/includes/pre_main_2.conf instead of httpd.conf

  4. #4
    Member paulkoan's Avatar
    Join Date
    Nov 2006
    Posts
    80

    Default

    The bug report for this issue suggests there is a workaround - at least for the main host, if not for the addons.

    What I would like to do is create a server alias, where if the domain of the server is "ourdomain.com" and the customer site is "theirdomain.com", that the server alias "theirdomain.com.ourdomain.com" is created.

    Then use dns wildcards to get it to resolve. This is an alternative to the userdir approach prior to DNS propagation, and aligns with our other platforms.

    If there is no workaround for the vhost.local bug, is there an alternative method that achieves this?

    Thanks,

    Paul
    ServWise Advanced Hosting - Better, Faster, Smarter

  5. #5
    cPanel Development cpanelkenneth's Avatar
    Join Date
    Apr 2006
    Posts
    3,768
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    The problem is there are two templating systems in question. The first is used by account creation, the second is used when httpd.conf is regenerated.

    The templates used by account creation are found in /usr/local/cpanel/etc/httptemplates

    The templates used by httpd.conf generation are in /var/cpanel/templates/

    At some point the processes will be merged so there is only one template system

    For sub and addon domains, the templates in /usr/local/cpanel/etc/httptemplates are the ones to modify.

  6. #6
    Member paulkoan's Avatar
    Join Date
    Nov 2006
    Posts
    80

    Default

    The templates used by account creation are found in /usr/local/cpanel/etc/httptemplates
    There doesn't seem to be a .local version option for these templates. Does this mean that with cPanel updates, the changes will get wiped out?

    Cheers,

    Paul
    ServWise Advanced Hosting - Better, Faster, Smarter

  7. #7
    cPanel Development cpanelkenneth's Avatar
    Join Date
    Apr 2006
    Posts
    3,768
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    Quote Originally Posted by paulkoan View Post
    There doesn't seem to be a .local version option for these templates. Does this mean that with cPanel updates, the changes will get wiped out?

    Cheers,

    Paul
    There is no '.local' variant of those files because those are part of a much older template system that predates what cPanel 11 uses for httpd.conf generation.

    The templates in /usr/local/cpanel/etc/httptemplates should not be over-written except with a upcp --force call.

  8. #8
    Member paulkoan's Avatar
    Join Date
    Nov 2006
    Posts
    80

    Default

    Did this issue of having a separate template for addon and reseller accounts get addressed in the recent version?

    Or otherwise is there a way to do local changes to /usr/local/cpanel/etc/httptemplates without it being lost during updates?

    Thanks,

    Paul
    ServWise Advanced Hosting - Better, Faster, Smarter

  9. #9
    cPanel Development cpanelkenneth's Avatar
    Join Date
    Apr 2006
    Posts
    3,768
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    Quote Originally Posted by paulkoan View Post
    Did this issue of having a separate template for addon and reseller accounts get addressed in the recent version?

    Or otherwise is there a way to do local changes to /usr/local/cpanel/etc/httptemplates without it being lost during updates?

    Thanks,

    Paul
    It is not addressed in 11.24, but possibly in 11.25. To preserve your old-style templates across cPanel updates, store them in a different location ( e.g /root/my_templates), then have a /scripts/postupcp script copy them to /usr/local/cpanel/etc/httptemplates after upcp.

Similar Threads & Tags
Similar threads

  1. how to change vhost template file for good?
    By AL-Kateb in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 03-13-2011, 02:46 PM
  2. Documentation of properties of vhost in template?
    By JoeMurray in forum cPanel and WHM Discussions
    Replies: 3
    Last Post: 05-07-2009, 02:44 PM
  3. Creating new accounts ignores vhost.local template
    By jandafields in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 08-01-2008, 02:55 PM
  4. Custom Log Entries (for one vhost)
    By PPNSteve in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 04-04-2008, 01:42 PM
  5. Create account from template
    By pdonlin in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 11-18-2005, 08:40 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube