---
title: "nginx Linux启动脚本"
author: "waiting"
date: "2011-10-07T18:31:40Z"
tags: []
categories: ["操作系统"]
slug: "nginx-linux"
draft: false
lastmod: "2011-10-07T18:31:40Z"
id: 1186365
url: "https://waiting.iteye.com/blog/1186365"
---

nginx启动脚本，CentOS运行测试通过

 

解压文件到 /etc/init.d/ 目录下，运行以下命令安装nginx服务

 

```
# chkconfig --add nginx
# chkconfig nginx on
```

 

然后就可以两种方式来管理nginx服务

 

```
# /etc/init.d/nginx start|stop|reload|restart
```

或者

 

```
# service nginx start|stop|reload|restart
```