How to Install and Setup WordPress with E2E DBaaS Service
Introduction
WordPress is a free and open-source content management system written in PHP and paired with a MySQL or MariaDB database. It's a highly popular content management system (CMS) that is used for almost over 30% of all sites on the internet. In this tutorial, we will go through the steps to set up a WordPress blog with DBaaS service to run your WordPress MySQL database.
A WordPress blog uses the MySQL database to store its data. Maintaining the data is very critical for your website, and if the database goes down, there will be downtime for your websites. Using the DBaaS service, you can focus on your WordPress site instead of working on database administration. Performance and backup of your database will be handled by the DBaaS service.
Step 1: Creating a Database Service
Many WordPress installations use a MySQL database that is available on the same server where WordPress installation is done. Doing this could impact resources on your server. Another reason is that you would not be able to horizontally scale your WordPress server when your site becomes popular. By having a separate database for your site, you will avoid this issue, giving you more resources and horizontal expansion capabilities in the future.
To create a Database Service, please refer to the steps below:
Login into MyAccount Portal
Please log in to MyAccount Portal using your credentials set up at the time of creating and activating the E2E Networks 'My Account'.
Navigate to Database Page
Once you have logged in to the MyAccount Portal, you can navigate to the database page from the sidebar menu.
Create Database
In the top right section of the manage database dashboard, you need to click on the Create Database button, which will prompt you to the cluster page where you will select the configuration and enter the details of your database.
Database Configuration and Setting
After creating the database, you need to select the required configuration and settings for your database, which are mentioned below.
-
Database Engine: The database has various engines available. You need to select the required database engine, which we currently support:
- MariaDB - 10.4
- MySQL 5.6
- MySQL 5.7
- MySQL 8.0
-
Cluster Configuration: Node Cluster configuration comprises varying combinations of CPU, memory, and storage, giving you the flexibility to choose the appropriate mix of resources for your database.
-
Cluster Name: You need to provide the cluster name that you want for your cluster. This name will be visible on the Database page.
-
Database Setting: You need to update the database name, user, and provide a secure password for your database. You will use these credentials to log in to the database server.
With strong password authentication, your database controls and authenticates user accounts. If a DB engine has strong password management features, they can enhance security.
Once you have entered the required details, click on Create Database. Your database might take a few minutes to launch. The database node will be in a "setting up" state until it's ready to use, and the status will change to "running."
Step 2: Creating a Node
You will now need to create a node to host your WordPress site. E2E Networks provides a MyAccount portal that lets you access and manage your E2E Nodes through a simple and intuitive web-based user interface. With your WordPress site hosted on the node, your site will be up and running and can be accessed over the internet.
You can refer to the steps mentioned here to launch a node if you have not already done so.
Step 3: Installing and Configuring WordPress on Your Node
After creating a Database service and node, we need to install a WordPress application on your node and connect it to the Database service.
Please follow the below steps to install the WordPress application on your node:
Install Apache Webserver
To install Apache on your node, run the following command in your terminal:
sudo yum install -y httpd
Once the installation is done, To start the Apache web server, run the following command in your terminal:
sudo service httpd start
If you now open the browser with your server IP, You should be able to see the Apache Test Page.
Install and Configure Wordpress
To download the Wordpress on your node, Dowload and uncompress below file.
wget https://wordpress.org/latest.tar.gz
tar -xzf latest.tar.gz
Once the file is uncompressed, Go to WordPress directory and copy of the default config file using the below command
cd Wordpress
cp wp-config-sample.php wp-config.php
Now, To connect the WordPress Application to your Database, Open the config file (wp-config.php) and edit the below areas of configuration with your Actual database configuration.
// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define( 'DB_NAME', 'database_name_here' );
/** MySQL database username */
define( 'DB_USER', 'username_here' );
/** MySQL database password */
define( 'DB_PASSWORD', 'password_here' );
/** MySQL hostname */
define( 'DB_HOST', 'localhost' );
The values should be:
- DB_NAME: The name of your database
- DB_USER: The name of the user you created in the database
- DB_PASSWORD: The password for the user you created
- DB_HOST: The hostname of the database that you found (Server IP)
Once the configuration is updated, you can now deploy your WordPress website.
Step 4: Setting up WordPress
After installing and configuring WordPress to use the database service, we need to set up WordPress.
We need to ensure that the Apache web server can handle requests for WordPress. To do this, copy the WordPress application files to the Apache web root directory:
sudo cp -r wordpress/* /var/www/html/
Restart the apache web server
sudo service httpd restart
Now, Open the browser with the server IP. You should be able to see the WordPress welcome page and the five-minute installation process. Proceed with the Installation.
That’s it, You have now made WordPress publicly accessible using e2e’s database service and your node is handling the installation and configurations.