### Run Vesta Installation Script Source: https://vestacp.com/docs/how-to-install-vesta-control-panel Execute the downloaded installation script to begin the Vesta Control Panel setup. ```bash bash vst-install.sh ``` -------------------------------- ### Enable and Start ProFTPD Service Source: https://vestacp.com/docs/how-to-replace-vsftpd-with-proftpd-on-a-rhel-or-centos Enable the ProFTPD service to start on boot and then start the service immediately. ```bash chkconfig proftpd on service proftpd start ``` -------------------------------- ### Start PostgreSQL Server Source: https://vestacp.com/docs/how-to-set-up-postgresql-on-a-rhel-or-centos Starts the PostgreSQL database server service. ```bash service postgresql start ``` -------------------------------- ### Install Fail2Ban Package Source: https://vestacp.com/docs/how-to-install-fail2ban-on-debian-or-ubuntu Installs the Fail2Ban package using apt-get. This is the initial step for setting up Fail2Ban. ```bash apt-get install fail2ban ``` -------------------------------- ### Start Percona Server Source: https://vestacp.com/docs/how-to-replace-mysql-with-percona-server-on-rhel-or-centos Starts the Percona Server service. The service is typically named 'mysql'. ```bash service mysql start ``` -------------------------------- ### Launch Fail2Ban Service Source: https://vestacp.com/docs/how-to-install-fail2ban-on-debian-or-ubuntu Configures Fail2Ban to start on boot and then starts the Fail2Ban service. This activates Fail2Ban's protection. ```bash update-rc.d fail2ban defaults service fail2ban start ``` -------------------------------- ### Install Percona Server Packages Source: https://vestacp.com/docs/how-to-replace-mysql-with-percona-server-debian-or-ubuntu Install the Percona Server packages. Do not change the root password when prompted. ```bash apt-get install percona-server-server-5.5 percona-server-client-5.5 ``` -------------------------------- ### Install PostgreSQL Packages Source: https://vestacp.com/docs/how-to-set-up-postgresql-on-a-debian-or-ubuntu Installs the necessary PostgreSQL server and contrib packages, along with the phpPgAdmin web interface. ```bash apt-get install postgresql postgresql-contrib phppgadmin ``` -------------------------------- ### Install PostgreSQL Packages Source: https://vestacp.com/docs/how-to-set-up-postgresql-on-a-rhel-or-centos Installs PostgreSQL, its server components, contrib modules, and phpPgAdmin. Use the --enablerepo=remi flag if the 'remi' repository is enabled. ```bash yum install postgresql postgresql-server postgresql-contrib phpPgAdmin ``` ```bash yum install --enablerepo=remi postgresql postgresql-server postgresql-contrib phpPgAdmin ``` -------------------------------- ### Download Vesta Installation Script Source: https://vestacp.com/docs/how-to-install-vesta-control-panel Download the official Vesta Control Panel installation script using curl. ```bash curl -O https://vestacp.com/pub/vst-install.sh ``` -------------------------------- ### Install Percona Repository Source: https://vestacp.com/docs/how-to-replace-mysql-with-percona-server-on-rhel-or-centos Installs the Percona repository configuration package on RHEL or CentOS systems. ```bash yum install https://www.percona.com/redir/downloads/percona-release/redhat/latest/percona-release-0.1-3.noarch.rpm ``` -------------------------------- ### Start System Service Source: https://vestacp.com/docs Initiates the operation of a specified system service. ```bash v-start-service SERVICE ``` -------------------------------- ### Install fcgid Apache module and enable it Source: https://vestacp.com/docs/how-to-enable-php-fcgi-support-on-a-debian-or-ubuntu Installs the Apache module for FastCGI and enables it. This is a prerequisite for using PHP-FCGI. ```bash apt-get install libapache2-mod-fcgid a2enmod fcgid ``` -------------------------------- ### Install SpamAssassin Source: https://vestacp.com/docs/how-to-install-clamav-and-spamassassin-on-a-debian-or-ubuntu Installs the SpamAssassin spam filtering package, enables the service, and restarts it. ```bash apt-get install spamassassin update-rc.d spamassassin defaults sed -i "s/ENABLED=0/ENABLED=1/" /etc/default/spamassassin service spamassassin restart ``` -------------------------------- ### Install Percona Server Source: https://vestacp.com/docs/how-to-replace-mysql-with-percona-server-on-rhel-or-centos Installs the Percona Server package. Use 'Percona-Server-server-56' for version 5.6 or 'Percona-Server-server-57' for version 5.7. ```bash yum install Percona-Server-server-56 ``` -------------------------------- ### Install ProFTPD Packages Source: https://vestacp.com/docs/how-to-replace-vsftpd-with-proftpd-on-a-debian-or-ubuntu Installs the basic ProFTPD package along with the vroot module, which is necessary for virtual root configurations. ```bash apt-get install proftpd-basic proftpd-mod-vroot ``` -------------------------------- ### Set Percona Server to Auto-start Source: https://vestacp.com/docs/how-to-replace-mysql-with-percona-server-debian-or-ubuntu Configure the Percona Server service to start automatically on system boot. ```bash update-rc.d mysql defaults ``` -------------------------------- ### Install ClamAV Packages and Configuration Source: https://vestacp.com/docs/how-to-install-clamav-and-spamassassin-on-a-rhel-or-centos Installs ClamAV, downloads its configuration files, adds the 'clam' user to necessary groups, updates virus definitions, and enables/starts the ClamAV daemon. ```bash yum install clamd wget http://c.vestacp.com/0.9.8/rhel/clamd.conf -O /etc/clamd.conf wget http://c.vestacp.com/0.9.8/rhel/freshclam.conf -O /etc/freshclam.conf gpasswd -a clam exim gpasswd -a clam mail freshclam chkconfig clamd on service clamd start ``` -------------------------------- ### Install WHMCS Module Source: https://vestacp.com/docs/how-to-install-whmcs-module This command sequence installs the WHMCS module by navigating to the correct directory, creating a new directory for the module, and downloading the module file. ```bash cd /home/user/web/billing-site.ltd/public_html/modules/server mkdir vesta wget http://c.vestacp.com/0.9.8/rhel/whmcs-module.php -O vesta.php ``` -------------------------------- ### Install WSGI Apache Module Source: https://vestacp.com/docs/how-to-enable-wsgi-support-on-a-debian-or-ubuntu Installs the WSGI module for Apache and enables it. Run this command on your Debian or Ubuntu server. ```bash apt-get install libapache2-mod-wsgi a2enmod wsgi ``` -------------------------------- ### Install mod_fcgid Apache Module Source: https://vestacp.com/docs/how-to-enable-php-fcgi-support-on-a-rhel-or-centos Installs the necessary Apache module for FastCGI support using yum. ```bash yum install mod_fcgid ``` -------------------------------- ### Install WSGI Apache Module Source: https://vestacp.com/docs/how-to-enable-wsgi-support-on-a-rhel-or-centos Installs the mod_wsgi package using yum. This is the first step to enable WSGI support. ```bash yum install mod_wsgi ``` -------------------------------- ### Install ProFTPD Package Source: https://vestacp.com/docs/how-to-replace-vsftpd-with-proftpd-on-a-rhel-or-centos Install the ProFTPD package using yum, the default package manager for RHEL and CentOS. ```bash yum install proftpd ``` -------------------------------- ### Install Fail2Ban Package Source: https://vestacp.com/docs/how-to-install-fail2ban-on-rhel-or-centos Use yum to install the Fail2Ban package on RHEL or CentOS systems. ```bash yum install fail2ban ``` -------------------------------- ### Add Percona Repository Source: https://vestacp.com/docs/how-to-replace-mysql-with-percona-server-debian-or-ubuntu Add the Percona repository to your system's sources list to enable package installation. Replace VERSION with your distribution's codename. ```bash deb http://repo.percona.com/apt VERSION main deb-src http://repo.percona.com/apt VERSION main ``` -------------------------------- ### Install ClamAV Daemon Source: https://vestacp.com/docs/how-to-install-clamav-and-spamassassin-on-a-debian-or-ubuntu Installs the ClamAV antivirus daemon, downloads a specific configuration file, adds the 'clamav' user to relevant groups, updates virus definitions, enables the service, and restarts it. ```bash apt-get install clamav-daemon wget http://c.vestacp.com/0.9.8/ubuntu/clamd.conf -O /etc/clamav/clamd.conf gpasswd -a clamav mail gpasswd -a clamav Debian-exim freshclam update-rc.d clamav-daemon defaults service clamav-daemon restart ``` -------------------------------- ### Import Percona GPG Key Source: https://vestacp.com/docs/how-to-replace-mysql-with-percona-server-debian-or-ubuntu Import the Percona GPG key to verify package authenticity before installation. ```bash apt-key adv --keyserver keys.gnupg.net --recv-keys 1C4CBDCDCD2EFD2A ``` -------------------------------- ### v-schedule-letsencrypt-domain Source: https://vestacp.com/docs/cli Adds a cron job for Let's Encrypt SSL certificate installation for a domain. Supports USER, DOMAIN, and optional ALIASES. ```APIDOC ## v-schedule-letsencrypt-domain ### Description Adds a cron job for Let's Encrypt SSL certificate installation for a domain. ### Method Not specified (CLI command) ### Parameters #### Path Parameters - **USER** (string) - Required - The username associated with the domain. - **DOMAIN** (string) - Required - The domain for which to schedule certificate installation. - **ALIASES** (string) - Optional - Comma-separated list of domain aliases. ``` -------------------------------- ### Example DNS Records for XMPP Source: https://vestacp.com/docs/how-to-configure-service-records These are example DNS records required for a typical XMPP infrastructure. They include an 'A' record for the server and two 'SRV' records for service auto-detection. ```dns xmpp 18000 IN A 192.168.1.1 _xmpp-client._tcp.example.com. 18000 IN SRV 0 5 5222 xmpp.example.com. _xmpp-server._tcp.example.com. 18000 IN SRV 0 5 5269 xmpp.example.com. ``` -------------------------------- ### Install Custom Nginx Template for Force HTTPS Source: https://vestacp.com/docs/how-to-force-https-ssl-on-a-domain Download and extract the custom Nginx template designed to force HTTPS. This template should be placed in the web templates directory. ```bash cd /usr/local/vesta/data/templates/web wget http://c.vestacp.com/0.9.8/rhel/force-https/nginx.tar.gz tar -xzvf nginx.tar.gz rm -f nginx.tar.gz ``` -------------------------------- ### Get User Value Source: https://vestacp.com/docs Retrieves a specific user parameter by key. ```bash v-get-user-value USER KEY ``` -------------------------------- ### Redirect Wildcard Subdomains to Folders Source: https://vestacp.com/docs/how-to-redirect-subdomain-to-folder-using-htaccess This configuration handles wildcard subdomains, redirecting any subdomain (except 'www') to a folder named after the subdomain. For example, 'blog.domain.com' would be redirected to '/blog/'. Ensure the target directories are created. ```apache RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST} ^(?!www\.)([^.]+)\.domain\.com$ [NC] RewriteCond %{REQUEST_URI}::%1 !^/([^/]+).*?::\1 RewriteRule ^(.*)$ /%1/$1 [L] ``` -------------------------------- ### Create User Account with VestaCP API Source: https://vestacp.com/docs/api This snippet demonstrates how to create a new user account in VestaCP using the API. It requires server credentials and details for the new account. Ensure the cURL extension is enabled in your PHP installation. ```php $vst_username, 'password' => $vst_password, 'returncode' => $vst_returncode, 'cmd' => $vst_command, 'arg1' => $username, 'arg2' => $password, 'arg3' => $email, 'arg4' => $package, 'arg5' => $fist_name, 'arg6' => $last_name ); $postdata = http_build_query($postvars); // Send POST query via cURL $postdata = http_build_query($postvars); $curl = curl_init(); curl_setopt($curl, CURLOPT_URL, 'https://' . $vst_hostname . ':8083/api/'); curl_setopt($curl, CURLOPT_RETURNTRANSFER,true); curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false); curl_setopt($curl, CURLOPT_POST, true); curl_setopt($curl, CURLOPT_POSTFIELDS, $postdata); $answer = curl_exec($curl); // Check result if($answer == 0) { echo "User account has been successfuly created\n"; } else { echo "Query returned error code: " .$answer. "\n"; } ?> ``` -------------------------------- ### Update php-mysqlnd and phpMyAdmin Source: https://vestacp.com/docs/how-to-replace-mysql-with-percona-server-on-rhel-or-centos Installs or updates the php-mysqlnd package and phpMyAdmin, enabling the 'remi' repository. It also restores the phpMyAdmin configuration file and restarts the Apache web server. ```bash yum install php-mysqlnd phpmyadmin --enablerepo=remi mv /etc/httpd/conf.d/phpMyAdmin.conf.rpmsave /etc/httpd/conf.d/phpMyAdmin.conf service httpd restart ``` -------------------------------- ### Add System User Source: https://vestacp.com/docs Creates a new user account on the system. Requires username, password, and email. Optional parameters include package, first name, and last name. ```bash v-add-user USER PASSWORD EMAIL [PACKAGE] [FNAME] [LNAME] ``` -------------------------------- ### List System Configuration Source: https://vestacp.com/docs Retrieves a list of system parameters. The output format can be specified. ```bash v-list-sys-config [FORMAT] ``` -------------------------------- ### Generate API Key Source: https://vestacp.com/docs Creates an API key file in /usr/local/vesta/data/keys/ ```bash v-generate-api-key NONE ``` -------------------------------- ### Download phpPgAdmin Configuration Files Source: https://vestacp.com/docs/how-to-set-up-postgresql-on-a-debian-or-ubuntu Downloads the necessary configuration files for phpPgAdmin, including the main config and Apache configuration. ```bash wget http://c.vestacp.com/0.9.8/debian/pga.conf -O /etc/phppgadmin/config.inc.php wget http://c.vestacp.com/0.9.8/debian/apache2-pga.conf -O /etc/apache2/conf.d/phppgadmin ``` -------------------------------- ### List Databases Source: https://vestacp.com/docs Retrieves parameters for all databases. The output format can be specified. ```bash v-list-database USER DATABASE [FORMAT] ``` -------------------------------- ### Initialize PostgreSQL Database Cluster Source: https://vestacp.com/docs/how-to-set-up-postgresql-on-a-rhel-or-centos Initializes the database cluster for PostgreSQL. This command prepares the data directory for use. ```bash service postgresql initdb ``` -------------------------------- ### List System Services Source: https://vestacp.com/docs/cli Retrieves a list of configured system services. Specify the desired output format. ```bash v-list-sys-services [FORMAT] ``` -------------------------------- ### List User Packages Source: https://vestacp.com/docs/cli Retrieves a list of packages assigned to a user. Specify the desired output format. ```bash v-list-user-package USER [FORMAT] ``` -------------------------------- ### Rebuild Web Domain Configurations Source: https://vestacp.com/docs/how-to-remove-nginx-on-a-rhel-or-centos Iterate through all system users and rebuild their web domain configurations to apply the changes. ```bash for user in $(v-list-sys-users plain); do v-rebuild-web-domains $user; done ``` -------------------------------- ### List Supported Database Types Source: https://vestacp.com/docs Retrieves a list of supported database types. The output format can be specified. ```bash v-list-database-types [FORMAT] ``` -------------------------------- ### Stop and Disable vsftpd Service Source: https://vestacp.com/docs/how-to-replace-vsftpd-with-proftpd-on-a-rhel-or-centos Use these commands to stop the running vsftpd service and prevent it from starting on boot. ```bash service vsftpd stop chkconfig vsftpd off ``` -------------------------------- ### Add User Package Source: https://vestacp.com/docs Adds a new user package to the system. Options include package directory and package name, with an optional rewrite flag. ```bash v-add-user-package PKG_DIR PACKAGE [REWRITE] ``` -------------------------------- ### Delete Vesta Data Directory Source: https://vestacp.com/docs/how-to-uninstall-vesta-control-panel Remove the main Vesta data directory to clean up installed files and configurations. ```bash rm -rf /usr/local/vesta ``` -------------------------------- ### Stop and Remove vsftpd Service Source: https://vestacp.com/docs/how-to-replace-vsftpd-with-proftpd-on-a-debian-or-ubuntu Stops the vsftpd service and removes it from the system's run levels to prevent it from starting automatically. ```bash service vsftpd stop update-rc.d -f vsftpd remove ``` -------------------------------- ### Connect to Server via SSH Source: https://vestacp.com/docs/how-to-install-vesta-control-panel Use this command to establish an SSH connection to your server as the root user. ```bash ssh root@your.server-name ``` -------------------------------- ### Get Mail Domain Value Source: https://vestacp.com/docs/cli Retrieves a specific parameter value for a mail domain. Requires user, domain, and the key of the parameter. ```bash v-get-mail-domain-value USER DOMAIN KEY ``` -------------------------------- ### Rebuild Web Domain Configurations Source: https://vestacp.com/docs/how-to-remove-nginx-on-a-debian-or-ubuntu Iterate through all system users and rebuild their web domain configurations to apply the updated settings. ```bash for user in $(v-list-sys-users plain); do v-rebuild-web-domains $user; done ``` -------------------------------- ### Mail Client Configuration Settings Source: https://vestacp.com/docs/how-to-properly-set-up-a-mail-client Use these settings for IMAP and SMTP STARTTLS with normal passwords. Ensure you use your full email address as the username. ```text Username: william.cage@alpha-mimic.ltd Password: aXly8Kbiqo IMAP hostname: alpha-mimic.ltd IMAP port: 143 IMAP security: STARTTLS IMAP auth method: Normal password SMTP hostname: alpha-mimic.ltd SMTP port: 587 SMTP security: STARTTLS SMTP auth method: Normal password ``` -------------------------------- ### Remove Nginx Package Source: https://vestacp.com/docs/how-to-remove-nginx-on-a-debian-or-ubuntu Use the system's package manager to remove the Nginx package. Note: This example uses 'yum', which is typically for RHEL-based systems. For Debian/Ubuntu, 'apt' or 'apt-get' should be used. ```bash yum remove nginx ``` -------------------------------- ### List System Information Source: https://vestacp.com/docs Checks for available updates for Vesta packages. Supports optional formatting. ```bash v-list-sys-info [FORMAT] ``` -------------------------------- ### List Database Hosts Source: https://vestacp.com/docs/how-to-add-remote-mysql-database-server Verify that the remote MySQL database host has been successfully added by listing all configured database hosts. ```bash v-list-database-hosts ``` -------------------------------- ### Backup User Account Source: https://vestacp.com/docs/how-to-migrate-user-to-the-new-server Use this command on the old server to create a backup of a specific user's data. Replace 'admin' with the actual username. ```bash v-backup-user admin ``` -------------------------------- ### Download Fail2Ban Configuration Source: https://vestacp.com/docs/how-to-install-fail2ban-on-rhel-or-centos Download the Fail2Ban configuration archive from the provided URL and save it as fail2ban.tar.gz. ```bash cd /etc wget http://c.vestacp.com/0.9.8/rhel/fail2ban.tar.gz -O fail2ban.tar.gz ``` -------------------------------- ### v-add-backup-host Source: https://vestacp.com/docs/cli Adds a backup host. Requires TYPE, HOST, USERNAME, and PASSWORD. Optional parameters include PATH and PORT. ```APIDOC ## v-add-backup-host ### Description Adds a backup host. ### Method Not specified (CLI command) ### Parameters #### Path Parameters - **TYPE** (string) - Required - The type of backup host (e.g., 'FTP', 'SFTP', 'S3'). - **HOST** (string) - Required - The hostname or IP address of the backup host. - **USERNAME** (string) - Required - The username for connecting to the backup host. - **PASSWORD** (string) - Required - The password for connecting to the backup host. - **PATH** (string) - Optional - The path on the backup host where backups should be stored. - **PORT** (integer) - Optional - The port number for connecting to the backup host. ``` -------------------------------- ### v-add-database-host Source: https://vestacp.com/docs/cli Adds a new database server to the server pool. ```APIDOC ## v-add-database-host ### Description Adds a new database server to the server pool. Supports local and remote database servers. Allows setting a limit for the number of databases on a host. The template parameter is used only for PostgreSQL. ### Method CLI Command ### Endpoint v-add-database-host TYPE HOST DBUSER DBPASS [MAX_DB] [CHARSETS] [TEMPLATE] ### Parameters #### Path Parameters - **TYPE** (string) - Required - The type of database server (e.g., 'mysql', 'pgsql'). - **HOST** (string) - Required - The hostname or IP address of the database server. - **DBUSER** (string) - Required - The username for connecting to the database server. - **DBPASS** (string) - Required - The password for connecting to the database server. - **MAX_DB** (integer) - Optional - The maximum number of databases allowed on this host. - **CHARSETS** (string) - Optional - The character sets to support. - **TEMPLATE** (string) - Optional - The template to use for PostgreSQL databases (default: 'template1'). ``` -------------------------------- ### v-list-sys-php-config Source: https://vestacp.com/docs/cli Lists PHP configuration parameters. ```APIDOC ## v-list-sys-php-config ### Description Obtains the list of PHP configuration parameters. ### Method CLI Command ### Endpoint v-list-sys-php-config [FORMAT] ### Parameters #### Query Parameters - **FORMAT** (string) - Optional - Specifies the output format. ``` -------------------------------- ### Download ProFTPD Configuration Source: https://vestacp.com/docs/how-to-replace-vsftpd-with-proftpd-on-a-rhel-or-centos Download the ProFTPD configuration file from the VestaCP repository and save it to the correct location. ```bash wget http://c.vestacp.com/0.9.8/rhel/proftpd.conf -O /etc/proftpd.conf ``` -------------------------------- ### Download Fail2Ban Configuration Source: https://vestacp.com/docs/how-to-install-fail2ban-on-debian-or-ubuntu Downloads the Fail2Ban configuration archive from a specified URL to the /etc directory. This prepares the configuration files for extraction. ```bash cd /etc wget http://c.vestacp.com/0.9.8/ubuntu/fail2ban.tar.gz -O fail2ban.tar.gz ``` -------------------------------- ### List PostgreSQL Configuration Source: https://vestacp.com/docs Retrieves a list of PostgreSQL configuration parameters. Output can be formatted. ```bash v-list-sys-pgsql-config [FORMAT] ``` -------------------------------- ### Create Database Source: https://vestacp.com/docs/api This snippet demonstrates how to create a new database in VestaCP. It requires server credentials and database details such as name, user, and password. ```php $vst_username, 'password' => $vst_password, 'returncode' => $vst_returncode, 'cmd' => $vst_command, 'arg1' => $username, 'arg2' => $db_name, 'arg3' => $db_user, 'arg4' => $db_pass ); $postdata = http_build_query($postvars); // Send POST query via cURL $curl = curl_init(); curl_setopt($curl, CURLOPT_URL, 'https://' . $vst_hostname . ':8083/api/'); curl_setopt($curl, CURLOPT_RETURNTRANSFER,true); curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false); curl_setopt($curl, CURLOPT_POST, true); curl_setopt($curl, CURLOPT_POSTFIELDS, $postdata); $answer = curl_exec($curl); // Check result if($answer == 0) { echo "Database has been successfuly created\n"; } else { echo "Query returned error code: " .$answer. "\n"; } ?> ``` -------------------------------- ### List System Network Interfaces Source: https://vestacp.com/docs/cli Retrieves a list of the system's network interfaces. Specify the desired output format. ```bash v-list-sys-interfaces [FORMAT] ``` -------------------------------- ### v-add-sys-firewall Source: https://vestacp.com/docs/cli Enables the system firewall. ```APIDOC ## v-add-sys-firewall ### Description Enables the system firewall. ### Method CLI Command ### Endpoint v-add-sys-firewall NONE ### Parameters #### Path Parameters - **NONE** (string) - This parameter is a placeholder and does not take any specific value. ``` -------------------------------- ### Download and Extract FCGI Template Source: https://vestacp.com/docs/how-to-enable-php-fcgi-support-on-a-rhel-or-centos Downloads the FCGI template for Apache and extracts it to the VestaCP templates directory. The downloaded archive is then removed. ```bash cd /usr/local/vesta/data/templates/web wget http://c.vestacp.com/0.9.8/rhel/fcgid/httpd.tar.gz tar -xzvf httpd.tar.gz rm -f httpd.tar.gz ``` -------------------------------- ### v-list-database-hosts Source: https://vestacp.com/docs/cli Lists all configured database hosts on the server. ```APIDOC ## v-list-database-hosts ### Description Retrieves a list of all configured database hosts. ### Method Not applicable (CLI command) ### Parameters #### Options - **[FORMAT]**: Specifies the output format (e.g., json, shell, plain). ``` -------------------------------- ### List Users Source: https://vestacp.com/docs Obtains a list of all system users. The output format can be specified. ```bash v-list-users [FORMAT] ``` -------------------------------- ### Search System Objects Source: https://vestacp.com/docs Searches for system objects. The output can be formatted. ```bash v-search-object OBJECT [FORMAT] ``` -------------------------------- ### List ProFTPd Configuration Source: https://vestacp.com/docs Retrieves a list of ProFTPd configuration parameters. Output can be formatted. ```bash v-list-sys-proftpd-config [FORMAT] ``` -------------------------------- ### Download and extract fcgid template for Apache Source: https://vestacp.com/docs/how-to-enable-php-fcgi-support-on-a-debian-or-ubuntu Downloads the Apache template for FCGI support from the VestaCP repository, extracts it, and removes the archive. This template is used to configure Apache for FCGI. ```bash cd /usr/local/vesta/data/templates/web wget http://c.vestacp.com/0.9.8/ubuntu/fcgid/apache2.tar.gz tar -xzvf apache2.tar.gz rm -f apache2.tar.gz ``` -------------------------------- ### v-list-web-templates-backend Source: https://vestacp.com/docs/cli Lists the available backend templates for web domains. Supports optional FORMAT. ```APIDOC ## v-list-web-templates-backend ### Description Lists the available backend templates for web domains. ### Method Not specified (CLI command) ### Parameters #### Path Parameters - **FORMAT** (string) - Optional - The desired output format. ``` -------------------------------- ### Add Remote DNS Host (Slave) Source: https://vestacp.com/docs/how-to-set-up-master-slave-dns-cluster Use this command on the master server to register a DNS slave host. Replace 'slave.yourhost.com', '8083', and 'p4sw0rd' with your specific slave server details. ```bash v-add-remote-dns-host slave.yourhost.com 8083 admin p4sw0rd ``` -------------------------------- ### v-add-sys-sftp-jail Source: https://vestacp.com/docs/cli Enables a jailed SFTP environment for the system. ```APIDOC ## v-add-sys-sftp-jail ### Description Enables a secure, jailed SFTP environment for users, restricting their access to specific directories. ### Method Not applicable (CLI command) ### Parameters None. ``` -------------------------------- ### List vsftpd Configuration Source: https://vestacp.com/docs Retrieves a list of vsftpd configuration parameters. Output can be formatted. ```bash v-list-sys-vsftpd-config [FORMAT] ``` -------------------------------- ### Create User Account Source: https://vestacp.com/docs/api This snippet demonstrates how to create a new user account using the Vesta API. It includes server credentials, new account details, and the cURL request to the API endpoint. ```APIDOC ## Create User Account ### Description Creates a new user account on the Vesta Control Panel. ### Method POST ### Endpoint https://{server.vestacp.com}:8083/api/ ### Parameters #### Request Body - **user** (string) - Required - The username for API authentication. - **password** (string) - Required - The password for API authentication. - **returncode** (string) - Optional - Set to 'yes' to receive a return code. - **cmd** (string) - Required - The command to execute, e.g., 'v-add-user'. - **arg1** (string) - Required - The username for the new account. - **arg2** (string) - Required - The password for the new account. - **arg3** (string) - Required - The email address for the new account. - **arg4** (string) - Required - The package name for the new account. - **arg5** (string) - Required - The first name of the new user. - **arg6** (string) - Required - The last name of the new user. ### Request Example ```php $vst_username, 'password' => $vst_password, 'returncode' => $vst_returncode, 'cmd' => $vst_command, 'arg1' => $username, 'arg2' => $password, 'arg3' => $email, 'arg4' => $package, 'arg5' => $fist_name, 'arg6' => $last_name ); $postdata = http_build_query($postvars); // Send POST query via cURL $curl = curl_init(); curl_setopt($curl, CURLOPT_URL, 'https://' . $vst_hostname . ':8083/api/'); curl_setopt($curl, CURLOPT_RETURNTRANSFER,true); curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false); curl_setopt($curl, CURLOPT_POST, true); curl_setopt($curl, CURLOPT_POSTFIELDS, $postdata); $answer = curl_exec($curl); // Check result if($answer == 0) { echo "User account has been successfuly created\n"; } else { echo "Query returned error code: " .$answer. "\n"; } ?> ``` ### Response #### Success Response (0) Indicates successful user account creation. #### Error Response Returns an error code indicating the reason for failure. ``` -------------------------------- ### Download PostgreSQL HBA Configuration Source: https://vestacp.com/docs/how-to-set-up-postgresql-on-a-debian-or-ubuntu Downloads the hba configuration file from a remote URL and saves it to the PostgreSQL configuration directory, overwriting the existing file. ```bash wget http://c.vestacp.com/0.9.8/debian/pg_hba.conf -O /etc/postgresql/*/main/pg_hba.conf ``` -------------------------------- ### Activate SFTP Server Plugin Source: https://vestacp.com/docs/paid-plugins Use this code to activate the SFTP Server plugin. Any text can be used as an activation code in this version. ```bash FREESFTP ``` -------------------------------- ### Open Filesystem File Source: https://vestacp.com/docs Opens or reads files on the file system for a given user. ```bash v-open-fs-file USER FILE ``` -------------------------------- ### Download ProFTPD Configuration Source: https://vestacp.com/docs/how-to-replace-vsftpd-with-proftpd-on-a-debian-or-ubuntu Downloads the ProFTPD configuration file from a remote URL and saves it to the appropriate location on the server. ```bash wget http://c.vestacp.com/0.9.8/debian/proftpd.conf -O /etc/proftpd/proftpd.conf ``` -------------------------------- ### v-restart-web Source: https://vestacp.com/docs/cli Restarts the web server, reloading its configuration. ```APIDOC ## v-restart-web ### Description Reloads the web server configuration by restarting the web server process. ### Method Not applicable (CLI command) ### Parameters None. ``` -------------------------------- ### Register PostgreSQL Instance in VestaCP Source: https://vestacp.com/docs/how-to-set-up-postgresql-on-a-debian-or-ubuntu Registers the PostgreSQL instance with VestaCP, specifying the host, port, database user, and password. ```bash v-add-database-host pgsql localhost postgres pgp4sw0rd ``` -------------------------------- ### Add Wildcard DNS Record for Temporary Links Source: https://vestacp.com/docs/how-to-configure-temporary-links-for-new-domains Configure a wildcard DNS 'A' record to point to a specific IP address. This is the first step in setting up temporary domain aliases. ```bash Record: *.alpha Type: A IP: 192.168.3.57 ``` ```bash Record: *.beta Type: A IP: 192.168.3.58 ``` -------------------------------- ### List User Backups Source: https://vestacp.com/docs Retrieves a list of available backups for a specific user. Supports optional formatting. ```bash v-list-user-backups USER [FORMAT] ``` -------------------------------- ### v-add-web-domain-backend Source: https://vestacp.com/docs/cli Adds a backend configuration for a user's web domain. ```APIDOC ## v-add-web-domain-backend ### Description Configures a backend service or application for a specific web domain. ### Method Not applicable (CLI command) ### Parameters #### Arguments - **USER**: The username associated with the domain. - **DOMAIN**: The domain name for which to add the backend configuration. #### Options - **[TEMPLATE]**: Specifies a template to use for the backend configuration. - **[RESTART]**: Optional flag to restart services after configuration. ``` -------------------------------- ### v-add-web-domain-ftp Source: https://vestacp.com/docs/cli Adds an FTP account for a web domain. ```APIDOC ## v-add-web-domain-ftp ### Description Creates an additional FTP account for a web domain. ### Method CLI Command ### Endpoint v-add-web-domain-ftp USER DOMAIN FTP_USER FTP_PASSWORD [FTP_PATH] ### Parameters #### Path Parameters - **USER** (string) - Required - The username. - **DOMAIN** (string) - Required - The domain name. - **FTP_USER** (string) - Required - The username for the new FTP account. - **FTP_PASSWORD** (string) - Required - The password for the new FTP account. - **FTP_PATH** (string) - Optional - The path for the FTP account. ``` -------------------------------- ### Add Web/DNS/Mail Domain Source: https://vestacp.com/docs Adds a new domain to the server, including web, DNS, and mail configurations. Optionally specify an IP address and restart services. ```bash v-add-domain USER DOMAIN [IP] [RESTART] ``` -------------------------------- ### v-add-letsencrypt-domain Source: https://vestacp.com/docs/cli Enables SSL support for a domain by adding a Let's Encrypt certificate. Supports optional aliases, restart, and notification. ```APIDOC ## v-add-letsencrypt-domain ### Description Enables SSL support for a domain by adding a Let's Encrypt certificate. Supports optional aliases, restart, and notification. ### Method Not specified (CLI command) ### Endpoint Not applicable (CLI command) ### Parameters #### Path Parameters - **USER** (string) - Required - The username. - **DOMAIN** (string) - Required - The domain name. - **ALIASES** (string) - Optional - Additional aliases for the certificate. - **RESTART** (string) - Optional - Flag to restart services. - **NOTIFY** (string) - Optional - Flag to enable notifications. ``` -------------------------------- ### Add FTP Backup Host Source: https://vestacp.com/docs/how-to-configure-ftp-backup Use this command to add a remote FTP host for storing backups. Replace the placeholder credentials with your actual FTP server details. ```bash v-add-backup-ftp-host remote.ftp-host.ltd backup-user p4ssw0rd ``` -------------------------------- ### List Vesta Autoupdate Settings Source: https://vestacp.com/docs Retrieves the current autoupdate settings for Vesta. Supports optional formatting. ```bash v-list-sys-vesta-autoupdate [FORMAT] ``` -------------------------------- ### v-add-web-domain-ssl Source: https://vestacp.com/docs/cli Enables SSL support for a user's web domain. ```APIDOC ## v-add-web-domain-ssl ### Description Activates SSL/TLS support for a specified web domain. Requires certificate and key files. Optionally accepts a CA certificate file and specifies the document root. ### Method Not applicable (CLI command) ### Parameters #### Arguments - **USER**: The username associated with the domain. - **DOMAIN**: The domain name for which to enable SSL. - **SSL_DIR**: The directory containing the SSL certificate and key files. #### Options - **[SSL_HOME]**: The directory to use as the document root for HTTPS. Defaults to public_shtml. - **[RESTART]**: Optional flag to restart services after enabling SSL. ``` -------------------------------- ### v-change-web-domain-backend-tpl Source: https://vestacp.com/docs/cli Changes the backend template for a web domain. Supports optional restart. ```APIDOC ## v-change-web-domain-backend-tpl ### Description Changes the backend template for a web domain. Supports optional restart. ### Method Not specified (CLI command) ### Endpoint Not applicable (CLI command) ### Parameters #### Path Parameters - **USER** (string) - Required - The username. - **DOMAIN** (string) - Required - The domain name. - **TEMPLATE** (string) - Required - The new backend template. - **RESTART** (string) - Optional - Flag to restart services. ``` -------------------------------- ### v-schedule-user-restore Source: https://vestacp.com/docs/cli Schedules the restoration of a user's backup. Supports specifying which components to restore (web, DNS, mail, DB, cron, user directory). ```APIDOC ## v-schedule-user-restore ### Description Schedules the restoration of a user's backup. Supports specifying which components to restore (web, DNS, mail, DB, cron, user directory). ### Method Not specified (CLI command) ### Endpoint Not applicable (CLI command) ### Parameters #### Path Parameters - **USER** (string) - Required - The username. - **BACKUP** (string) - Required - The backup identifier. - **WEB** (string) - Optional - Flag to restore web data. - **DNS** (string) - Optional - Flag to restore DNS data. - **MAIL** (string) - Optional - Flag to restore mail data. - **DB** (string) - Optional - Flag to restore database data. - **CRON** (string) - Optional - Flag to restore cron jobs. - **UDIR** (string) - Optional - Flag to restore user directory. ``` -------------------------------- ### List File System Directory Source: https://vestacp.com/docs Lists the contents of a specified directory on the file system for a given user. ```bash v-list-fs-directory USER DIRECTORY ``` -------------------------------- ### Restore User Backup Source: https://vestacp.com/docs/how-to-migrate-user-to-the-new-server Restore the user account on the new server using the transferred backup file. The user account will be created if it does not exist. ```bash v-restore-user admin admin.2014-01-14.tar ``` -------------------------------- ### Download WSGI Template Source: https://vestacp.com/docs/how-to-enable-wsgi-support-on-a-rhel-or-centos Downloads and extracts the WSGI Apache template from the VestaCP repository. This template is required for WSGI configuration. ```bash cd /usr/local/vesta/data/templates/web wget http://c.vestacp.com/0.9.8/rhel/wsgi/httpd.tar.gz tar -xzvf httpd.tar.gz rm -f httpd.tar.gz ``` -------------------------------- ### v-restart-proxy Source: https://vestacp.com/docs/cli Restarts the proxy server, reloading its configuration. Requires no specific options. ```APIDOC ## v-restart-proxy ### Description Restarts the proxy server, reloading its configuration. ### Method Not specified (CLI command) ### Parameters None. ``` -------------------------------- ### Download PostgreSQL HBA Configuration Source: https://vestacp.com/docs/how-to-set-up-postgresql-on-a-rhel-or-centos Downloads the pg_hba.conf file from a remote URL and saves it to the PostgreSQL data directory. This file controls client authentication. ```bash wget http://c.vestacp.com/0.9.8/rhel/pg_hba.conf -O /var/lib/pgsql/data/pg_hba.conf ``` -------------------------------- ### List System IP Addresses Source: https://vestacp.com/docs Retrieves a list of system IP addresses and their parameters. Supports optional formatting. ```bash v-list-sys-ip IP [FORMAT] ``` -------------------------------- ### Download WSGI Apache Template Source: https://vestacp.com/docs/how-to-enable-wsgi-support-on-a-debian-or-ubuntu Downloads and extracts the WSGI Apache template files to the VestaCP templates directory. This is required for configuring WSGI support. ```bash cd /usr/local/vesta/data/templates/web wget http://c.vestacp.com/0.9.8/ubuntu/wsgi/apache2.tar.gz tar -xzvf apache2.tar.gz rm -f apache2.tar.gz ``` -------------------------------- ### v-list-dns-templates Source: https://vestacp.com/docs/cli Retrieves a list of all available DNS templates. Supports optional formatting. ```APIDOC ## v-list-dns-templates ### Description Retrieves a list of all available DNS templates. Supports optional formatting. ### Method Not specified (CLI command) ### Endpoint Not applicable (CLI command) ### Parameters #### Path Parameters - **FORMAT** (string) - Optional - The desired output format. ``` -------------------------------- ### List SpamAssassin Configuration Source: https://vestacp.com/docs Retrieves a list of SpamAssassin configuration parameters. Output can be formatted. ```bash v-list-sys-spamd-config [FORMAT] ``` -------------------------------- ### Configure Bind for AXFR Zone Transfer Source: https://vestacp.com/docs/how-to-enable-axfr-in-bind Modify the named.conf file to allow zone transfers to specific IP addresses and enable also-notify. ```bind allow-transfer { XXX.YYY.ZZZ.111; XXX.YYY.ZZZ.222; }; also-notify { XXX.YYY.ZZZ.111; XXX.YYY.ZZZ.222; }; ``` -------------------------------- ### v-list-web-templates-proxy Source: https://vestacp.com/docs/cli Lists available proxy templates. ```APIDOC ## v-list-web-templates-proxy ### Description Obtains the list of proxy templates available to a user. ### Method CLI Command ### Endpoint v-list-web-templates-proxy [FORMAT] ### Parameters #### Query Parameters - **FORMAT** (string) - Optional - Specifies the output format. ``` -------------------------------- ### List Overall User Statistics Source: https://vestacp.com/docs Retrieves overall statistics for all users. Supports optional formatting. ```bash v-list-users-stats [FORMAT] ``` -------------------------------- ### Copy Backup to New Server Source: https://vestacp.com/docs/how-to-migrate-user-to-the-new-server Transfer the generated backup tarball from the old server to the new server's backup directory using SCP. Adjust paths and filenames as necessary. ```bash scp /home/backup/admin.2014-01-14.tar new-server:/home/backup/ ``` -------------------------------- ### v-list-sys-dovecot-config Source: https://vestacp.com/docs/cli Lists the configuration parameters for the Dovecot mail server. ```APIDOC ## v-list-sys-dovecot-config ### Description Retrieves a list of all configurable parameters for the Dovecot mail server. ### Method Not applicable (CLI command) ### Parameters #### Options - **[FORMAT]**: Specifies the output format (e.g., json, shell, plain). ``` -------------------------------- ### List Firewall Rules Source: https://vestacp.com/docs Retrieves a list of all iptables firewall rules. Supports optional formatting. ```bash v-list-firewall [FORMAT] ``` -------------------------------- ### v-list-web-templates Source: https://vestacp.com/docs/cli Lists available web templates for a user. ```APIDOC ## v-list-web-templates ### Description Obtains the list of web templates available to a user. ### Method CLI Command ### Endpoint v-list-web-templates USER [FORMAT] ### Parameters #### Path Parameters - **USER** (string) - Required - The username. #### Query Parameters - **FORMAT** (string) - Optional - Specifies the output format. ``` -------------------------------- ### v-list-user-backup Source: https://vestacp.com/docs/cli Lists backup parameters for a specific user. ```APIDOC ## v-list-user-backup ### Description Retrieves a list of backup parameters and configurations for a given user. Supports JSON, shell, and plain text output formats. ### Method Not applicable (CLI command) ### Parameters #### Arguments - **USER**: The username for whom to list backup parameters. - **BACKUP**: The specific backup identifier or name. #### Options - **[FORMAT]**: Specifies the output format (e.g., json, shell, plain). ``` -------------------------------- ### Add Remote MySQL Host Source: https://vestacp.com/docs/how-to-add-remote-mysql-database-server Use this command to add a new remote MySQL server. Replace 'new-server.com', 'root', and 'password' with your actual server details. ```bash v-add-database-host mysql new-server.com root password ``` -------------------------------- ### List User Favorites Source: https://vestacp.com/docs Retrieves a list of favorite user objects. The output format can be specified. ```bash v-list-user-favourites USER [FORMAT] ``` -------------------------------- ### v-change-sys-service-config Source: https://vestacp.com/docs/cli Changes the configuration for a system service. Supports optional restart. ```APIDOC ## v-change-sys-service-config ### Description Changes the configuration for a system service. Supports optional restart. ### Method Not specified (CLI command) ### Endpoint Not applicable (CLI command) ### Parameters #### Path Parameters - **CONFIG** (string) - Required - The configuration file path. - **SERVICE** (string) - Required - The service name. - **RESTART** (string) - Optional - Flag to restart services. ``` -------------------------------- ### Restore User Source: https://vestacp.com/docs Restores a user account from a backup. Options include restoring web, DNS, mail, database, cron, user directory, and notification settings. ```bash v-restore-user USER BACKUP [WEB] [DNS] [MAIL] [DB] [CRON] [UDIR] [NOTIFY] ``` -------------------------------- ### Template for New Language File Source: https://vestacp.com/docs/how-to-translate-vesta-interface Use the existing English language file (en.php) as a template to create a new language file for your desired language. Remember to change the language code (e.g., 'en' to 'aa'). ```php $LANG['en'] = array( 'some_key' => 'English Translation', // ... other translations ); // To create a new language file (e.g., for 'aa'): // $LANG['aa'] = array( // 'some_key' => 'Translation in aa', // // ... other translations // ); ``` -------------------------------- ### v-add-web-domain-proxy Source: https://vestacp.com/docs/cli Enables proxy support for a web domain to improve website speed. Supports USER, DOMAIN, and optional TEMPLATE, EXTENTIONS, and RESTART. ```APIDOC ## v-add-web-domain-proxy ### Description Enables proxy support for a domain. This can significantly improve website speed. ### Method Not specified (CLI command) ### Parameters #### Path Parameters - **USER** (string) - Required - The username associated with the web domain. - **DOMAIN** (string) - Required - The web domain for which to enable proxy support. - **TEMPLATE** (string) - Optional - The proxy template to use. - **EXTENTIONS** (string) - Optional - Additional extensions to enable. - **RESTART** (string) - Optional - Whether to restart the proxy service after configuration. ``` -------------------------------- ### v-add-web-domain Source: https://vestacp.com/docs/cli Adds a virtual host (web domain) to the server. Supports specifying IP, aliases, proxy extensions, and restart. ```APIDOC ## v-add-web-domain ### Description Adds a virtual host (web domain) to the server. Supports specifying IP, aliases, proxy extensions, and restart. ### Method Not specified (CLI command) ### Endpoint Not applicable (CLI command) ### Parameters #### Path Parameters - **USER** (string) - Required - The username. - **DOMAIN** (string) - Required - The domain name. - **IP** (string) - Optional - The IP address to assign to the domain. Defaults to 'default' template if undefined. - **ALIASES** (string) - Optional - Aliases for the domain. Use 'none' to disable automatic www alias. - **PROXY_EXTENSIONS** (string) - Optional - Proxy extensions to enable. - **RESTART** (string) - Optional - Flag to restart services. ``` -------------------------------- ### Restart Operating System Source: https://vestacp.com/docs Initiates a restart of the operating system. Requires a restart flag. ```bash v-restart-system RESTART ``` -------------------------------- ### Restart Apache Web Server Source: https://vestacp.com/docs/how-to-set-up-postgresql-on-a-debian-or-ubuntu Restarts the Apache web server to load the new phpPgAdmin configuration. ```bash service apache2 restart ``` -------------------------------- ### Add User SFTP Jail Source: https://vestacp.com/docs/cli Enables a jailed SFTP environment for a user. Requires the username. ```bash v-add-user-sftp-jail USER ``` -------------------------------- ### v-list-letsencrypt-user Source: https://vestacp.com/docs/cli Lists the Let's Encrypt key thumbprint for a user. Supports USER and optional FORMAT. ```APIDOC ## v-list-letsencrypt-user ### Description Lists the Let's Encrypt key thumbprint for a user. ### Method Not specified (CLI command) ### Parameters #### Path Parameters - **USER** (string) - Required - The username for whom to list the Let's Encrypt key. - **FORMAT** (string) - Optional - The desired output format. ``` -------------------------------- ### v-list-user-ns Source: https://vestacp.com/docs/cli Retrieves a list of a user's DNS nameservers. Supports optional formatting. ```APIDOC ## v-list-user-ns ### Description Retrieves a list of a user's DNS nameservers. Supports optional formatting. ### Method Not specified (CLI command) ### Endpoint Not applicable (CLI command) ### Parameters #### Path Parameters - **USER** (string) - Required - The username. - **FORMAT** (string) - Optional - The desired output format. ``` -------------------------------- ### Add User Favorites Source: https://vestacp.com/docs Adds a system object to a user's favorites list. Requires user, system, and object identifiers. ```bash v-add-user-favourites USER SYSTEM OBJECT ```