nginx的安装步骤
时间: 2024-01-24 20:15:16 浏览: 149
nginx安装步骤详细
以下是Nginx的安装步骤:
1. 下载Nginx源码包并解压缩:
```shell
wget http://nginx.org/download/nginx-1.18.0.tar.gz
tar -zxvf nginx-1.18.0.tar.gz
```
2. 进入解压后的目录:
```shell
cd nginx-1.18.0
```
3. 配置Nginx的安装目录:
```shell
./configure --prefix=/usr/soft/nginx
```
4. 编译并安装Nginx:
```shell
make
make install
```
5. 启动Nginx:
```shell
/usr/soft/nginx/sbin/nginx
```
6. 停止Nginx:
```shell
/usr/soft/nginx/sbin/nginx -s stop
```
7. 重新加载Nginx配置:
```shell
/usr/soft/nginx/sbin/nginx -s reload
```
阅读全文