How to install Wordpress in CenOS 7

How to install Wordpress in CenOS 7

WordPress is a blogging platform and content management system. WordPress, according to wordpress.org, is "a cutting-edge semantic personal publishing platform with a focus on aesthetics, Web standards, and usability." You can use this platform to create and manage a website without any coding knowledge. This software allows you to customise almost every aspect of your website.


The latest version of WordPress requires PHP 7.3 or later, so you'll need to install the Remi repository first.



Step 1: Log in to the database server.


Command : # sudo mysql -u root -p





Step 2: Create a database for WordPress, user, grant permissions, flush privileges and after that exit from mysql by using following command .


Commands :


CREATE DATABASE wordpressdb;

CREATE USER 'wordpress_user'@'localhost' IDENTIFIED BY 'Abcd@1234';

GRANT ALL ON wordpressdb.* TO 'wordpress_user'@'localhost';

FLUSH PRIVILEGES;

EXIT;




















Step 3 : Restart mysqld service .


Command : # systemctl restart mysqld 




Step 4: Download the WordPress tarball from the WordPress repository .


Command : # cd /tmp && sudo wget http://wordpress.org/latest.tar.gz





Step 5 : extract the WordPress tarball file a shown.


Command : # sudo tar -xvf latest.tar.gz





Step 6 :Move the ‘WordPress’ folder to the Webroot directory /var/www/html as shown .


Command : # sudo mv wordpress /var/www/html/







Step 7 : Now change the ownership of that directory to user “apache”.

Command : # chown -R apache /var/www/html/wordpress .





Step 8 : change directory to /var/www/html/wordpress .

Command : cd /var/www/html/wordpress



Step 9 : Proceed and rename the wp-config-sample.php to wp-config.php .


Command :  mv wp-config-sample.php wp-config.php



Step 10 : Now , open the file wp-config.php and edit the database , user and password record for Wordpress .

Command :  vi wp-config.php



Edit the database name, user name and password mentioned in step 2 as shown in the screenshot below.
press 'i' for insert mode


Save and exit the file by pressing ‘ESC’ and then ‘:wq’ .

Step 11: We will create a separate virtual host for our WordPress install. Open /etc/httpd/conf/httpd.conf with your favorite text editor:

Command : # vi /etc/httpd/conf/httpd.conf




press 'i' for the insert mode and add the following code at the bottom of the file and replace the marked text with the information related to your installation:


For domain :- 


<VirtualHost *:80>

  ServerAdmin your_domainname 

  DocumentRoot /var/www/html/wordpress

  ServerName your_domainname

  ServerAlias www.your_domainname

  ErrorLog /var/log/httpd/tecminttest-error-log

  CustomLog /var/log/httpd/tecminttest-acces-log common

</VirtualHost>


OR for IP (Testing)


<VirtualHost *:80> 

  DocumentRoot /var/www/html/wordpress

</VirtualHost>




 

Save and exit the file by pressing ‘ESC’ and then ‘:wq’ .


Step 12 : To begin the installation, navigate to your server's IP address at http://ip-address, or if installing locally, navigate to http://localhost, or if using a real domain, navigate to the domain. You should look at the following webpage.




Enter all the necessary information and login to wordpress dashboard .





THANK YOU !

    • Related Articles

    • Upgrading WordPress Manually on Linux sever

      Step 1: login to wordpress by accessing the server IP_address/wp-admin or domain_name/wp-admin in the browser: Step 2 : check the current version of wordpress , i.e 5.0.13 here .  Step 3 : Download the most recent version of WordPress from the ...
    • Install CWP in Centos 7

      CWP is an free and paid license based hosting panel for managing website database,emails,file,etc using a single Panel. In this article we will discuss how to install CWP in Centos 7 Software Requirements You must have a clean/fresh installation of ...
    • Install Plesk on CentOS 7

      Plesk is a private web host panel that provides users with the ability to administer websites, databases, emails and domains for their personal and/or custome clients. Allows simple point-and-click administration / maintenance via a browser. Install ...
    • Install VnStat Network Monitoring on CentOS 7

      Console based network traffic monitoring This article will help you install VnStat network monitoring on your CentOS 7 server. VnStat is console based network traffic monitor for Linux. This will help monitor multiple interfaces at the same time. ...
    • How to Install PHP in CentOS 7

      PHP is the part of our setup that processes code for dynamic content display. It can run scripts, link to our MySQL databases, and view processed content to our web server. Step 1: We can use the following command for the installation of our ...