Linux安装nginx问题
Linux安装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.
1.nginx安装包导入linux服务器
2. tar -zxvf nginx-1.17.9.tar.gz 解压nginx
3. cd nginx-1.17.9 执行 ./configure --prefix=/usr/local/nginx
出现下图报错
4.网上查询让安装PCRE,在这里下载解压;chmod -R 777 pcre-8.44 授权文件夹;
cd pcre-8.44
运行 ./configure 进行pcre初始化配置 ;
执行make操作,进行编译;
执行make install,进行安装。
装完又尝试安装nginx还是不行…
5.又查到让安装zlib,openssl ,
下载zlib命令:wget http://www.zlib.net/zlib1.2.11.tar.gz
也可官网下载,传包;解压、安装;
tar -xzvf zlib-1.2.11.tar.gz
cd zlib-1.2.11
./configure && make && make install
官网下载的openssl,
tar zxvf openssl-fips-2.0.9.tar.gz 解压;
cd openssl-fips-2.0.9
./config && make && make install 安装;
再次运行 ./configure --prefix=/usr/local/nginx 安装
红框内为nginx安装路径。
cd /usr/local/nginx/sbin
./ngnix
OK 了