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!

AutoSSL & different DocumentRoot

Discussion in 'Security' started by iBotPeaches, Jun 21, 2017.

  1. iBotPeaches

    iBotPeaches Registered

    Joined:
    Jan 11, 2011
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    51
    Whether by mistake or not. I chose the best route for hosting a variety of applications, by simply dropping include files into `etc/apache2/conf.d/userdata` changing the DocumentRoot for most of my sites.

    When AutoSSL runs, it drops these challenge files into the regular `/home/$user/public_html`. I think I can probably work around this using mod_alias and some additional rules, but before I make things more complicated I'm wondering if there is another option here that would allow AutoSSL to work while maintaining different DocumentRoots.
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    43,660
    Likes Received:
    1,787
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    The proper method to modify the document root is to update the "documentroot" value in the file corresponding to the domain name in the following directory:

    /var/cpanel/userdata/$username/


    Then, run the following command:

    Code:
    /scripts/rebuildhttpdconf
    This should allow AutoSSL to detect the correct document root during the validation process.

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
    iBotPeaches likes this.
  3. dnavarrojr

    dnavarrojr Member

    Joined:
    Feb 13, 2014
    Messages:
    19
    Likes Received:
    1
    Trophy Points:
    3
    cPanel Access Level:
    Root Administrator
    I would also add that you need to make sure you edit both the $domain.conf and $domain_SSL.conf files. Also, you have to restart Apache.

    This should really be a setting in cPanel. Allow us to put the primary domain in the same folder where the addon and subdomain folders go.
     
    #3 dnavarrojr, Nov 30, 2017
    Last edited: Nov 30, 2017
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