Install WordPress on Centos

Before beginning, a domain, an ESC or a VPS are needed. Once the ECS or the VPS and the domain are prepared, the following procedures can be conducted.

Detailed steps are as followings:

·        Install LAMP services (Linux, Apache, MySQL, PHP).

input these commands:

1. Install Apache, MySQL, and PHP

yum -y install httpd mysql mysql-server php php-mysql php-gd php-xml

2. Set up httpd and mysqld to start with system

systemctl enable httpd.service

“””

·        Updated on 7.26.2018 mysqld.service failed to start.

yum install mariadb-server mariadb -y

systemctl start mariadb.service

systemctl enable mariadb.service

 

·        Updated on 3.2.2019 Applying php7x, old method no longer used.

Install mariadb

yum install mariadb-server mariadb -y

systemctl start mariadb.service

systemctl enable mariadb.service

 

 

·        Install apache:

yum -y install httpd

systemctl start httpd.service

systemctl enable httpd.service

 

·        Install php:

yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm -y

yum install yum-utils -y

yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm -y

yum-config-manager --enable remi-php72

yum -y install php7.2 php7.2-cli php7.2-fpm php7.2-gd php7.2-json php7.2-mysql

 

yum -y install php72 php72-php-fpm php72-php-mysqlnd php72-php-opcache php72-php-xml php72-php-xmlrpc php72-php-gd php72-php-mbstring php72-php-json

systemctl restart httpd.service

 

·        Test:

vim /var/www/html/info.php

<?php

phpinfo();

?>

http://192.168.1.100/info.php

 

“””

·        Start services

systemctl restart httpd.service
systemctl restart mariadb.service

Set up MySQL

mysql_secure_installation
Set root password? [Y/n] // (Y)
Remove anonymous users? [Y/n] // (Y)
Disallow root login remotely? [Y/n] //(n)
Remove test database and access to it? [Y/n] //(Y)
Reload privilege tables now? [Y/n] //(Y)
login MySQL: mysql -u root -p  (the password is empty, just press enter)

mysql> create database wordpress; //create a database and name it as ‘wordpress’

 

·        Getting MySQL Support In PHP

yum -y install php-mysql

yum -y install php-gd php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-soap curl curl-devel

systemctl restart httpd.service

 

·        Install phpMyAdmin

sudo yum install phpMyAdmin -y

vim /etc/httpd/conf.d/phpMyAdmin.conf

 

php not decoding .php

yum install httpd
yum install httpd-devel

yum install php php-pear

 

·        Install WordPress

wget http://wordpress.org/latest.zip 
unzip latest.zip 
cp -r wordpress/* /var/www/html/

cd /var/www/html/
cp wp-config-sample.php wp-config.php
vim wp-config.php

 

Press ‘i’ to write, insert database name, user name and user password. Others remain the same.

Press ‘Esc’ to exit writing mode. Double press ‘Shift’ + ‘z’ to exit the file.

Then, go to your domain to finish WordPress set up.

I used Wanwang to register a domain and Aliyun to set up an ECS. The discounts for students and Double 11th are very attractive. As for the other services in its store, I have not used them yet.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值