centOS7.6安装Nginx

centOS7.6安装Nginx

# centOS7.6下安装nginx
cd /

yum install gcc gcc-c++ # 安装依赖
wget http://nginx.org/download/nginx-1.17.1.tar.gz # 下载nginx源码

tar -zxvf nginx-1.17.1.tar.gz # 解压
cd nginx
-1.17.1 # 进入解压后的文件夹

./configure --prefix=/usr/local/nginx # 配置nginx安装路径
make make install

ln -s /usr/local/nginx/sbin/nginx /usr/bin/nginx # 创建nginx软链接,若已被占用,则在 /usr/bin 下 rm-rf nginx

nginx # 启动ngixn
nginx -s stop # 停止nginx服务

nginx安装报错:./configure: error: the HTTP gzip module requires the zlib library.
You can either disable the module by using –without-http_gzip_module
option, or install the zlib library into the system, or build the zlib library
statically from the source with nginx by using –with-zlib= option.

解决办法:

需要安装“zlib-devel”即可。SSH执行命令:yum install -y zlib-devel


🐞标题:centOS7.6安装Nginx
👽作者:ruige
🐾地址:https://jjdhhc.com/articles/2020/11/07/1604714451561.html
🙏感恩:谢谢您的打赏与支持!中间图片是我的微信公众号,扫码关注哦!
支付宝支付 微信公众号 微信支付