How to install Wordpress CMS 4.9.6 on Ubuntu 18.04

To install Wordpress CMS 4.9.6 on Ubuntu 18.04
Wordpress is the most powerful and popular content management system (CMS) application. WordPress is a Content Management System, that allows you to create and publish your content on the web. Although it can be used for web publishing and manage content on an intranet or on a single computer.

Prerequisites
Install LAMP(Apache, MariaDB, php7)
In MariaDB (create database and user and give privileges to that user )

Php installation with required following modules

add-apt-repository ppa:ondrej/php 
apt-get update 
apt-get install php7.0 php7.0-mysql php7.0-curl php7.0-json php7.0-cgi libapache2-mod-php7.0 php7.0-mcrypt php7.0-xmlrpc php7.0-gd php7.0-mbstring php7.0  php7.0-common  php7.0-xmlrpc php7.0-soap  php7.0-xml php7.0-intl 
  php7.0-cli  php7.0-ldap php7.0-zip php7.0-readline php7.0-imap php7.0-tidy php7.0-recode php7.0-sq php7.0-intl

Installation

Download a Wordpress CMS package using the following URL

root@linuxhelp1:/home/user1/Downloads# wget https://wordpress.org/latest.zip
--2018-05-24 21:23:12--  https://wordpress.org/latest.zip
Resolving wordpress.org (wordpress.org)... 198.143.164.252
Connecting to wordpress.org (wordpress.org)|198.143.164.252|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 9502138 (9.1M) [application/zip]
Saving to: ‘ latest.zip’ 

latest.zip              100%[==============================> ]   9.06M   668KB/s    in 13s     

2018-05-24 21:23:26 (721 KB/s) - ‘ latest.zip’  saved [9502138/9502138]

The downloaded package is a zip file, so unzip the file using the following command

root@linuxhelp1:/home/user1/Downloads# unzip latest.zip

 Archive:  latest.zip
   creating: wordpress/
  inflating: wordpress/xmlrpc.php    
  inflating: wordpress/wp-blog-header.php  
  inflating: wordpress/readme.html
.
.
  inflating: wordpress/wp-admin/admin-header.php  
  inflating: wordpress/wp-admin/post-new.php  
  inflating: wordpress/wp-admin/themes.php  
  inflating: wordpress/wp-admin/options-reading.php  
  inflating: wordpress/wp-trackback.php  
  inflating: wordpress/wp-comments-post.php

Move the extracted file into the following path

root@linuxhelp1:/home/user1/Downloads# mv wordpress /var/www/

Switch to the following directory

root@linuxhelp1:/home/user1/Downloads# cd /var/www/

Change the ownership and permission of the file

root@linuxhelp1:/var/www# chown -R www-data.www-data wordpress
root@linuxhelp1:/var/www# chmod -R 775 wordpress

Create a new virtual host configuration for accessing the Wordpress CMS application

root@linuxhelp1:/var/www# vim /etc/apache2/sites-available/wordpress.conf
< VirtualHost *:80> 
ServerName www.linuxhelp1.com
DocumentRoot /var/www/wordpress

< Directory /var/www/wordpress> 
AllowOverride All
allow from all
< /Directory> 

< /VirtualHost> 

Enable the site access

root@linuxhelp1:/var/www# a2ensite wordpress.conf
Enabling site wordpress.
To activate the new configuration, you need to run:
systemctl reload apache2

Disable the default access

root@linuxhelp1:/var/www# a2dissite 000-default.conf
Site 000-default disabled.
To activate the new configuration, you need to run:
systemctl reload apache2

Enable the rewrite module

root@www:/var/www# a2enmod rewrite
Enabling module rewrite.
To activate the new configuration, you need to run:
systemctl restart apache2

Restart the apache2 service

root@linuxhelp1:/var/www# systemctl restart apache2

Now you can proceed the further installation and configuration from the browser by navigating to the following URL: http://< ipaddress or domain name

Choose the language for using Wordpress

Configure the database setup

Setup the database details

Run the installation

Configure the site information

After the successful installation, you will see the following page

Log in using the admin user credential

After the successful login, you will see the Dashboard of Wordpress

You can customize your site from the following available options on the left panel

With this, the method to install Wordpress CMS 4.9.6 on Ubuntu 18.04 comes to an end.

Tag : Ubuntu
FAQ
Q
Hey great guide but im stuck at step 8 I did everything but when I point to my IP in my case its 192.168.7.201 it shows the welcome screen of “Welcome to nginx!” when i try 192.168.7.201/phpm?
A
If the root location of your vhost points to /srv/www/html, then make a symlik to phpmyadmin with the following command: ln -s /usr/share/phpmyadmin /srv/www/html/
Q
I am not able to edit my wp-config.php file as it has Read-Only permission. How do I edit it?
A
Use sudo command to gain root privileges: $sudo vi /path/to/file
Q
Can you please help me? E325: ATTENTION Found a swap file by the name "/var/tmp/wp-config.php.swp" Why do I keep getting this message when I try to update my database information?
A
When a file is not properly closed, it will create a temporary file with same name as extension .swp, deleting this file will solve problem. # rm -rf /var/tmp/wp-config.php.swp
Q
What are features available in "Wordpress"?
A
Refer the following link to get information about the features has available for "WordPress", "https://codex.wordpress.org/WordPress_Features"
Q
How can I transfer my blog or website from other services to a self-hosted "WordPress" installation?
A
You can exchange any blog or site from any administration you wish. We have a rundown of aides which will assist you in transferring from your particular stage in "WordPress'