Addon / Subdomain skeleton files revisited

Metro2

Well-Known Member
May 24, 2006
574
94
178
USA
cPanel Access Level
Root Administrator
Since we can't seem to reply to the original thread at Addon/Subdomain skeleton files , I'm hoping that maybe we can find some more people to vote / chime-in on this feature request - https://features.cpanel.net/topic/skeleton-directory-for-addon-and-sub-domains

Or maybe even see if cPanel will still consider publishing the guide that benny mentioned in the comments. Being able to have custom files auto-populate newly created Addon Domains and Subdomains just like how it works for master domain / accounts would be incredibly helpful to us shared hosting providers on many levels. Not to mention cut down on unnecessary addons / subs sitting there with nothing in them, and also let us provide an instant notice alerting users to wait for AutoSSL to complete before they go install WordPress or something without the https (which leads to them wondering why they have mixed-content issues once the SSL kicks-in). There's a huge list of reasons that having a skeleton files option for Addons / Subdomains would be of great purpose.

Please consider voting - https://features.cpanel.net/topic/skeleton-directory-for-addon-and-sub-domains - thanks!
 
Last edited by a moderator:

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
12,499
1,971
363
cPanel Access Level
Root Administrator
Hey there! I like this idea as well, and just added my vote. It might be worth reviewing the following details as well for more details on the hook system if you're interested in exploring that:

 
  • Like
Reactions: Metro2

Metro2

Well-Known Member
May 24, 2006
574
94
178
USA
cPanel Access Level
Root Administrator
Thank you for the reply @cPRex

If you read down through the comments at https://features.cpanel.net/topic/skeleton-directory-for-addon-and-sub-domains , you'll see that I'm not the only one who hasn't had much experience / time with standardized hooks (or just aren't comfortable experimenting) and that we were all hoping for either the feature request to happen or for the "guide" that cPanel Benny mentioned. It's been a couple years now since that was mentioned, so I was hoping to get some momentum one way or the other.
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
12,499
1,971
363
cPanel Access Level
Root Administrator
I did see there were other comments in that feature request, but as of this point we don't have a specific guide for this work. In order to create such a guide we would need to write a custom script, which is something we try and avoid on our end as much as possible as we'd hate to be responsible for something going wrong on your system - either now, or in the future when/if an update changes that behavior.

It might be best to work with an admin that is familiar with the hook script tools, as one could be found at System Administration Services
 

Metro2

Well-Known Member
May 24, 2006
574
94
178
USA
cPanel Access Level
Root Administrator
I've noticed that cPanel has recently started automatically populating new Addon Domains with the following skeleton files:

400.shtml
401.shtml
403.shtml
404.shtml
413.shtml
500.shtml
cp_errordocument.shtml

However, they're the "default" system generates ones, not the custom ones I have in my /root/cpanel3-skel/public_html and there is no blank index.html file (something I have in /root/cpanel3-skel/public_html purposely so that when an Addon Domain is created, it's folder is not sitting there openly visible to people and bots).

If cPanel could tell us what they put in place / where those files are being generated from for new Addon Domains now, then perhaps we could customize those files and add a custom index file just like the way the /root/cpanel3-skel/public_html functions for the public_html folder of new master account domains.

It feels like we're so close!

Can cPanel please let us know where the new Addon Domain skeleton files are coming from / where they're stored so that we can finally have this long-awaited function?
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
12,499
1,971
363
cPanel Access Level
Root Administrator
@Metro2 - there will be a Tweak Settings option to allow the option of these being created or not in version 9.6.0.5, which is in the Current tier at this time.

These currently get pulled from /usr/local/cpanel/htdocs. Although it's possible these could be overwritten in a future update, I edited the 500.shtml file, created a new account, and my custom version was applied.
 

Metro2

Well-Known Member
May 24, 2006
574
94
178
USA
cPanel Access Level
Root Administrator
Thanks very much for the insight. So it's not the beginning of actual skel for addons and can't put a custom index file in there :( Shoot... had my hopes up.
 
  • Like
Reactions: cPRex

Metro2

Well-Known Member
May 24, 2006
574
94
178
USA
cPanel Access Level
Root Administrator
@Metro2 - there will be a Tweak Settings option to allow the option of these being created or not in version 9.6.0.5, which is in the Current tier at this time.
Sorry to dredge up an old thread, but I must be overlooking something. I don't see this option you were speaking of. Has it been removed or revised?
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
12,499
1,971
363
cPanel Access Level
Root Administrator
I'm the latest release we just pushed, which is 106.0.8, and I see the following at the bottom of Tweak Settings:

"Copy default error documents to docroot for new accounts, addon domains, and subdomains"

Are you not seeing that on your machine?
 

Metro2

Well-Known Member
May 24, 2006
574
94
178
USA
cPanel Access Level
Root Administrator
Checking now...

Edit - PS - my servers are showing as 106.0.7 and no notification of .8 being available. Will try upcp
 

Metro2

Well-Known Member
May 24, 2006
574
94
178
USA
cPanel Access Level
Root Administrator
I'm the latest release we just pushed, which is 106.0.8, and I see the following at the bottom of Tweak Settings:

"Copy default error documents to docroot for new accounts, addon domains, and subdomains"

Are you not seeing that on your machine?
cPanel > Upgrade to Latest Version via WHM (without Force reinstall checked) still leaves me at 106.0.7 , just FYI

However, I am seeing that in 106.0.7 now. It's possible I missed it before of course, but I can't be sure. I did scour the entire Tweak Settings section before bumping this thread, and didn't notice it, but could've been just tired eyes.
 

Metro2

Well-Known Member
May 24, 2006
574
94
178
USA
cPanel Access Level
Root Administrator
Unfortunately this function still doesn't work as expected.

For subdomains, it will add the skel shtml error files, but for an Addon Domain (a feature cPanel thought would be cool to take away and make more complicated :confused: for users when it used to be straight-forward) , skel does not populate anything at all.

I don't like to complain about cPanel and I seldom do, but the new "all in one stop shop" for domains is non-intuitive, confuses users into adding new domains to their existing master root public_html, and still cannot do something as simple as putting our skel files there. One step up, THREE steps back. Sorry guys, but this sucks worse than Jupiter.
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
12,499
1,971
363
cPanel Access Level
Root Administrator
Thanks for the feedback - just to make sure I'm testing this right:

-create a cPanel & WHM server
-ensure WHM >> Tweak Settings "Copy default error documents to docroot for new accounts, addon domains, and subdomains" is switched to "On" and save the page
-create a new cPanel account
-observe the error pages are put inside public_html

Code:
[[email protected] public_html]# ll
total 48K
drwxr-xr-x  3 cptest2 cptest2 4.0K Oct 26 09:58 .
drwx--x--x 12 cptest2 cptest2 4.0K Oct 26 09:59 ..
-rw-r--r--  1 cptest2 cptest2  229 Oct 26 09:58 400.shtml
-rw-r--r--  1 cptest2 cptest2  207 Oct 26 09:58 401.shtml
-rw-r--r--  1 cptest2 cptest2  203 Oct 26 09:58 403.shtml
-rw-r--r--  1 cptest2 cptest2  204 Oct 26 09:58 404.shtml
-rw-r--r--  1 cptest2 cptest2  216 Oct 26 09:58 413.shtml
-rw-r--r--  1 cptest2 cptest2  243 Oct 26 09:58 500.shtml
drwxr-xr-x  2 cptest2 cptest2 4.0K Oct 26 09:58 cgi-bin
-rw-r--r--  1 cptest2 cptest2  11K Oct 26 09:58 cp_errordocument.shtml
-create an addon domain under our new account
-observe those files are placed there too - notice the change in path:

Code:
[[email protected] addontest.com]# ll
total 48K
drwxr-xr-x  3 cptest2 cptest2 4.0K Oct 26 10:01 .
drwx--x--x 13 cptest2 cptest2 4.0K Oct 26 10:01 ..
-rw-r--r--  1 cptest2 cptest2  229 Oct 26 10:01 400.shtml
-rw-r--r--  1 cptest2 cptest2  207 Oct 26 10:01 401.shtml
-rw-r--r--  1 cptest2 cptest2  203 Oct 26 10:01 403.shtml
-rw-r--r--  1 cptest2 cptest2  204 Oct 26 10:01 404.shtml
-rw-r--r--  1 cptest2 cptest2  216 Oct 26 10:01 413.shtml
-rw-r--r--  1 cptest2 cptest2  243 Oct 26 10:01 500.shtml
drwxr-xr-x  2 cptest2 cptest2 4.0K Oct 26 10:01 cgi-bin
-rw-r--r--  1 cptest2 cptest2  11K Oct 26 10:01 cp_errordocument.shtml
Now, for the cpanel3-skel test:

-turn 'Off' the previously mentioned Tweak Settings option:
-create a subdomain
-no files are added to the account:

Code:
[[email protected] sub2.cptest2.com]# ll
total 12K
drwxr-xr-x  3 cptest2 cptest2 4.0K Oct 26 10:08 .
drwx--x--x 16 cptest2 cptest2 4.0K Oct 26 10:08 ..
drwxr-xr-x  2 cptest2 cptest2 4.0K Oct 26 10:08 cgi-bin
That's the intended behavior. This case *only* controls the default files being added or not, and doesn't have anything to do with the data in the skeleton directory being used for sub/addon domains.
 

Metro2

Well-Known Member
May 24, 2006
574
94
178
USA
cPanel Access Level
Root Administrator
OK, I must be overlooking something because...

WHM >> Tweak Settings "Copy default error documents to docroot for new accounts, addon domains, and subdomains" is switched to "On"

copy_default_error_docs_enabled.png

30 minutes ago I created an addon domain under an existing cPanel account.

Default error documents are not added to the /home/user/public_html/example.com new addon domain folder.

addon_domain_not_getting_error_files.png

Only the .well-known folder and .htaccess file are added. (No cgi-bin folder because I don't have CGI Access enabled for that package).

I can't figure out what I'm doing wrong or overlooking here.

Edit - PS - same results when adding a subdomain such as dev.example.com . No error doc files.
 
Last edited: