安装sqlite和wordpress

apt install unzip
apt install php7.3-cgi php7.3-fpm php7.3-curl php7.3-gd php7.3-mbstring php7.3-xml php7.3-sqlite3 sqlite3 -y 
systemctl enable php7.3-fpm
systemctl restart php7.3-fpm
wget --no-check-certificate https://wordpress.org/latest.tar.gz -O wordpress.tar.gz
tar -zxvf wordpress.tar.gz -C /html
mv /html/wordpress/* /html
rm -rf /html/wordpress
rm -rf wordpress.tar.gz

wget --no-check-certificate https://downloads.wordpress.org/plugin/sqlite-integration.1.8.1.zip -O sqlite.zip
unzip sqlite.zip -d /html
mv /html/wp-config-sample.php /html/wp-config.php
mv /html/sqlite-integration /html/wp-content/plugins/
mv /html/wp-content/plugins/sqlite-integration/db.php /html/wp-content/
sed -i "s/define('DB_COLLATE', '');/define('DB_TYPE', 'sqlite');/g" /html/wp-config.php
rm -rf sqlite.zip
 
chmod -R 777 /html

注释掉listen = /run/php/php7.3-fpm.sock

nano /etc/php/7.3/fpm/pool.d/www.conf
#找到listen = /run/php/php7.3-fpm.sock注释掉
#然后添加listen = 127.0.0.1:9000

nginx.conf配置

user  root; #注意用户名
worker_processes  1;
error_log /etc/nginx/logs/error.log warn; #注意路径
pid        /run/nginx.pid;
events {
    worker_connections  1024;
}
http {
    include       /etc/nginx/conf/mime.types; #注意路径
    default_type  application/octet-stream;
    log_format  main  '\$remote_addr - \$remote_user [\$time_local] "\$request" '
                      '\$status \$body_bytes_sent "\$http_referer" '
                      '"\$http_user_agent" "\$http_x_forwarded_for"';
 access_log /etc/nginx/logs/access.log main; #注意路径
    sendfile        on;
    #tcp_nopush     on;
    keepalive_timeout  120;
    client_max_body_size 20m;
    #gzip  on;
    include /etc/nginx/conf/conf.d/*.conf;
}
d.conf配置
server {
    listen 0.0.0.0:443;
    listen [::]:443;
    ssl on;
    ssl_certificate       /etc/nginx/ssl/www.kkiikk.top.crt;
    ssl_certificate_key   /etc/nginx/ssl/www.kkiikk.top.key;
    ssl_protocols         TLSv1.3 TLSv1.2;
    ssl_ciphers             TLS13-AES-256-GCM-SHA384:TLS13-CHACHA20-POLY1305-SHA256:TLS13-AES-128-GCM-SHA256:TLS13-AES-128-CCM-8-SHA256:TLS13-AES-128-CCM-SHA256:EECDH+CHACHA20:EECDH+CHACHA20-draft:EECDH+ECDSA+AES128:EECDH+aRSA+AES128:RSA+AES128:EECDH+ECDSA+AES256:EECDH+aRSA+AES256:RSA+AES256:EECDH+ECDSA+3DES:EECDH+aRSA+3DES:RSA+3DES:!MD5;
    server_name www.kkiikk.top;
    index index.html index.htm index.php;
    root  /html;
    error_page 400 = /400.html;

    location ~ [^/]\.php(/|$) {
            try_files $uri =404;
            fastcgi_pass 127.0.0.1:9000; #这里注意,填写与php-fpm的listen相对应的端口
            fastcgi_index index.php;
            set $path_info $fastcgi_path_info;
            set $real_script_name $fastcgi_script_name;
            if ($fastcgi_script_name ~ "^(.+?\.php)(/.+)$") {
                set $real_script_name $1;
                set $path_info $2;
            }
            fastcgi_param SCRIPT_FILENAME $document_root$real_script_name;
            fastcgi_param SCRIPT_NAME $real_script_name;
            fastcgi_param PATH_INFO $path_info;
            include fastcgi_params;
    }

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

    # Config for 0-RTT in TLSv1.3
    ssl_early_data on;
    ssl_stapling on;
    ssl_stapling_verify on;
    add_header Strict-Transport-Security "max-age=31536000";
}
server {
listen 80;
listen [::]:80;   #没有ipv6的话要注释掉这行
server_name www.kkiikk.top;
return 301 https://www.kkiikk.top$request_uri;
}
server {
    listen 80;
    listen [::]:80;   #没有ipv6的话要注释掉这行
    server_name kkiikk.top;
    return 301 https://www.kkiikk.top$request_uri;
}
server {
    listen 443;
    listen [::]:443;   #没有ipv6的话要注释掉这行
    server_name kkiikk.top;
    return 301 https://www.kkiikk.top$request_uri;
}
最后修改:2023 年 12 月 19 日
如果觉得我的文章对你有用,请随意赞赏