linux下安装nginx 以及依赖包 笔记(一)

来源:互联网 发布:agile软件 编辑:程序博客网 时间:2024/05/20 17:08


准备齐全的安装包:

openssl-fips-2.0.2.tar.gz   zlib-1.2.7.tar.gz  pcre-8.21.tar.gz    nginx-1.2.6.tar.gz

本人安装环境(VMware + centos6.4)

 PS:下面会提供上述包的下载,(以上方法我也是按照网上执行下来成功,但是版本可能不一样,安装的时候记得修改下版本,)另外:安装过程中如果提示需要其他依赖记得安装yum install (提示需要安装的包即可)

第二步:

依次安装openssl-fips-2.0.2.tar.gz, zlib-1.2.7.tar.gz, pcre-8.21.tar.gz, nginx-1.2.6.tar.gz

1.安装openssl-fips-2.0.2.tar.gz

[root@localhost mrms]# tar -zxvf openssl-fips-2.0.2.tar.gz 

[root@localhost mrms]# cd openssl-fips-2.0.2

[root@localhost openssl-fips-2.0.2]# ./config 

[root@localhost openssl-fips-2.0.2]# make

[root@localhost openssl-fips-2.0.2]# make install

 

2.安装zlib-1.2.7.tar.gz

[root@localhost mrms]# tar -zxvf zlib-1.2.7.tar.gz

[root@localhost mrms]# cd zlib-1.2.7

[root@localhost zlib-1.2.7]# ./configure 

[root@localhost zlib-1.2.7]# make

[root@localhost zlib-1.2.7]# make install

 

3.安装pcre-8.21.tar.gz

[root@localhost mrms]# tar -zxvf pcre-8.21.tar.gz

[root@localhost mrms]# cd pcre-8.21

[root@localhost pcre-8.21]# ./configure 

[root@localhost pcre-8.21]# make

[root@localhost pcre-8.21]# make install

 

4.安装 nginx-1.2.6.tar.gz

[root@localhost mrms]# tar -zxvf nginx-1.2.6.tar.gz 

[root@localhost mrms]# cd nginx-1.2.6

[root@localhost nginx-1.2.6]# ./configure --with-pcre=../pcre-8.21 --with-zlib=../zlib-1.2.7 --with-openssl=../openssl-fips-2.0.2

[root@localhost nginx-1.2.6]# make

[root@localhost nginx-1.2.6]# make install

 

至此Nginx的安装完成!

检测是否安装成功

[root@localhost nginx-1.2.6]# cd  /usr/local/nginx/sbin

[root@localhost sbin]# ./nginx -t

 

如图所示,表示Nginx安装成功.

启动nginx

[root@localhost sbin]# ./nginx

查看端口

[root@localhost sbin]# netstat -ntlp


最后就可以打开http://127.0.0.1/就能看见nginx的欢迎界面了

下载地址

http://download.csdn.net/detail/u010386438/8594661

下载不了再联系

0 0
原创粉丝点击