Site icon TestingDocs.com

Install WordPress on the Linux machine

Overview

In this tutorial, we will go through the steps involved to install WordPress CMS (Content Management System)on the Linux machine.

About WordPress

WordPress is open-source web software that we can use to create a website or blog. WordPress powers more than 30% of the websites on the internet. WordPress is free software to use for any website or blog both personal or commercial purposes without paying a license.

WordPress is powered by thousands of themes and plugins. We can easily customize the look & feel and add functionality to your websites on the fly.

Install Apache Web Server

https://www.testingdocs.com/install-apache-http-server-on-ubuntu-linux/

Install WordPress

To install WordPress, issue the following command in the terminal window.

$ sudo apt install wordpress

Install PHP

PHP is the programming language used to build and maintain WordPress. Newer versions of PHP are faster and more secure, so staying up to date will help your site’s overall performance and security. The minimum recommended version of PHP is 7.4.

Install the PHP latest version on the machine.

$ sudo apt install php libapache2-mod-php php-mysql

Install MySQL

https://www.testingdocs.com/install-mysql-server-on-linux/

Create a Database user

Create a database user and grant ALL PRIVILEGES to the user.

Apache Configuration

Navigate to /ect/apache2/sites-available

Create wordpress.conf

 

Add the following code to the conf file.

Alias /blog /usr/share/wordpress
<Directory /usr/share/wordpress>
    Options FollowSymLinks
    AllowOverride Limit Options FileInfo
    DirectoryIndex index.php
    Order allow,deny
    Allow from all
</Directory>
<Directory /usr/share/wordpress/wp-content>
    Options FollowSymLinks
    Order allow,deny
    Allow from all
</Directory>

 

Navigate to /etc/wordpress

Create a file config-localhost.php file.

Add the database information to the file.

 

<?php
define('DB_NAME', 'your_WordPress_DB_goes_here');
define('DB_USER', 'your_DB_User_goes_here');
define('DB_PASSWORD', 'your_DB_User_Password_goes_here');
define('DB_HOST', 'localhost');
define('DB_COLLATE', 'utf8_general_ci');
define('WP_CONTENT_DIR', '/usr/share/wordpress/wp-content');
?>

 

Configure WordPress

 

 

For more information on WordPress, visit the official website:
https://wordpress.org/

Exit mobile version