如何使 Tomcat 支持 IIS 的虚拟主机(200分)

  • 主题发起人 主题发起人 张一健
  • 开始时间 开始时间

张一健

Unregistered / Unconfirmed
GUEST, unregistred user!
如题。如何做?
 
看这里: http://jakarta.apache.org/tomcat/tomcat-3.3-doc/index.html
 
哈,终于进来了(满头大汗~)
to yysun:
我照文档做已经做好了设置,现在可以使用如下访问:
http://servername:8080
自己的例子 test.jsp 文件放在 tomcat_home/webapps/ROOT/ 下时,
可以用 http://servername/test.jsp 访问。
而放在 IIS 的虚拟主机目录下时,提示 "HTTP 404" 找不到该页。
用它的例子 http://servername/examples/jsp/index.html 出现提示同上。
该如何解决?
我的目的是想要 IIS 中的若干虚拟主机支持 jsp。
并且各个虚拟主机之间的 jsp 文件独立存放,互不干扰。
最好放在各自的虚拟主机的目录中。
还有我看英文比较吃力。 :p
 
哇,这么久没回应,难道没人做过吗?
 
my question is ..... why use IIS?
u love code red? or code blue?
why not use apache?
 
to 曹晓钢:
不是我想用 IIS,只是公司的服务器已经有IIS在运行了。
不是我不想用 apache,只是服务器不是有我在管理。
现在的我想在内部的测试服务器上,实现虚拟主机中使用JSP.
大虾,不管是IIS或apache,也不管是windows或linux,请问JSP支持虚拟主机吗?
 
我自己没有试过, 但是看 http://jakarta.apache.org/tomcat/tomcat-3.3-doc/tomcat-iis-howto.html
中有关于 isapi_redirect.dll 和 Context 的配置等说明已经很详细了
您已经可以用 http://servername/test.jsp 访问。说明 isapi_redirect.dll 已经配置好.
而 test.jsp 放在 IIS 的虚拟主机目录下,以及用 /examples/jsp/index.html 时,
提示 "HTTP 404" 找不到该页。说明 Context 或者 Worker 没有配置好.
注意 Tomcat 3.2 以上是大小写有关的.

Check the extension_uri name for typos.
Check the worker_file setting for typos, name and data.
Check the worker_mount_file setting typos, name and data. .
 
to yysun:
我把 Tomcat IIS HowTo 看来看去,就是无法解决问题。快被它折磨死了!
大虾救我!
不管是谁,不管是 Apache 还是 IIS 都行,只要可以实现虚拟主机中正常工作,
我将倾囊而出(1100分)。
曹大虾——
孙老师——
来人啊……

------------------------------------------------------------------------
OS : Win2000
WebServer : IIS
有一个虚拟主机 test.xf, 位置 d:/website/test/
一个虚拟目录 "jakara" 指向c:/jakarta-tomcat-3.2.3/bin/win32/i386
isapi_redirect.dll 位置 c:/jakarta-tomcat-3.2.3/bin/win32/i386/
(isapi_redirect.dll 已经有绿色向上箭头)
tomcat_home = c:/jakarta-tomcat-3.2.3
java_home = c:/jdk1.3
extension_uri = /jakarta/isapi_redirect.dll
worker_file = c:/jakarta-tomcat-3.2.3/conf/workers.properties
worker_mount_file = c:/jakarta-tomcat-3.2.3/conf/uriworkermap.properties
-----------------------------------------------------------
目前情况:
http://test.xf:8080/ 正常
http://test.xf:8080/examples/jsp/index.html 正常
http://test.xf/examples/jsp/index.html HTTP 404 - 无法找到文件
http://test.xf/_date.jsp 正常(_date.jsp为自编jsp文件,放在 c:/jakarta_tomcat_3.2.3/webapps/ROOT 下)
http://test.xf/date.jsp HTTP 404 - 未找到文件(date.jsp为自编jsp文件,放在 test.xf/ 下)
----------------- workers.properties ----------------------
workers.tomcat_home=c:/jakarta-tomcat-3.2.3
workers.java_home=c:/jdk1.3
ps=/
worker.list=ajp12, ajp13
worker.ajp12.port=8007
worker.ajp12.host=localhost
worker.ajp12.type=ajp12
worker.ajp12.lbfactor=1
worker.ajp13.port=8009
worker.ajp13.host=localhost
worker.ajp13.type=ajp13
worker.ajp13.lbfactor=1
worker.loadbalancer.type=lb
worker.loadbalancer.balanced_workers=ajp12, ajp13
worker.inprocess.type=jni
worker.inprocess.class_path=$(workers.tomcat_home)$(ps)classes
worker.inprocess.class_path=$(workers.tomcat_home)$(ps)lib$(ps)jaxp.jar
worker.inprocess.class_path=$(workers.tomcat_home)$(ps)lib$(ps)parser.jar
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
worker.inprocess.class_path=$(workers.java_home)$(ps)lib$(ps)tools.jar
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)
worker.inprocess.jvm_lib=$(workers.java_home)$(ps)jre$(ps)bin$(ps)classic$(ps)jvm.dll
worker.inprocess.stdout=$(workers.tomcat_home)$(ps)inprocess.stdout
worker.inprocess.stderr=$(workers.tomcat_home)$(ps)inprocess.stderr
worker.inprocess.sysprops=tomcat.home=$(workers.tomcat_home)
-------------------------------------------------------------------------------------
-------------- uriworkermap.properties ------------------
/servlet/*=ajp12
/examples/*=ajp12
---------------------------------------------------------
 
1.在http://jakarta.apache.org/builds/jakarta-tomcat/release/v3.3/bin/win32/i386/
下载isapi_redirect.dll,放在tomcat_home/bin目录下
2.建立worker.properties,放在tomcat_home/conf下
3.设置IIS
点击Internet Service Manager
停止Web 站点
创建虚拟目录,设置虚拟目录为tomcat_home/bin,设置目录的权限只读、脚本
建立iis_redirect.reg,并运行
启动IIS
检查Web站点的ISAPI 过滤器属性,确认加载成功
4.建立uriworkermap.properties ,放在tomcat_home/conf下
Sample worker.properties file

# ************ begin
worker.properties **************
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 workdo
ne 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) worker perform weighted 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
# worker.
worker.loadbalancer.type=lb
worker.loadbalancer.balanced_workers=ajp13
#
# worker.tomcat_home should point to the location where you
# installed tomcat. This is where you have your conf, webapps and lib
# directories.
#
worker.tomcat_home=C:/jakarta-tomcat-4.0.1
#
# worker.java_home should point to your Java installation. Normally
# you should have a bin and lib directories beneath it.
#
worker.java_home=C:/jdk1.3.1
#
# You should configure your environment slash... ps=/ on NT and / on UNIX
# and maybe something different else
where.
#
ps=/
#
#------ ADVANCED MODE ------------------------------------------------
#---------------------------------------------------------------------
#
#
#------ DEFAULT worker list ------------------------------------------
#---------------------------------------------------------------------
#
# The worker that your plugins should create and work with
worker.list=ajp13
#
#------ DEFAULT ajp13 WORKER DEFINITION ------------------------------
#---------------------------------------------------------------------
#
#
# Defining a worker named ajp13 and of type ajp13
# Note that the name and the typedo
not have to match.
#
worker.ajp13.port=8009
worker.ajp13.host=localhost
# ************ End worker.properties **************



Sample uriworkermap.properties

# *********** begin
uriworkermap.properties ***
#
# Simple worker configuration file
#
# Mount the Servlet context to the ajp13 worker
/servlet/*=ajp13
# Mount the examples context to the ajp13 worker
/examples/*=ajp13
# Advanced mount of the examples context
# /examples/servlet/*=ajp13
# ************* End uriworkermap.properties ****



iis_redirect.reg

REGEDIT4
[HKEY_LOCAL_MACHINE/SOFTWARE/Apache Software Foundation/Jakarta Isapi Redirector/1.0]
"extension_uri"="/jakarta/isapi_redirect.dll"
"log_file"="C://jakarta-tomcat-4.0.1//logs//iis_redirect.log"
"log_level"="emerg"
"worker_file"="C://jakarta-tomcat-4.0.1//conf//worker.properties"
"worker_mount_file"="C://jakarta-tomcat-4.0.1//conf//uriworkermap.properties"



 
多人接受答案了。
 
后退
顶部