Plesk basic command line functions
Here's a list of helpful and time saving commands for Parallels Plesk Panel administrators who want to manage the Plesk server and its configuration locally using command line utilities.
The command line utilities for Linux/Unix are located in the /usr/local/psa/bin
directory on the Parallels Plesk Panel server.
To run a utility from any directory, use the following command line format:
$ /usr/local/psa/bin/[utility name] [options] [parameters]
or with a shortcut:
$ plesk [s]bin [utility name] [options] [parameters]
Basic commands
Show admin password:
$ plesk bin admin --show-password
Change Plesk admin password:
$ plesk bin init_conf -u -passwd [new_password]
Setup a new customer:
$ /usr/local/psa/bin/./customer --create username \ -name 'name' -passwd 'password' -country UK -phone 123456 -email user@domain.com
Setup a new domain
$ /usr/local/psa/bin/./subscription --create domain.com \ -owner 'user' -service-plan 'somehostingplan' -login user -passwd 'password' -ip x.x.x.x
Reinstall current patch:
$ /usr/local/psa/admin/sbin/autoinstaller --select-release-current \ --reinstall-patch --install-component base
MySQL
Show database admin password:
$ cat /etc/psa/.psa.shadow
Log into MySQL:
$ mysql -uadmin -p`cat /etc/psa/.psa.shadow`
Change log rotation properties:
$ mysql -uadmin -p`cat /etc/psa/.psa.shadow` psa -Ns \ -e "select name from domains" | xargs -I {} /usr/local/psa/bin/./site \ -u {} -log_bysize 10M \ -log-max-num-files 2
Show mail passwords:
$ /usr/local/psa/admin/sbin/mail_auth_view
Create or update mail account:
$ /usr/local/psa/bin/./mail --create/update email@domain.com -passwd somepass -mailbox true
Rebuild mail configuration.
$ /usr/local/psa/admin/sbin/mchk --with-spam
Webserver
Rebuild webserver configuration:
$ /usr/local/psa/admin/bin/httpdmng --reconfigure-all
Rebuild web configuration for a single domain:
$ /usr/local/psa/admin/bin/websrvmng --reconfigure-vhost --vhost-name=domain.com