how to get document root of every domain
Hi, due to many records in apache error log (for example cant find 404.shtml in a site's doc root) i've added 403,404 etc files in cpanel3-skel folder for new accounts and i want to write a script that will copy the same files to existing domains.
So i will :
1. read the server's domains/subdomains/addondomains
2. find the owner in order to chmod the files after the copy
3. read the document root for every domain
4. copy and chmod the files
I can get the domains in a server and the owner by reading /etc/userdomains
I cant find a file that contains the document root for the addon domains (or subdomains).
Even though there are files in /var/cpanel/userdata/USERNAME/DOMAIN where i can extract the doc_root for the main domain very simple, the addon and subdomains files are not in the form of ADDONDOMAIN but in the form of ADDONDOMAIN.MAINDOMAIN, which makes the script difficult to build.
are any other files that i can extract the document root of domains/subdomains/addondomains by knowing the domain/subdomain/addodomain name and the user that owns it?
thank you in advance,
-
Hello, You may find the following WHM API 1 function helpful for this purpose: WHM API 1 Functions - domainuserdata - Software Development Kit - cPanel Documentation Thank you. 0
Please sign in to leave a comment.
Comments
1 comment