Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 15 of 16
  1. #1
    Member
    Join Date
    Jan 2004
    Posts
    51

    Default httpd.conf template

    Is it possible to modify the template used to add new entries to the httpd.conf for different reseller accounts ?

    I'd like to be able to add a mod_layout entry only for accounts created via a specific reseller account, all other accounts would use the standard template.

    Is this possible ?
    Alex Monaghan, Monaghan Consultants Ltd
    www.monaghan.co.uk - IT / Database consultancy
    www.www-hoster.com - International web hosting
    www.diyhosting.co.uk - Quality budget web hosting

  2. #2
    Super Moderator This forum account has been confirmed by cPanel staff to represent a vendor. chirpy's Avatar
    Join Date
    Jun 2002
    Location
    Go on, have a guess
    Posts
    13,495

    Default

    I'm not aware of an easy way to do it. You'd probably have to do some nifty coding in a script file for /scripts/postwwwacct and make adjustments when a new account is created.
    Jonathan Michaelson

    Need your cPanel servers secured and tuned?
    cPanel Server Configuration, Security, Recovery and Antivirus/AntiSpam Services
    Developers of the most effective (and free) Firewall & Security Solution for cPanel Servers - csf
    http://www.configserver.com

  3. #3
    Member SubZero's Avatar
    Join Date
    Apr 2005
    Location
    Balmumcu, Istanbul, TR
    Posts
    100

    Default

    There is no link for /scripts/postwwwacct in /scripts/wwwacct script.
    WHM 10.8.0 cPanel 10.8.2-C110
    CentOS 3.7 i686 - WHM X v3.1.0
    (nightly auto-updated at 6:00 GMT)

  4. #4
    Member PWSowner's Avatar
    Join Date
    Nov 2001
    Location
    ON, Canada
    Posts
    2,994

    Default

    Quote Originally Posted by SubZero
    There is no link for /scripts/postwwwacct in /scripts/wwwacct script.
    There better be.

    if (-e "/scripts/postwwwacct") {
    system("/scripts/postwwwacct",@ARGV);
    }

    is at the end of mine.
    Mike
    WHM and cPanel Scripts (join our "Scripts Club")
    D/A Photography

  5. #5
    Member
    Join Date
    Jun 2005
    Posts
    28

    Default

    I'm also interested in inserting additional stuff to httpd.conf upon account creation.

    However postwwwacct does not exist in /scripts.

    root@orbit [~]# ls /scripts/postwwwacct
    /bin/ls: /scripts/postwwwacct: No such file or directory
    HostingZero.com - Free Web Hosting. Up to 10 GB disk space / 100 GB bandwidth. cPanel with Fantastico

  6. #6
    Member PWSowner's Avatar
    Join Date
    Nov 2001
    Location
    ON, Canada
    Posts
    2,994

    Default

    The postwwwacct file doesn't exist until you create one. That's why the wwwacct script says to run it if it exists.

    Take a look at my postwwwacct scripts to see how it works. (scripts club in my sig)
    Mike
    WHM and cPanel Scripts (join our "Scripts Club")
    D/A Photography

  7. #7
    Member
    Join Date
    Jun 2005
    Posts
    28

    Default

    Wow this is wonderful. I didn't know this can be done!.

    Thank you!
    HostingZero.com - Free Web Hosting. Up to 10 GB disk space / 100 GB bandwidth. cPanel with Fantastico

  8. #8
    Registered User
    Join Date
    Mar 2006
    Posts
    2

    Default

    Thought I would mention here that there is a template file in /usr/local/cpanel/etc/httptemplates/{server-type}/default (and ssldefault)

    I spent a while trying to figure out how to customize in my suPHP_UserGroup line through these scripts mentioned here. This might save someone some time...

  9. #9
    Member
    Join Date
    Nov 2003
    Location
    NC, USA
    Posts
    55

    Default

    I've customized mine, but with automatic updates enabled, the modified templates get overwritten pretty often for me

  10. #10
    Registered User
    Join Date
    May 2008
    Posts
    6

    Question Same for me intel352

    Yes! I'm having the same issue intel352. I've also made suPHP modifications to the default and ssldefault cpanel templates, but every time cPanel updates itself on my VPS, it overwrites my modifications to those files.

    How can we prevent this? Anyone?

    Thx in advance!

    - MWM

  11. #11
    Member
    Join Date
    May 2005
    Location
    Auburn, CA
    Posts
    243

    Default

    Quote Originally Posted by MWMcons View Post
    Yes! I'm having the same issue intel352. I've also made suPHP modifications to the default and ssldefault cpanel templates, but every time cPanel updates itself on my VPS, it overwrites my modifications to those files.

    How can we prevent this? Anyone?

    Thx in advance!

    - MWM
    You could use "chattr +i" on the file.
    cPanel: Latest Release Version [11.32.2.*]
    PHP 5.3.10, Apache 2.2.22, MySQL 5.1.56, Perl 5.8.8, CentOS 6.2

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

    Root Administrator

    Default

    The templates you should modify are those in /var/cpanel/templates

    At some point those in /usr/local/cpanel/etc/httptemplates will go away, but until then, the following work around generally suffices:

    1. Create a .local version of the vhost template in the appropriate directory of /var/cpanel/templates
    2. Create account (or add sub domain, etc)
    3. Rebuild httpd.conf

  13. #13
    Registered User
    Join Date
    May 2008
    Posts
    6

    Default

    Thx for the reply cpanelkenneth. I'm a bit confused, so perhaps you could explain a few things to me:

    1) Why isn't cpanel using the templates in /var/cpanel/templates/apache1/ now? Or is it? I assumed it was only using the templates in /usr/local/cpanel/etc/httptemplates/apache1/ when adding a new domain/sub-domain.

    2) So I should create a vhost.local version of the vhost.default template and make modifications within it? In doing so, will these modifications reflect changes made to the httpd.conf file when new domains/sub-domains are added? And cPanel will not overwrite the .local version during future updates? I guess this kind of goes along with my question above in number 1.

    3) When you say to "rebuild httpd.conf", what exactly do you mean? I don't think I've ever performed the process of rebuilding the httpd.conf file.

    Thx for your help. I really appreciate it, and invite any further explanation you can provide.

    Cheers!

    - MWM

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

    Root Administrator

    Default

    Quote Originally Posted by MWMcons View Post
    Thx for the reply cpanelkenneth. I'm a bit confused, so perhaps you could explain a few things to me:

    1) Why isn't cpanel using the templates in /var/cpanel/templates/apache1/ now? Or is it? I assumed it was only using the templates in /usr/local/cpanel/etc/httptemplates/apache1/ when adding a new domain/sub-domain.

    2) So I should create a vhost.local version of the vhost.default template and make modifications within it? In doing so, will these modifications reflect changes made to the httpd.conf file when new domains/sub-domains are added? And cPanel will not overwrite the .local version during future updates? I guess this kind of goes along with my question above in number 1.

    3) When you say to "rebuild httpd.conf", what exactly do you mean? I don't think I've ever performed the process of rebuilding the httpd.conf file.

    Thx for your help. I really appreciate it, and invite any further explanation you can provide.

    Cheers!

    - MWM
    The templates in /usr/local/cpanel/etc/httptemplates are used:

    1. When creating a new account
    2. When creating a sub domain or addon domain

    The templates in /var/cpanel/templates are used when rebuilding httpd.conf

    To rebuild httpd.conf, execute:

    /scripts/rebuildhttpdconf


    The /usr/local/cpanel templates are legacy and will eventually go away in favor of those in /var/cpanel which use a more robust templating technology (Template toolkit, a very nice Perl application).


    The .local variations of any templates in /var/cpanel will not be touched by cPanel updates.

  15. #15
    Registered User
    Join Date
    May 2008
    Posts
    6

    Default

    The templates in /usr/local/cpanel/etc/httptemplates are used:

    1. When creating a new account
    2. When creating a sub domain or addon domain
    Ahh, I see Kenneth. Then my problem will still continue if cPanel uses the above templates when creating new accounts/addon domains/sub-domains. Because this is where my problem stems. cPanel overwrites my modifications to the /usr/local/cpanel/ templates and then I or a client adds a new domain and the whole system breaks down.

    So, basically there is no way to prevent my situation until cPanel switches to the /var/cpanel/ templates completely and entirely, yes?

    Also, I'm confused as to the existence of the /var/cpanel/ templates now. Does the httpd.conf file get rebuilt automatically by the system? If so, when? I see the script you sent me, but is it up to me to rebuild the httpd.conf file on my own? A little confused.

    Thx.

    - MWM

Similar Threads & Tags
Similar threads

  1. Faulty httpd.conf - can't rebuild with rebuildhttpd.conf
    By movielad in forum cPanel and WHM Discussions
    Replies: 4
    Last Post: 03-21-2011, 12:43 PM
  2. Preserve amends to /etc/httpd/conf/httpd.conf ?
    By robocrop in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 08-14-2010, 02:08 AM
  3. httpd.conf template variables
    By thobarn in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 03-30-2009, 02:42 AM
  4. httpd.conf sites/www.domain.com.conf Wildcard DNS
    By ttremain in forum cPanel and WHM Discussions
    Replies: 6
    Last Post: 12-16-2008, 11:19 AM
  5. Apache 2.2 httpd.conf template
    By BamaStangGuy in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 09-16-2007, 05:44 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube