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.

apache includes editor

Discussion in 'EasyApache' started by jimlongo, Jan 2, 2013.

  1. jimlongo

    jimlongo Well-Known Member

    Joined:
    Mar 20, 2008
    Messages:
    145
    Likes Received:
    2
    Trophy Points:
    18
    Hi, I have an account on which I have a lot of addons and subdomains, and for organization I want to have the main domain in a subfolder of public_html.

    I can do this by editing httpd.conf and changing the line in that section from this
    Code:
    <VirtualHost xx.xx.137.162:80>
        ServerName xyz.com
        ServerAlias www.xyz.com
        DocumentRoot /home/xyz/public_html/
    . . .

    to this
    Code:
    <VirtualHost xx.xx.137.162:80>
        ServerName xyz.com
        ServerAlias www.xyz.com
        DocumentRoot /home/xyz/public_html/xyz

    But I understand I should do this in the WHM Apache includes editor instead of directly in the httpd.conf file.

    My question is which include file, and what exactly do I put in there. Do I add the whole Virtual Host section with changes?

    Thanks,
    jim
     
  2. hgrg

    hgrg Well-Known Member

    Joined:
    Oct 4, 2010
    Messages:
    90
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Root Administrator
    you need to edit httpd conf and then 'distill' the changes..
     
  3. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    653
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    You can change the document root path in the cPanel user data file for the domain name. This is located at:

    Code:
    /var/cpanel/userdata/$username/$domain.com
    Look for "documentroot:" and modify it to the new path. Then, save the file and rebuild the Apache configuration file:

    Code:
    # /scripts/rebuildhttpdconf
    Thank you.
     
  4. jimlongo

    jimlongo Well-Known Member

    Joined:
    Mar 20, 2008
    Messages:
    145
    Likes Received:
    2
    Trophy Points:
    18
    Thank you.

    Do I need to change the scriptalias path: as well.
     
  5. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    653
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    You only need to change that if the cgi-bin will be utilized in a different location than what's configured by default.

    Thank you.
     
Loading...

Share This Page