Is it possible to change the location / path of the cpanel account to another directory?

Does anyone know how to change the location / path of a cpanel account using PHP?

Basically, it will have a multi-brand store with SSL certificates, and we want this to point to a single location / directory in the root directory.

I was able to achieve this with a little tweak in the httpd.conf file, but we want to automate this and have a php plugin.

Any idea?

Note. We have dedicated servers, and this is possible + verified.

Maybe using cPanel API or something else?

+4
source share
2 answers

I know nothing but setting up the httppd.conf file. However, perhaps you could create a script account creation that connects to the cpanel account setup. You can view documents in WHM. I believe that you will be after the postwwacct script.

http://docs.cpanel.net/twiki/bin/view/SoftwareDevelopmentKit/WebHome

I'm not sure if you are trying to move them to root if you do not have disk partitions configured in such a way that the home directory will not work, but perhaps using a mount point / file system link for this account will do the trick.

0
source

You can do it through the CPanel API. Look at this as a starting point https://documentation.cpanel.net/display/SDK/Guide+to+the+LiveAPI+System

And using PHP over the API functions, you can make changes to the location / path to the account, similar to how it is done through WHM using the "Home" Account Functions "Reorder the account ... But this is only if you have more one section, for other methods, since Joe Meyer said just tweak httpd.conf or use symbolic links to redirect folders and files (which is the most unsafe method) ...

0
source

Source: https://habr.com/ru/post/1439015/


All Articles