Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 11 of 11
  1. #1
    Member
    Join Date
    Feb 2012
    Posts
    6
    cPanel/Enkompass Access Level

    Website Owner

    Default Problem with Apache Configuration File !

    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. #2
    Member
    Join Date
    Feb 2012
    Posts
    6
    cPanel/Enkompass Access Level

    Website Owner

    Default Re: Problem with Apache Configuration File !

    Any one?! ....

  3. #3
    cPanel Staff cPanelTristan's Avatar
    Join Date
    Oct 2010
    Location
    somewhere over the rainbow
    Posts
    6,305
    cPanel/Enkompass Access Level

    Root Administrator

    Default Re: Problem with Apache Configuration File !

    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
    cPResources: Support Options | More Support Options | Forums Search | cPanel.net Site Search | Mailing Lists(Alt) | Docs
    -- Tristan, Forums Technical Analyst, cPanel Tech Support

    Submit a ticket | Check an existing ticket

  4. #4
    Member JoshDylan's Avatar
    Join Date
    Apr 2011
    Location
    Michigan
    Posts
    163
    cPanel/Enkompass Access Level

    Root Administrator

    Default Re: Problem with Apache Configuration File !

    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.
    ~ Joshua @JoshuaDubinsky
    Check out my site - JoshDylan.com

  5. #5
    cPanel Staff cPanelTristan's Avatar
    Join Date
    Oct 2010
    Location
    somewhere over the rainbow
    Posts
    6,305
    cPanel/Enkompass Access Level

    Root Administrator

    Default Re: Problem with Apache Configuration File !

    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.
    cPResources: Support Options | More Support Options | Forums Search | cPanel.net Site Search | Mailing Lists(Alt) | Docs
    -- Tristan, Forums Technical Analyst, cPanel Tech Support

    Submit a ticket | Check an existing ticket

  6. #6
    Member
    Join Date
    Feb 2012
    Posts
    6
    cPanel/Enkompass Access Level

    Website Owner

    Default Re: Problem with Apache Configuration File !

    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. #7
    cPanel Staff cPanelTristan's Avatar
    Join Date
    Oct 2010
    Location
    somewhere over the rainbow
    Posts
    6,305
    cPanel/Enkompass Access Level

    Root Administrator

    Default Re: Problem with Apache Configuration File !

    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.
    cPResources: Support Options | More Support Options | Forums Search | cPanel.net Site Search | Mailing Lists(Alt) | Docs
    -- Tristan, Forums Technical Analyst, cPanel Tech Support

    Submit a ticket | Check an existing ticket

  8. #8
    cPanel Product Evangelist Infopro's Avatar
    Join Date
    May 2003
    Location
    Pennsylvania
    Posts
    7,894
    cPanel/Enkompass Access Level

    Root Administrator

    Default Re: Problem with Apache Configuration File !

    Quote Originally Posted by St493r View Post
    Hi

    When I want to change apache configuration , Example change , +indexes to -indexes
    ...
    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. #9
    Member
    Join Date
    Feb 2012
    Posts
    6
    cPanel/Enkompass Access Level

    Website Owner

    Default Re: Problem with Apache Configuration File !

    Thanks

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

  10. #10
    cPanel Product Evangelist Infopro's Avatar
    Join Date
    May 2003
    Location
    Pennsylvania
    Posts
    7,894
    cPanel/Enkompass Access Level

    Root Administrator

    Question Re: Problem with Apache Configuration File !

    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. #11
    cPanel Staff cPanelTristan's Avatar
    Join Date
    Oct 2010
    Location
    somewhere over the rainbow
    Posts
    6,305
    cPanel/Enkompass Access Level

    Root Administrator

    Default Re: Problem with Apache Configuration File !

    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?
    cPResources: Support Options | More Support Options | Forums Search | cPanel.net Site Search | Mailing Lists(Alt) | Docs
    -- Tristan, Forums Technical Analyst, cPanel Tech Support

    Submit a ticket | Check an existing ticket

Similar Threads & Tags
Similar threads

  1. Replies: 1
    Last Post: 05-26-2011, 03:38 PM
  2. Replies: 6
    Last Post: 03-02-2010, 03:48 AM
  3. Problem with apache configuration
    By mikesta in forum New User Questions
    Replies: 0
    Last Post: 08-11-2009, 04:24 AM
  4. Replies: 2
    Last Post: 11-09-2004, 06:50 AM
  5. whm/apache configuration?..problem
    By bigpy2003 in forum cPanel and WHM Discussions
    Replies: 6
    Last Post: 02-27-2004, 03:15 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube