记一次cenos7安装nginx
- 安装依赖
yum -y install gcc gcc-c++ make libtool zlib zlib-devel openssl openssl-devel pcre pcre-devel
- 下载Nginx安装包
wget -c https://nginx.org/download/nginx-1.20.2.tar.gz
- 解压安装包
tar -zxvf nginx-1.20.2.tar.gz
cd nginx-1.20.2
- 配置安装运行目录
./configure --prefix=/usr/local/nginx
- 编译安装
make&&make install
PS: 使用扩展模块第四步添加参数即可
例:
./configure --prefix=/usr/local/nginx --with-http_ssl_module --with-http_flv_module --with-http_gzip_static_module --with-http_stub_status_module --with-threads --with-file-aio
完活
常用命令
# 启动
/usr/local/nginx/sbin/nginx
#强制关闭
nginx -s stop
# 重启
nginx -s reload
本文来自博客园,作者:脆,转载请注明原文链接:https://www.cnblogs.com/Wei-notes/p/16945446.html