linux + nginx + supervisor
服務(wù)運(yùn)行
linux++nginx+supervisor
nginx:開機(jī)啟動(dòng)配置文件/ib/systemd/system/nginx.service
#啟動(dòng)nginx服務(wù)
systemctlenablenginx.service
systemctlstartnginx.service
supervisor進(jìn)程管理工具,python編寫的:監(jiān)控進(jìn)程狀態(tài),進(jìn)程異常退出時(shí)自動(dòng)重啟
supervisor.service
supervisor.conf
在線安裝:
yuminstallpython-setuptools
easy_installsupervisor
配置supervisor
mkdir/etc/supervisor
echo_supervisord_conf>/etc/supervisor/supervisord.conf
在supervisord.conf文件最后一行添加:
include
files=/etc/supervisor/conf.d/*.conf
nginx.service:
#服務(wù)的說明
Unit
#描述服務(wù)
Description=nginx
#描述服務(wù)類別
After=network.target
#服務(wù)運(yùn)行參數(shù)的設(shè)置
Service
#Type=forking是后臺(tái)運(yùn)行的形式
Type=forking
#服務(wù)的具體運(yùn)行命令
ExecStart=/usr/local/nginx/sbin/nginx-c/usr/local/nginx/conf/nginx.conf
#重啟命令
ExecReload=/usr/local/nginx/sbin/nginx-sreload
#停止命令
ExecStop=/usr/local/nginx/sbin/nginx-sstop
#PrivateTmp=True表示給服務(wù)分配獨(dú)立的臨時(shí)空間
PrivateTmp=true
#運(yùn)行級(jí)別下服務(wù)安裝的相關(guān)設(shè)置,可設(shè)置為多用戶,即系統(tǒng)運(yùn)行級(jí)別為3
Install
WantedBy=multi-user.target
Tags:服務(wù)運(yùn)行,linux + nginx + supervisor
版權(quán)聲明:本站文章來源標(biāo)注為YINGSOO的內(nèi)容版權(quán)均為本站所有,歡迎引用、轉(zhuǎn)載,請(qǐng)保持原文完整并注明來源及原文鏈接。禁止復(fù)制或仿造本網(wǎng)站,禁止在非www.sddonglingsh.com所屬的服務(wù)器上建立鏡像,否則將依法追究法律責(zé)任。本站部分內(nèi)容來源于網(wǎng)友推薦、互聯(lián)網(wǎng)收集整理而來,僅供學(xué)習(xí)參考,不代表本站立場(chǎng),如有內(nèi)容涉嫌侵權(quán),請(qǐng)聯(lián)系alex-e#qq.com處理。