How to set up WordPress on top of Ubuntu 18 Using Command Line
Setting up WordPress on your local Ubuntu 18.x Machine with Apache2
This tutorial is designed to help with the installation of WordPress on top of Ubunut 18.x
NOTE: This tutorial will not be covering how to install LAMP/LEMP and will be using Apache2 instead.
1. The first thing we need to do is to update our Ubuntu and then install the needed packages. To do this use the following commands in your terminal:
2. Next, we need to create the database. Unless you created a database specifically for WordPress during a LAMP/LEMP setup, you are going to need to create a new one for WordPress to use.
3. Once you are into your mysql console, create a new database for use with WordPress:
4. Create a new user for use with the new database:
5. The next step is to grant our new database user the needed permissions to manage the database. Use the following command in your mysql console to do this:
6. Now we need to flush the database privileges and exit the mysql console:
7. We will now install Apache2 and a one more needed apache2/PHP package:
8. Install WordPress to your Ubuntu machine. To do this we will first change directory into your home directory, then we will download the latest version of WordPress. Next, we will cd into your web server file location (usually /var/www with apache), then we will extract the files:
9. Now we will change the permissions of the newly extracted and created wordpress directory so that wordpress will have the correct access needed and be in the correct group:
10. The next step is to Configure your Apache2 webserver configuration for your wordpress site.
11. Now open your new configuration file named "wordpress". To do this I use 'vim' text editor, but you may use nano or any editor that you prefer, just replace 'vim' in the following command to your editor:
Make the needed adjustments to your config file so that it looks similar to the following example:
NOTE: This setup is for using the localhost only, you may need to make further adjustments for sites using a ServerName.
12. Now "turn on" your site and reload apache2 by running:
13. Finally adjust your WordPress configurations and start using your new wordpress site. The areas that need edited in the wp-config.php file at this time is the 'dbname', 'db username', and 'db pass'. I also recommend changing the Authentication and Unique Keys and Salts which are towards the bottom of the config file (I do not show these in the example below):
NOTE: I will show an example of the wp-config.php file with the needed changes for this tutorial:
Finally, you now have wordpress installed on your local Ubunut 18.x machine and can see your new local website by going to ://localhost/wordpress/ . To log into your new wordpress dashboard and learn the basics of using wordpress to design your site go to ://localhost/wordpress/wp-admin.php
I will make another tutorial on how to get your wordpress site set up on an amazon web server at a later time.
IN NO EVENT WILL WE BE LIABLE FOR ANY DIRECT, INDIRECT, CONSEQUENTIAL, INCIDENTAL, SPECIAL OR EXEMPLARY DAMAGES FOR ANY USE OF THIS SITE, OR USE OF ANY OTHER LINKED SITE, OR SOFTWARE, EVEN IF WE ARE ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
With over 10 years of experience in the Technology field, I have solved my fair share of technical issues and problems.u00a0