Topic: 完全安装 Apache2.43+jboss3+Tomcat4.1.*手册

  Print this page

1.完全安装 Apache2.43+jboss3+Tomcat4.1.*手册 Copy to clipboard
Posted by: aojingen
Posted on: 2002-12-04 17:31

1.软件下载并安装
Download JavaTM 2 Platform, Standard Edition, v 1.4.1 from
http://java.sun.com/j2se/1.4.1/
run installer exe, change destination path to c:\lib\java
Download jboss-3.0.3_tomcat-4.1.12 from
http://prdownloads.sourceforge.net/jboss/jboss-3.0.3_tomcat-4.1.12.zip
decompress zip and copy to c:\jboss
Download Apache 2.0.42 from from
http://www.apache.org/dist/httpd/binaries/win32/apache_2.0.42-win32-x86-no_ssl.exe
run installer exe, change destination path to c:\, configure to run as a service on port 80

2.在控制面板中设置环境变量
JAVA_HOME:   c:\lib\java
JBOSS_HOME:   c:\jboss
CATALINA_HOME:  c:\jboss\tomcat-4.1.x
APACHE_HOME:   c:\apache2

3、下载apache的扩展模块mod_jk-2.0.42.dll,拷贝到 C:\apache2\modules
该模块将servlet,jsp请求转给tomcat处理
acquire win32 binary of mod_jk.dll (it must be apache http server version-specific)
from http://www.acg-gmbh.de/mod_jk/

4、新建一个空文件 C:\jboss\tomcat-4.1.x\logs\jk.log
当apache中的ajp13 connector工作时,这个文件会记录下日志信息

5、修改C:\jboss\server\default\deploy\tomcat41-service.xml

find the xml tag below:
  
<!-- A HTTP Connector on port 8080 -->
<Connector className = "org.apache.catalina.connector.http.HttpConnector"
port = "8080" minProcessors = "3" maxProcessors = "10" enableLookups = "true"
acceptCount = "10" debug = "0" connectionTimeout = "60000"/>

add directly beneath it:
  
<!-- An AJP Connector on port 8009 -->
<Connector className="org.apache.ajp.tomcat4.Ajp13Connector"
port="8009" minProcessors="5" maxProcessors="75" enableLookups="true" acceptCount="10" debug="1" />

6、新增C:\jboss\tomcat-4.1.x\conf\workers.properties
并下面这段内容加入文件中,注意其中有中文注释的地方,注意修改

# BOF - workers.properties
# $Date: 2002/10/01 10:15:22 $
# Modified by Alexander Petty for JBoss 3.0.3 and Jakarta-Tomcat 4.1.12
#
#
# This file provides jk derived plugins with with the needed information to
# connect to the different tomcat workers.
#
# As a general note, the characters $( and ) are used internally to define
# macros. Do not use them in your own configuration!!!
#
# Whenever you see a set of lines such as:
# x=value
# y=$(x)\something
#
# the final value for y will be value\something
#
# Normaly all you will need to modify is the first properties, i.e.
# workers.tomcat_home, workers.java_home and ps. Most of the configuration
# is derived from these.
#
# When you are done updating workers.tomcat_home, workers.java_home and ps
# you should have 3 workers configured:
#
# - An ajp12 worker that connects to localhost:8007
# - An ajp13 worker that connects to localhost:8009
# - A jni inprocess worker.
# - A load balancer worker
#
# However by default the plugins will only use the ajp12 worker. To have
# the plugins use other workers you should modify the worker.list property.
#
#

#
# workers.tomcat_home should point to the location where you
# installed tomcat. This is where you have your conf, webapps and lib
# directories.
# 注意修改你的tomcat的安装路径
workers.tomcat_home=c:\jboss\tomcat-4.1.x

#
# workers.java_home should point to your Java installation. Normally
# you should have a bin and lib directories beneath it.
# 注意修改你的JAVA的根目录
workers.java_home=c:\lib\java
#
# You should configure your environment slash... ps=\ on NT and / on UNIX
# and maybe something different elsewhere.
#
ps=\
# ps=/

#
#------ ADVANCED MODE ------------------------------------------------
#---------------------------------------------------------------------
#

#
#------ DEFAULT worket list ------------------------------------------
#---------------------------------------------------------------------
#
#
# The workers that your plugins should create and work with
#
worker.list=ajp12, ajp13

#
#------ DEFAULT ajp12 WORKER DEFINITION ------------------------------
#---------------------------------------------------------------------
#

#
# Defining a worker named ajp12 and of type ajp12
# Note that the name and the type do not have to match.
#注意修改你的worker.ajp12.host= 你的机器的IP,如果用localhost访问可以用127.0.0.1
worker.ajp12.port=8007
worker.ajp12.host=127.0.0.1
worker.ajp12.type=ajp12
#
# Specifies the load balance factor when used with
# a load balancing worker.
# Note:
# ----> lbfactor must be > 0
# ----> Low lbfactor means less work done by the worker.
worker.ajp12.lbfactor=1

#
#------ DEFAULT ajp13 WORKER DEFINITION ------------------------------
#---------------------------------------------------------------------
#

#
# Defining a worker named ajp13 and of type ajp13
# Note that the name and the type do not have to match.
#注意修改你的worker.ajp13.host= 你的机器的IP,如果用localhost访问可以用127.0.0.1
worker.ajp13.port=8009
worker.ajp13.host=127.0.0.1
worker.ajp13.type=ajp13
#
# Specifies the load balance factor when used with
# a load balancing worker.
# Note:
# ----> lbfactor must be > 0
# ----> Low lbfactor means less work done by the worker.
worker.ajp13.lbfactor=1

#
# Specify the size of the open connection cache.
#worker.ajp13.cachesize

#
#------ DEFAULT LOAD BALANCER WORKER DEFINITION ----------------------
#---------------------------------------------------------------------
#

#
# The loadbalancer (type lb) workers perform wighted round-robin
# load balancing with sticky sessions.
# Note:
# ----> If a worker dies, the load balancer will check its state
# once in a while. Until then all work is redirected to peer
# workers.
worker.loadbalancer.type=lb
worker.loadbalancer.balanced_workers=ajp12, ajp13

#
#------ DEFAULT JNI WORKER DEFINITION---------------------------------
#---------------------------------------------------------------------
#

#
# Defining a worker named inprocess and of type jni
# Note that the name and the type do not have to match.
#
worker.inprocess.type=jni

#
#------ CLASSPATH DEFINITION -----------------------------------------
#---------------------------------------------------------------------
#

#
# Additional class path components.
#
worker.inprocess.class_path=$(workers.tomcat_home)$(ps)classes

#
# The XML parser provided with Tomcat
#
worker.inprocess.class_path=$(workers.tomcat_home)$(ps)lib$(ps)jaxp.jar
worker.inprocess.class_path=$(workers.tomcat_home)$(ps)lib$(ps)parser.jar

#
# Tomcat's implementation
#
worker.inprocess.class_path=$(workers.tomcat_home)$(ps)lib$(ps)jasper.jar
worker.inprocess.class_path=$(workers.tomcat_home)$(ps)lib$(ps)servlet.jar
worker.inprocess.class_path=$(workers.tomcat_home)$(ps)lib$(ps)webserver.jar

#
# Javac as available from Java2SE
#
worker.inprocess.class_path=$(workers.java_home)$(ps)lib$(ps)tools.jar

#
# Setting the command line for tomcat
# Note: The cmd_line string may not contain spaces.
#
worker.inprocess.cmd_line=-config
worker.inprocess.cmd_line=$(workers.tomcat_home)/conf/jni_server.xml
worker.inprocess.cmd_line=-home
worker.inprocess.cmd_line=$(workers.tomcat_home)

#
# The JVM that we are about to use
#
# This is for Java2
#
worker.inprocess.jvm_lib=$(workers.java_home)$(ps)jre$(ps)bin$(ps)classic$(ps)jvm.dll

#
# And this is for jdk1.1.X
#
#worker.inprocess.jvm_lib=$(workers.java_home)$(ps)bin$(ps)javai.dll
#

#
# Setting the place for the stdout and stderr of tomcat
#
worker.inprocess.stdout=$(workers.tomcat_home)$(ps)inprocess.stdout
worker.inprocess.stderr=$(workers.tomcat_home)$(ps)inprocess.stderr

#
# Setting the tomcat.home Java property
#
worker.inprocess.sysprops=tomcat.home=$(workers.tomcat_home)

#
# Java system properties
#
# worker.inprocess.sysprops=java.compiler=NONE
# worker.inprocess.sysprops=myprop=mypropvalue

#
# Additional path components.
#
# worker.inprocess.ld_path=d:$(ps)SQLLIB$(ps)bin
#
# EOF - workers.properties

7、修改apache的设置
(1)ServerName 127.0.0.1:80
#ServerName 如果你有域名可以用域名,如果没有直接用IP,127.0.0.1是缺省的localhost
(2)找到下面这句话
  # Dynamic Shared Object (DSO) Support

  并在它下面加入

  LoadModule jk_module modules/mod_jk-2.0.42.dll
  <IfModule mod_jk.c>
  JKWorkersFile "c:/jboss/tomcat-4.1.x/conf/workers.properties"
  JKLogFile "c:/jboss/tomcat-4.1.x/logs/jk.log"
  JKLogLevel debug
  JKMount /*.jsp ajp13
  JKMount /servlet/* ajp13
  </IfModule>
  # as you require new contexts(uri paths) to be handed to tomcat set them with JKMOUNT
# 注意修改JKWorkerFile和JKLogFile的路径

8、重起apache httpd server 和 jboss

9. 测试apache的一般页面服务
http://localhost/index.html.en, 如果看到apache的测试页面,表示成功
注意,Apache2\htdocs\下有很多index.html.* 文件,随便找一个测试,但路径一定要全不能是http://localhost/,
因为该目录下没有index.html文件

10、测试tomcat
http://localhost:8080, 如果看到tomcat error page indicating no configured context,表示成功

11、测试apache 和 tomcat的整合,servlet的调用是否正常
http://localhost/servlet/test.html,如果出现tomcat error page indicating no configured context
表示ajp3 connector工作正常

12、测试apache 和 tomcat的整合,jsp的调用是否正常
http://localhost/test.jsp, 如果出现tomcat error page indicating no configured context
表示ajp3 connector工作正常

如果11、12没有出现tomcat error page,表示配置不对,需要重新配置

13、配置jboss为windows 2000服务程序

1) Download JavaService from
  http://www.alexandriasc.com/software/JavaService/JavaService-bin-1.2.0.zip
  decompress files and copy JavaService.exe to c:\jboss\bin

2) Add file c:\jboss\bin\InstallJBossService.cmd
  add the entire file contents below to newly created file and save

---> start file (do not cut this line to clipboard)

@echo off
echo.
echo Installing JBoss as service on Windows NT/2K/XP
echo -----------------------------------------------
echo.

if [%1] == [] goto help
if [%2] == [] goto help
if [%Java_Home%] == [] goto help
if [%JBoss_Home%] == [] goto help

echo on
JavaService -install %1 %Java_Home%\jre\bin\server\jvm.dll -Djava.class.path=%Java_Home%\lib\tools.jar;%JBoss_Home%\bin\run.jar;%JBoss_Home%\bin\shutdown.jar -start org.jboss.Main -params -c %2 -stop org.jboss.Shutdown -out %JBoss_Home%\server\%2\log\stdout.log -err %JBoss_Home%\server\%2\log\stderr.log -current %JBoss_Home%\bin

@echo off
echo.
echo.
echo The JBoss service can be removed with "JavaService.exe -uninstall %1".
goto end

:help
echo The environment variables %%Java_Home%% and %%JBoss_Home%% have to be set,
echo JavaService.exe and this script have to be in %%JBoss_Home%%\bin.
echo.
echo Parameters:
echo %0 service-name configuration
echo.
echo service-name: name of service (e.g. "JBoss")
echo configuration: configuration of JBoss (e.g. "default", "all" or "minimal")
echo.
echo Java_Home = %Java_Home%
echo JBoss_Home = %JBoss_Home%
echo.

:end

---> end file (do not cut this line to clipboard)

3) from the command line type the following:
  1>> cd\
  2>> cls
  3>> cd c:\jboss\bin
  4>> InstallJBossService "JBoss with Tomcat" default

4) make sure any manually started JBOSS servers are stopped

5) open up the services applet from the control panel and right click the newly added service,
  JBoss with Tomcat, choose start to get it running and make sure it set to start automatically

***************************************************************************************************
** You have successfully completed the JBOSS as NT Service configuration successfully.      **
**        Good Job!!              **
***************************************************************************************************

2.測試一下,有些小修正 [Re: aojingen] Copy to clipboard
Posted by: smileboss
Posted on: 2002-12-13 13:10

第13. 點, 步驟2)
2)之前先要產生兩個檔案,否則Jboss會無法以service模式啟動
(可以由windows event log 中看出端倪)

%JBoss_Home%\server\%2\log\stdout.log
%JBoss_Home%\server\%2\log\stderr.log

然後再執行InstallJbossService.cmd將jboss變成windows service

3.good articles [Re: aojingen] Copy to clipboard
Posted by: poiuytre
Posted on: 2002-12-26 09:47

希望以后能有更多这样的文章出现

4.good [Re: aojingen] Copy to clipboard
Posted by: hobohero
Posted on: 2002-12-31 14:58

good


   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923