tomcat 5.0 + apache 2.0 完全安装

Apachehttpd-2.0.47+Tomcatjakarta-tomcat-4.1.24+jk2+php-4.3.3的安装:

服务器环境:

RedHatLinux8.0
J2sdk1.4.1_02
Tomcat4.1.12binary
Apache2.0.47builtfromsource
jk2connectorsourcefromjakarta.apache.org


安装JDK:

下载:j2sdk-1_4_1_02-linux-i586.bin
把jdk安装在/usr/local/j2sdk1.4.1_02
在/usr/local下建立软连接jdk
#ln-s/usr/local/j2sdk1.4.1_02/usr/local/jdk

[user@host]#cat/etc/profile.d/java.sh
#setjavaenvironment
exportJAVA_HOME=/usr/local/jdk
exportPATH=$PATH:$JAVA_HOME/bin
exportCLASSPATH=$JAVA_HOME/lib

#更改shell文件属性:
#chmod755/etc/profile.d/java.sh

#查看是否正确
#whichjava
/usr/local/jdk/bin/java


安装apache:

#cd/usr/local/src/
#tar-xzvfhttpd-2.0.47.tar.gz
#cdhttpd-2.0.47
#配置apache支持动态module加载
#./configure
"--with-layout=Apache"
"--prefix=/usr/local/apache"
"--enable-module=so"
"--enable-module=setenvif"
"--enable-module=rewrite"
"--with-mpm=prefork"

#make
#makeinstall

#修改http.conf具体的修改请参考apache2.0文档
#或者查看http://www.cnfug.org/journal/3/02.html

StartServers10
MinSpareServers25
MaxSpareServers50
ServerLimit2000
MaxClients1500#Apache可以同时处理的请求
MaxRequestsPerChild10000



安装Php:
下载:php-4.3.3.tar.gz
#cd/usr/local/src
#tar-xzvf

#phpforapache以apachemodules的方式运行
./configure--with-apxs2=/usr/local/apache/bin/apxs

#phprunlikeshell以单独的shell方式运行
./configure--prefix=/usr/local/php

#phpforapache
./configure
--with-apxs2=/usr/local/apache/bin/apxs
--enable-track-vars
--enable-debug
--enable-url-includes
--enable-sockets
--with-config-file-path=/usr/local/apache/conf#php.ini文件放的目录
#下面的参数是安装PHP+gd库
--with-gd=/usr/local
--enable-gd-native-ttf
--with-ttf=/usr/local
--with-jpeg-dir=/usr/local
--with-zlib-dir=/usr/local
--with-png-dir=/usr/local
#make
#makeinstall
#ls-l/usr/local/apache/modules/libphp4.so#存在安装成功

#修改apachehttp.conf
添加
LoadModulephp4_modulemodules/libphp4.so
AddTypeapplication/x-httpd-php.php


安装Tomcat:
#cd/usr/local
#tar-xzvfjakarta-tomcat-4.1.24.tar.gz
#ln-sjakarta-tomcat-4.1.24tomcat
#测试Tomcat正常安装:
#/usr/local/tomcat/bin/startup.sh

#通过IEhttp://yourIP:8080/Tomcat的页面正常显示


安装JK2:
#cd/usr/local/src
#tar-xzvfjakarta-tomcat-connectors-jk2-2.0.2-src.tar.gz
#cdjakarta-tomcat-connectors-jk2-2.0.2-src
#cdjk/native2
#chmod755buildconf.sh
#./configure--with-apxs2=/usr/local/apache/bin/apxs--enable-EAPI
#make
#makeinstall
#如果makeinstall不成功需要手工发布mod_jk2.so
#cd/usr/local/src/jakarta-tomcat-connectors-jk2-2.0.2-src/jk/build/jk2/apache2
#cp*.so/usr/local/apache/modules/


配置$CATLINA/conf/server.xml


debug="0"/>
debug="0"/>



port="8080"minProcessors="5"maxProcessors="75"
enableLookups="true"redirectPort="8443"
acceptCount="100"debug="0"connectionTimeout="-1"
useURIValidationHack="false"disableUploadTimeout="true"/>

port="8009"minProcessors="5"maxProcessors="75"
enableLookups="true"redirectPort="8443"
acceptCount="10"debug="0"connectionTimeout="-1"
useURIValidationHack="false"
protocolHandlerClassName="org.apache.jk.server.JkCoyoteHandler"/>








prefix="catalina_log."suffix=".txt"
timestamp="true"/>


unpackWARs="true"autoDeploy="true">

directory="logs"prefix="localhost_log."suffix=".txt"
timestamp="true"/>







#编辑
#vi/usr/local/tomcat/conf/jk2.properties
#listofneededhandlers.
handler.list=channelSocket,request
#OverridethedefaultportforthechannelSocket
channelSocket.port=8009


#编辑文件:

#vi/usr/local/apache/conf/workers2.properties

#onlyatbeginnin.Inproductionuncommentitout
[logger.apache2]
level=DEBUG

[shm]
file=/usr/local/apache/logs/shm.file
size=1048576

#Examplesocketchannel,overrideportandhost.
[channel.socket:localhost:8009]
port=8009
host=127.0.0.1

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

#Urimapping
[uri:192.168.0.90/*.jsp]
worker=ajp13:localhost:8009

[uri:211.167.83.165/*.jsp]
worker=ajp13:localhost:8009

#编辑http.conf
#修改
DocumentRoot"/usr/local/tomcat/webapps"
#添加index.jsp
DirectoryIndexindex.htmlindex.html.varindex.jsp


LoadModulejk2_modulemodules/mod_jk2.so


Orderdeny,allow
Denyfromall

#
#Orderdeny,allow
#Denyfromall
#


OrderAllow,Deny



ServerNamewww.home.net
ServerAliaswww
ServerAliaslocalhost
ServerAlias192.168.0.90
ServerAlias211.167.83.165
ServerAdminwebmater@5757.com
DocumentRoot/usr/local/tomcat/webapps

ErrorLoglogs/home.net-errorlog
CustomLoglogs/home.net-access.logcommon


JkUriSetworkerajp13:localhost:8009




在配置server.xml的时候:
配置管理端口和连接的端口顺序颠倒一下
在catalina.out可以观察到:
这样用apache连接的时候,就不用等待了.


port="8009"minProcessors="5"maxProcessors="75"
enableLookups="true"redirectPort="8443"
acceptCount="10"debug="0"connectionTimeout="0"
useURIValidationHack="false"
protocolHandlerClassName="org.apache.jk.server.JkCoyoteHandler"/>


port="8080"minProcessors="5"maxProcessors="75"
enableLookups="true"redirectPort="8443"
acceptCount="100"debug="0"connectionTimeout="20000"
useURIValidationHack="false"disableUploadTimeout="true"/>

#server.xml不支持中文的注释
#对shared/classes目录下的java进行的修改不能立刻的反应到jsp中标.不能立即起作用.

以上的安装同样适合jakarta-tomcat-5.0.12在以下的配置中注意

#在配置jakarta-tomcat-5.0.12的时候,注意server.xml中

没有封闭.

BUG:

在catalina.out报错误.

总体上感觉tomcat5.0比4.x在性能上是有了改进.启动的速度快.
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值