linux安装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.8.tar.gz
下载pcre    : wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.38.tar.gz
如果没有安装c++编译环境,还得安装,通过yum install gcc-c++完成安装

下一步,编译安装
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

zlib: 
[root@localhost]tar zxvf zlib-1.2.8.tar.gz 
[root@localhost] cd zlib-1.2.8 
[root@localhost] ./configure && make && make install


 pcre:
[root@localhost] tar zxvf pcre-8.38.tar.gz 
[root@localhost] cd pcre-8.36 
[root@localhost] ./configure && make && make install 


最后安装nginx

[root@localhost]tar zxvf nginx-1.8.0.tar.gz

[root@localhost] cd nginx-1.8.0

[root@localhost]  ./configure && make && make install
 

   启动nginx

/usr/local/nginx/sbin/nginx
   检查nginx是否配置正确

/usr/local/nginx/sbin/nginx -t
   重新加载nginx配置

/usr/local/nginx/sbin/nginx -s reload


1
0

暂无评论