下载好安装包后:进行解压:只需将upload文件夹移动到/usr/share/nginx/html/下。
1.部署LNMP环境
安装epel源:
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
部署LNMP环境:
yum install nginx mariadb-server php php-mysql php-gd php-fpm -y
修改数据库密码:(也可以不修改)
mysqladmin -uroot password '123456'
创建数据库: create database wordpress character set utf8;
赋予权限: granted all on wordpress.* to wordpress@localhost identified by '密码';
2.配置LNMP环境
在nginx.conf中配置php-fpm:
location ~ \.php$ {
root /usr/share/nginx/html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
有可能没有location,增加location,还有index.php:
location / {
root html;
index index.html index.htm index.php;
}
在/etc/php.ini 增加以下两行。
cgi.fix_pathinfo=0
date.timezone ="Asia/shanghai"
启动服务
然后通过http://ip/load进行访问部署
然后通过http://ip/load进行访问部署