硬链接 软链接
image.pngimage.png
image.png image.png
======================================================
自定义服务
[Unit]
Description=nginx server daemon
[Service]
Type=forking
ExecStart=/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
ExecStop=/usr/local/nginx/sbin/nginx -s stop
[Install]
WantedBy=multi-user.target
-
vim /etc/systemd/system/nginx.service
image.png - 程序加载 systemctl daemon-reload
让 systemd 加载服务 - 查看端口号 ss -ntal |grep '8080'
- 关闭端口 /usr/local/nginx/sbin/nginx -s stop
- 查看 端口 ss -ntal |grep '8080' // 此时端口已关闭
- systemctl start nginx.service //开启服务
systemctl status nginx.service //查看服务状态 - ss -ntal |grep '8080' //查看端口号
网友评论