main logo

How to install WordPress on CentOS7

Install wordpress on centos7 In this article, we will show you how to install WordPress on a CentOS server.

Login to your server via SSH or KVM, via root.

Disable selinux;

setenforce 0
sed -i ‘s/enforcing/disabled/g’ /etc/selinux/config

Run the following command to install all the required packages for your LAMP stack, which will host the WordPress site;

yum install httpd php php-common php-mysqlnd php-mbstring php-gd mariadb-server mod_ssl -y

Update the Apache config to allow for htaccess to be used;

sed -i ‘s/AllowOverride none/AllowOverride all/g’ /etc/httpd/conf/httpd.conf

Start Apache & MySQL on the server;

systemctl start httpd && systemctl start mariadb

You should now be able to confirm that Apache is started by going to either your server IP address or the domain name you have pointed to the server, in this example we will use the server IP address.
Create the MySQL user and database for WordPress, enter the mysql command to get to a prompt (choose a different password to the below one, just make sure it is secure!)

mysql
CREATE DATABASE wordpress;
GRANT ALL PRIVILEGES ON wordpress.* TO ‘wordpress’@’localhost’ IDENTIFIED BY ‘Eh4wph8WItSO’;

Download and put into place the latest version of WordPress;

curl -O https://wordpress.org/latest.tar.gz
tar zxvf latest.tar.gz
mkdir /var/www/html/
mv wordpress/* /var/www/html/

Update the permissions so that we can upload files through the WordPress control panel;

chown -R apache:apache /var/www/html

You can now go to your site URL or IP address in the browser to complete the WordPress installation, below are the following pages you should go through to complete the install;

On the following page you should enter the details that you used earlier when creating the MySQL database;

9. Your site is now setup and ready to login to, if you go to your URL or server IP address you should see a basic WordPress installation. You can login to your WordPress admin control panel at http://IP-ADDRESS/wp-admin/.

Please have a look at our VPS servers sections to have high a speed WordPress site

For official guidelines and additional details on installing WordPress, refer to the WordPress Codex Installation Guide.

To learn more about setting up and configuring a CentOS 7 server before installing WordPress, visit CentOS 7 Server Setup and Configuration.

Surya Reddy
Surya Reddy
Surya works at Medha Cloud and has been there for two years. He's an expert in his field, and besides helping customers as a Technical Support Engineer, he also shares his insights through blogs. Always curious, Surya keeps an eye on the latest tech to stay ahead.
Share
Contents

Related Articles

medhacloud logo
USA:
Medha Cloud Solutions LLC
30 N Gould St Ste R, Sheridan, WY 82801,
Phone: +1 646 775 2855

India:
Medha Cloud Solutions Private Limited
#74, 7th Cross, Krishna Garden InCity Layout. Chikka Kammanahalli, Banneraghatta Road, Bangalore 560083
Phone:+91 93536 44646

E-Mail: support@medhahosting.com
©Medha Cloud 2024. All rights reserved.