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!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

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:
    15
    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? :)
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,658
    Likes Received:
    1,425
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    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.
     
  3. gentlemedia

    gentlemedia Member

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

Share This Page