Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to build JSP Virtual Host Environment on Windows platform

2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

Editor to share with you how to set up the JSP virtual host environment on the Windows platform, I believe most people do not know much about it, so share this article for your reference, I hope you will learn a lot after reading this article, let's go to know it!

Install the software required for the JSP virtual host:

1. Operating system: Window2003 Chinese version

2. Web server: IIS6.0

3. JAVA processing platform: JAVA 2 SDK-SE v1.4.2room06

4. Jsp/Servlets operating platform: Resin 2.1.16, because Resin is said to be 10 times more efficient than Tomcat.

First, install JAVA 2 SDK

Since there is no JAVA development here, you can install a standard environment and download it on java.sun.com. My installation file name is: j2sdk-1_4_2_06-windows-i586-p.exe

Then select the installation path, where I install it in the C:\ jdk directory

It is important to set the environment variable:

JAVA_HOME = C:\ JDK

CLASSPATH=C:\ JDK\ LIB\ tools.jar;C:\ JDK\ LIB\ dt.jar

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

Second, install jsp/Servlets operating platform, Resin

The file name I used: resin-2.1.17.zip, unzipped to C:\ resin directory

Remember to set the environment variable of Resin immediately, otherwise the system will not be able to find out where the resin is.

RESIN_HOME = C:\ resin

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

Click httpd.exe and wait, then 2 windows will appear.

It should be noted that to start the Resin Web server and shut down the server, use the small window to operate, do not directly close the back of the big window.

At this point, you can see http listening to *: 8080 on the terminal output of the Resin service.

It indicates that the web service that comes with Resin is already running on port 8080 of this machine.

Use IE to test the effect:

At this point, the Resin server has been set up, if you only do your own test jsp or the server runs such a website, then it is enough.

Third, connect Resin to IIS

Set up IIS6 and connect Resin to IIS for centralized management.

Here I use D:\ jsp_site as the home directory of the jsp website.

Then create a test test.jsp file in the directory

Enter the following:

Next, create a C:\ jsp\ dllrun directory on disk C.

Copy the isapi_srun.dll from C:\ resin\ libexec directory to C:\ jsp\ dllrun directory

As for why dll is copied over, the reason is that the parsing of jsp is done through the third-party isapi interface provided by Resin.

Usually when the client submits URL, as long as it is found to be .jsp, IIS will throw .jsp to iis_srun.dll for execution.

Continue:

To start IIS6.0, first add a Web service extension that allows the .jsp suffix to the Web service extension

This is the enhanced security feature of IIS6.0 in Windows2003. You can allow which service extensions are allowed and which are prohibited on the server. Choose to allow JSP here.

Next, open the site properties, add a new filter to the ISAPI filter, and type jsp

Then enter the executable file, that is, the ISAPI filter used to attach resin to IIS, and enter C:\ jsp\ dllrun\ isapi_srun.dll

After confirmation, it should be noted that the dll just attached will not take effect immediately, and the priority will also show * unknown *

It doesn't matter. Keep going.

The next step is to modify the configuration file of Resin

It is recommended that you carefully study the reference of the configuration files under C:\ resin\ conf\ samples, especially iis.conf and virtual_host.conf

Next, set up a website with hostname to realize the function of JSP virtual host

Point the www.jsp.com to the IP address of the server in the DNS domain name control panel to access the local jsp site.

Point the www.asp.com to the IP address of the server to access the local asp site.

If both of them can be accessed, it shows that our goal has been achieved.

Next, modify the configuration file resin.conf in the c:\ resin\ conf directory

This is very critical, but in fact, there are only two most important places.

Comment out the doc

Comment out the services running on port 8080 that come with Resin

Take a closer look at the middle part, which is the key to building a virtual host, which needs to be modified every time you add a virtual host, and each site is enclosed.

The configuration file is basically ready.

Let's add a resin.ini file to the previously established dllrun directory

Add content

ResinConfigServer localhost 6802

CauchoStatus yes

It means to read the relevant configuration when calling isapi_srun.dll

Go back to the IIS and add the host header name.

Add an account to the virtual host user.

And add this user to the Guests group

Then set permissions to the corresponding directory:

Add the permissions of the user just now to the D:\ jsp_site directory, and note that you need to give both read and write.

Give read permission to the previous user in the C:\ jsp\ dllrun directory:

Add a new pool in the middle of the application pool in IIS6.0

Name is jsp, and then give SYSTEM permission to the pool application pool identity.

In fact, lower authority can be given here, and interested friends can study it on their own.

Add JSP's website to this pool to facilitate centralized management.

Add a virtual directory named scripts to jsp's Web site and give executable permissions.

Don't forget to set the permission of this site to the jsp user just now.

Restart Resin, restart IIS.

The way to check if Resin is connected to IIS is to look at the ISAPI filter

If the status is a green arrow, it has been successfully attached by the system.

Then browse www.asp.com to access the test.asp file (the asp website can work properly)

Browse www.jsp.com (jsp website can also be run at the same time)

OK, JSP virtual host is complete.

These are all the contents of the article "how to set up the JSP virtual host environment on the Windows platform". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report