CentOS6.5编译安装Nginx和Openssl
时间:2015-03-05 17:27 来源:linux.it.net.cn 作者:IT
Nginx是一款轻量级的Web 服务器/反向代理服务器及电子邮件(IMAP/POP3)代理服务器,并在一个BSD-like 协议下发行。由俄罗斯的程序设计师Igor Sysoev所开发,供俄国大型的入口网站及搜索引擎Rambler(俄文:Рамблер)使用。其特点是占有内存少,并发能力强,事实上nginx的小文件并发能力在同类型的网页服务器中表现较好。
[root@Node1 ~]
# wget http://www.openssl.org/source/openssl-1.0.2.tar.gz
[root@Node1 ~]
# wget http://nginx.org/download/nginx-1.6.2.tar.gz
[root@Node1 ~]
# tar zxf openssl-1.0.2.tar.gz
[root@Node1 ~]
# tar zxf nginx-1.6.2.tar.gz
[root@Node1 ~]
# cd nginx-1.6.2
[root@Node1 nginx-1.6.2]
# ./configure --user=www --group=www --prefix=/data/nginx1.6.2 --with-http_stub_status_module --with-http_gzip_static_module --with-http_ssl_module --with-openssl=/root/openssl-1.0.2
make
[1]: Entering directory `
/root/nginx-1
.6.2'
cd
/server/openssl
\
&&
make
clean \
&& .
/config
--prefix=
/server/openssl/openssl
no-shared no-threads \
&&
make
\
&&
make
install
make
[2]: Entering directory `
/server/openssl
'
make
[2]: *** No rule to
make
target `clean'. Stop.
make
[2]: Leaving directory `
/server/openssl
'
make
[1]: *** [
/server/openssl/openssl/include/openssl/ssl
.h] Error 2
make
[1]: Leaving directory `
/root/nginx-0
.7.61'
make
: *** [build] Error 2
.
/configure
: error: the HTTP rewrite module requires the PCRE library.
You can either disable the module by using --without-http_rewrite_module
option, or
install
the PCRE library into the system, or build the PCRE library
statically from the
source
with nginx by using --with-pcre=<path> option.
[root@Node1 nginx-1.6.2]
# yum -y install pcre pcre-devel
[root@Node1 nginx-1.6.2]
# make
[root@Node1 nginx-1.6.2]
# make install
[root@Node1 nginx-1.6.2]
# /data/nginx1.6.2/sbin/nginx -t
nginx: the configuration
file
/data/nginx1
.6.2
/conf/nginx
.conf syntax is ok
nginx: [emerg] getpwnam(
"www"
) failed
nginx: configuration
file
/data/nginx1
.6.2
/conf/nginx
.conf
test
failed
[root@Node1 nginx-1.6.2]
# groupadd www
[root@Node1 nginx-1.6.2]
# useradd -g www -s /sbin/nologin -d /dev/null www
[root@Node1 nginx-1.6.2]
# /data/nginx1.6.2/sbin/nginx
[root@Node1 nginx-1.6.2]
# netstat -ntlup |grep :80
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 19849
/nginx
[root@Node1 nginx-1.6.2]
# ps aux |grep nginx
root 19849 0.0 0.0 22664 852 ? Ss 11:19 0:00 nginx: master process
/data/nginx1
.6.2
/sbin/nginx
www 19850 0.0 0.1 23100 1448 ? S 11:19 0:00 nginx: worker process
root 19858 0.0 0.0 103244 856 pts
/0
S+ 11:21 0:00
grep
nginx
(责任编辑:IT)
Nginx是一款轻量级的Web 服务器/反向代理服务器及电子邮件(IMAP/POP3)代理服务器,并在一个BSD-like 协议下发行。由俄罗斯的程序设计师Igor Sysoev所开发,供俄国大型的入口网站及搜索引擎Rambler(俄文:Рамблер)使用。其特点是占有内存少,并发能力强,事实上nginx的小文件并发能力在同类型的网页服务器中表现较好。
|