nginx部署与小程序配置说明
1、安装nginx
$ sudo apt-get update
$ sudo apt-get install nginx
2、配置https:
查看:
https://help.aliyun.com/knowledge_detail/95491.html?spm=5176.2020520154.cas.64.7dd7Quq8Quq8ap
mkdir /opt/cert
把证书上传到这个文件夹
在/etc/nginx/conf.d下增加一个文件default.conf
内容:
server {
listen 443;
server_name localhost;
ssl on;
root html;
index index.html index.htm;
ssl_certificate /opt/cert/2012832_sqw.iruiyi.net.pem;
ssl_certificate_key /opt/cert/2012832_sqw.iruiyi.net.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 / {
root html;
index index.html index.htm;
}
}
3、将图片上传到 这个目录,比如:dir1/abc.jpg
/usr/share/nginx/html
(本地也注意将图片上传git,避免丢失)
4、在浏览器中访问:
https://sqw.iruiyi.net/dir1/abc.jpg
能正常访问则正常。
5、小程序,设置 开发 - request路径
设置https://sqw.iruiyi.net
搭建msql服务,
https://www.cnblogs.com/heimaoloveyu/archive/2018/12/13/10113740.html
配置mysql文件
https://www.cnblogs.com/YunnuoFan/p/8482449.html
service mysql restart
service mysql status
创建数据库
create database sqw;
use sqw;
set names utf8;
导入数据:
source /home/test.sql;
https://blog.csdn.net/hewenjing8168/article/details/80821447
show tables;
允许所有用户访问
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY ' ' WITH GRANT OPTION;
FLUSH PRIVILEGES;
添加安全组规则