Step One: Confirm Your Operating System Template
The exact steps required to connect a domain and install WordPress will depend on the choice of operating system template. If you want to follow this tutorial, your first step is to head to Templates and install Ubuntu 18.04, if it’s not already done.
Step Two: Log into the Virtual Console
When you’re inside the dashboard, enter your virtual machine. From there, you can select Virtual Console. Open this up in a new window and log in (if this is new to you, your username is “root” and your password can be found in the overview section of your virtual machine).
Step Three: Update Your Server
This step is relatively simple, to make sure that your server is up to date. Do this by running the following commands:apt-get update apt-get upgrade |
Step Four: Apache Web Server Installation
To install the Apache web server, run the following command:apt-get install apache2 |
systemctl enable apache2 |
Step Five: Install PHP
The next step is to install PHP. You can do this using the following command:apt install php php-curl php-gd php-mbstring php-xml php-xmlrpc php-soap php-intl php-zip |
Step Six: Install MySQL Server
Next, you need to install the MySQL server. Do this with the following command:apt install mysql-server |
Step Seven: Create Database for WordPress and User
Create the database using the following command:mysql admin create your_database_name |
grant all privileges on your_database_name.* to [email protected] identified by ‘yourpassword’ ; |
flush privileges; |
cntrl+D |
Step Eight: Create a Virtual Host File for Your Website
First, create a virtual host for your new website:vi /etc/apache2/sites-available/your_domain_name.conf |
<VirtualHost *:80>
ServerName domain_name ServerAlias www.domain_name DocumentRoot /var/www/html/domain_name <Directory /var/www/html/domain_name> Options Indexes FollowSymLinks AllowOverride All Require all granted </Directory> ErrorLog ${APACHE_LOG_DIR}/your_domain.com_error.log CustomLog ${APACHE_LOG_DIR}/your_domain.com_access.log combined </VirtualHost> |
Step Nine: Enable the Website
Next, you need to enable the website by inputting the following command:a2ensite domain_name.conf |
systemctl restart apache2 |
Step Ten: Download WordPress
You can download the latest WordPress version as follows:cd /var/www/html/ wget https://wordpress.org/latest.tar.gz tar xf latest.tar.gz mv wordpress domain_name chown -R www-data:www-data domain_name/ |