4

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

Basically will have a multi-brand store with SSL certs and we want this pointed to one location/directory in root.

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

Any idea?

Note: We have dedicated servers and it's possible + tested.

Maybe with the help of cPanel API or something?

2 Answers2

0

I'm not aware of anything other than tweaking the httppd.conf file. However, perhaps you could build a post account creation script that hooks into the cpanel account setup. You can view the docs on WHM. I believe you will be after the postwwwacct script.

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

I'm not sure your reasoning for moving these to root, unless you have disk partitions set up in such a way that the home directory won't do, but perhaps using a filesystem junction point / link to that account folder would do the trick.

Joe Meyer
  • 4,315
  • 20
  • 28
0

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

And with PHP over API functions you can make changes to account location/path similar as you would do that through WHM with Home »Account Functions »Rearrange an Account... But that is only if you have more then one partition. For other methods as Joe Meyer said only tweak httpd.conf or use simbolic links to redirect folders and files (which is most unsecure method)...

Sasa Bajic
  • 113
  • 1
  • 6