Introduction to the setup of JSP virtual host environment on Windows platform (1)

Source: Internet
Author: User

Install the software required by the jsp vm:

1. Operating System: Window2003 Chinese Version

2. Web server: IIS6.0

3, JAVA processing platform: JAVA 2 SDK-SE v1.4.2 _ 06

4. jsp/Servlets operating platform: Resin 2.1.16, because it is said that Resin is 10 times more efficient than Tomcat.

1. install JAVA 2 SDK

Since JAVA development is not performed here, you can install a standard environment. You can download it from java.sun.com.My Installation File Name is: j2sdk-1_4_2_06-windows-i586-p.exe


Then select the installation path. Here I install it in the C: \ jdk directory.
This step is important to set environment variables:
JAVA_HOME = C: \ JDK
CLASSPATH = C: \ JDK \ LIB \ tools. jar; C: \ JDK \ LIB \ dt. jar


Add C: \ JDK; C: \ JDK \ bin to the Path

Ii. Install the jsp/Servlets operating platform, Resin
The file name I used: resin-2.1.17.zip, decompress to the C: \ resin directory
Remember to set the environment variable of Resin immediately. Otherwise, the system will fail to find the resin.
RESIN_HOME = C: \ resin

Next, run C: \ resin \ bin \ httpd.exe.

Click httpd.exe and wait. Two windows will appear.
Note that you must use a small window to start the Resin Web server and close the server. Do not directly close the large window that follows.

In this case, the output of the Resin service terminal shows that http listening to *: 8080
It indicates that the web service provided by Resin is already running on port 8080 of the local machine.
Use IE to test the effect:


By now, the Resin server has been set up. If you only test the jsp or the server runs such a website, it is enough..
3. Mount Resin to IIS
Set up IIS6 and mount Resin to IIS for centralized management
Here, I use D: \ jsp_site as the main directory of the jsp website.
Create a test. jsp file for testing in the directory.
Enter the following content:
<% Out. println ("Hello, world! _ Www.ritto.cn "); %>

 
Create the C: \ jsp \ dllrun directory on drive C
Copy isapi_srun.dll under the C: \ resin \ libexec directory to the C: \ jsp \ dllrun directory.
The reason why we need to copy the dll is that jsp Parsing is performed through the third-party isapi interface provided by Resin.
When the client submits a URL, as long as it finds it is. jsp, IIS will throw. jsp to iis_srun.dll for execution.

 
Continue:
Start IIS6.0. First, add a Web service extension that allows the. jsp Suffix in the Web service extension.



This is an enhanced security function of IIS6.0 in Windows2003. You can allowWhich service extensions are allowed and which are prohibited on the server? select to allow JSP.
Next, open the site attribute, add a new filter in the ISAPI filter, and enter jsp,
Enter the executable file, that is, the "resin" mounted to the ISAPI filter used by IIS, and enter C: \ jsp \ dllrun \ isapi_srun.dll.

After confirmation, note that the attached dll does not take effect immediately and the priority is displayed as * unknown *

It doesn't matter,Continue
Next, modify the Resin configuration file.
It is recommended that you carefully study the reference of the configuration file under C: \ resin \ conf \ samples, especially to study iis. conf and virtual_host.conf.
Next, create a website with a host name to implement the jsp vm function.
In the DNS domain name control panel, direct www.jsp.com to the IP address of the local server to access the local jsp site..
Direct www.asp.com to the IP address of the server to access the asp site of the local server..
If both of them can be accessed, it indicates that our goal has been achieved.
Next, modify the configuration file resin. conf in the c: \ resin \ conf directory.
This is very important, but the most important thing is two places.
Set Doc Comment out
Run the service on port 8080 of Resin. Comment out

Take a closer look This part in the middle is the key to creating a virtual host. You need to modify this part every time you add a virtual host. Each site is enclosed by <> .  


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.