run JSP(TOMCAT) บน IIS Service
ในหลายกรณี ที่ต้องการใช้งาน TOMCAT ซึ่งได้เขียนโปรแกรมไว้ด้วย JSP แล้วต้องการให้ไป RUN บน IIS Service อีกที
จะด้วยความจำเป็นใดๆก็ตามแต่นะ... อันนี้คือวิธีการที่ผมได้ทดลองทำตาม web นี้ ซึ่งได้ผลดีมาก //neosmart.net/blog/2006/configuring-jsp-for-iis/ ถ้าอ่านภาษาอังกฤษคล่องก็ไปดูที่ต้นฉบับนะ ในนี้ผมจะสรุปวิธีที่ผมทำตาม
ทั้งหมดนี้ผมทดสอบบนเครื่อง window 2003/tomcat 5 1. ติดตั้ง IIS ตามปกติ 2. ติดตั้ง JDK 3. ติดตั้ง TOMCAT ให้เลือกแบบที่ install เป็น service มาใช้ (ผมติดตั้ง TOMCAT บน C:\TOMCAT) 4. downnload isapi_redirect*.dll (* หมายถึง version) จาก //www.apache.org/dist/tomcat/tomcat-connectors/jk/binaries/win32/ แล้วเอาไป copy ลงใน C:\TOMCAT\bin\isapi_redirect.dll (อย่าลืม rename มัน) 5. download(เขียนเองก็ได้) isapi_redirect.properties มาแก้เป็น ====================================
# Configuration file for the Jakarta ISAPI Redirector
# The path to the ISAPI Redirector Extension, relative to the website # This must be in a virtual directory with execute privileges extension_uri=/jakarta/isapi_redirect.dll
# Full path to the log file for the ISAPI Redirector log_file=C:\TOMCAT\bin\isapi_redirect.log
# Log level (debug, info, warn, error or trace) log_level=info
# Full path to the workers.properties file worker_file=C:\TOMCAT\conf\workers.properties
# Full path to the uriworkermap.properties file worker_mount_file=C:\TOMCAT\conf\uriworkermap.properties
========================================= ให้ copy file นี้ไปที่ C:\TOMCAT\bin
6.download หรือ เขียน workers.properties ======================================
workers.tomcat_home=C:\TOMCAT\
# workers.java_home should point to your Java installation. Normally # you should have a bin and lib directories beneath it. # workers.java_home=C:\Program Files\Java\jdk1.5.0_09\
# You should configure your environment slash... ps=\ on NT and / on UNIX # and maybe something different elsewhere. # ps=\
# The workers that your plugins should create and work with # worker.list=neosmart
#------ 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.neosmart.port=8009 worker.neosmart.host=localhost worker.neosmart.type=ajp13
====================================== แล้ว copy file นี้ไปที่ c:\tomcat\conf
7. dowload หรือ เขียน file uriworkermap.properties ====================================
/jsp-examples/*=neosmart
==================================== แล้ว copy file นี้ไปที่ c:\tomcat\conf
8. ที่ IIS MMC ให้กด right-click ที่ default website -> Properties -> ISAPI Filters ให้เพิ่ม filter isapi_redirect โดยให้ Browse ไปที่ C:\TOMCAT\bin\isapi_redirect.dll.
9. ที่ IIS MMC อีกที add virtual directory ไปให้ชื่อ jakarta แล้วกำหนด home ไปที่ c:\tomcat\bin
10. ที่ IIS MMC อีกที ที่เมนู Web Service Extensions -> [Add a new Web service extension..] ให้เพิ่ม [extension name]= JSP แล้วให้ executable file=C:\TOMCAT\bin\isapi_redirect.dll แล้ว check [set this extension to allowed] แล้วกด OK.
11. ที่ C:\TOMCAT\bin\isapi_redirect.dll กด right-click properties ที่ tab security ให้เพิ่ม user = iusr_COMPUTERNAME ให้สิทธิ read และ execute
12. restart iis service
เพียงแค่นี้ ก็จำสำเร็จได้ ทดสอบโดยเรียก //servername/jsp-examples
ในกรณีที่ยังไม่ได้ ให้ลองไปอ่านรายละเอียดที่ต้นฉบับ โดยเฉพาะให้ส่วนของ comment ต่างๆที่ถามตอบกัน
Create Date : 27 เมษายน 2551 |
Last Update : 27 เมษายน 2551 20:05:46 น. |
|
3 comments
|
Counter : 2353 Pageviews. |
|
|