Linux下安装Nginx1.8
新建目录,假设到/usr/java/nginx,下载Nginx相关的安装文件:
下载nginx: wget http://nginx.org/download/nginx-1.8.0.tar.gz
下载openssl : wget http://www.openssl.org/source/openssl-fips-2.0.9.tar.gz
下载zlib : wget http://zlib.net/zlib-1.2.11.tar.gz
下载pcre : wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.39.tar.gz
先安装C++的环境:yum install gcc-c++
按照先后顺序开始安装:
1、安装openssl
[root@localhost] tar zxvf openssl-fips-2.0.9.tar.gz
[root@localhost] cd openssl-fips-2.0.9
[root@localhost] ./config && make && make install
2、安装pcre
[root@localhost] tar zxvf pcre-8.39.tar.gz
[root@localhost] cd pcre-8.39
[root@localhost] ./configure && make && make install
3、安装zlib
[root@localhost]tar zxvf zlib-1.2.11.tar.gz
[root@localhost] cd zlib-1.2.11
[root@localhost] ./configure && make && make install
4、最后安装Nginx
[root@localhost]tar zxvf nginx-1.8.0.tar.gz
[root@localhost] cd nginx-1.8.0
[root@localhost] ./configure && make && make install
5、制作软连接
[root@localhost]cd /usr/local/lib
[root@localhost]ln -s /usr/local/lib/libpcre.so.1 /lib64/
大功告成,开始启动Nginx:
[root@localhost]/usr/local/nginx/sbin/nginx
重启Nginx的命令:
[root@localhost]/usr/local/nginx/sbin/nginx -s reload