TOMCAT+IIS配置方法_服务器

一.说明:  
配置如下:Win2000  Server  +  IIS  5.0(Win2000自带)+  Tomcat  3.1  binary  release.  
我使用的Tomcat  3.1是编译过的版本,在这个版本里面没有配置IIS和NT  Service  
的说明,但是在Tocmcat  3.2  source版里面有比较详细的帮助文件。根据这些帮助文件  可以顺利的把Tomcat作为插件插入IIS。  

二.启动tomcat  
安装完tomcat之后(具体安装过程略),要启动Tomcat很简单,首先可以查看tomcat\bin\startup.bat文件,利用控制面板里面的系统->高级->环境变量对话框,新建环境变量TOMCAT_HOME和JAVA_HOME,使它们各自指向TOMCAT和JDK的根目录即可。另外为保险起见,可以在path里面把二者的路径添加进去。然后开启一个DOS窗口执行startup.bat。  启动Tomcat后,会有一个DOS窗口显示启动情况。此时访问http://localhost:8080可以看到Tomcat的一些示例。  

三.配置  
下一步工作就是如何把Tomcat插入IIS,使二者协同工作。主要分以下几个步骤:  
1、在Windows注册表中注册:  
将下面的begin和end之间的Jakarta.reg文件装入机器,我的Tomcat装在c:\\jakarta-tomcat,你可根据自己的环境修改Jakarta.reg文件  
Jakarta.reg:  
---begin---  
Windows  Registry  Editor  Version  5.00  

[HKEY_LOCAL_MACHINE\SOFTWARE\Apache  Software  Foundation\Jakarta  Isapi  Redirector\1.0]  
"extension_uri"="/jakarta/isapi_redirect.dll"  
"log_file"="c:\\jakarta-tomcat\\logs\\isapi.log"  
"log_level"="debug"  
"worker_file"="c:\\jakarta-tomcat\\conf\\workers.properties"  
"worker_mount_file"="c:\\jakarta-tomcat\\conf\\uriworkermap.properties"  
---end---  
注:其中的路径需改成你的tomcat的安装路径。  

2、打开IIS管理器,在"默认WEB站点”中建立一个虚拟目录jakarta,让它的路径指向isapi_redirect.dll所在目录。(在3.1  bin中可能没有这个dll,你可以从3.2的bin\iis\nt4\i386目录中拷贝一个过来。该虚拟目录应被设置为"可执行”。  
3、利用IIS管理器,把isapi_redirect.dll设置为"默认WEB站点”的ISAPI筛选器,名称可以任起。  
4、重启IIS,确认刚才添加的ISAPI筛选器前面标了一个绿色向上的箭头然后重启Tomcat(执行tomcat\bin\shutdown.bat可关闭Tomcat)  此时,IIS应该已经可以处理*.jsp文件了。由于Tomcat设置中,默认的Root是  tomcat\webapps\ROOT,所以你可以在这个目录中放置一个jsp文件(例如  index.jsp),然后访问http://localhost/index.jsp,看一下效果。  如果按照上面的方法还是无法使IIS处理jsp文件,可以尝试在IIS管理器->默认WEB站点属性->主目录->配置中添加一个"应用程序映射”,把*.jsp文件映射到isapi_redirect.dll上。  

四.作为NT的服务  
作为NT  service的设置比较简单。  
首先从3.2拷贝过来jk_nt_service.exe,然后把下面的内容保存起来,起名  
为wrapper.properties  
#  
#  $Header:  /home/cvs/jakarta-tomcat/src/etc/wrapper.properties,v  1.1  
#2000/05/03  11:54:49  shachor  Exp  $  
#  $Revision:  1.1  $  
#  $Date:  2000/05/03  11:54:49  $  
#  
#  
#  jk_service.properties  -  a  bootstrup  file  for  the  Tomcat  NT  service.  
#  
#  This  file  provides  jk_nt_service  with  the  needed  information  to  
#  start  tomcat  at  a  different  process.  
#  
#  As  a  general  note,  the  characters  $(  and  )  are  used  internally  to  define  
#  macros.  Do  not  use  them!!!  
#  
#  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  two  properties,  i.e.  
#  wrapper.tomcat_home  and  wrapper.java_home.  Most  of  the  configuration  
#  is  derived  from  these  two.  
#  
#  
#  wrapper.tomcat_home  should  point  to  the  location  where  you  
#  installed  tomcat.  This  is  where  you  have  your  conf,  webapps  and  lib  
#  directories.  
#  
wrapper.tomcat_home=d:\tomcat  
#  
#  wrapper.java_home  should  point  to  your  Java  installation.  Normally  
#  you  should  have  a  bin  and  lib  directories  beneath  it.  
#  
wrapper.java_home=d:\JBuilder35\jdk1.2.2  
#  
#------  ADVANCED  MODE  ------------------------------------------------  
#  Make  sure  that  you  read  the  how-to  before  making  too  many  changes.  
#---------------------------------------------------------------------  
#  
#  
#  Defining  where  the  service  is  going  to  put  the  standard  
#  output  of  Tomcat.  This  is  where  System.out.println  and  
#  System.err.println  goes  to.  
#  
wrapper.stdout=$(wrapper.tomcat_home)\jvm.stdout  
wrapper.stderr=$(wrapper.tomcat_home)\jvm.stderr  
#  
#  Additions  to  the  path.  put  here  directories  where  you  store  DLLs  for  
#  native  methods  etc.  
#  
wrapper.ld_path=d:\  
wrapper.ld_path=c:\  
#  
#  Defining  the  classpath.  All  the  rows  that  belongs  to  the  class_path  
#  property  are  concatenated  to  create  the  classpath  for  Tomcat.  
#  
#  If  you  have  additional  locations  that  you  would  like  to  add  to  the  
#  claspath  you  should  add  a  new  wrapper.class_path=<location>  line.  
#  
wrapper.class_path=$(wrapper.tomcat_home)\classes  
wrapper.class_path=$(wrapper.tomcat_home)\lib\xml.jar  
wrapper.class_path=$(wrapper.tomcat_home)\lib\webserver.jar  
wrapper.class_path=$(wrapper.tomcat_home)\lib\servlet.jar  
wrapper.class_path=$(wrapper.tomcat_home)\lib\jasper.jar  
#  
#  This  is  where  Javac  is  located  in  JDK1.2.x  
#  
wrapper.class_path=$(wrapper.java_home)\lib\tools.jar  
#  
#  and  a  tribute  to  JDK1.1.x  
#  
wrapper.class_path=$(wrapper.java_home)\lib\classes.zip  
#  
#  This  is  the  Java  interpreter  used  for  running  Tomcat  
#  
wrapper.javabin=$(wrapper.java_home)\bin\java.exe  
#  
#  This  is  Tomcat"s  startup  class  (the  class  that  contains  Tomcat"s 
#  starting  point.  
#  
wrapper.startup_class=org.apache.tomcat.startup.Tomcat  
#  
#  This  is  the  location  where  tomcat"s  server.xml  configuration  file  
#  is  located.  
#  
wrapper.server_xml=$(wrapper.tomcat_home)\conf\server.xml  
#  
#  The  NT  service  uses  AJP12  to  shutdown  Tomcat.  The  wrapper.shutdown_port  
#  tells  the  service  the  identity  of  the  port  that  is  used  by  AJP12.  
#  
wrapper.shutdown_port=8007  
#  
#  This  is  the  command  line  that  is  used  to  start  Tomcat.  You  can  *add*  extra  
#  parameters  to  it  but  you  can  not  remove  anything.  
#  
wrapper.cmd_line=$(wrapper.javabin)  -classpath  $(wrapper.class_path)  $(wrapp  
er.startup_class)  -config  $(wrapper.server_xml)  -home  $(wrapper.tomcat_home)  
保存后,只需修改里面的wrapper.tomcat_home和wrapper.java_home使它们各自指向tomcat根目录和JDK根目录即可。  然后运行jk_nt_service  -I  <服务名称>  <wrapper.properties的路径>  服务名称可以随便起,例如tomcat或者jakarta等等都行。wrapper.properties的路径应为完整路径(包括wrapper.properties这个文件名)示例:jk_nt_service  -I  Jakarta  d:\wrapper.properties  这样在控制面板->服务里面,我们可以看到一个名为Jakarta的服务,可以 在这里启动或者中止它 。

时间: 2024-08-01 07:39:40

TOMCAT+IIS配置方法_服务器的相关文章

Web服务器IIS6的PHP最佳配置方法_服务器

IIS6的PHP最佳配置方法 本文收藏自网络,本人还没有试过,不知如何,现在PHP版本已经到了5.2了.读者应该找找新的文章,本人自已搭建了一个Apache+PHP+Mysql+Mysqladmin平台,只用做学习用,还没真正实战过.!!! 虽然 LAMP 组合很不错,但是如果想要架设一台同时支持 PHP.ASP.ASP.NET.JSP.Perl 的 Web 虚拟主机服务器,还是用 Windows 2003 的 IIS 6 最好.网上有很多介绍在 IIS 6 上配置 PHP 的文章,但是那些方法

IIS 6 的 PHP 最佳配置方法_服务器

作者:冷漠 虽然 LAMP 组合很不错,但是如果想要架设一台同时支持 PHP.ASP.ASP.NET.JSP.Perl 的 Web 虚拟主机服务器,还是用 Windows 2003 的 IIS 6 最好.网上有很多介绍在 IIS 6 上配置 PHP 的文章,但是那些方法不是性能不好,就是升级麻烦.下面的方法可以让你在第一次配置好后,能够非常方便的进行升级. 这里所说的升级,是指从某个 php4 版本升级到另一个 php4 版本,或者从某个 php5 版本升级到另一个 php5 版本,而不是指从 

Cobbler 批量安装操作系统的配置方法_服务器其它

Cobbler介绍 Cobbler是一个快速网络安装linux的服务,而且在经过调整也可以支持网络安装windows.该工具使用python开发,小巧轻便(才15k行代码),使用简单的命令即可完成PXE网络安装环境的配置,同时还可以管理DHCP,DNS,以及yum包镜像. 一.安装和修改cobbler配置 1. Cobbler不在CentOS的基本源中,需要导入EPEL源升级软件包, # rpm -Uvh http://download.fedoraproject.org/pub/epel/6/

win+apache+php+mysql+phpmyadmin环境配置方法_服务器

win+apache+php+mysql环境配置2007-03-09 23:38由于要把学生在线的博客从asp转到php,需要以上的环境配置,在网上找了一些资料,但是都是比较老的,所以决定自己总结一下.         我用的版本也不是最新的,但是是比较稳定的,discuz的官方网上有一些好的说明,以及一些好的软件的下载地址.http://www.discuz.com/index.php?category=4,大家可以看一下. 我用的软件如下: apache:    apache_2.2.3-w

win2003 64位系统IIS配置方法_win服务器

1.因用模版安装ASP.NET 2.0需先卸载64位的.net2.0 命令:C:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727\aspnet_regiis.exe –u 2.把IIS切换为32Bit模式运行 命令:Cscript C:\inetpub\adminscripts\adsutil.vbs SET W3SVC/AppPools/Enable32bitAppOnWin64 1 3.重装安装32Bit .NET 2.0 命令:C:\WINDOWS

Ubuntu Server Rsync服务端与Windows cwRsync客户端数据同步配置方法_服务器其它

说明:1.Rsync服务端 系统:Ubuntu Server 11.10 IP地址:192.168.21.168 数据存放目录:/home/mysql_data2.cwRsync客户端 系统:Windows Server 2003 IP地址:192.168.21.130 同步的目录:D:\mysql_data实现目的:cwRsync客户端每天凌晨3:00钟自动同步Rsync服务端/home/mysql_data目录中的数据到D:\mysql_data目录一.Rsync服务端配置 1.开启防火墙t

CentOS Rsync服务端与Windows cwRsync客户端实现数据同步配置方法_服务器其它

说明: 1.Rsync服务端 系统:CentOS 5.5 IP地址:192.168.21.160 数据存放目录:/data/osyunwei 2.cwRsync客户端 系统:Windows Server 2003 IP地址:192.168.21.130 同步的目录:D:\osyunwei 实现目的: cwRsync客户端每天凌晨3:00钟自动同步Rsync服务端/data/osyunwei目录中的数据到D:\osyunwei目录 一.Rsync服务端配置 1.关闭SELINUX vi /etc/

Cisco网络防火墙配置方法_服务器其它

由于网络防火墙默认禁止所有的通信,因为,只有对其进行适当配置后,才能实现正常的网络通信. 1.进入全局配置模式 ciscoasa# configure terminal 2.选择欲作为网络防火墙外部接口的网络接口 ciscoasa(config)# interface interface-id 3.为该接口指定IP地址和网掩码 ciscoasa(config-if)# 4.将该接口指定IP地址和网掩码 ciscoasa(config-if)# nameif outside INFO:Securi

使IIS支持PHP,ISAPI或CGI,FastCGI完全配置教程(最新php5.2.13配置方法)_win服务器

在Windows Server 2003的IIS6下配置ISAPI方式的PHP,配置方法是,在IIS的"WEB服务扩展"中,添加一个新的WEB服务扩展,程序后缀为PHP,ISAPI程序为php5isapi.dll,然后再我的电脑->属性->高级->"环境变量"-"系统变量"中增加变量名PHPRC,数值为php.ini的路径,在Internet信息服务管理器中,选择网站或应用程序的根目录,打开目录属性页(右键选择"属性&