首先,先将文件复制到指定的文件夹
我这里选择在/var下面新建一个www的文件夹来存放
复制BLOG文件夹的内容到www文件夹下
1 sudo cp -r /home/jakeychen/Jakey/Blog/ /var/www/
1 jakeychen@JakeyPC:/var/www/Blog$ sudo service supervisor restart 2 Restarting supervisor: supervisord. 3 jakeychen@JakeyPC:/var/www/Blog$ sudo supervisorctl 4 tornadoes:tornado-8000 RUNNING pid 10949, uptime 0:00:08 5 tornadoes:tornado-8001 RUNNING pid 10950, uptime 0:00:08 6 tornadoes:tornado-8002 RUNNING pid 10951, uptime 0:00:08 7 tornadoes:tornado-8003 RUNNING pid 10952, uptime 0:00:08 8 supervisor>
在conf.d目录下新建一个tornado.conf
sudo vim /etc/supervisor/conf.d/tornado.conf
tornado.conf文件内容
1 [group:tornadoes] 2 programs=tornado-8000,tornado-8001,tornado-8002,tornado-8003 3 4 [program:tornado-8000] 5 command=sudo python /var/www/Blog/main.py --port=8000 6 directory=/var/www/Blog 7 user=root 8 autorestart=true 9 redirect_stderr=true 10 stdout_logfile=/var/www/Blog/logs/server.log 11 loglevel=info 12 13 [program:tornado-8001] 14 command=sudo python /var/www/Blog/main.py --port=8001 15 directory=/var/www/Blog 16 user=root 17 autorestart=true 18 redirect_stderr=true 19 stdout_logfile=/var/www/Blog/logs/server.log 20 loglevel=info 21 22 [program:tornado-8002] 23 command=sudo python /var/www/Blog/main.py --port=8002 24 directory=/var/www/Blog 25 user=root 26 autorestart=true 27 redirect_stderr=true 28 stdout_logfile=/var/www/Blog/logs/server.log 29 loglevel=info 30 31 [program:tornado-8003] 32 command=sudo python /var/www/Blog/main.py --port=8003 33 directory=/var/www/Blog 34 user=root 35 autorestart=true 36 redirect_stderr=true 37 stdout_logfile=/var/www/Blog/logs/server.log 38 loglevel=info
重启服务
sudo service supervisor restart