register nginx systemctl service
Register nginx systemctl service
Easy to manage and use ,,,
vi /lib/systemd/system/nginx.service
Add the following code
1
2
3
4
5
6
7
8
9
10
11
12
13
[Unit]
Description = nginx
After = network.target
[Service]
Type = forking
ExecStart = /usr/local/nginx/sbin/nginx
ExecReload =/us/local/nginx/sbin/nginx -s reload
ExecStop =/usr/local/nginx/sbin/nginx -s quit
PrivateTmp =true
[Install]
WantedBy = multi-user.target
Common commands
1
2
3
4
5
systemctl start nginx.service //start nginx service
systemctl stop nginx.service //close nginx service
systemctl restart nginx.service // restart nginx service
systemctl reload snginx.service //reload nginx configuration file
systemctl status nginx.service // View nginx service status
💘 相关文章
- Nginx – Unit nginx.service is masked的解决方法
- 注册nginx的systemctl服务
- nginx: [emerg] unknown directive "set_real_ip_from"的解决方法
- 不会配置nginx?这个在线配置nginx的网站非常方便
- 一款可视化适合小白的cdn构建系统
- nginx打上QUIC补丁,抢先体验http3
- nginx: [warn] "ssl_stapling" ignored, issuer certificate not found for certificate的错误解决方法
- digitalocean開源nginx可視化配置工具,非常適合新手小白,支持漢化
- nginx反向代理配置演示,包括静态资源处理,百分百成功
- openwrt使用Nginx 替代uhttpd