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.

Problem with Apache Configuration File !

Discussion in 'EasyApache' started by St493r, Feb 5, 2012.

  1. St493r

    St493r Member

    Joined:
    Feb 5, 2012
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Website Owner
    Hi

    When I want to change apache configuration , Example change , +indexes to -indexes I got an error like :
    Changes to these settings do not take effect until the main Apache configuration file is rebuilt.

    Then all web site of my server got 403 forbidden error

    I edit /usr/local/apache/conf/httpd.conf and change -symlinkifownsermatch to +symlinkifownermatch

    Later again i got 403 forbidden and when i open httpd.conf i see symlinkifownermatch is - againe automaticly !

    What i can do?!

    Execusme because bad english

    Regards
     
  2. St493r

    St493r Member

    Joined:
    Feb 5, 2012
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Website Owner
    Any one?! ....
     
  3. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    Can you please show what you are putting in this section of /usr/local/apache/conf/httpd.conf file?

    Code:
    <Directory "/">
        Options All
        AllowOverride All
    </Directory>
    I know it isn't Options All, but we really do need to see exactly what you have there for testing purposes.

    Of note, if you make changes there, you would need to run the distiller:

    Code:
    /usr/local/cpanel/bin/apache_conf_distiller --update
    You would then need to rebuild Apache and restart it:

    Code:
    /scripts/rebuildhttpdconf
    /etc/init.d/httpd restart
    Prior to making any of these changes, please make a backup copy of httpd.conf file:

    Code:
    cp /usr/local/apache/conf/httpd.conf /usr/local/apache/conf/httpd.conf.bak120205
     
  4. JayFromEpic

    JayFromEpic Well-Known Member

    Joined:
    Apr 2, 2011
    Messages:
    204
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Scottsdale, AZ
    cPanel Access Level:
    Root Administrator
    If you are just a website owner, I highly suggest you contact a Server Administration company to do this for you. When changing the settings of Apache, it is extremely easy to mess it up and cause all of the websites on the server to go down.

    For one, once you make these changes to the apache config file, simply recompile it apache. Your best bet is to simply look over the official installation file for apache at Compiling and Installing - Apache HTTP Server.

    You can also try Easy Apache located in WHM but im not entirely sure if it will overwrite any configuration changes.
     
  5. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    Without root access, this user couldn't have edited Apache configuration as was being mentioned in their initial post. Linking to the installation instructions for Apache outside of the cPanel system could potentially break this user's server if they do have root access.

    My reply would be the correct way to edit httpd.conf and retain changes under cPanel system. The distiller works to maintain changes outside the VirtualHost section.
     
  6. St493r

    St493r Member

    Joined:
    Feb 5, 2012
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Website Owner
    I have root access and this code is httpd.conf :

    <Directory "/">
    Options -ExecCGI -FollowSymLinks -Includes -IncludesNOEXEC -Indexes -MultiViews +SymLinksIfOwnerMatch
    AllowOverride All
    </Directory>


    but automaticly +SymLinksIfOwnerMatch change to -SymLinksIfOwnerMatch and all web sites got 403 forbidden error !

    regards
     
  7. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    I am unable to get the distiller to allow that specific portion to update with the settings you've noted. You are probably going to have to copy /var/cpanel/templates/apache2/main.default to /var/cpanel/templates/apache2/main.local and then revise this portion:

    Code:
    <Directory "[% main.maindirectory.item.directory %]">
        Options [% main.directory.options.item.options %]
        AllowOverride [% main.directory.allowoverride.item.allowoverride %]
    </Directory>
    Simply change to the following:

    Code:
    <Directory "[% main.maindirectory.item.directory %]">
    Options -ExecCGI -FollowSymLinks -Includes -IncludesNOEXEC -Indexes -MultiViews +SymLinksIfOwnerMatch
    AllowOverride All
    </Directory>
    At that point, re-run "/scripts/rebuildhttpdconf" and see if the changes show up there. If they do, try restarting Apache. If you have issues with the change, you would have to move main.local out of the way to get the regular main.default file to load again with another "/scripts/rebuildhttpdconf" command.

    Please ensure that backup copy of httpd.conf is created prior to making these changes.
     
  8. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,446
    Likes Received:
    195
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    Just out of curiosity, whats the purpose behind changing this to use - instead of + like you're hoping to do?

    In WHM > Service Configuration > Apache Configuration > Global Configuration, Directory “/” Options, you can check or uncheck these options and save. In doing so httpd.conf is rebuilt, Apache restarted and these values are added or removed from httpd.conf

    They are not changed from - to + or visa versa, so I'm curious of the need for the - instead of the +
     
  9. St493r

    St493r Member

    Joined:
    Feb 5, 2012
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Website Owner
    Thanks

    I do all items but automaticly +SymLinksIfOwnerMatch change to -SymLinksIfOwnerMatch yet !!!
     
  10. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,446
    Likes Received:
    195
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    if I leave all variables set to the cPanel marked Defaults and save/rebuild, this section of httpd.conf looks like this:

    Code:
    <Directory "/">
        Options ExecCGI FollowSymLinks IncludesNOEXEC Indexes SymLinksIfOwnerMatch
        AllowOverride All
    </Directory>
    If I uncheck SymLinksIfOwnerMatch save/rebuild I end up with this instead:

    Code:
    <Directory "/">
        Options ExecCGI FollowSymLinks IncludesNOEXEC Indexes
        AllowOverride All
    </Directory>
    Reading this I don't understand what you're hoping to do:
    Apache Performance Tuning - Apache HTTP Server

    ..so wanted to ask to have you clarify a bit more if possible to better understand the need in whatever it is you're hoping for here.
     
  11. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    It doesn't change to - if you use the steps I've noted. I tested what I suggested prior to providing my reply. If you truly do need the options you've mentioned with + or - for them, then have you tried what I suggested above yet?
     
Loading...

Share This Page