$ service supervisor stop
$ ps aux | grep uwsgi
$ kill -9 PID
$ rm /tmp/uwsgi.sock
$ vi /etc/supervisor/supervisor.conf
---
[inet_http_server]
port = 0.0.0.0:9001
username = future
password = future_01
---
$ vi /etc/supervior/conf.d/service.conf
---
[program:service]
command=/home/service/aws_flask/run.sh
environment=HOME='/home/service',USER='service'
directory=/home/service/aws_flask
autostart=true
autorestart=true
startretries=3
---
$ vi /home/service/aws_service/env/uwsgi.ini
---
[uwsgi]
chdir=/home/service/aws_flask/
chmod-socket=666
callable=app
module=app
socket=/tmp/uwsgi.sock
virtualenv=/home/service/aws_flask
master=true
processes=5
max-requests=1000
harakiri=10
lazy-apps=true
logto=/var/log/uwsgi/uwsgi.log
enable-threads = true
---
vi /home/service/aws_service/run.sh
---
source /home/service/aws_service/bin/activate
exec uwsgi --ini /home/service/aws_service/env/uwsgi.ini
---
$ service nginx restart
$ cd /tmp; ls -al
$ /home/service/aws_flask/run.sh
ctrl + c
$ cd /tmp; ls -al
$ service supervisor start
$ supervisorclt
'Python' 카테고리의 다른 글
heroku 설정 방법 (0) | 2018.03.07 |
---|---|
python, stored-procedure, mysql, flask, run api (0) | 2018.03.02 |
ubuntu, flask restful (0) | 2018.02.26 |
AWS Cloud, Python, Use sshtunneling to store rds data in a local database (0) | 2018.02.25 |
python, heroku, git, flask 샘플코드 (0) | 2018.01.27 |