Linux监控FastCGI程序自启,Linux系统(centos7.6)设置fastcgi-mono-server2开机启动

濮阳和泰
2023-12-01

Linux系统(centos7.6)设置fastcgi-mono-server2开机启动:

vim /etc/systemd/system/fastcgi.service

[Unit]

Description=FastCgi-mono-server for Application

After=syslog.target network.target

[Service]

Type=simple

ExecStart=/usr/local/mono/bin/fastcgi-mono-server2 /socket=tcp:9000 /address=127.0.0.1 /applications=/:/var/www/html /port=9000 /loglevels=Error /logfile=/var/log/nginx/xsp.log &

Restart=always

[Install]

WantedBy=multi-user.target

说明:

network.target代表有网路,network-online.target代表一个连通着的网络。

加载服务器配置文件:

systemctl daemon-reload

systemctl status fastcgi.service 查看服务状态

systemctl stop fastcgi.service 停止服务

systemctl start fastcgi.service 开启服务

systemctl stop fastcgi 停止服务

systemctl start fastcgi 开启服务

设为开机自动启动:

systemctl daemon-reload

systemctl start fastcgi.service

systemctl enable fastcgi

systemctl status fastcgi.service

Loaded: loaded (/etc/systemd/system/fastcgi.service; disabled; vendor preset: disabled) 禁用状态

Loaded: loaded (/etc/systemd/system/fastcgi.service; enabled; vendor preset: disabled) 启用自启动状态

请开启xsp调试:

/loglevels=Error /logfile=/var/log/nginx/xsp.log 这两个要同时设置才会显示详细出错信息 &表示该命令在后台运行

/usr/local/mono/bin/fastcgi-mono-server2 /socket=tcp:9000 /address=127.0.0.1 /applications=/:/var/www/html /port=9000 /loglevels=Error /logfile=/var/log/nginx/xsp.log &

查看服务器已开启的端口:

netstat -lntp

 类似资料: