• Nginx https ssl配置
server {
    listen 443 ssl;   #SSL协议访问端口号为443。此处如未添加ssl,可能会造成Nginx无法启动。
    server_name www.wuloves.com;  #将localhost修改为您证书绑定的域名,例如:www.example.com。
    root /web/www.wuloves.com;
    index index.php index.html index.htm;
    ssl_certificate /key/www.wuloves.com/www.wuloves.com.pem;   #将domain name.pem替换成您证书的文件名。
    ssl_certificate_key /key/www.wuloves.com/www.wuloves.com.key;   #将domain name.key替换成您证书的密钥文件名。
    ssl_session_timeout 5m;
    ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;  #使用此加密套件。
    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;   #使用该协议进行配置。
    ssl_prefer_server_ciphers on; 

#    location / {
#        try_files $uri $uri/ /index.php?$query_string;
#    }
    # 将blog目录下的路由重写到blog/index.php

    location /blog/ {
        if (!-e $request_filename) {
            rewrite ^/ /blog/index.php last;
        }
    }

    location ~ \.php {
        fastcgi_pass   127.0.0.1:9000;
        fastcgi_index  index.php;
        fastcgi_split_path_info  ^(.+\.php)(/.*)$;
        fastcgi_param  PATH_INFO $fastcgi_path_info;
        include        fastcgi.conf;
        if (!-e $request_filename) {
            rewrite ^/ /blog/index.php last;
        }
    }
        access_log /web/logs/www.wuloves.com.success.ssl.log;
        error_log  /web/logs/www.wuloves.com.error.ssl.log;
} 
  • Nginx 强制https访问
server {
    listen       80;
    server_name  www.wuloves.com;
    rewrite ^(.*)$  https://$host$1 permanent;  
    access_log /dev/null;
    error_log  /dev/null;
}

linux下mysql8.0重置密码的方法
过程是先设置无密码登录, 把root的密码设为空字符, 在取消无密码登录, 再登录root, 再执行重置密码动作
无密码登录mysql
systemctl set-environment MYSQLD_OPTS="--skip-grant-tables";
systemctl restart mysqld
mysql 回车即可
update mysql.user set authentication_string=''  where User='root';
ALTER USER 'root'@'localhost' IDENTIFIED BY 'Abc123456!';

  • 安装EPEL源
yum install epel-release -y
  • 安装 REMI 源
yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm -y
  • 安装 Yum 源管理工具
yum install -y yum-utils
  • 安装 PHP7.3
yum install -y php73-php-fpm php73-php-cli php73-php-bcmath php73-php-gd php73-php-json php73-php-mbstring php73-php-mcrypt php73-php-mysqlnd php73-php-opcache php73-php-pdo php73-php-pecl-crypto php73-php-pecl-mcrypt php73-php-pecl-geoip php73-php-recode php73-php-snmp php73-php-soap php73-php-xmll
  • 查看php版本
[root@xgblog ~]# php73 -v
PHP 7.3.20 (cli) (built: Jul  7 2020 07:53:49) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.20, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.3.20, Copyright (c) 1999-2018, by Zend Technologies
  • 加个软链, 方便自己
[root@xgblog bin]# which php73
/usr/bin/php73
打开到 /usr/bin/ 目录, ls -la 可以判断实际指向到/opt/remi/php73/root/usr/bin/php
# 创建软链
ln -s /opt/remi/php73/root/usr/bin/php /usr/bin/php
[root@xgblog bin]# php -v
PHP 7.3.20 (cli) (built: Jul  7 2020 07:53:49) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.20, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.3.20, Copyright (c) 1999-2018, by Zend Technologies
  • 重启php服务
systemctl restart php73-php-fpm
  • 确定9000端口被打开
[root@localhost ~]# netstat -nl
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State      
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN     
tcp        0      0 127.0.0.1:9000          0.0.0.0:*               LISTEN 
  • 编辑nginx配置文件, 参考下面的编辑方式
vim /etc/nginx/nginx.conf
>
server {
    listen       80;
    server_name  abc.de.com;
    root   /var/www/html;
    index  index.php index.html index.htm;
    location / {
        try_files $uri $uri/ /index.php?$query_string;
    }

    access_log /dev/null;
    error_log  /dev/null;
    

    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   /usr/share/nginx/html;
    }

# 下面的内容拷贝到对应的位置
    location ~ \.php {
        fastcgi_pass   127.0.0.1:9000;
        fastcgi_index  index.php;

        fastcgi_split_path_info  ^(.+\.php)(/.*)$;
        fastcgi_param  PATH_INFO $fastcgi_path_info;
        include        fastcgi.conf;
    }
}
  • 设置php服务开机自启动
systemctl enable php73-php-fpm

# 更多php相关操作
systemctl restart php73-php-fpm #重启
systemctl start php73-php-fpm #启动
systemctl stop php73-php-fpm #关闭
systemctl status php73-php-fpm #检查状态