Install WordPress 4.9 On Ubuntu 16.10/16.04-LINUX (5-SETUP)

 Install WordPress 4.9 On Ubuntu 16.10/16.04

 open terminal

1: Install Apache Web Server

$ sudo apt-get install apache2 apache2-utils
$ sudo systemctl enable apache2
$ sudo systemctl start apache2
To test whether the server is running open web browser and enter http://your server add
apache2 screen showing then ok  Note: The Apache default root directory is /var/www/html 

2: Install MySQL Database Server

$ sudo apt-get install mysql-client mysql-server
note: During the package installation, you will be prompted to set the root user password for mysql

3: Install PHP and Modules

$ sudo apt-get install php7.0 php7.0-mysql libapache2-mod-php7.0 php7.0-cli php7.0-cgi php7.0-gd  
test if php is working in collaboration with the web server, we need to create a info.php file inside /var/www/html
$ sudo vi /var/www/html/info.php

And paste the code below into the file, save it and exit.

<?php 
phpinfo();
?>
When that is done, open your web browser and type in the this address http://server_address/info.php You should be able to view the php info page below as a confirmation

4: Install WordPress CMS

$ wget -c http://wordpress.org/latest.tar.gz
$ tar -xzvf latest.tar.gz
sudo rsync -av wordpress/* /var/www/html/
$ sudo chown -R www-data:www-data /var/www/html/
$ sudo chmod -R 755 /var/www/html/

5: Create WordPress Database

$ mysql -u root -p
mysql> CREATE DATABASE wp_myblog;
mysql> GRANT ALL PRIVILEGES ON wp_myblog.* TO 'your_username_here'@'localhost' IDENTIFIED BY 'your_chosen_password_here';
mysql> FLUSH PRIVILEGES;
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', ''); restart the web server and mysql service
$ 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

Leave a Reply

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