尚未完结。。。
sudo adduser XXX sudo
sudo ufw allow 5000
sudo ufw enable
创建环境
mkdir Flask_Blog
cd Flask_Blog/
ls
cd ..
sudo apt install python3-pip
sduo apt install python3-venv
sudo apt install python3-venv
python3 -m venv Flask_Blog/venv
cd Flask_Blog/
ls
source venv/bin/activate
pip install flask
nginx
sudo apt install nginx
sudo rm /etc/nginx/sites-enabled/default
sudo nano /etc/nginx/sites-enabled/flaskblog
nginx: /etc/nginx/sites-enabled/flaskblog:
server {
listen 80;
server_name YOUR_IP_OR_DOMAIN;
location /static {
alias /home/YOUR_USER/YOUR_PROJECT/flaskblog/static;
}
location / {
proxy_pass http://localhost:8000;
include /etc/nginx/proxy_params;
proxy_redirect off;
}
}
gunicorn
···
网友评论