茫茫網海中的冷日
         
茫茫網海中的冷日
發生過的事,不可能遺忘,只是想不起來而已!
 恭喜您是本站第 1671260 位訪客!  登入  | 註冊
主選單

Google 自訂搜尋

Goole 廣告

隨機相片
PIMG_00252.jpg

授權條款

使用者登入
使用者名稱:

密碼:


忘了密碼?

現在就註冊!

微軟帝國 : [轉貼]IIS 6.0 + Tomcat 6.0 整合

發表者 討論內容
冷日
(冷日)
Webmaster
  • 註冊日: 2008/2/19
  • 來自:
  • 發表數: 15771
[轉貼]IIS 6.0 + Tomcat 6.0 整合
    文章主題: IIS 6.0 + Tomcat 6.0 整合
下載軟體:
JDK: http://java.sun.com/javase/downloads/index.jsp
Tomcat: http://tomcat.apache.org/download-60.cgi
Tomcat Connector(Installer): http://archive.apache.org/dist/tomcat/tomcat-connectors/jk/binaries/win32/jk-1.2.15/isapi_redirect.msi
Tomcat Connector(Update): http://tomcat.apache.org/download-connectors.cgi


1.安裝Windows作業系統(包含IIS安裝),並更新到最新的Service Pack及修正程式。

2.安裝Java SE JDK 6.0最新版的Update( 下載)
預設安裝到C:\Program Files\Java\jdk1.6.0_<Update version>,同時安裝Public JRE至C:\Program Files\Java\jre6下
(1)取消不常用的一些套件,如Source Code或Java DB
(2)開啟檔案總管切換到安裝目錄C:\Program Files\Java\jdk1.6.0_<Update version>,複製bin目錄下的msvcr71.dll至C:\Windows\system32目錄下。

3.安裝Tomcat 6.0最新版( 下載)
預設安裝到 C:\Program Files\Apache Software Foundation\Tomcat 6.0
(1)勾選Service和Native,取消Documentation和Examples。(註:如果要使用manager則必須安裝Examples)
image
(2)安裝完成後設定記憶體相關參數
image


4.安裝Tomcat Connectors (isapi_redirect.msi)並更新至新版isapi_redirect.dll( 下載)。
預設安裝到 C:\Program Files\Apache Software Foundation\Jakarta Isapi Redirector
(1) 下載新版的Tomcat connector,儲存到安裝目錄的bin目錄下,以點選isapi_redirect.dll來覆蓋掉上個步驟產生的檔案

5.新增IIS網頁服務延伸
網頁服務延伸->新增網頁服務延伸
延伸名稱:JavaServer Pages
需要的檔案:C:\Program Files\Apache Software Foundation\Jakarta Isapi Redirector\isapi_redirect.dll
image

6.設定要給Tomcat處理的檔案(加!在最前面表示不給Tomcat處理)
C:\Program Files\Apache Software Foundation\Jakarta Isapi Redirector\conf\uriworkermap.properties

/*.jsp=wlb
/*.do=wlb
/*.page=wlb
/servlet/*=wlb

/manager/*=wlb

!/images/*=wlb
!/css/*.css=wlb
!/js/*=wlb

7.準備測試站台
(1)編輯 C:\Program Files\Apache Software Foundation\Tomcat 6.0\conf\Catalina\localhost\ROOT.xml
<Context path="" docBase="C:/Inetpub/wwwroot" reloadable="true"/>
(2)編輯 C:\Inetpub\wwwroot\index.jsp
<%="Hello world"%>
(3)確認"預設的 Web 站台"的主目錄是在C:\Inetpub\wwwroot

8.重新啟動 Tomcat

9.重新啟動 IIS

10.瀏覽 http://localhost/index.jsp
如果出現 Hello world 那就成功了

11.檢查IIS的ISAPI 篩選器(Filter)是否正常運作(狀態有個綠色向上的箭頭)
IIS->預設的網站->右鍵->內容->ISAPI篩選器
image

12.設定壓縮靜態檔案
網站->內容->服務
image

13.修改IIS目錄安全性設定中的驗證及存取控制,取消整合式 Windows 驗證。


到此,大功告成,可以開始部署您的應用程式了。

原文出處:IIS 6.0 + Tomcat 6.0 整合
冷日
(冷日)
Webmaster
  • 註冊日: 2008/2/19
  • 來自:
  • 發表數: 15771
[轉貼]IIS6 和Tomcat5 的整合
花了很久時間,終於搞定了IIS6和Tomcat的整合。現在把步驟貼出來給各位一點參考,也免去了新手在Google上暴走和一次次的調試。開始吧!
首先先說明我的系統,Windows 2003 Server中文版+IIS6+Tomcat5.0.14,JDK 1.4.2安裝目錄為C:\JDK,Tomcat安裝目錄為C:\Tomcat,環境變量JAVA_HOME和TOMCAT_HOME都已設置好並指向其各自的安裝目錄。(注意,接下來所有文件中涉及到tomcat路徑的請自行修改為自己的Tomcat路徑)
Tomcat5和IIS6的安裝我就不說了,網上的文檔很多,假定此時我們已經安裝好了Tomcat5和IIS6並都能獨立運行,兩者的默認網站均指向C:\web目錄。

現在我們要做的是到http://apache.linuxforum.net/dist/jakarta/tomcat-connectors/jk2/binaries/win32/jakarta-tomcat-connectors-jk2.0.2-win32-IIS.zip 去下載JK2,由JK2負責IIS和Tomcat的通訊,解開後得到isapi_redirector2.dll,我把它放在了C:\tomcat\iis下(目錄隨便)。
接下來在Tomcat安裝目錄下的conf目錄下建一個workers2.properties文件,把下面這段東東拷進去保存。注意file=".."之中的路徑要用"/"哦!
[shm]
file=c:/Tomcat/logs/jk2.log
size=1048576

# 實際運用時把所有的localhost和8009換成你自己的IP和端口
[channel.socket:localhost:8009]
port=8009
host=localhost

# define the worker
[ajp13:localhost:8009]
channel=channel.socket:localhost:8009

# Uri mapping
[uri:/*.jsp]
[uri:/web/*]
worker=ajp13:localhost:8009

# define the worker
[status:status]

# Uri mapping
[uri:/jkstatus/*]
worker=status:status


之後編輯jk2.properties文件,確認其中是否有此一句:
request.tomcatAuthentication=false


接下來開始編輯註冊表,直接建一個iis.reg文件,把下面一段拷進去保存然後雙擊iis.reg把信息導入註冊表。(注意,把涉及的Tomcat路徑改成你的Tomcat的路徑)
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Apache Software Foundation\Jakarta Isapi Redirector\2.0]
"serverRoot"="c:\\Tomcat"
"extensionUri"="/jakarta/isapi_redirector2.dll"
"workersFile"="c:\\Tomcat\\conf\\workers2.properties"
"logLevel"="INFO"


然後打開「我的電腦->控制面板->管理工具->Internet信息服務管理器」,在裡面選擇「網站」中的默認網站(默認網站我假定指向C:\web),在其上點右鍵選「屬性」,在彈出的頁框裡選擇「ISAPI篩選器」,點「添加」,篩選器名稱填jakarta,可執行文件中填入你的isapi_redirector2.dll的絕對路徑。「確定」後點「確定」關閉屬性頁。再在「默認網站」上右鍵,選擇「新建」->「虛擬目錄」,別名填jakarta,下一步,路徑選為你的isapi_redirector2.dll存放的目錄,我的是C:\tomcat\iis,下一步,權限中記得把「執行」那項打勾,好了,完成。
如果你用的是IIS5的話,到這裡就可以結束了,但IIS6還沒完,繼續。
在「Internet信息服務管理器」的「網站」中的「Web服務擴展」上點右鍵選擇「添加一個新的Web服務擴展」,彈出的框中擴展名填Tomcat(其實無所謂的),「要求的文件」選「添加」然後找到你的isapi_redirector2.dll後「確定」。「設置擴展狀態為允許」也打上勾,確定。
好了,配置完了。現在我們啟動Tomcat5,然後net start w3svc啟動IIS6。鍵入http://localhost:8080/hello.jsp(這個文件是我放在c:\web下的)看看!然後在看看http://localhost/hello.jsp,如果兩者執行結果一樣,恭喜你,整合成功了!

但或許此時還不行,這時你該確認以下幾點:
1.你的「Internet信息服務管理器」->「網站」->「默認網站」->「屬性」->「ISAPI篩選器」中的jakarta是否是向上的綠色箭頭?如果是紅色的,檢查一下你之前做的配置有沒有少了或是寫錯了點什麼,再重新配置一遍
2.確認你的Tomcat安裝目錄下的common\lib目錄中是否有tools.jar文件(Tomcat5好像是有的,但Tomcat4中是沒有的,網上的文檔很少提到這件事,致使我多次配置失敗),沒有的話從JDK的lib下拷一個過去。
3.IIS指向的目錄最好和Tomcat指向的目錄一致,不然會發生找不到圖像和其他資源文件的問題。(這點不影響執行,呵呵!)
4.英文文檔中還提到應該把IIS6設置為IIS5隔離模式,「Internet信息服務管理器」->「網站」->「屬性」->「服務」,把「以IIS5.0隔離模式運行WWW服務」打上勾。不過我不打勾也能正常使用,如果你配置不成功也可以試試這個。

還不行?好,我們來狠的,打開機箱,取出硬盤,扔到地上給我踩,踩,踩!看你還敢跟我頂^_^(開個玩笑,不過之前我配置多次失敗後確實有些無奈和懊惱)
此文實際也等於是轉載,我只是負責輸入而已,如有錯誤請指出!歡迎各位與我交流,ymer@21cn.com,JSP程序員,EJB學習中......

參考網址:
https://www.rit.edu/~ack5504/tomcat-iis6-howto/tomcat-iis6-howto.html
http://www.knowsky.com/3181.html


原文出處:IIS6 和Tomcat5 的整合
冷日
(冷日)
Webmaster
  • 註冊日: 2008/2/19
  • 來自:
  • 發表數: 15771
[轉貼]整合Tomcat5和IIS5 及正常打開jsp
前言:以前也看了N篇文檔,照著裡面的說明配置,卻總沒有成功過,今天終於成功了!!!回過來再看那些文檔,好多就直接Ctrl+C和Ctrl+v來的(又還不說明原文出處,想找人問都不能),關鍵操作的地方總是含糊不清,而且即使配置完了,也還打不開jsp頁面,有些沒有實際操作過就...... 唉......

我又去找資料來看,昨天下午終於配置成功了。

需要說明的幾個問題:操作系統win2000pro,已經裝了Jbilder8,從來沒有設置過JAVA_HOME等環境變量,文中需要用到的幾個文件在文末有下載連接,我整合的是IIS5+Tomcat5.0.7,但是估計IIS6,tomcat4也應該可以,不好意思,我的win2003因為打了個補丁,結果Daemon虛擬光驅掛了,認不出ISO了,IIS6也壞了,沒有辦法測試了,請允許我鬱悶一下先。

好了,下面開始我的具體操作步驟:

1。安裝tomcat5.0.7。
運行jakarta-tomcat-5.0.7.exe,安裝模式不用normal,而是選擇full(這樣會把tomcat安裝成win2000的服務,而且還有tomcat的源代碼),然後按照提示進行。我的taomcat裝在C:\Program Files\Apache Software Foundation\Tomcat 5.0.7下。

2。設置環境變量tomcat_home。在桌面上,「我的電腦」->點右鍵->「屬性」->「高級」->「環境變量」->「系統變量」->新建->變量名:tomcat_home, 變量值:C:\Program Files\Apache Software Foundation\Tomcat 5.0.7。點「確定」保存。

3.在C:\Program Files\Apache Software Foundation\Tomcat 5.0.7\conf下新建「connector」文件夾,然後複製isapi_redirector2.dll到C:\Program Files\Apache Software Foundation\Tomcat 5.0.7\conf\connector下面。

4.創建workers2.properties到C:\Program Files\Apache Software Foundation\Tomcat 5.0.7\conf下(可以用我附件中的workers2.properties,使用前請先修改文件的第一行,把「C:/Program Files/Apache Software Foundation/Tomcat 5.0.7/logs/jk2.log」改成你需要的路徑,copy地址欄的路徑時請注意,是"/"而不是「\」哦,跟windows表示的路徑不一樣)。

5.創建jk2.properties到C:\Program Files\Apache Software Foundation\Tomcat 5.0.7\conf下(直接使用我的附件裡的jk2.properties)。

6.導入註冊表文件isapi_redirect.2.0.reg(雙擊文件,然後點確定就好了)導入之前請先修改註冊表文件,把serverRoot 和workersFile的「C:\\Program Files\\Apache Software Foundation\\Tomcat 5.0.7」替換成你的tomcat安裝路徑。

7.開始菜單->設置->控制面板->管理工具->Internet 服務管理器,然後找到 你的站點(我的計算機名是lnboy ,「默認 Web 站點」)。點右鍵->「屬性」->「ISAPI篩選器」->「添加」->篩選器名稱:jakarta,可執行文件:C:\Program Files\Apache Software Foundation\Tomcat 5.0.7\conf\connector\isapi_redirector2.dll。點「確定」保存。

8.接下來在「默認 Web 站點」點右鍵->新建->虛擬目錄->下一步->別名填:jakarta,再點下一步->目錄選擇為:C:\Program Files\Apache Software Foundation\Tomcat 5.0.7\conf\connector,再點下一步->"執行(例如ISAPI應用程序或CGI)"一項打上勾,再點下一步,再點「完成」。

9.重新啟動「默認 Web 站點」。然後在「默認 Web 站點」點右鍵->「屬性」->「ISAPI篩選器」,如果"jakarta"前面的箭頭是綠色的,那麼表明配置已經成功了。

如果箭頭是紅色,那麼請你檢查整個配置過程,看看有沒有弄錯的地方,(基本上除了涉及到tomcat的安裝目錄的地方需要修改之外, 其它沒有什麼地方需要修改的)。

(大家還可以參考http://www.reynir.net/tomcat/tomcat_IIS_service_jk2.html,以上步驟,我就是按照它的說明加上一些小修改之後配置成功的。)

此時要想正常訪問jsp還有一些小問題,

10.設置環境變量tomcat_home。
桌面上,「我的電腦」->點右鍵->「屬性」->「高級」->「環境變量」->「系統變量」->新建->變量名:JAVA_HOME, 變量值:D:\JBuilder8\jdk1.4。點「確定」保存。

11.把D:\JBuilder8\jdk1.4\lib目錄下的tools.jar給複製到tomcat的common\lib的目錄下(C:\Program Files\Apache Software Foundation\Tomcat 5.0.7\common\lib\下),重新啟動Tomcat,再重新啟動IIS。

12.此時打開http://localhost/index.jsp(注意:不是http://localhost/),應該可以看見tomcat的頁面。
但是看見了嗎???圖片顯示不正常,接下來再修改。

13.開始菜單->設置->控制面板->管理工具->Internet 服務管理器,然後找到 你的站點(我的計算機名是lnboy ,「默認 Web 站點」)。點右鍵->「屬性」->「文檔」->添加,輸入「index.jsp」,確定,再添加「index.html」,確定(因為著這是tomcat的默認起始頁面)。再到「主目錄」,「本地路徑」一欄,選擇「C:\Program Files\Apache Software Foundation\Tomcat 5.0.7\webapps\ROOT」。

14.重新啟動IIS,此時打開http://localhost/,比較一下,和打開http://localhost:8080/吧???大功告成也!!!
別忙,打開http://localhost/jsp-examples/看看,是不是打不開啊???此時還需要在IIS中新建虛擬目錄jsp-examples,本地路徑為:C:\Program Files\Apache Software Foundation\Tomcat 5.0.7\webapps\jsp-examples(看看次文件夾下的index.html,知道為什麼要在前面添加"index.html"了吧???)。

15.重新啟動IIS,可以打開http://localhost/jsp-examples/jsp2/simpletag/hello.jsp了吧???

PS:上傳了附件,裡面有需要用到的workers2.properties,jk2.properties和isapi_redirector2.dll,isapi_redirect.2.0.reg。

附件在http://www.delphibbs.com/keylife/images/u88173/tomcatconf.rar

最後感謝:google http://www.google.com/(好可愛的狗狗)


原文出處:http://www.knowsky.com/3181.html
冷日
(冷日)
Webmaster
  • 註冊日: 2008/2/19
  • 來自:
  • 發表數: 15771
[轉貼]Tomcat咬在IIS中的方式

Tomcat咬在IIS中的方式

1. 先灌好JAVA、IIS和Tomcat並測試全都已經可以正常執行

2. 下載isapi_redirect.dll連接器
可至 ftp://ftp.nsysu.edu.tw/Unix/Web/apache/jakarta/tomcat-3/bin/win32/i386/isapi_redirect.dll
或到 http://ftp.nsysu.edu.tw http://ftp.tku.edu.tw 去搜尋關鍵字

3. 新增一個環境變數,變數名稱輸入CATALINA_HOME,變數值輸入Tomcat的安裝路徑,例如我的內容是:C:\Tomcat 4.1

4. 在C:\Tomcat 4.1\bin中新增一個iis資料夾,並將isapi_redirect.dll放進C:\Tomcat 4.1\bin\iis當中


5. 啟動IIS點選你的WEB站台按右鍵,選「內容」進入「ISAPI篩選器」→新增,篩選器名稱輸入「Jakarta Redirector」,執行檔輸入「C:\Tomcat 4.1\bin\iis\isapi_redirect.dll」(視你實際的位置而定)

6. 在點選你的WEB站台中新增一個虛擬目錄名叫jakarta,目錄請指到C:\Tomcat 4.1\bin\iis,權限請選擇「讀取」、「執行指令檔」、「執行」三項

7. 打開一個記事本輸入以下內容


1
2
3
4
5
6
7

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



8. 將該內容另存成iis_redirect.reg在任意位置,檔案建好之後即可執行該檔案,按下確定後會將檔案內容註冊進windows裡頭

9. 到tomcat\conf下打開一個記事本輸入以下內容並將檔名存成worker.properties


1
2
3
4
5
6
7
8
9
10
11
12
13
14

# ************ Begin worker.properties **************
worker.ajp13.type=ajp13
worker.ajp13.lbfactor=1
worker.loadbalancer.type=lb
worker.loadbalancer.balanced_workers=ajp13
worker.tomcat_home=C:\Tomcat 4.1
#上面這一行指到你的tomcat目錄
worker.java_home=C:\j2sdk1.4.2_07
#上面這一行指到你的java的目錄
ps=\
worker.list=ajp13
worker.ajp13.port=8009
worker.ajp13.host=localhost
# ************ End worker.properties **************



10. 到tomcat\conf下打開一個記事本輸入以下內容並將檔名存成uriworkermap.properties


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20

# ************ Begin uriworkermap.properties **************
default.worker=ajp13
/=$(default.worker)
/*=$(default.worker)
/ROOT/=$(default.worker)
/ROOT/*=$(default.worker)
/manager=$(default.worker)
/manager/*=$(default.worker)
/examples=$(default.worker)
/examples/*=$(default.worker)
/tomcat-docs=$(default.worker)
/tomcat-docs/*=$(default.worker)
/webdav=$(default.worker)
/webdav/*=$(default.worker)
#以上的目錄結構,視您webapps下的目錄結構自行增減,
#例如webapps目錄底下如果建立了一個ePOS的資料夾,
#那麼上面就得再加上
#/ePOS=$(default.worker)
#/ePOS/*=$(default.worker)
# ************ End uriworkermap.properties **************



11. 假如在ROOT目錄底下建立了一個ePOS的資料夾,則在該資料夾中建立一個名為WEB-INF的資料夾,並在WEB-INF資料夾中建立兩個名為classes和lib的資料夾

12. 先將TOMCAT關閉,再將IIS重新啟動,再開啟TOMCAT

13. 將電腦關機幾秒鐘之後再開機

14. 開機後在IE裡輸入http://localhost/examples/jsp/dates/date.jsp,重新整理幾次確定JSP程式能正常執行

15. 將自己寫的*.jsp網頁放進ROOT以及ROOT中的目錄裡,假如目錄名稱為ePOS,檔案名稱為test.jsp

16. 在IE裡輸入http://localhost/test.jsp以及http://localhost/ePOS/test.jsp,若有正常執行程式的話就表示您已經成功了

17. 若是失敗的話請先檢查第10步及以後的步驟,再不成功的話就請將以上全部檢查一遍吧

18. 當其它目錄中的網頁要連結進您的JSP網頁時可用絕對路徑法或是URL

 

--

以上    轉自javaworld 備忘用  
          如有侵權 請告知刪除


原文出處: Tomcat咬在IIS中的方式 @ Mr. 8的單身日記 :: 痞客邦 PIXNET ::
冷日
(冷日)
Webmaster
  • 註冊日: 2008/2/19
  • 來自:
  • 發表數: 15771
[轉貼]IIS配合Tomcat搭建JSP環境
IIS配合Tomcat搭建JSP環境

使用和測試JSP程序,必須要有一個完整的JSP運行環境,這裡介紹一種簡單的JSP環境搭建方法,適用於中小企業的JSP建站環境,也適用於JSP網站開發人員的JSP測試環境。

這裡假設的系統是採用安裝了IIS組件的Windows 2000 Professional或者是Windows 2000 Server。WWW服務採用Windows組件中IIS自帶的WWW服務。JSP環境主要使用Tomcat3.2.3。當然,出於安全的考慮,系統必須安裝好了Service Pack2補丁,該補丁如果沒有,可以從微軟的官方網站下載。下面介紹具體的配置步驟:
安裝Java開發工具包,用來執行Tomcat3.2.3的主程序。可以採用jdk1.3.1,從http://java.sun.com/products/archive/index.html裡下載,可以得到它。安裝完之後,假設安到c:\jdk1.3.1。要在"我的電腦"->;"屬性"->;"高級"->;"環境變量"->;"用戶變量"裡添加如下環境變量:
PATH c:\jdk1.3.1\bin;c:\jdk1.3.1\jre\bin
CLASSPATH .;c:\jdk1.3.1\lib\dt.jar;c:\jdk1.3.1\lib\tools.jar;c:\jdk1.3.1\jre\lib\rt.jar
JAVA_HOME c:\jdk1.3.1

接著,運行cmd進入DOS窗口,或者直接進入,然後分別執行javac和java命令,如果有相關命令幫助提示,則正常,如不然,可以進入"控制面板",刪除應用程序"Java2運行時環境",接著返回DOS,運行上述兩命令,直到提示正確為止。這樣表明,系統可以運行任何Java程序了。你甚至可以寫一個Java程序用作測試。
下載tomcat3.2.3(或者tomcat3.2.4),它的具體下載位置在http://jakarta.apache.org/builds/jakarta-tomcat/release/v3.2.4/bin/裡邊。將jakarta-tomcat-3.2.4.zip解壓即可(設解壓到C盤)。並將解壓後的文件夾重命名為tomcat(為方便起見)。你見到的目錄結果將是如下結構:
c:\tomcat\conf
c:\tomcat\webapps
c:\tomcat\bin


如果不是這樣的結構,則進行修改。
接著,同第一步一樣,在"我的電腦"->;"屬性"->;"高級"->;"環境變量"->;"用
戶變量"裡添加環境變量:
TOMCAT_HOME C:\tomcat

修改c:\tomcat\conf\server.xml文件,找到如下語句:
<Context path="/examples"
docBase="webapps/examples"
crossContext="false"
debug="0"
reloadable="true" >;
</Context>;

在它的後邊添加一個類似語句:
<Context path="/myjsp"
docBase="webapps/myjsp"
crossContext="false"
debug="0"
reloadable="true" >;
</Context>;

說明:"/myjsp"是相對於網站根的路徑,就相當於http://192.168.0.75/myjsp
而"webapps/myjsp"是/myjsp的實際位置,這裡是c:\tomcat\webapps\myjsp。
同時在http://jakarta.apache.org/builds/jakarta-tomcat/release/v3.2.4/bin/win32/i386/中下載isapi_redirect.dll文件。將它拷貝到c:\tomcat\bin\win32\i386目錄下邊。子目錄win32以及i386都是手工創建的。
運行regedit命令,進入註冊表,建立如下一個註冊項:HKEY_LOCAL_MACHINE\SOFTWARE\Apache Software Foundation\Jakarta Isapi Redirector\1.0
在上述項1.0下創建如下串值:
extension_uri /jakarta/isapi_redirect.dll
log_file C:\tomcat\logs\isapi.log
log_level Debug
worker_file C:\tomcat\conf\workers.properties
worker_mount_file C:\tomcat\conf\uriworkermap.properties

在IIS服務控制台下(打開"控制面板"->;"管理工具"->;"Internet服務管理器"->;"默認web站點"),將默認web站點下邊的子目錄全部刪掉,然後,創建一個虛擬目錄,名為:jarkata,設置其權限為可執行。路徑為c:\tomcat\bin\win32\i386,在該目錄的文檔屬性欄裡添加index.htm,index.html,index.jsp。

在IIS控制台下,加一個filefilter(ISAPI篩選器,在屬性裡邊),名為jarkata。權限為可執行。文件為c:\tomcat\bin\win32\i386\isapi_redirect.dll.確定後,如果圖標為綠色,即表示正常。

修改IIS的主目錄。可以設為c:\ mysite(預先創建mysite子目錄),以及IP地址,主機名。
在uriworkermap.properties 文件中,加進/jsp/*=ajp12。
將"管理工具"->;"服務"中的WWW服務設置為手動方式。

這樣,整個JSP環境配置結束,可以提供給網絡開發人員使用了。
啟動JSP環境時,進入c:\tomcat\bin目錄,執行startup.bat,再啟動"管理工具"->;"服務"中的WWW服務即可。結束JSP環境,可以停止WWW服務,再執行c:\tomcat\bin中的shutdown.bat程序。
假設系統的IP為192.168.0.75,那麼在啟動JSP環境以後,在IE地址欄中輸出:
http://192.168.0.75/examples/jsp/就能見到JSP的頁面。
裡邊有一些很有用的例子。在開發時,可以將JSP程序放到c:\tomcat\webapps\myjsp下邊。它的下邊也可以建立子目錄。而htm(l)頁面放到c:\mysite下邊。
比如,c:\tomcat\webapps\myjsp\news\test.jsp程序在運行之後,其真正的URL將變為:http://192.168.0.75/myjsp/news/test.jsp


原文出處:[藍森林-自由軟件] - IIS配合Tomcat搭建JSP環境
冷日
(冷日)
Webmaster
  • 註冊日: 2008/2/19
  • 來自:
  • 發表數: 15771
[轉貼]Setup IIS with URL Rewrite as a reverse proxy for real world apps.

Setup IIS with URL Rewrite as a reverse proxy for real world apps.


Url Rewrite, one of the many modules that can be added on to the IIS web-server to make this a very versatile tool can be used to perform a variety of tasks, including allowing you to setup your IIS web-server as a reverse-proxy server to some other back-end HTTP service. A reverse proxy is a network device that takes in traffic coming from the Internet (for example), and forwards this traffic to a backend server on your private network, allow that backend server to be accessible to people who are not necessarily connected to your network. There are a lot of articles on how to use IIS and Url Rewrite as a reverse proxy, but I have found that many are incomplete with regards to real world scenarios from today’s web applications.

Scenario: Setting up IIS with URL rewrite as a reverse proxy with SSL offloading for a backend service.


Details: suppose that we have a web-application hosted on one of our backend web-servers, IIS or another web server, and that this application server cannot be configured to use SSL and is not accessible to the end users because the end users do not have access to the network the server is on. We want IIS to perform the following tasks:

  • Take in requests from the end users for content from this application using SSL
  • Route these requests to the backend application server using HTTP
  • Rewrite all responses from the backend server, so that any hyperlinks, form action tags and such are constructed with the URL that the IIS reverse proxy server has.

Below is the diagram of the setup we wish to accomplish using IIS as a reverse proxy server:


I would like to take you through the configuration steps required to setup such a system, where requests are routed via the IIS server to the backend application server and the re-written back again with the public host-name of the IIS server and sent back to the connecting clients.

Install URL Rewrite

The first step is to install the add-on module for URL Rewrite. With Windows Server 2012 R2, you can use the Microsoft Web Platform Installer (WebPI) to download and install the URL Rewrite Module. Just search for ‘URL Rewrite’ in the search options and click ‘Add’. You can also download the extension from IIS.net – http://www.iis.net/downloads/microsoft/url-rewrite .


Once the module is installed in IIS, you will see a new Icon in the IIS Administration Console, called URL Rewrite. This icon is present at the level or each site and web-application you have in the server, and will allow you to configure re-write rules that will apply from that level downwards.


Setup a Reverse Proxy rule using the Wizard.

Open the IIS Manager Console and click on the Default Web Site from the tree view on the left. Select the URL Rewrite Icon from the middle pane, and then double click it to load the URL Rewrite interface.


Chose the ‘Add Rule’ action from the right pane of the management console, and the select the ‘Reverse Proxy Rule’ from the ‘Inbound and Outbound Rules’ category.

Now we can proceed to fill in the routing information based on the diagram above in the Wizard window that is provided to us.


While still in the same configuration window, we also need to provide information to take care of the responses that will be emitted by the backend server and will transit the IIS server on their way back to the requesting browser. These responses may have absolute hyperlinks inside and other information which contains the hostname of the backend server. If these are sent to the browser as is, the end user will not be able to access the resources these links point to simply because the browser does not know where http://privateserver:8080/HomePage.aspx is located and how it can be reached. We need to convert these into the hostname of the reverse proxy server, and have them look like: https://www.mypublicserver.com/HomePage.aspx . For this reason, we will check the ‘Rewrite the domain names of the links in HTTP responses’ checkbox in the Outbound Rules section.


The basic setup for the reverse proxy is now complete, with IIS able to capture incoming traffic and forward it to the backend server, and inspect responses from the backend server and rewrite URL links inside the responses to match the host headers that IIS uses to publish the site.

Read on in part number 2 to see where the problems with this setup start.

By Paul Cociuba
http://linqto.me/about/pcociuba


原文出處:Setup IIS with URL Rewrite as a reverse proxy for real world apps. – Blog de l'équipe support IIS/Azure France — French IIS/Azure Support Team Blog
前一個主題 | 下一個主題 | 頁首 | | |



Powered by XOOPS 2.0 © 2001-2008 The XOOPS Project|