How To Install WordPress with LAMP on Ubuntu 16.04


WordPress is the most popular CMS (content management system) on the internet. It allows you to easily set up flexible blogs and websites on top of a MySQL back end with PHP processing. WordPress has seen incredible adoption and is a great choice for getting a website up and running quickly. After setup, almost all administration can be done through the web front end.


Configure LAMP setup

How To Install Linux, Apache, MySQL, PHP (LAMP) stack on Ubuntu

Step 1:  Install WordPress CMS:-

Download the latest WordPress package and extract it by issuing the commands below on the terminal:

$ wget -c
$ tar -xzvf latest.tar.gz

Then move the WordPress files from the extracted folder to the Apache default root directory, /var/www/html/:

$ sudo rsync -av wordpress/* /var/www/html/

Next, set the correct permissions on the website directory, that is give ownership of the WordPress files to the web server as follows:

$ sudo chown -R www-data:www-data /var/www/html/
$ sudo chmod -R 755 /var/www/html/

Step 2: Create WordPress Database

Execute the command below and provide the root user password, then hit Enter to move to the mysql shell:

$ mysql -u root -p 

At the mysql shell, type the following commands, pressing Enter after each line of a mysql command. Remember to use your own, valid values for database_namedatabaseuser, and also use a strong and secure password as databaseuser_password:

mysql> CREATE DATABASE wp_myblog;
mysql> GRANT ALL PRIVILEGES ON wp_myblog.* TO 'your_username_here'@'localhost' IDENTIFIED BY 'your_chosen_password_here';
mysql> EXIT;

Go the /var/www/html/ directory and rename existing wp-config-sample.php to wp-config.php:

$ sudo mv wp-config-sample.php wp-config.php

then update it with your database information under the MySQL settings section (refer to the highlighted boxes in the image below):

// ** 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'); /** Database Charset to use in creating database tables. */ define('DB_CHARSET', 'utf8'); /** The Database Collate type. Don't change this if in doubt. */ define('DB_COLLATE', '');

Afterwards, restart the web server and mysql service using the commands below:

$ sudo systemctl restart apache2.service 
$ sudo systemctl restart mysql.service 

Open your web browser, then enter your server address: http://server-address to get the welcome page below. Read through the page and click on “Let’s go!” to proceed further and fill all requested on screen information .

worpress main page

for any query comment below-

Read More:-

Top 10 Framework of 2k17

Google Assistance Broadcast Message for you

Why need Responsive Website


One thought on “How To Install WordPress with LAMP on Ubuntu 16.04

Leave a Reply

Your email address will not be published. Required fields are marked *