How to install and setup latest wordpress on CentOS 7 step by step guide

In this tutorial we learn what is wordpress and simple setup of latest version of wordpress on centos server.

What is Wordpress

Wordpress is an  free and open source blogging platform based on PHP and Mysql which is most popular blogging platform all over the world. Wordpress supports 70 different languages and many themes are available for wordpress to create a power ful website and also there are large no plugins available as well.
How to install and setup latest wordpress on CentOS 7 step by step guide
How to install and setup latest wordpress on CentOS 7 step by step guide

Installation LAMP stack

Before installing and setup wordpress we need to install LAMP stack. To install LAMP stack we execute the below command.
[root@localhost ~]# yum install httpd mariadb mariadb-server php php-common php-mysql php-gd php-xml php-mbstring php-mcrypt php-xmlrpc unzip wget –y

After installing the all required packages we start the service . To start the service we execute the below command.
[root@localhost ~]# systemctl start httpd
[root@localhost ~]# systemctl start mariadb

Configure Mariadb for Wordpress
After installing Mariadb package we need to secure mariadb using the below command.
#mysql_secure_installation

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!

In order to log into MariaDB to secure it, we'll need the current
password for the root user.  If you've just installed MariaDB, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none):
OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.

Set root password? [Y/n] y
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
 ... Success!


By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them.  This is intended only for testing, and to make the installation
go a bit smoother.  You should remove them before moving into a
production environment.

Remove anonymous users? [Y/n] y
 ... Success!

Normally, root should only be allowed to connect from 'localhost'.  This
ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] y
 ... Success!

By default, MariaDB comes with a database named 'test' that anyone can
access.  This is also intended only for testing, and should be removed
before moving into a production environment.

Remove test database and access to it? [Y/n] y
 - Dropping test database...
 ... Success!
 - Removing privileges on test database...
 ... Success!

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Reload privilege tables now? [Y/n] y
 ... Success!

Cleaning up...

All done!  If you've completed all of the above steps, your MariaDB
installation should now be secure.

Thanks for using MariaDB!


After securing mariadb we login and  create the database for wordpress.
#mysqladmin –u root -p
MariaDB [(none)]>CREATE DATABASE wordpress;
MariaDB [(none)]>GRANT ALL PRIVILEGES on wordpress.* to 'test'@'localhost' identified by 'testpassword';
MariaDB [(none)]>FLUSH PRIVILEGES;
MariaDB [(none)]>exit

Installing and Configuring WordPress on CentOS 7 server

We can download the latest version of wordpress to execute the below command.
wget http://wordpress.org/latest.tar.gz
Once download finished we extract the compressed package using the below command.
tar -xzvf latest.tar.gz
NOW we move the extracted files to the Apache web root directory using the below command.
 cp -avr wordpress/* /var/www/html/
After that we  create a directory  to store uploaded files using the below command.
mkdir /var/www/html/wp-content/uploads

Now we need to assign proper permission and ownership to the web directory.
chown -R apache:apache /var/www/html/
chmod -R 755 /var/www/html/

Now we rename  the wordpress sample config file and edit it to change the database parameter
 cd /var/www/html/
 mv wp-config-sample.php wp-config.php
 vi wp-config.php
Change the DB_NAME,DB_USER, and DB_PASSWORD variables as shown below.
define('DB_NAME','wordpress');
define('DB_USER', 'test');
define('DB_PASSWORD', 'testpassword');
Save and close the file .
After completion the above steps open the browser and type url http://server-ip and select the language and click continue button and fill up required info and press install to install the wordpress.

After installation successfully we will get the wordpress dashboard.

If this article is helpful to know about how to install and setup latest wordpress on CentOS 7 please share this article.

SHARE

Admin

  • Image
  • Image
  • Image
  • Image
  • Image
    Blogger Comment
    Facebook Comment

0 comments:

Post a Comment