잡담 배치
nginx 위치 vim / etc / nginx / nginx. conf / usr / local / openresty / nginx / sbin / nginx
vim i 삽입 esc: w 저장: q 종료
supervisor 명령 supervisorctl 서비스 감독자 재 시작
python 2 python 3 전환
sudo update-alternatives --install /usr/bin/python python /usr/bin/python2 100
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 150
그리고 입력:
sudo update-alternatives --config python
nginx - s reload 포트 점용 보기
lsof -i:80
로 컬 덮어 쓰기 강제
git fetch --all
git reset --hard origin/master
git pull
#!/usr/bin/env python3
import sys
#
from os.path import abspath
from os.path import dirname
sys.path.insert(0, abspath(dirname(__file__)))
# app.py
import app
# application
# gunicorn
# Flask
# ( )
application = app
# -*- coding: utf-8 -*-
import os
from manage import app
import datetime
# Create an application instance that web servers can use. We store it as
# "application" (the wsgi default) and also the much shorter and convenient
# "app".
application = app
@app.context_processor
def template_extras():
"""
,
:return:
"""
return {'enumerate': enumerate, 'len': len, 'datetime': datetime}
# apache gunicorn nginx
"""
➜ ~ cat /etc/supervisor/conf.d/python101.conf
[program:test]
command=/usr/local/bin/gunicorn wsgi --bind 0.0.0.0:80 --pid /tmp/todo.pid
directory=/root/tmp/test
autostart=true
"""/usr/local/bin/gunicorn -w 4 -b 127.0.0.1:81 manage:app
from manage import db
db.create_all()
python manage.py db
./venv/bin/gunicorn -w 4 -b 127.0.0.1:8080 manager:app
gunicorn --worker=3 manage:manager -b 0.0.0.0:8000
gunicorn -b 127.0.0.1:8000 -k gevent -w 1 manager.wsgi
gunicorn wsgi --bind 0.0.0.0:8000
gunicorn -b 127.0.0.1:8000 -k gevent -w 1 wsgi
[program:python101]
command=/usr/local/bin/gunicorn wsgi --bind 0.0.0.0:8000
directory=/var/www/python101
autostart=true
nano /etc/supervisor/conf.d/python101.conf
vim /etc/supervisor/conf.d/bbs.conf
vim /etc/supervisor/conf.d/python101.conf
[program:python101] command=/usr/local/bin/gunicorn wsgi --bind 0.0.0.0:8000 --pid /tmp/python101.pid directory=/root/var/www/python101 autostart=true autorestart=true
supervisorctl
service supervisor restart
cat /etc/nginx/sites-enabled/chat
vim /etc/nginx/sites-enabled/python101
rm /etc/nginx/sites-enabled/python101
service nginx restart
cat /etc/nginx/sites-enabled/python101
cat /etc/nginx/nginx.conf
vim /etc/nginx/sites-enabled/chat
vim /etc/supervisor/conf.d/python101.conf
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
다양한 언어의 JSONJSON은 Javascript 표기법을 사용하여 데이터 구조를 레이아웃하는 데이터 형식입니다. 그러나 Javascript가 코드에서 이러한 구조를 나타낼 수 있는 유일한 언어는 아닙니다. 저는 일반적으로 '객체'{}...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.