I’m on the lookout for a solution to automate the creation of a brand new area, together with a Lets Encrypt SSL, and a replica of the principle Database – all from a single PHP script..
For the time being, once we get a brand new consumer, I log into SSH and run this….
plesk bin area -c mynewdomain.com -webspace-name mywebspace.com -dns false -mail_service false -www-root httpdocs && plesk bin extension --exec letsencrypt cli.php -d mynewdomain.com -m firstname.lastname@example.org && MYSQL_PWD=`cat /and so on/psa/.psa.shadow` mysqldump -u admin default_database > /tmp/default_db_tmp.sql && plesk bin database -c new_database -domain mywebspace.com -type mysql && MYSQL_PWD=`cat /and so on/psa/.psa.shadow` mysql -u admin new_database < /tmp/default_db_tmp.sql However ideally I would really like it to run routinely.
I’ve tried working it in an exec() command, tried getting round numerous permissions points, and likewise run into a difficulty the place nginx or apache restarts when a brand new area is added – however im not getting anyplace.
Has anybody managed to do that?
I am on Ubuntu 18.04 MariaDB