AutoSSL & different DocumentRoot

iBotPeaches

Registered
Jan 11, 2011
2
0
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.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,883
2,256
463
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.
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.
 
  • Like
Reactions: iBotPeaches

dnavarrojr

Member
Feb 13, 2014
19
1
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.
 
Last edited: