nginx1.10.2安装过程

/usr/local/src下

1.安装nginx需要一个c++环境:yum install -y gcc gcc-c++

2.安装nginx需要一个pcre依赖:wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.40.tar.gz

(1)tar -zxvf pcre-8.40.tar.gz

(2) cd pcre-8.40

(3) ./configure && make && make install 完成pcre安装

3安装nginx需要zlib依赖:wget http://zlib.net/zlib-1.2.11.tar.gz

(1)tar -zxvf zlib-1.2.11.tar.gz

(2) cd zlib-1.2.11

(3)./configure && make && make install 完成zlib安装

4.若为ssl网需执行这一步wget http://www.openssl.org/source/openssl-fips-2.0.10.tar.gz

(1) tar -zxvf openssl-fips-2.0.10.tar.gz

(2)cd openssl-fips-2.0.10

(3)./config && make && make install   进入文件执行安装程序

5.安装nginx:wget http://nginx.org/download/nginx-1.10.2.tar.gz

(1) tar -zxvf nginx-1.10.2.tar.gz

(2) cd nginx-1.10.2

(3)./configure && make && make install完成安装

3.启动nginx

(1)、查看nginx安装的地址(whereis)

(2)、进入目录启动

    cd /usr/local/nginx/     

   /usr/local/nginx/sbin/nginx

一般这个时候会报错,不要慌张!!!

错误信息:error while loading shared libraries:libpcre.so.1.......

解决方案:

[root@localhost nginx]# whereis libpcre.so.1
libpcre.so: /lib64/libpcre.so.0 /usr/local/lib/libpcre.so.1 /usr/local/lib/libpcre.so
[root@localhost nginx]# ln -s /usr/local/lib/libpcre.so.1 /lib64
[root@localhost nginx]# sbin/nginx 
[root@localhost nginx]# ps -aux | grep nginx
Warning: bad syntax, perhaps a bogus '-'? See /usr/share/doc/procps-3.2.8/FAQ
root      12007  0.0  0.0  20296   628 ?        Ss   13:28   0:00 nginx: master process sbin/nginx
nobody    12008  0.0  0.1  20716  1220 ?        S    13:28   0:00 nginx: worker process
root      12010  0.0  0.0 103244   836 pts/0    S+   13:29   0:00 grep nginx


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值