nginx+php+wordpres博客

nginx1.23+php7.4 wordpress华为云centos7.9 来搭建

编辑nginx配置文件vim/etc/nginx/conf.d/wordpress.conf内容为

server {
listen 80;
server_name 777.echo.com;#公私网域名或者ip地址

root /usr/share/nginx/html;#网站的发布目录,吧wordpress解压放在此目录下。
index index.php index.html index.htm;

location / {
    try_files $uri $uri/ /index.php?$args;
}

location ~ \.php$ {
    include /etc/nginx/fastcgi_params;
    fastcgi_pass 127.0.0.1:9000;
    fastcgi_index index.php;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}

location ~* \.(jpg|jpeg|gif|css|png|js|ico|xml)$ {
    expires 1d;
    access_log off;
}

}

mysql的安装版本5.7.40yum方式

wget https://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm

安装yum源5.7

yum install mysql-server –nogpgcheck

systemctl start mysqld ##先启动MySQL这样才会有临时密码

然后再过滤出临时密码

grep ‘password’ /var/log/mysqld.log

拿到密码后先登录mysql

mysql -uroot -p’你的临时密码’

进入mysql后更改密码

ALTER USER ‘root’@’localhost’ IDENTIFIED BY ‘new_password’;

然后exit退出后,测试新密码是否可用

然后mysql -uroot -p你的新密码 -e create database wordpress#为wordpress创建一个库

授权用户

GRANT ALL PRIVILEGES ON wordpress.* TO ‘wpuser’@’localhost’; FLUSH PRIVILEGES; EXIT;

One thought on “nginx+php+wordpres博客

回复 一位 WordPress 评论者 取消回复

您的邮箱地址不会被公开。 必填项已用 * 标注

Back To Top