栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 系统运维 > 运维 > Linux

linux oracle 开机自启动 nginx

Linux 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

linux oracle 开机自启动 nginx

添加xxx.service文件,挂载到multi-user.target

操作目录:/etc/systemd/system/

1、nginx配置

a、添加文件nginx.service

b、内容

[Unit]
Description=nginx service
After=network.target

[Service]
# 启动模式 是后台运行的形式
Type=forking 
# 启动命令
ExecStart=/home/slt/nginx_server/sbin/nginx
# 重新加载命令
ExecReload=/home/slt/nginx_server/sbin/nginx -s reload
# 停止命令
ExecStop=/home/slt/nginx_server/sbin/nginx -s quit
# 表示给服务分配独立的临时空间
PrivateTmp=true

[Install]
WantedBy=multi-user.target

c、加入开机启动

systemctl enable nginx.service

d、测试命令

# systemctl start nginx.service          启动nginx服务
# systemctl stop nginx.service           停止服务
# systemctl restart nginx.service        重新启动服务
# systemctl list-units --type=service     查看所有已启动的服务
# systemctl status nginx.service          查看服务当前状态
# systemctl enable nginx.service          设置开机自启动
# systemctl disable nginx.service         停止开机自启动
转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/880954.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号