欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

讓IIS6支持JSP的設(shè)置方法(IIS完美整合Tomcat)

 更新時(shí)間:2014年07月06日 17:58:24   作者:llying  
這方面的教程網(wǎng)上很多,多數(shù)是copy之后又copy,以至于有些細(xì)節(jié)一直含糊不清,也導(dǎo)致我走了許多彎路,今天腳本之家小編特為大家整理了一些方法,經(jīng)測(cè)試正常運(yùn)行jsp

大家都了解在MS家族中iis作為internet服務(wù)器可謂是赫赫有名,簡(jiǎn)單,方便。
而且相關(guān)的web程序(asp,asp.net)也是比比皆是。
我們希望java開發(fā)的web程序可以和iis共存(共同使用80端口發(fā)布)。
這方面的教程網(wǎng)上很多,多數(shù)是copy之后又copy,以至于有些細(xì)節(jié)一直含糊不清,也導(dǎo)致我走了許多彎路。在此留個(gè)腳印防止日后的錯(cuò)誤。
軟件及環(huán)境
windows server 2003
IIS 6.0
Tomcat 6.0.20
JDK 6.0
JK isapi_redirect-1.2.14 (很多情況下是由于isapi_redirect 的版本不符,我之前用過最新的1.2.28但是沒有整合成功 大家可以嘗試一下,這個(gè)軟件好像不太好找,腳本之家為大家提供了本地下載,速度更快)

1.安裝IIS

控制面板--> 添加刪除程序 --> 添加刪除windows組件



測(cè)試


2.安裝java環(huán)境,這里要用jdk而不是jre
我安裝到

復(fù)制代碼 代碼如下:

c:\java\jdk1.6

不要忘記配置環(huán)境變量

3.安裝tomcat

我的安裝目錄是

復(fù)制代碼 代碼如下:

C:\tomcat6

啟動(dòng)tomcat
測(cè)試8080端口



4.基本工作完成 下面我們進(jìn)行整合
安裝isapi_redirect-1.2.14 當(dāng)然也可以直接使用isapi_redirect-1.2.14.dll + 配置文件手動(dòng)編寫,不過對(duì)于首次安裝還是建議使用安裝文件,防止配置文件書寫產(chǎn)生誤差導(dǎo)致整合不成功。


一路next
安裝目錄是

C:\Program Files\Apache Software Foundation\Jakarta Isapi Redirector

5.打開iis的管理界面

查看默認(rèn)站點(diǎn)是否存在



中的jakarta的虛擬目錄
并查看屬性中



是否存在jakarta的篩選器。至于向上的綠色箭頭可能沒有(網(wǎng)上很多都指出要求由此,實(shí)際上只有配置之后首次訪問的時(shí)候,才進(jìn)行加載)只要不是紅色就可以。
如果沒有則創(chuàng)建,
添加篩選器 名稱jakarta 文件地址 C:\Program Files\Apache Software Foundation\Jakarta Isapi Redirector\bin\isapi_redirect.dll
創(chuàng)建虛擬目錄



別名 jakarta (必須) 路徑 C:\Program Files\Apache Software Foundation\Jakarta Isapi Redirector\bin\
訪問權(quán)限


不要忘記 運(yùn)行腳本 執(zhí)行 勾選
ok
8.我們?cè)趖omcat app下面隨便建立個(gè)工程 我這里是目錄名0431la
修改配置文件
C:\Program Files\Apache Software Foundation\Jakarta Isapi Redirector\conf\uriworkermap.properties

# uriworkermap.properties - IIS
#
# This file provides sample mappings for example wlb
# worker defined in workermap.properties.minimal
# The general syntax for this file is:
# [URL]=[Worker name]

/admin/*=wlb
/manager/*=wlb
/jsp-examples/*=wlb
/servlets-examples/*=wlb

# Optionally filter out all .jpeg files inside that context
# For no mapping the url has to start with exclamation (!)

!/servlets-examples/*.jpeg=wlb

#
# Mount jkstatus to /jkmanager
# For production servers you will need to
# secure the access to the /jkmanager url
#
/jkmanager=jkstatus
/0431la/*=wlb

我們重啟tomcat 和 iis 并訪問測(cè)試
iis的重啟可以通過鼠標(biāo)右鍵我的電腦 --> 管理 進(jìn)行重啟




接下來我們可以進(jìn)行測(cè)試





ok了 雖然這不是我們的最終結(jié)果 但是至少我們之前配置的沒有問題了

下面我們進(jìn)行虛擬主機(jī)的配置
9.我們把0431la目錄放到c盤根目錄并配置tomcat的虛擬主機(jī)

復(fù)制代碼 代碼如下:

 <Host name="www.0431.la" debug="0" appBase="c:\0431la" unpackWARs="true" autoDeploy="true">
<Context path="" docBase="c:\0431la" debug="0" reloadable="true"/>
</Host>

10.在iis下面配置虛擬主機(jī)的映射目錄
并添加jakarta虛擬目錄 和 isapi篩選 配置過程可參考第五步

11.修改配置文件
C:\Program Files\Apache Software Foundation\Jakarta Isapi Redirector\conf\uriworkermap.properties

復(fù)制代碼 代碼如下:

# uriworkermap.properties - IIS
#
# This file provides sample mappings for example wlb
# worker defined in workermap.properties.minimal
# The general syntax for this file is:
# [URL]=[Worker name]

/admin/*=wlb
/manager/*=wlb
/jsp-examples/*=wlb
/servlets-examples/*=wlb

# Optionally filter out all .jpeg files inside that context
# For no mapping the url has to start with exclamation (!)

!/servlets-examples/*.jpeg=wlb

#
# Mount jkstatus to /jkmanager
# For production servers you will need to
# secure the access to the /jkmanager url
#
/jkmanager=jkstatus
/0431la/*=wlb
/*.jsp=wlb

讓jsp請(qǐng)求交由tomcat處理
呵呵
重啟iis 和 tomcat 看看我們的成果


我們可以考但jsp請(qǐng)求完全正常解析了。

復(fù)制代碼 代碼如下:

<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>" rel="external nofollow" >
   
    <title>My JSP 'index.jsp' starting page</title>
 <meta http-equiv="pragma" content="no-cache">
 <meta http-equiv="cache-control" content="no-cache">
 <meta http-equiv="expires" content="0">   
 <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
 <meta http-equiv="description" content="This is my page">
 <!--
 <link rel="stylesheet" type="text/css" href="styles.css" rel="external nofollow" >
 -->
  </head>
 
  <body>
    This is my JSP page. <br>
  </body>
</html>

該jsp是myeclipse工程自動(dòng)生成的。

相關(guān)文章

最新評(píng)論