//编译依赖 gcc 环境,如果没有 gcc 环境
yum install gcc-c++
//安装 pcre zlib openssl 库
yum install -y pcre pcre-devel
yum install -y zlib zlib-devel
yum install -y openssl openssl-devel
//下载nginx安装包
https://nginx.org/en/download.html
//解压
tar -zxvf nginx-1.18.0.tar.gz
cd nginx-1.18.0
//查找安装路径
whereis nginx
//使用默认配置,在nginx根目录下执行
./configure
make
make install
//nginx常用指令
cd /usr/local/nginx/sbin/
./nginx 启动
./nginx -s stop 停止
./nginx -s quit 安全退出
./nginx -s reload 重新加载配置文件
ps aux|grep nginx 查看nginx进程
nginx
最新推荐文章于 2024-09-11 11:53:23 发布