2021-08-05Nginx离线安装:Nginx 离线安装:
⼀、安装包下载
我的版本是:nginx-1.14.,pcre-8.,openssl.1.1.
⼆.解压Nginx
###nginx安装
借助xftp6⼯具将安装包上传到linux系统中,我是上传到/home/src
cd /home/src
tar -zxvf nginx-1.14.
cd nginx-1.14.2/
./configure
--prefix=/home/nginx(不指定在/usr/local/nginx)
make &&make install
可能报错缺少openssl或者pcre资源库,由于nginx依赖openssl(安全库)和pcre(正则表达式资源库)
###openssl安装
cd /home/src
tar -zxvfopenssl.1.1.
cd openssl.1.1.1a/
./config--prefix=/home/openssl ./config -t
make open
make install
###pcre安装
cd /home/src
tar -zxvfpcre-8.
cd pcre-8.37/
./configure--prefix=/home/pcre make &&make install
三、启动
cd /home/nginx/sbin
启动:./nginx 或者 ./nginx -c /home/nginx/f
linux离线安装nginx详细教程注意若缺少依赖库
ldd $(which
/usr/local/nginx/sbin/nginx)
linux-gate.so.1=> (0x0071b000)
libpthread.so.0=> /lib/libpthread.so.0 (0×00498000)
libcrypt.so.1=> /lib/libcrypt.so.1 (0×00986000)
libpcre.so.1=> not found //问题在这
libcrypto.so.6=> /lib/libcrypto.so.6 (0×00196000)
libz.so.1=> /lib/libz.so.1 (0×00610000)
libc.so.6=> /lib/libc.so.6 (0x002d7000)
/lib/ld-linux.so.2(0x006a8000)
libdl.so.2 => /lib/libdl.so.2 (0x008c3000)
查看少什么到添加软连接过去
ln -s/usr/local/lib/libpcre.so.0.0.1 /lib/libpcre.so.1 //具体的路径根据⾃⼰libpcre.so.0.0.1的位置决定
错误1:
./configure: error: the HTTP rewritemodule requires the PCRE library.
You can eitherdisable the module by using --without-http_rewrite_module
option, or installthe PCRE library into the system, or build the PCRE library
statically from thesource with nginx by using --with-pcre= option.
解决办法:yum -y installpcre-devel
错误2:
./configure: error: the HTTP gzipmodule requires the zlib library. You can eitherdisable the module by using --without-http_gzip_module option, or install thezlib library into the system, or build the zlib library statically from thesource with nginx by using --with-zlib= option.
yum install -y zlib-devel
错误4:make not comond
C compiler cc isnot found
安装:
yum -y install gccautomake autoconf libtool make
安装g++:
yum install gccgcc-c++
make
make install
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论