Hello,
A reseller customer wants to install for students an account with a default installation of Wordpress ?
Any idea on how to do that ?
Thanks a lot,
Francois
Hello,
A reseller customer wants to install for students an account with a default installation of Wordpress ?
Any idea on how to do that ?
Thanks a lot,
Francois
Get your reseller to put the contents of the wordpress install in the "cpanel3-skel" folder, you will find it in his accuonts root![]()
Hello,
Thanks for your answer,
But this won't install the database of wordpress. I would like a site ready to be used with something like admin, admin the default pass.
Thanks,
Francois
you should put the wordpress files in the cpanel3-skel as was suggested below, then you can make a script called "/scripts/postwwwacctuser" which cpanel executes after creating a new user account... in there you can run whatever you want.. the configuration below is simple and just runs an external "addwordpress" script.
in the addwordpress script, create a database user and database for this account:
I have NOT tested the below, but I grabbed some code from the cpanel scripts and I reasonably believe this should do what you want.. if you find you need to tweak it... post your modifications back here for people
--also, you may want to add some checks in postwwwacctuser to make sure this account SHOULD have the wordpress db created, otherwise, you'll be creating this for every new account. (if you use /scripts/postwwacct instead of postwwwacctuser, you get more information including, I believe, the reseller, so you can put in a check for that and just add the wordpress for particular reseller accounts)
/scripts/postwwwacctuser:
#!/bin/sh
/scripts/postwwwacctuser $1
/scripts/addwordpress:
#!/bin/sh
#
# this will create a DB user similar to: username_wordpress with the
# admin user: username_wpadmin with password: admin
# this naming convention is required in order for the user to properly use
# phpmyadmin and for cpanel to manage the proper databases when backing
# up and deleting users
#
user=$1;
hostname=`hostname`;
if [ -e "/usr/bin/mysql" ]; then
mysql='/usr/bin/mysql'
mysqladmin='/usr/bin/mysqladmin'
else
mysql='/usr/local/bin/mysql'
mysqladmin='/usr/local/bin/mysqladmin'
fi
/scripts/mysqladduserdb $user_wpadmin 'admin'
$mysqladmin-u root <<END_OF_DATA
create database $user_wordpress
GRANT ALL ON $user_wordpress.* TO $user_wpadmin@localhost
GRANT ALL ON $user_wordpress.* TO $user_wpadmin@$hostname
END_OF_DATA
$mysqladmin -u root reload <<EOM
EOM