supervisor是一个进程管理工具,以后就不怕reboot了
sudo apt-get update
sudo apt-get install supervisor
然后就是配置了
sudo vi /etc/supervisor/supervisord.conf
添加打开网络管理,并设置密码
[inet_http_server]
port=0.0.0.0:xxxx
username=xxxx
password=********
然后重启一下
sudo supervisorctl reload
就可以通过浏览器管理进程了,不过还什么都没有,下边就配置一下c#的web应用
sudo vi /etc/supervisor/conf.d/cs.conf
添加配置
[program:cs]
command = fastcgi-mono-server4 /applications=/cs/:/home/--/cs/ /socket=tcp:127.0.0.1:9000
directory=
autostart = true
autorestart = true
user = root
redirect_stderr = true
stdout_logfile = /home/--/log/cs.log
记得mkdir log,否则会报错,然后update一下就好啦
sudo supervisorctl update
刷新管理网页也会发现cs项的出现
关于日志中的中文
environment=LC_ALL='en_US.UTF-8',LANG='en_US.UTF-8'
environment=LC_ALL='C.UTF-8',LANG='C.UTF-8'
[program:rds]
command = mono rds.exe
directory= /rds/bin
autostart = true
autorestart = true
user = user
redirect_stderr = true
stdout_logfile = /rds/log/rds.log