本文最后更新于:2023年12月31日 下午
一、插件安装
1.1 安装 gcc
1.2 安装 pcre、pcre-devel
1
| yum install -y pcre pcre-devel
|
1.3 安装 zlib
1
| yum install -y zlib zlib-devel
|
1.4 安装 openssl
1
| yum install -y openssl openssl-devel
|
下载并安装 Nginx
2.1 下载 Nginx
Nginx 官方下载网址为:http://nginx.org/en/download.html
在上面可以查看最新版本的 nginx 及下载,当前最新版本为 1.24.0
推荐下载 stable 版本,较为稳定
这里选择在线下载的方式
1
| wget http://nginx.org/download/nginx-1.24.0.tar.gz
|
2.2 解压
1
| tar -xf nginx-1.24.0.tar.gz
|
2.3 编译并安装 Nginx
1 2 3 4 5
| cd nginx-1.24.0
./configure --with-http_stub_status_module --with-http_ssl_module
make && make install
|
2.4 创建软连链接
1
| ln -s /usr/local/nginx/sbin/nginx /usr/local/bin
|
三 启动 Nginx
3.1 检查配置准确性
3.2 启动
访问主机的 IP 地址,出现如下界面则表示已经安装成功了