在CentOS7下将nginx添加到systemctl
来源:互联网 发布:阿里移动推荐算法总结 编辑:程序博客网 时间:2024/05/22 05:22
1、正确安装Nginx
安装Nginx请自行百度
2、将Nginx添加到systemctl
在/usr/lib/systemd/system/下新建文件“nginx.service”
编辑nginx.service,输入如下内容
[Unit]Description=nginx - high performance web server Documentation=http://nginx.org/en/docs/After=network.target remote-fs.target nss-lookup.target[Service]Type=forkingPIDFile=/var/run/nginx.pidExecStartPre=/usr/sbin/nginx -t -c /etc/nginx/nginx.confExecStart=/usr/sbin/nginx -c /etc/nginx/nginx.confExecReload=/bin/kill -s HUP $MAINPIDExecStop=/bin/kill -s QUIT $MAINPIDPrivateTmp=true[Install]WantedBy=multi-user.target
编辑保存
3、将Nginx设置为开机启动
[root@localhost init.d]# systemctl enable nginx.service
测试启动Nginx
[root@localhost init.d]# systemctl start nginx.service
阅读全文
0 0
- 在CentOS7下将nginx添加到systemctl
- centos7使用systemctl控制nginx
- 在centos7下使用systemctl加入自建服务
- 在win7下将nginx添加到系统变量造成的悲剧
- 在CentOS7中systemctl命令
- CentOS7利用systemctl添加自定义系统服务
- CentOS7利用systemctl添加自定义系统服务
- 在windows下将Nginx添加为系统服务
- mongodb 在centos7里用systemctl起不来
- nginx在centos7下开启80端口
- 在 CentOS7 下用 yum 安装 nginx
- 在Centos7下源代码安装配置Nginx
- Centos7下systemctl status postgresql 命令相关研究
- Centos7下的systemctl命令与service和chkconfig
- Centos7下的systemctl命令与service和chkconfig
- Centos7下的systemctl命令与service和chkconfig
- centos7下systemctl管理springboot微服务的基础配置
- 在IPython下如何将常用模块的目录添加到模块的搜索路径下
- python3 闭包的两种情况
- Java堆和栈
- Makefile基础教程 9
- git 冲突解决技巧
- 数袋鼠好有趣
- 在CentOS7下将nginx添加到systemctl
- 基础代码-维护图的连通性
- C++连接Mysql
- Makefile基础教程 10
- iOS学习笔记-133.RunLoop01——基础知识
- HDU 6201 transaction transaction transaction(树上dfs/费用流)
- 洛谷 P1967 货车运输(Kruskal最大生成树&&倍增lca)
- hadoop初识之十一:mapreduce编写格式与示例, 并在yarn上运行
- ICPC2017网络赛(沈阳)1008&HDU6201transaction(spfa 费用流)