sudo apt-get update -y
sudo apt-add-repository ppa:ondrej/php
sudo apt-get install nginx mysql-server php8.1-fpm php8.1-mysql -y
sudo apt install nginx=1.18.0-0ubuntu1.2
vi /etc/nginx/nginx.conf
vi /etc/nginx/conf.d/default.conf
wget https://cn.wordpress.org/latest-zh_CN.tar.gz
tar zxvf latest-zh_CN.tar.gz
cp wordpress/wp-config-sample.php wordpress/wp-config.php
chown -R www-data.www-data wordpress
vi /usr/share/nginx/wordpress/wp-config.php
vi /etc/mysql/mysql.conf.d/mysqld.cnf
mysql -u root -p
create database Soar;
create user Soar@’%’ identified by ‘123456’;
GRANT ALL ON . TO ‘Soar’@’%’;
FLUSH PRIVILEGES;
exit;
systemctl restart nginx
server{
listen 80;
listen [::]:80;
server_name www.wenping.ga wenping.ga;
rewrite ^(.*) https://${server_name}$1 permanent;
}
server{
listen 443 ssl;
listen [::]:443 ssl;
server_name www.wenping.ga wenping.ga;#可用域名
ssl_certificate /root/cert.crt; #证书路径
ssl_certificate_key /root/private.key; #私钥路径
root /usr/share/nginx/wordpress;
index index.php index.html;
server_tokens off;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3;
ssl_prefer_server_ciphers on;
ssl_ciphers “ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE”;
ssl_ecdh_curve secp384r1;
ssl_session_cache shared:SSL:10m;
ssl_session_tickets off;
ssl_stapling on; #ensure your cert is capable
ssl_stapling_verify on; #ensure your cert is capable
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php8.1-fpm.sock;
}
}
没有评论:
发表评论