用nginx+tomcat来代替apache+jk+tomcat
#wget http:///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 {
listen 81;
server_name localhost;
charset gb2312;
# serve static files |