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.

upcp overwriting httpd.conf

Discussion in 'General Discussion' started by thobarn, Apr 6, 2009.

  1. thobarn

    thobarn Well-Known Member

    Joined:
    Apr 25, 2008
    Messages:
    153
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    sanctum sanctorum
    I have CPanel/WHM set to manual updates only, Package updates and Security Package updates to automatic.

    I make the following change to the httpd.conf

    Code:
    <Directory "/">
        Options -ExecCGI FollowSymLinks -Includes -IncludesNOEXEC -Indexes -MultiViews -SymLinksIfOwnerMatch (Using UI)
        AllowOverride None
        Order deny,allow
        Deny from all
    </Directory>
    Commit the changes:
    Code:
    /usr/local/cpanel/bin/apache_conf_distiller --update
    and rebuild the config file:
    Code:
    /usr/local/cpanel/bin/build_apache_conf
    The changes are preserved, that is until next time upcp runs, which removes those changes, even if there is no updates.

    Why is this happening? If someone can help I will be much grateful.
     
  2. compuminus

    compuminus Registered

    Joined:
    Apr 9, 2008
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    I am having the same problem. This really should be fixed. I found the following crude workarounds:

    (1) http://forums.cpanel.net/showthread.php?t=79989
    (2) http://forums.cpanel.net/showthread.php?t=63968

    Via method (1)
    Run the following in shell:

    1. echo "/scripts/rebuildhttpdconf" >> /scripts/postupcp
    2. chmod +x /scripts/postupcp

    Via method (2)

    mv /scripts/checkallowoverride /scripts/.checkallowoverride
    touch /scripts/checkallowoverride
    chattr +i /scripts/checkallowoverride

    I understand that preventing "allowoverride none" was done for frontpage, but this really shouldn't be the default behavior, or at least it should be easily prevented via a checkbox in the whm menus. Setting "allowoverride none" is standard practice for tweaking the performance of an apache server. There have been many threads about this issue over the past few years, but it's never been addressed.
     
    #2 compuminus, Apr 8, 2009
    Last edited: Apr 8, 2009
  3. thobarn

    thobarn Well-Known Member

    Joined:
    Apr 25, 2008
    Messages:
    153
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    sanctum sanctorum
    According to OP in this thread /usr/local/cpanel/bin/build_apache_conf does build the httpd.conf correctly after upcp as it he made his changes in main.local. Having a main.local, even an identical one to main.default causes havoc after a upcp in my case This is interesting. In this thread cpanelkenneth says
    In my case it also nukes
    Code:
    Order deny,allow
    Deny from all
    So now I am adding it to pre_main_2.conf under another <Directory /> directive.

    I am somehow reluctant to make a file CPanel/WHM may need immutable.

    Thanks for digging deeper in to past threads. I missed both of those.

    And while we are at httpd.conf, if anybody from Cpanel is reading, not terribly important, (but some like their conf files tidy :)
    • AddType text/html .shtml appears twice
    • In edge version 35196 now appears an empty block <IfModule prefork.c></IfModule>
     
Loading...

Share This Page