Automating script installation
Good evening,
I'm glad I joined the cPanel community :) So, here's my "little" problem:
I own a VPS which has several parked domains in different dirs. One of these domains needs a script which installs automatically an application package when a new user is created in cPanel in his own space.
So, the main script is installed in /usr/shared/app_name
As far as I understood, I can make a postwwwacct script in cpanel /scripts dir which takes the arguments from cPanel when the account is created, and includes the install.php from the /usr/shared/app_name
My problem is that the installation is only for one of the domains - not all... And the app_name symlinks the user dir (/home/username) to that user dir
In the postwwwacct I think I can run the install - or not - if I detect the right domain.
Is this the easy way of doing it?
Also, I would like very much to know if - regarding the cPanel API - I can simply call it from any domain, and how to give an user the permissions to call a root dir, like /usr/shared/app_name for instance.
Any sugestions - previous experiences - are welcomed :)
Clear skies,
Kepler
-
Hello, You can setup a post-stage hook that runs immediately after an account is created. You can read more about how hooks work at: My problem is that the installation is only for one of the domains - not all... And the app_name symlinks the user dir (/home/username) to that user dir
Have you verified this works when you set it up manually? We typically recommend avoiding those types of symbolic links, and instead recommend creating individual directories for each account. Thank you.0 -
Good afternoon, I created allready a php which creates automatically an account in whm with a cpanel account. Now I'm trying to do the same, but regarding a particular app from Softaculous, without the user having to do it. I found this code: login = ' = 'domain.com'; // OPTIONAL - By Default the primary domain will be used $new->data['softdirectory"> = 'folder'; // OPTIONAL - By default it will be installed in the /public_html folder $new->data['admin_pass"> = 'qwerty'; //root password $new->data['admin_email"> = 'admin@domain.com'; $res = $new->install(26); // Will install WordPress if($res == 'installed'){ echo 'Installed'; }else{ echo $res; // A serialized array of error will be returned } But I have 3 questions: 1) Does the script requires the include('/usr/local/cpanel/whostmgr/docroot/cgi/softaculous/sdk/installapi.php'); ? 2) Will the app be installed automatically, or must the user/root login to cPanel? 3) Is data['softdomain"> the 'username.domain.com', and the data['admin_pass"> the root password? Kind regards, Kepler 0 -
Hello, These questions are related to the Softacoulous API itself and are better answered by their support team. Here's a link to their API documentation and support page: Auto Install API - Softaculous Wiki Softaculous Support Centre Thank you. 0
Please sign in to leave a comment.
Comments
3 comments