Nginx ("engine x") 是一个高性能的 HTTP 和 反向代理 服务器,也是一个 IMAP/POP3/SMTP 代理服务器。 Nginx 是由 Igor Sysoev 为俄罗斯访问量第二的 Rambler.ru 站点开发的,它已经在该站点运行超过两年半了。Igor 将源代码以类BSD许可证的形式发布。尽管还是测试版,但是,Nginx 已经因为它的稳定性、丰富的功能集、示例配置文件和低系统资源的消耗而闻名了.
IXDBA.NET技术社区
Nginx 是一个轻量级的 http server,也可作为 proxy server 使用,由一个俄罗斯哥们儿开发并在一些高负载的站点上跑了2年多。许多人用它来搭建 Rails 应用,有的评测性能已经超过 lighty。Nginx 能快速响应静态页面的请求,支持 fastcgi、ssl、virtual host、rewrite、HTTP Basic Auth、Gzip 等,功能比较完备,配置文件也是类似 lighty 那种很简介的形式。
Nginx 和 PHP 一起应用应该也是个不错的搭配.
用nginx+tomcat来代替apache+jk+tomcat
#wget http://sysoev.ru/nginx/nginx-0.6.26.tar.gz
#tar zxvf nginx-0.6.26.tar.gz
#cd nginx-0.6.26
#[root@test nginx-0.6.26]# ./configure
./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@test nginx-0.6.26]# rpm -qa|grep pcre
pcre-6.6-1.1
[root@test suantop]# rpm -ivh pcre-devel-6.6-1.1.i386.rpm
warning: pcre-devel-6.6-1.1.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
Preparing... ################################## [100%]
1:pcre-devel ################################# [100%]
[root@test suantop]# rpm -qa|grep pcre
pcre-6.6-1.1
pcre-devel-6.6-1.1
等再次执行./configure
[root@test nginx-0.6.26]# ./configure --with-http_stub_status_module
[root@test nginx-0.6.26]# make
[root@test nginx-0.6.26]# make install
修改配置文件 /usr/local/nginx/conf/nginx.conf
给出一些主要更改的地方
user nobody nobody;
worker_processes 2;
error_log logs/error.log notice;
pid logs/nginx.pid;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
include /usr/local/nginx/conf/proxy.conf;
#上面这行是增加的
server {