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.

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:
    41,396
    Likes Received:
    1,606
    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.
     
    iBotPeaches likes this.
  3. dnavarrojr

    dnavarrojr Member

    Joined:
    Feb 13, 2014
    Messages:
    18
    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