安装nginx及依赖包
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了安装nginx及依赖包相关的知识,希望对你有一定的参考价值。
#!/bin/bash
#auto zhangjia
#date 20171007
#安装SSL##############################################################3
SSL(){
URL=https://www.openssl.org/source/openssl-1.1.0f.tar.gz
TARFILE=openssl-1.1.0f.tar.gz
DIR=openssl-1.1.0f
wget -c $URL && tar -xzvf $TARFILE && cd $DIR && ./config
if [ $? -eq 0 ];then
make && make install
echo -e "\033[32mSSL install success...\033[0m"
else
echo -e "\033[32mSSL install failde,please check...\033[0m"
fi
}
#rewrite模块需要pcre库##################################################333333
pcre(){
URL=https://ftp.pcre.org/pub/pcre/pcre-8.38.tar.gz
TARFILE=pcre-8.38.tar.gz
DIR=pcre-8.38
wget -c $URL && tar -xzvf $TARFILE && cd $DIR && ./configure
if [ $? -eq 0 ];then
make && make install
echo -e "\033[32mpcre install success...\033[0m"
else
echo -e "\033[32mpcre install failde,please check...\033[0m"
fi
}
#################安装gzip模块###################
gzip(){
URL=http://www.zlib.net/zlib-1.2.11.tar.gz
TARFILE=zlib-1.2.11.tar.gz
DIR=zlib-1.2.11
wget -c $URL && tar -xzvf $TARFILE && cd $DIR && ./configure
if [ $? -eq 0 ];then
make && make install
echo -e "\033[32mpcre install success...\033[0m"
else
echo -e "\033[32mpcre install failde,please check...\033[0m"
fi
}
###############select选择##########################33
echo -e "\033[32mPlease select install mnue: \033[0m"
select i in "SSL" "pcre" "gzip"
do
case $i in
SSL)
SSL;;
pcre)
pcre;;
gzip)
gzip;;
esac
done
以上是关于安装nginx及依赖包的主要内容,如果未能解决你的问题,请参考以下文章