By default, the VestaCP panel has one user named admin. On behalf of this user, we will create a domain on the server, a database and issue an SSL certificate for the domain. After that, we will download the Wordpress installation files to the server and complete the installation in the browser.
1.Connect to the server via SSH (how to do it)
2. Create a domain on the server where Wordpress will be installed. by running the command:
/usr/local/vesta/bin/v-add-domain admin site.comwhere site.com is your domain name
3. For the future site, you need to create a database. To do this, enter the command:
/usr/local/vesta/bin/v-add-database admin dbname dbuser dbpasswwhere
dbname - the name of the database, for example, dbsite
dbuser - username (may be the same as the database name)
dbpassw - password
For example, your command might look like this:
/usr/local/vesta/bin/v-add-database admin dbmysite dbmysite THPuGyCXB8r4
It should be noted that the user name of the VestaCP panel will be automatically added to the database name and the database user name. In this case, the total number of characters (including the prefix) should not exceed 16. In our example, the database name and database user name will be admin_dbmysite.
4. For the site to work using the https protocol, you need to issue an SSL certificate for the domain. This requires that the domain is directed to the server. You can check the link https://check-host.net/. As a result of the check, we will get the IP of the server where the site will be hosted.
To issue an SSL certificate for a domain, run the command
/usr/local/vesta/bin/v-add-letsencrypt-domain admin site.comwhere site.com is your domain name
As a result, your site at https://site.com should open the default page of the VestaCP panel in the browser
5. Let's move on to installing WordPress.
First, let's download the installation files to our server. To do this, run the command:
cd /root && wget https://ru.wordpress.org/latest-ru_RU.tar.gz && tar -xvf latest-ru_RU.tar.gz
Go to site folder
cd /home/admin/web/site.com/public_html/where site.com is your domain name
And we will transfer the installation files to the folder of our site, having previously deleted the default index.html and robots.txt created by the panel:
rm -f index.html && rm -f robots.txt && mv /root/wordpress/* .
It remains to set the rights to files and folders with the command
chmod -R 777 wp-content && cd .. && chown -R admin:admin ./ && cd public_html/
Let's finish installing Wordpress in the browser.
Open your site in a browser. A welcome window should open.
Feel free to press "Forward!"
On the next page, you need to enter the database access data (which we created in step 3). Please note that in the database name and username, you must add the VestaCP username (in our case, this is admin).
Click "Submit" and "Start installation"
Now write down the Site Name, Username (with this user you can enter the site's admin panel), User Password (I recommend writing it down or changing it to your own), Email and click "Install Wordpress"
In a moment Wordpress installed
The site is available at: https://site.com
where site.com is your domain name
Admin panel: https://site.com/wp-login.php
Password: which was specified for the admin user
As a result, you have created a site based on the popular Wordpress CMS from scratch to a finished site.