首先安装supervisor, 此步骤略过, 在centos7使用命令
yum install supervisor -y增加开机启动
systemctl enable supervisordsupervisord 的配置 文件是 /etc/supervisord.conf
打开
vi /etc/supervisord.conf
添加以下内容
[program:idea-server]
command=/home/IdeaServer -p 1024
autostart=true
autorestart=true
startsecs=3注: IdeaServer 文件是许可文件, 需要具备执行权限, 添加执行权限
chmod +x IdeaServer重启supervisord , 命令
supervisorctl reload让配置生效
nginx代理:
server
{
listen 80;
server_name idea.test.com;
location / {
proxy_pass http://127.0.0.1:1017;
proxy_redirect off;
}
}