Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

SOLVED Modify apache config file directly

Discussion in 'Workarounds and Optimization' started by gentlemedia, Jul 20, 2017.

  1. gentlemedia

    gentlemedia Member

    Joined:
    Jul 15, 2017
    Messages:
    11
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    Greece
    cPanel Access Level:
    Root Administrator
    Hi,

    I need to add the following to my apache config file:

    Code:
    <Directory /path/to/your/home/public_html/>
        Options FollowSymLinks MultiViews Includes Indexes
        AllowOverride All
        Require all granted
    </Directory>
    I have 2 questions regarding this
    1. How do I figure out what the full path is to my public_htme folder
    2. In which config file do I add this block?
    The 2nd question I think I do already know the answer, but I'd like to get this confirmed. For the record I have WHM/cPanel on CentOS 7.

    I have read the docs about the risks when modifying httpd.conf directly
    Advanced Apache Configuration - EasyApache - cPanel Documentation

    When I opened the httpd.conf file with nano /usr/local/apache/conf/httpd.conf I read a comment at the WHM/cPanel comment section that is not mentioned in the documentation. The steps in the documentation to modify it directly are more complex than what the comment says.
    When I open that file with nano it is completely empty, so can I just add my modifications in this file, restart Apache and be done with it? :)
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  2. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    44,749
    Likes Received:
    1,884
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello,

    The default path to the public_html directory is the following by default:

    Code:
    /home/$username/public_html/
    You'd replace "$username" with the username of the cPanel account the domain name is associated with. As far as setting up that entry for a specific domain name, you can follow the steps and examples outlined on the following document:

    Modify Apache Virtual Hosts with Include Files - EasyApache 4 - cPanel Documentation

    These are older instructions for use with EasyApache 3. The updated document for EasyApache 4 is available at:

    Advanced Apache Configuration - EasyApache 4 - cPanel Documentation

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. gentlemedia

    gentlemedia Member

    Joined:
    Jul 15, 2017
    Messages:
    11
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    Greece
    cPanel Access Level:
    Root Administrator
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
    cPanelMichael likes this.
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice