登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

ideality

@linux c 编程@

 
 
 

日志

 
 
 
 

DEBIAN下APACHE整合TOMCAT  

2010-08-01 09:26:41|  分类: 后台架构 |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |

                                                                                                 ----from:http://home.5uhost.com/space.php?uid=1&do=blog&id=957

一、需要的安装包
JDK : jdk-1_5_0_05-linux-i586.bin(下载地址:http://java.sun.com)

Apache 2.0 :(下载方法:apt-get install apache2)

TOMCAT5.5.17(下载地址:http://apache.justdn.org/tomcat/tomcat-5/v5.5.17/bin/apache-tomcat-5.5.17.zip

libapache2-mod-jk2(下载方法:apt-get install libapache2-mod-jk2)

使用JK来把apache-tomcat连接的一些文档
http://tomcat.apache.org/connectors-doc-archive/jk2/index.html

二、JDK安装与配置


1、JDK的安装


  #./jdk-1_5_0_05-linux-i586.bin 或者有用普通用户运行也可以$./jdk-1_5_0_05-linux-i586.bin


2、环境变量的配置


  我的JDK用/root用户安装到/home/jdk1.5.0_06下的,
我经常在Debian系统下使用普通用户,所以可以在普通用户的家目录来设定JDK的环境变量

在$~/.bashrc中加入:


#set J2SDK enviroment

export JAVA_HOME=/home/jdk1.5.0_06

export PATH=$PATH:/home/jdk1.5.0_06/bin

export CLASS_PATH=$JAVA_HOME/lib


注销系统使之生效!


三、TOMCAT的安装


  也是非常的Easy只需要解压就可以了,我的是放在/home/eagle/apache-tomcat-5.5.17下的。


再到/$~/.bashrc 中加入


#set tomcat home
export TOMCAT_HOME=/home/eagle/apache-tomcat-5.5.17



  改PATH为

export  PATH=$PATH:$JAVA_HOME/bin:$TOMCAT_HOME/bin:


export CLASS_PATH=$JAVA_HOME/lib:$TOMCAT_HOME/common/lib


重启计算机使其生效。然后就可以到浏览里测试了!http://localhost:8080/看见小猫头像了吧!哈哈哈。。。成功!


四、APACHE的安装


在Debian系统下直接用这条命令,就可以安装apache2

#aptget -install apache2


快到浏览器上去测试一下吧http://192.168.101.88/看见那根羽毛了吧!!哈哈apache安装成功了!


五、libapache2-mod-jk2(整合必备)


在Debian系统下直接用这条命令,就可以安装libapache2-mod-jk2

#aptget -install libapache2-mod-jk2


  查看/etc/apache2/mods-enabled目录下面的jk2.load是否加入以下内容


LoadModule jk2_module modules/mod_jk2.so 保存之!


创建workers2.properties

第一种方法(最简单的方法):

  手动创建/etc/apache2/workers2.properties文件,内容如下:


  [shm]
file=/etc/apache2/logs/jk2.shm
size=1048576

[channel.socket:localhost:8009]
port=8009
host=127.0.0.1

[ajp13:localhost:8009]
channel=channel.socket:localhost:8009

[Uri:/*]
worker=ajp13:localhost:8009


保存后重启apache2!快去测试一下吧!
#/etc/init.d/apache2 restart

 http://192.168.101.88/一样能够显示小猫了!整合成功!

第二种方法:
把/usr/share/doc/libapache2-mod-jk2/examples/workers2.properties.minimal 拷贝到/etc/apache2

#
# This is the minimal JK2 connector configuration file.
#

[logger]
info=Native logger
level=ERROR

[config:]
file=${serverRoot}/conf/workers2.properties
debug=0
debugEnv=0

[uriMap:]
info=Maps the requests.
debug=0

[shm:]
info=Scoreboard. Required for reconfiguration and status with multiprocess servers
file=anonymous
debug=0

[workerEnv:]
info=Global server options
timing=0
debug=0

[lb:lb]
info=Default load balancer.
debug=0

[channel.socket:localhost:8009]
info=Ajp13 forwarding over socket
debug=0
tomcatId=localhost:8009

[uri:/admin]
info=Tomcat HTML based administration web application.
debug=0

[uri:/manager]
info=A scriptable management web application for the Tomcat Web Server.
debug=0

[uri:/jsp-examples]
info=JSP 2.0 Examples.
debug=0

[uri:/servlets-examples]
info=Servlet 2.4 Examples.
debug=0

[uri:/*.jsp]
info=JSP Extension mapping.
debug=0

这个worker2.properties只要改动以下内容


[shm:]
info=Scoreboard. Required for reconfiguration and status with multiprocess servers
file=anonymous
debug=0

改为
[shm:]
info=Scoreboard. Required for reconfiguration and status with multiprocess servers
file=/etc/apache2/logs/jk2.shm
debug=0

保存后重启apache2!快去测试一下吧!
#/etc/init.d/apache2 restart

 http://192.168.101.88/ 一样能够显示小猫了!整合成功!

  评论这张
 
阅读(1659)| 评论(0)

历史上的今天

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2018