1,352 views
Liunx-服务安装

LNMP+WordPress

一、LNMP架构原理

二、安装LNMP

1.安装nginx

[code]

rpm -Uvh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm

yum install -y nginx

systemctl start ngin

配置文件路径:/etc/nginx

发布路径:/usr/share/nginx/html/

[/code]

2.安装php-fpm

[code]

yum install php php-fpm php-gd php-mysql php-mbstring php-xml php-odbc php-pear php -xmlrpc -y

systemctl start php-fpm

配置文件路径:/etc/php-fpm.conf

[/code]

3.安装mariadb

[code]

yum install -y mariadb mariadb-server mariadb-devel

systemctl start mariadb

[/code]

4.wordpress下载地址https://cn.wordpress.org/wordpress-4.9.1-zh_CN.tar.gz

[code]

wget https://cn.wordpress.org/wordpress-4.9.1-zh_CN.tar.gz 下载比较慢的话,就用浏览器下载传到服务器

tar -zxf wordpress-4.9.1-zh_CN.tar.gz

cd wordpress

cp * /usr/share/nginx/html/

[/code]

5.安装wordpress

[code]

mysql

create database wordpress;

grant all on wordpress.* to ‘wordpress’@’localhost’ identified by ‘wordpress’;

然后根据提示操作即可

[/code]

PS:如果需要开机启动所有服务,执行下面的命令即可(centos7)

systemctl enable nginx;systemctl enable php-fpm;systemctl enable mariadb

Leave a Reply

影子专属博客 赣ICP备17013143号