How to Install WordPress on CentOS 8

How to Install WordPress on CentOS 8

WordPress is a free and open-source content management system written in PHP and paired with a MySQL or MariaDB database with supported HTTPS. Features include a plugin architecture and a template system, referred to within WordPress as Themes.

Install WordPress on centOS; Through this tutorial, we will learn how to install wordpress with mysql on centOS 8.

How to Install WordPress on CentOS 8

Follow the following steps to install wordpress with mysql on centOS 8:

  • Step 1 – Create MySQL Database
  • Step 2 – Download WordPress
  • Step 3 – Extract WordPress Zip
  • Step 4 – Configure WordPress with Database
  • Step 5 – Test WordPress Installation

Step 1 – Create MySQL Database

First of all, open terminal or command line and execute the following command into it to setting up the database:

mysql -u root -p

When prompted, enter MySQL root password that you set up when installing MySQL.

In MySQL, enter the following commands:

create database wordpress character set utf8 collate utf8_bin;

Make sure set own secure password where it says [insert-password-here]

grant all privileges on wordpress.* to wordpressuser@localhost identified by '[insert-password-here]';
flush privileges;
exit

Step 2 – Download WordPress

Execute the following command on command line or terminal to download the latest version of WordPress:

wget http://wordpress.org/latest.tar.gz

Note: if wget is not installed, install it by running the command:

yum install wget

Step 3 – Extract WordPress Zip

Execute the following command on command line or terminal to decompress dowloaded file:

tar -xzvf latest.tar.gz

Step 4 – Configure WordPress with Database

Next, we need to copy wp-config-sample.php to wp-config.php which is where WordPress gets its base configuration. To do that run:

cp wordpress/wp-config-sample.php wordpress/wp-config.php

In our favorite text editor, edit wordpress/wp-config.php

For a basic setup, we need to have the following:

define(‘DB_NAME’, ‘wordpress’);
define(‘DB_USER’, ‘wordpressuser’);
define(‘DB_PASSWORD’, ‘[insert-password-here]’);

Next, execute the following command on command line or terminal to move the WordPress folder to our web directory.

sudo cp -r ~/wordpress/* /var/www/html

Step 5 – Test WordPress Installation

Open the browser and hit the following URL into it to test WordPress installation:

http://yourhostname-or-ipaddress/

Conclusion

Through this tutorial, we have learned how to install WordPress with MySQL on centOS 8.

Recommended CentOS Tutorials

AuthorAdmin

Greetings, I'm Devendra Dode, a full-stack developer, entrepreneur, and the proud owner of Tutsmake.com. My passion lies in crafting informative tutorials and offering valuable tips to assist fellow developers on their coding journey. Within my content, I cover a spectrum of technologies, including PHP, Python, JavaScript, jQuery, Laravel, Livewire, CodeIgniter, Node.js, Express.js, Vue.js, Angular.js, React.js, MySQL, MongoDB, REST APIs, Windows, XAMPP, Linux, Ubuntu, Amazon AWS, Composer, SEO, WordPress, SSL, and Bootstrap. Whether you're starting out or looking for advanced examples, I provide step-by-step guides and practical demonstrations to make your learning experience seamless. Let's explore the diverse realms of coding together.

Leave a Reply

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