安装wordpress

cd /opt
wget https://cn.wordpress.org/wordpress-5.0.3-zh_CN.zip
unzip wordpress-5.0.3-zh_CN.zip
mysql -uroot -p

CREATE DATABASE wordpress CHARACTER SET utf8 COLLATE utf8_general_ci;
CREATE USER 'wordpress'@'localhost' IDENTIFIED BY 'wordpress@123$';
GRANT ALL PRIVILEGES ON wordpress.* TO 'wordpress'@'localhost';
FLUSH PRIVILEGES;
EXIT;
vim /etc/nginx/conf.d/wordpress.conf

upstream php-handler {
    server 127.0.0.1:9000;
}

server {
    listen 80;
    server_name t.yjsec.com;
    root /opt/wordpress/;
    add_header Strict-Transport-Security "max-age=15768000;includeSubDomains; preload;";
    add_header X-Content-Type-Options nosniff;
    add_header X-Frame-Options "SAMEORIGIN";
    add_header X-XSS-Protection "1; mode=block";
    add_header X-Robots-Tag none;
    add_header X-Download-Options noopen;
    add_header X-Permitted-Cross-Domain-Policies none;

    index index.php index.html;
    # Load configuration files for the default server block.
    location / {
        try_files $uri $uri/ /index.php?q=$uri&$args;
    }
    location ~ \.php$ {
        fastcgi_pass 127.0.0.1:9000;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include fastcgi_params;
    }

    location /d {
        autoindex on;
        autoindex_exact_size off;
        autoindex_localtime on;
    }

    error_page 404 /404.html;
    location = /40x.html {
    }
    error_page 500 502 503 504 /50x.html;
    location = /50x.html {
    }
}


点赞

发表评论

电子邮件地址不会被公开。必填项已用 * 标注