Skip to content

Instantly share code, notes, and snippets.

@shanelau
Last active May 12, 2016 10:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shanelau/5d90f5d51242aa3447d2733cc2e59694 to your computer and use it in GitHub Desktop.
Save shanelau/5d90f5d51242aa3447d2733cc2e59694 to your computer and use it in GitHub Desktop.
nginx install for centos
#设置安装路径 chmod +x install_nginx.sh
save_path="/usr/local/"
#各安装包的版本
pcre="8.38"
path_pcre="pcre-${pcre}"
zlib="zlib-1.2.8"
openssl="openssl-1.0.1j"
nginx="nginx-1.8.0"
node="v0.12.2"
#下载所需的安装包
cd ${save_path}
wget https://sourceforge.net/projects/pcre/files/pcre/${pcre}/${path_pcre}.tar.gz
wget http://zlib.net/${zlib}.tar.gz
wget http://www.openssl.org/source/${openssl}.tar.gz
wget http://nginx.org/download/${nginx}.tar.gz
#解压所有包
tar -zxvf ${path_pcre}.tar.gz
tar -zxvf ${zlib}.tar.gz
tar -zxvf ${openssl}.tar.gz
tar -zxvf ${nginx}.tar.gz
#安装pcre
cd ${save_path}${path_pcre}
./configure
make
make install
cd ..
#安装zlib
cd ${save_path}${zlib}
./configure
make
make install
cd ..
#安装openssl
cd ${save_path}${openssl}
./config
make
make install
cd ..
#安装nginx
cd ${save_path}${nginx}
./configure --prefix=/usr/local/nginx --with-pcre=${save_path}${path_pcre} --with-zlib=${save_path}${zlib}
make
make install
cd ..
echo nginx is ok!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment