centos nginx开机启动
时间: 2023-09-08 14:15:53 浏览: 106
Linux配置nginx自启动
要在CentOS上实现Nginx开机启动,可以使用systemctl命令来完成。下面是具体步骤:
第一步:创建nginx.service文件,可以使用vi编辑器打开并编辑文件:
```
vi /lib/systemd/system/nginx.service
```
在文件中添加以下内容:
```
[Unit]
Description=nginx
After=network.target
<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *3* [Linux-Centos配置nginx开机自启动](https://blog.csdn.net/privateobject/article/details/124712096)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
- *2* [centos 设置开机 自动启动 以nginx为例](https://blog.csdn.net/qq_27309053/article/details/100169809)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文