Edit The wp-config.php File
Almost done with the server, the only thing that you need to do now is edit the wp-config.php file. We are going to use nano for the editor here since we are working in the terminal. So type in the following command.
This will bring up the wp-config.php file. You need to change the database name, username and the password so that WordPress can connect to your database.
/** The name of the database for WordPress */ define( 'DB_NAME', 'database-name' ); /** MySQL database username */ define( 'DB_USER', 'database-user' ); /** MySQL database password */ define( 'DB_PASSWORD', 'database-password' );
Note that when you are using nano in terminal that you can use your up, down, left and right arrows on your keyboard to navigate. After you have entered the correct information you want to press “Control O” at the same time then press enter on your keyboard to save the file. Then you can press “Control x” to exit nano.
If you do not have nano installed on your system you can install it by entering the following code.
sudo apt install nano
If you are on CentOS or RHEL you can use this command to install nano.
sudo yum install nano
For more information on nano see this post How to Install Nano & Use Text Editor Commands in Linux (phoenixnap.com)
To check the nano version that you have, enter the following code.
Now that you have your website files and database in the correct locations it is time to change your DNS. I will show you how to do this on the following page.