centos7重装nginx
时间: 2023-10-30 21:05:51 浏览: 101
centos离线安装nginx所需的依赖资源
好的,以下是重装nginx的步骤:
1. 卸载旧版本的nginx
```
yum remove nginx
```
2. 安装依赖包
```
yum install -y gcc gcc-c++ make zlib-devel pcre-devel openssl-devel
```
3. 下载nginx源码包
```
wget http://nginx.org/download/nginx-1.18.0.tar.gz
```
4. 解压源码包
```
tar -zxvf nginx-1.18.0.tar.gz
```
5. 进入解压后的目录
```
cd nginx-1.18.0
```
6. 配置编译参数
```
./configure --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module
```
7. 编译安装
```
make && make install
```
8. 启动nginx
```
/usr/local/nginx/sbin/nginx
```
阅读全文