安装部分软件: yum install nginx mariadb php php-fpm php-mysql
如果方便的话,更倾向于用源码安装nginx.
安装MySQL:Centos 7 MySQL安装
下载wordpress 安装到指定目录,注意不要是root下的目录。
启动:systemctl start php-fpm
更改nginx配置到root目录下:
贴一份清单:
user root; worker_processes 1; events { worker_connections 1024; } http { include mime.types; default_type application/octet-stream; sendfile on; keepalive_timeout 65; server { listen 80; server_name localhost; location / { #root /usr/share/nginx/html; root /var/www/html; index index.php; } location ~ \.php$ { root /var/www/html; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; # fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; # fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; include fastcgi_params; } error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } } }
403 错误多半是user没有设置对。如果user设置对了,还是找不到文件,可以看一下是否是php那儿upstream的问题,参考:nginx提示php为未知脚本Primary script unknown的解决办法
Nginx 常用命令:http://www.cnblogs.com/apexchu/p/4119252.html
搭建过程:http://jingyan.baidu.com/article/ca41422fd9593c1eae99edac.html