Win2000 Server IIS+TOMCAT5 Multi-site configuration

Source: Internet
Author: User
Tags filter comments iis socket version win32 zip root directory
iis|server| Site Configuration requirements: IIS (Win2000 Server with), Java 2 SDK 1.4.2 (or later), Tomcat WEB Server connector, Tomcat 5.0.24 (or later)
  
   Ready to
  
   One, Java 2 SDK 1.4.2 (or later)
  
1, the www.java.sun.com/downloads/website downloads, the choice
2, Java 2 Platform, Standard Edition (J2SE)
3, in the Drop-down list box, select all platforms
4. J2SE v 1.4.2_04 SDK includes the JVM technology Select
5, Download j2se SDK
6, select Accept after download Windows Offline installation, multi-language (J2sdk-1_4_2_04-windows-i586-p.exe, 49.36 MB) version
  
   Two, Tomcat 5.0.24 (or later)
  
1, http://jakarta.apache.org/site/binindex.cgi download
2. Select Binaries in Downloads
3, in the Tomcat 5.0.25 KEYS select 5.0.25 exe PGP MD5 download
  
   three, Tomcat Web Server connectors
  
1, http://jakarta.apache.org/site/binindex.cgi download
2. Select Binaries in Downloads
3. Select in Tomcat Web Server connectors KEYS
4, JK 2
JK 2 Binary Releases
5, the occurrence of index of/dist/jakarta/tomcat-connectors/jk2/binaries
interface, select win32/and select Download
Jakarta-tomcat-connectors-jk2.0.4-win32-iis.zip
Note that the file name shown in this directory list is truncated, so you need to observe the prompts in the browser's status bar to confirm that the file you are downloading should end with \ "... iis.zip\".
  
   installation
  
   One, Java 2 SDK
  
Run J2sdk-1_4_2_04-windows-i586-p.exe follow the prompts to install (you can change the installation path to where you are accustomed). Choose here
D:\\JDK (the JDK creates a new folder for itself)
  
   Two, Tomcat 5
  
Run Jakarta-tomcat-5.0.24.exe Install as prompted (you can change to another path).
Here Select d:\\tomcat5.0 (tomcat5.0 a new folder for yourself)
Select the JDK path for the local machine, in general, the installation files will automatically search and display, if not displayed correctly, you can manually change
After a successful installation, the program prompts to start Tomcat and view the Readme document.
Note: Before starting Tomcat, make sure that no other services are already consuming 8080 ports (tomcat default port) and 8009 Port (tomcat\ ' s AJP13 connector port)
Tomcat loads icon in system tray after normal startup
Note: tomcat5.0 The following version must be set the initial password, tomcat5.0 above can not be set
  
   three, Tomcat JK2 IIS connectors
  
Decompression Jakarta-tomcat-connectors-jk2.0.4-win32-iis.zip Get bin conf doc three folders, enter \\bin\\ after visible isapi_redirector2.dll.
Cut/Copy isapi_redirector2.dll file to tomcat\ ' s bin\\ directory
Create a new directory win32\\i386\\ and paste Isapi_redirector2.dll.
Remember this path and use it later when you configure IIS. This path is not required by the system and can be changed!
Now you can delete the Jakarta-tomcat-connectors-jk2.0.4-win32-iis directory, this file is useless. In fact, in Jakarta-tomcat-connectors-jk2.0.4-win32-iis.zip, we only used a Isapi_redirector2.dll file.
  
   Set up
  
   One, Tomcat
  
Enter the tomcat\ ' s conf\\ folder.
To support the JK2 connector, you may need to modify the Jk2.properties file. In most cases, you can leave this file in the default state, and I have not modified this file in my multiple configuration procedures.
  
# # This FILE May is overriden at RUNTIME. Make sure TOMCAT is stoped
# # When you EDIT the FILE.
  
# # COMMENTS'll be _lost_
  
# # Documentation of the FORMAT in Jkmain Javadoc.
  
# Set the desired handler list
# Handler.list=apr,request,channeljni
# www.knowsky.com
# Override The default port for the Socketchannel
# channelsocket.port=8019
# Default:
# Channelunix.file=${jkhome}/work/jk2.socket
# Just to check if the ' config is working
# SHM.FILE=${JKHOME}/WORK/JK2.SHM
  
# into order ' Enable JNI use ' channeljni directive
# channeljni.disabled = 0
# and one of the following directives:
  
# apr.jnimodeso=/opt/apache2/modules/mod_jk2.so
  
# If set to inprocess the MOD_JK2 would Register natives itself
# This'll enable the starting of the Tomcat from MOD_JK2
# apr.jnimodeso=inprocess
Request.tomcatauthentication=false
  
   second, set the environment variable tomcat_home.
  
Point to Tomcat's installation directory under D:\\tomcat 5.0. Note that the system has available java_home environment variables
  
Create Workers2.properties to D:\\tomcat 5.0\\conf. Workers2.properties content files are as follows:
[SHM]
File=\ "D:/tomcat 5.0/logs/jk2.shm\"
size=1048576
  
# Example Socket channel, override port and host.
[channel.socket:localhost:8009]
port=8009
host=127.0.0.1
  
# define the worker
[ajp13:localhost:8009]
channel=channel.socket:localhost:8009
  
# Uri Mapping
[Uri:/*.jsp]
[uri:/servlet/*]
worker=ajp13:localhost:8009
  
   three, Tomcat IIS connectors
  
You have placed Isapi_redirector2.dll under your path, this example is
D:\\tomcat 5.0\\bin\\win32\\i386
Now you need to add some necessary registration information to the registry, which redirector read when invoked by IIS. Create a. reg file
  
Windows Registry Editor Version 5.00
[Hkey_local_machine\\software\\apache SOFTWARE Foundation\\jakarta Isapi redirector\\2.0]
\ "Workersfile\" =\ "D:\\\\tomcat 5.0\\\\conf\\\\workers2.properties\"
\ "Extensionuri\" =\ "/jakarta/isapi_redirector2.dll\"
\ "Loglevel\" =\ "debug\"
\ "Serverroot\" =\ "D:\\\\tomcat 5.0\\\\\"
Write the above text in Notepad and save it as Reg.reg
Double-click the. reg file and the contents in the registry will be added successfully
Visible in the Hkey_local_machine\\software\\apache SOFTWARE foundation\\jakarta Isapi redirector\\2.0.
  
   four, to Tomcat configuration virtual host multiple sites.
  
Create a new two folder D:\\tomcat1 and D:\\TOMCAT2. In two folders, create a separate root directory.
  
Notepad opens the D:\\tomcat5.0\\conf\\server.xml file. Found in file Server.xml
Label, and create a new message after the label:
  
Www.tomcat1.com\ "appbase=\" d:\\tomcat1\ ">
  
Www.tomcat2.com\ "appbase=\" d:\\tomcat2\ ">
  
The main is to create a new two virtual host www.tomcat1.com and www.tomcat2.com. The site Directory is D:\\TOMCAT1 and D:\\TOMCAT2 respectively. D:\\tomcat1\\root and D:\\tomcat2\\root. is the home directory of two sites, respectively. Log files and access log files are also established.
  
   v. Open the/servlet/* mapping for Tomcat.
  
Notepad opens the D:\\tomcat 5.0\\conf\\web.xml file.
Put
  
Invoker
  
Org.apache.catalina.servlets.InvokerServlet
  
  
Debug
0
  
2
  
And
  
Invoker
/servlet/*
  
The comments for these two pieces of code are removed to make it effective.
  
   Vi. establish two sites Tomcat1 and Tomcat2 in IIS.
  
Note that the host head is set to Www.tomcat1.com and www.tomcat2.com respectively. The home directory is set to D:\\tomcat1\\root and D:\\tomcat2\\root respectively. Two sites establish an ISAPI filter named Jakarta, respectively. The executable file points to D:\\tomcat 5.0\\conf\\connector\\isapi_redirector2.dll.
  
Two sites new virtual directory aliases are filled in: Jakarta, directory selection point to: D:\\tomcat 5.0\\bin\\win32\\i386 in \ "Execution (for example, ISAPI application or CGI) \" A tick, complete.
  
   IIA Filter
  
When selecting a filter, select the Jakarta executable as the D:\\tomcat 5.0\\bin\\win32\\i386
  
   the virtual directory required to build the filter
  
Select to load the Tomcat service point, right-click to select New, and then select Virtual directory. Create a virtual directory with an alias of Jakarta. Note that this name is a fixed value, do not spell wrong! Specifies that the directory is the Isapi_redirector2.dll directory. This example is D:\\tomcat 5.0\\bin\\win32\\i386.
  
   Restart Tomcat and IIS.
  
It is best to put a index.htm and a index.jsp file under the TOMCAT1 and Tomcat2 folders. Easy to test.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.