Login/Register

Automation API: Sample to automatically install Joomla as each control panel account is created (command-line interface)

Introduction

Provided here is sample code that will use the control panel's "hook" system to automatically install a copy of Joomla to the joomla sub-directory of each account created. A randomized password is used for the install's admin login, and the account owner will be emailed the login information for the new install.

With minimal programming knowledge this sample can be modified and expanded on to handle installing different applications or multiple applications. This possibilities are endless.

Note: The single-domain free version will not work with this automation method. Please test with a 45-day trial license or a paid license.

cPanel setup instructions

Copy-and-paste the below code to the /usr/local/cpanel/scripts/postwwwacct file on the server. If the file already exists, the code below likely can be appended to the file.

#!/usr/bin/perl
sleep 10;
my %OPTS = @ARGV;
system(
	"/usr/local/installatron/installatron".
	" --install".
	" --application joomla".
	" --language es".
	" --user $OPTS{'user'}".
	" --url http://$OPTS{'domain'}/joomla"
);

Next, ensure the /usr/local/cpanel/scripts/postwwwacct file is chmod 0755 to allow it to be executed.

That's it! The next account created through WHM will automatically install a copy of Joomla.

DirectAdmin setup instructions

Copy-and-paste the below code to the /usr/local/directadmin/scripts/custom/user_create_post_confirmed.sh file on the server. If the file already exists, the code below likely can be appended to the file.

#!/bin/sh
echo sleep 20;/usr/local/installatron/installatron --install --application joomla --user $username --cp-password 'ADMINS_PASSWORD' --url http://$domain/joomla >> /var/installatron/logs/autoinstall_log | at now

To enable DirectAdmin API communication, replace the ADMINS_PASSWORD value with the main admin's login password.

Finally, ensure the /usr/local/directadmin/scripts/custom/user_create_post_confirmed.sh file is chmod 0755 to allow it to be executed.

That's it! The next account created will automatically install a copy of Joomla.

Support

Support is readily available. We can answer any questions and even assist with your modifications.

https://installatron.com/tickets

© 2004 - 2023 Installatron LLC. All rights reserved. Privacy Policy.