http://blog.chinaunix.net/uid/16979052.html
全部博文(286)
分类: LINUX
2013-03-11 08:18:43
下载apache2.2.15源代码。
tar xvf httpd-2.2.15.tar.gz
解压源代码
mkdir /apache2.2
建立安装目标目录(也可不建立,由make自动建立)
./configure --prefix=/apache2.2
编译预处理,并设置安装目标目录。
make
编译apache
make install
安装apache到目标目录
/apache2.2/bin/apachectl start
启动apache
访问出现页面则安装正确。
在apache下载mod_jk.so
修改apache的httpd.conf添加mod_jk相关配置(只有jsp被转发到tomcat!!)
LoadModule jk_module modules/mod_jk.so JkWorkersFile conf/worker.properties JkMount /*.jsp lbcontroller JkShmFile logs/jkshm.shm JkLogFile logs/mod_jk.log |
添加worker.properties
worker.list = lbcontroller,node1,node2 ##node1 worker.node1.port=8009 worker.node1.host=192.168.180.114 worker.node1.type=ajp13 worker.node1.lbfactor =1 ##node2 worker.node2.port=8009 worker.node2.host=192.168.180.118 worker.node2.type=ajp13 worker.node2.lbfactor =1 ##loadblancer worker.lbcontroller.type=lb worker.lbcontroller.balance_workers=node1,node2 worker.lbcontroller.sticky_session=1 |
安装nginx
下载稳定版本的ngnix,pcre
wget
wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.02.tar.gz
解压pcreb并安装pcre包
./configure
make
make install
解压nginx并安装nginx
./configure --prefix=/nginx
make
make install
修改nginx配置文件
worker_processes 10; events { use epoll; worker_connections 8192; } http { include mime.types; default_type application/octet-stream; sendfile on; keepalive_timeout 65; upstream backend { server 192.168.180.114:8080; server 192.168.180.118:8080; } server { listen 81; server_name localhost; #charset koi8-r; #access_log logs/host.access.log main; location / { root /; index index.jsp index.htm index.html; proxy_redirect off; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_pass } } } |
安装TOMCAT
wget
下载JDK6
创建用户
[root@vm118 /]# useradd tomcat
[root@vm118 /]# passwd tomcat
Changing password for user tomcat.
New UNIX password:
BAD PASSWORD: it is based on a dictionary word
Retype new UNIX password:
passwd: all authentication tokens updated successfully.
[root@vm118 /]# id tomcat
uid=500(tomcat) gid=500(tomcat) groups=500(tomcat) context=root:system_r:unconfined_t:SystemLow-SystemHigh
安装tomcat。
tar xvf apache-tomcat-6.0.26.tar.gz
安装tomcat native
解压tomcat/bin/tomcat-native.tar.gz
tomcat Native需要apache的apr包,可以将另一个主机上的apache apr源代码复制到本机。
./configure
make
make install
当tomcat的日志文件中出现下面信息时,表示native安装成功
INFO: Loaded APR based Apache Tomcat Native library 1.1.20.