Created
August 16, 2018 08:29
-
-
Save sun4lower/3dd4c412e979c89f23333f2f08001df5 to your computer and use it in GitHub Desktop.
Nginx Install
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
##Nginx安装指南 | |
#1、编译环境 | |
#ubuntu | |
apt-get install build-essential | |
apt-get install libtool | |
#centos | |
yum -y install gcc automake autoconf libtool make | |
yum install gcc gcc-c++ | |
########################################################### | |
#2、pcre、zlib、openssl | |
#2.1 pcre | |
cd /usr/local/src | |
wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.41.tar.gz | |
tar xzf pcre-8.41.tar.gz | |
cd pcre-8.41 | |
./configure | |
make && make install | |
#2.2 zlib | |
cd /usr/local/src | |
wget https://jaist.dl.sourceforge.net/project/libpng/zlib/1.2.11/zlib-1.2.11.tar.gz | |
tar xzf zlib-1.2.11.tar.gz | |
cd zlib-1.2.11 | |
./configure | |
make && make install | |
#2.3 openssl | |
cd /usr/local/src | |
wget https://www.openssl.org/source/openssl-1.0.2o.tar.gz | |
tar xzf openssl-1.0.2o.tar.gz | |
########################################################### | |
#3 Nginx | |
cd /usr/local/src | |
wget https://nginx.org/download/nginx-1.14.0.tar.gz | |
tar xzf nginx-1.14.0.tar.gz | |
cd nginx-1.14.0 | |
./configure --sbin-path=/usr/local/nginx/nginx \ | |
--conf-path=/usr/local/nginx/nginx.conf \ | |
--pid-path=/usr/local/nginx/nginx.pid \ | |
--with-http_ssl_module \ | |
--with-http_sub_module \ | |
--with-pcre=../pcre-8.41 \ | |
--with-zlib=../zlib-1.2.11 \ | |
--with-openssl=../openssl-1.0.2o \ | |
--with-http_stub_status_module | |
#Mac OS下需要添加此步骤 | |
cd objs | |
vim Makefile | |
#将如下这行 | |
&& ./config --prefix=/Users/wid/Downloads/nginx-1.8.0/../openssl-1.0.2d/.openssl no-shared | |
#修改成 | |
&& ./Configure darwin64-x86_64-cc --prefix=/Users/wid/Downloads/nginx-1.8.0/../openssl-1.0.2d/.openssl no-shared | |
#然后保存即可 | |
make && make install |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment