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.

How to properly Enable AllowOverride All for default dir of /usr/local/apache/htdocs/

Discussion in 'General Discussion' started by BrianLayman, Mar 19, 2015.

  1. BrianLayman

    BrianLayman Member

    Joined:
    Aug 3, 2009
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    I would like to have a .htaccess file in
    /usr/local/apache/htdocs/

    The reason I want to do this is that I have a client that has a contest going on with dozens of hidden locations on their server. If people go to https urls, they get sent to the 404 page for the default vhost.

    So I want to turn on AllowOverride and redirect traffic back to the correct domain under the correct url.

    For now I've edited httpd.conf directly, but I want the changes to stick. I've tried creating a main.local but apparently did not edit the correct location. For a rebuild and restart didn't produce the desired effect.

    Where is the correct place to edit?
     
    #1 BrianLayman, Mar 19, 2015
    Last edited: Mar 19, 2015
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello,

    Could you let us know the specific changes you are making?

    Thank you.
     
  3. BrianLayman

    BrianLayman Member

    Joined:
    Aug 3, 2009
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    Of course.
    I changed:

    <Directory "/usr/local/apache/htdocs">
    Options All
    AllowOverride None
    Require all granted
    </Directory>

    to:

    <Directory "/usr/local/apache/htdocs">
    Options All
    AllowOverride All
    Require all granted
    </Directory>

    How do I make that persistent? & is there any reason why that is a bad idea?
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Have you tried directly editing /usr/local/apache/conf/httpd.conf and preserving the changes with the distiller? EX:

    Code:
    /usr/local/cpanel/bin/apache_conf_distiller --update
    Let us know if that helps.

    Thank you.
     
Loading...

Share This Page