在后端首次启动后,在执行文件根目录下会生成
configs/global.conf文件,此文件可以更改暴露的端口以及pgsql链接字符串。将文章直接上传至
posts目录下,在后端开启的情况下,文章会自动同步到数据库。此目录在可执行文件同级目录下。无法对0.0.0.0暴露。需要配置nginx进行转发。
https://www.postgresql.org/download/sudo -u postgres psqlALTER USER postgres WITH PASSWORD '123456';
默认一般是5432
netstat -tulpn | grep postgressudo -u postgres psql
create database blog;
\q;
sudo -u postgres psql -U postgres -h 127.0.0.1 -d blog -f NanTingBlog.API.Services.Db.BlogContext.sqlserver {
listen 25001 ssl;
server_name yourdns.temp;
ssl_certificate /usr/local/nginx/ssl/yourdns.temp.pem;
ssl_certificate_key /usr/local/nginx/ssl/yourdns.temp.key;
ssl_session_cache shared:SSL:1m;
ssl_session_timeout 5m;
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on;
location / {
proxy_pass http://127.0.0.1:6999/; # 这个看你自己端口
}
}server {
listen 443 ssl;
server_name yourdns.temp;
ssl_certificate /usr/local/nginx/ssl/yourdns.temp.pem;
ssl_certificate_key /usr/local/nginx/ssl/yourdns.temp.key;
ssl_session_cache shared:SSL:1m;
ssl_session_timeout 5m;
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on;
location = /index.html {
proxy_pass http://127.0.0.1:1313/;
}
location / {
proxy_pass http://127.0.0.1:1313;
proxy_intercept_errors on;
error_page 404 =200 /index.html;
}
}nohup http-server /opt/nantingBlog/fornt -p 1313 >> fornt.log &
nohup /opt/nantingBlog/end/NanTingBlog.API >> end.log &如果要使用用户注册功能,必须启用邮箱验证。在应用启动后,可以在根目录下找到configs下找到global.conf文件,需要配置MailOptions项。以qq邮箱为例。
需要前往 qq邮箱 -> 设置 -> 账户与安全 -> 安全设置,开启POP3/IMAP/SMTP/Exchange/CardDAV 服务,并查看[配置方法]
"MailOptions": {
"Account": "",
"AuthorizationCode": "",
"MailAddress": "",
"ReveiveUrl": "imap://imap.qq.com:993",
"SendUrl": "smtp://smtp.qq.com:465",
"UseSSL": true
}

