server {
listen 80 default_server;
listen [::]:80 default_server;
server_name _;
root /var/www/html;
# Load configuration files for the default server block.
include /etc/nginx/default.d/*.conf;
location ~ \.php$ {
root /var/www/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 / {
index index.php index.html;
}
error_page 404 /404.html;
location = /40x.html {
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
}
}
mysql mysql数据库里面主要就是新建一个数据库和用户供wordpress使用 首先 通过mysql -u root -p进入MySQL,然后:
CREATE DATABASE WDB;
CREATE USER 'WUSER'@'%' IDENTIFIED BY 'WPASS';
#创建一个用户,用户名 :WUSER,密码:WPASS,@ % 是用户的权限。
GRANT ALL ON WDB.* TO 'WUSER'@'%' IDENTIFIED BY 'WPASS';
flush privileges;
#刷新数据库