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.

After create an new account the apache settings are reset

Discussion in 'EasyApache' started by DevBreak, Sep 14, 2007.

  1. DevBreak

    DevBreak Active Member

    Joined:
    Jun 26, 2006
    Messages:
    32
    Likes Received:
    0
    Trophy Points:
    0
    Hello,
    Another bug in whm destroy my live.
    I have custom settings in apache httpd.conf (maxclients, keepalive , etc..) after i create an new account in whm this settings are gone and replaced with default. In this case the default settings are not good for me.

    What can i do?

    Apache 1.3.39 EA3
    RHE4 & FedoraCore 5 - same problem .

    Waiting for an urgently solution...
     
  2. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,461
    Likes Received:
    22
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    Make your changes to httpd.conf, then run /usr/local/cpanel/bin/apache_conf_distiller --update --main

    it should preserve your settings then.
     
  3. verdon

    verdon Well-Known Member

    Joined:
    Nov 1, 2003
    Messages:
    836
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    Northern Ontario, Canada
    cPanel Access Level:
    Root Administrator
    Can you explain (just a little) what that does? It sounds as if apache conf settings are actually being set somewhere else?
     
  4. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,461
    Likes Received:
    22
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    In brief, we have consolidated all management of httpd.conf into a "cPanel" database, found in /var/cpanel/useradata apache_conf_distiller is used to create and maintain that data. httpd.conf is rebuilt based upon that data. We don't recommend modifying the data in /var/cpanel/userdata
     
  5. verdon

    verdon Well-Known Member

    Joined:
    Nov 1, 2003
    Messages:
    836
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    Northern Ontario, Canada
    cPanel Access Level:
    Root Administrator
    Thanks, that's what I was looking for.
     
  6. verdon

    verdon Well-Known Member

    Joined:
    Nov 1, 2003
    Messages:
    836
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    Northern Ontario, Canada
    cPanel Access Level:
    Root Administrator
    So a new protocal would be to run /var/cpanel/useradata apache_conf_distiller whenever any manual edit is done to httpd.conf?
     
  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
    You need to run it with --update --main, otherwise it won't do anything.

    Otherwise, correct. After making changes to the global values, run:

    Code:
    /usr/local/cpanel/bin/apache_conf_distiller --update --main
    
    to preserve the changes.
     
  8. Rafaelfpviana

    Rafaelfpviana Well-Known Member

    Joined:
    Mar 12, 2004
    Messages:
    142
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Brazil
    was this suppose to keep the modified or added values that where added between <VirtualHost></VirtualHost> ????
     
  9. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,461
    Likes Received:
    22
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    No, changes to VirtualHost will not be preserved. Those changes need added to /usr/local/apache/conf/userdata/std/<apache version>/<user name>/custom.conf

    The file doesn't actually need to be named customer,conf, as long as it end with .conf

    After adding such a file, run:
    Code:
    perl /scripts/ensure_vhost_includes
    
    once that is done, the Include directives will be added to the vhost and retained across httpd.conf regenerattions.

    On a side note, there is a bug in 17046 (Current and Edge) that causes the httpd.conf be regenerated by anything that modifies the httpd.conf. Thus, adding a subdomain will cause the entire file be regenerated. This will be fixed in the next build.
     
  10. thedavid

    thedavid Well-Known Member

    Joined:
    Nov 22, 2002
    Messages:
    124
    Likes Received:
    0
    Trophy Points:
    16

    This would've been good as part of documentation, or maybe included in the changelog or something. This is the first I've seen of it, and this was after doing some searching.

    Also, how would this work if I wanted to say, change the secure web path for a domain? Rather than serving the pages from /home/username/public_html/ the client would like it served from /home/username/secure_html/

    In what way is this possible?
     
    #10 thedavid, Sep 17, 2007
    Last edited: Sep 17, 2007
  11. Rafaelfpviana

    Rafaelfpviana Well-Known Member

    Joined:
    Mar 12, 2004
    Messages:
    142
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Brazil
    kenneth, i didn't find /usr/local/apache/conf/userdata/std/<apache version>/<user name>/custom.conf, in fact /usr/local/apache/conf/userdata doesn't exist for me.

    By the way, would this be the correct way:

    Code:
    perl /scripts/ensure_vhost_includes  --all-users
     
  12. mtech-hosting

    mtech-hosting Well-Known Member

    Joined:
    Apr 30, 2006
    Messages:
    62
    Likes Received:
    0
    Trophy Points:
    6
    Is this distiller something that cpanel came up with or is it new to apache? This seems like an aweful lot of work just to make a few changes here and there and i can see it leading to a whole slew of problems
     
  13. cPanelBilly

    cPanelBilly Guest

    This is a cPanel thing and it is needed because of the multiple apache versions
     
  14. thedavid

    thedavid Well-Known Member

    Joined:
    Nov 22, 2002
    Messages:
    124
    Likes Received:
    0
    Trophy Points:
    16
    Does this reply mean that there's no way of making the changes I mentioned above?
     
  15. JamieD

    JamieD Well-Known Member

    Joined:
    Sep 3, 2003
    Messages:
    58
    Likes Received:
    0
    Trophy Points:
    6
    The userdata directory does not exist on my system, if this is manually created will cPanel pick it up, for instance if I created:

    /usr/local/apache/conf/userdata/std/1.3/a_user/custom.conf

    then ran perl /scripts/ensure_vhost_includes
     
  16. Koreru

    Koreru Member

    Joined:
    Nov 17, 2006
    Messages:
    18
    Likes Received:
    0
    Trophy Points:
    1
    OK. This is a problem directly related to the topic:

    I've got something close to the following line on a few accounts:
    Code:
    CustomLog "| /home/username/public_html/cgi-bin/filename.cgi" "%a|%u|%s|%{SOMEOTHERNAME_HASH}e|%b|%{SOMEOTHERNAME_WORK}e|%{SOMEOTHERNAME_BLOCKED}e"
    

    It was working until we updated recently. (Now running 11.12.0-C17073 w/Apache 2.2)

    If I edit httpd.conf, /usr/local/cpanel/bin/apache_conf_distiller doesn't parse the line correctly. It removes the quotes and pipe for the first part and then places the whole line in the "format" part of /var/cpanel/userdata/username/domainname, and the "target" part is set to "/".

    If I edit /var/cpanel/userdata/username/domainname directly, it doesn't add anything to httpd.conf when I run /usr/local/cpanel/bin/build_apache_conf.

    Any ideas?

    Edit----------------------------------------------------------------------------------------------------------------------------------


    OK, I found the answer here: http://bugzilla.cpanel.net/show_bug.cgi?id=5893



    This should answer your question as well, JamieD.

     
    #16 Koreru, Sep 18, 2007
    Last edited: Sep 18, 2007
  17. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,461
    Likes Received:
    22
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    apache_conf_distiller shouldn't be choking on that. Sounds like a parsing bug.
     
  18. Koreru

    Koreru Member

    Joined:
    Nov 17, 2006
    Messages:
    18
    Likes Received:
    0
    Trophy Points:
    1
    Yeah, I don't think it likes the quotation marks (Or the space after the pipe, maybe?).

    It's a moot point though since that doesn't seem to be the proper way to do it anyways. Adding the fragment files to /usr/local/apache/conf/userdata works good. Now that we've figured it out, I actually think it's a pretty decent setup. But it'd be nice to have a WHM interface for it with the directories created automatically.
     
    #18 Koreru, Sep 19, 2007
    Last edited: Sep 19, 2007
  19. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,461
    Likes Received:
    22
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    OK, this is a quickie on using the /usr/local/apache/conf/userdata /magic/

    1. If the directory does not exist, create it:
    Code:
    shell> mkdir /usr/local/apache/conf/userdata
    
    2. The directory hierarchy is as follows:

    Code:
    shell> cd /usr/local/apache/conf/userdata
    
    First level of directories are std and ssl std means non-SSL settings and ssl means SSL settings. Within both of those directories you would create two directories 1 and 2. These correspond to the Major Apache versions. Thus, one would not create 1.3, 2.2 or 2.0

    Within the directories that correspond to the Major Apache version, would be directories for each cPanel user name. Within those directories for each user name would be directories for each domain owned by the account. Thus, if my user name is cpkenneth and I own the domain cpanelkenneth.info and my cPanel server runs Apache 2.2 and I wanted fine-grained control over the vhost that configures that domain, I would drop a conf file in:

    Code:
    shell> mkdir -p /usr/local/apache/conf/userdata/std/2/cpkenneth/cpanelkenneth.info
    shell> cd /usr/local/apache/conf/userdata/std/2/cpkenneth/cpanelkenneth.info
    shell> vim custom.conf
    shell> /scripts/ensure_vhost_includes --user=cpkenneth
    shell> /scripts/restartsrv_httpd
    
    Whereas, if I wanted to customize behavior for all vhosts on that hypothetical server, I would do this:

    Code:
    shell> mkdir -p /usr/local/apache/conf/userdata/std/2/
    shell> cd /usr/local/apache/conf/userdata/std/2/
    shell> vim custom.conf
    shell> /scripts/ensure_vhost_includes --all-users
    shell> /scripts/restartsrv_httpd
    
    The file does not need named custom.conf, as long as it ends in .conf

    We are working to simplify some of this, based upon user request.

    Since this is a "quickie" there are likely errors/typos.
     
  20. Rafaelfpviana

    Rafaelfpviana Well-Known Member

    Joined:
    Mar 12, 2004
    Messages:
    142
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Brazil
    Very nice, but.... DOCUMENT THIS!!!!

    Notice that alot of people had trouble with this.
     
Loading...

Share This Page