The erection of JSP virtual Host environment on Windows platform--windows2003+iis6+j2sdk1.4.2+resin2.1.16

Source: Internet
Author: User
Tags filter continue copy iis ini join version access
iis|js|window|windows2003| Virtual Host

The erection of JSP virtual host environment on platform--windows2003+iis6+j2sdk1.4.2+resin2.1.16
. Abu. At Patching.net

Posted on: November 03, 2005

Recorded in: January 04, 2005

Today, my birthday, my memory is not very good, write an article, save accidentally forget.

I usually work on windows, this time to set up a JSP virtual host to run the environment, view the online

The information I can find is basically useless because I need to be able to enable IIS to support both. ASP also supports. jsp and can do virtual host.

Separate from each other and run on port 80. Anyway, search out a bunch, for reference, do it yourself.

One to find, this need a lot of things, do not be afraid of trouble, first ready:

1, operating system, I work in the environment is Window2003 Chinese version.

2, the Web server, I am using the system from the IIS6.

3, Java processing platform, here with the Java 2 sdk,se v1.4.2_06 version.

4, jsp/servlets running platform, I chose the resin 2.1.16 version, because resin is said to be more efficient than Tomcat 10 times times higher, and about

Resin version should be noted that I heard that resin 2.x is a free version, and 3.x is the billing version, so choose Resin 2.1.16 version. Oh.

There's nothing to start with.

 

First, install Java 2 SDK

Do not do Java development, install a standard environment on it, to java.sun.com, the right side of the page has a quick navigation, directly to download the good, there are Chinese version.

My installation file name is: J2sdk-1_4_2_06-windows-i586-p.exe, do not provide a URL, you find.

To run the installation, the interface appears:

Then choose the installation path, all installed, their own operation, very simple.

I put it in the C:\JDK catalogue.

The next step is to set the environment variable, which is important, and don't forget:

Java_home = C:\JDK

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

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

 

Second, the installation of Jsp/servlets operating platform, Resin

Where to find it? Download well, to www.caucho.com, go up to find download, download the latest version of it.

I used the filename: Resin-2.1.16.zip, extract to C:\resin directory

Remember to do the following immediately, set the resin environment variables, I always forget here, the last system can not find resin where, of course, did not succeed.

Resin_home = C:\resin

Next we go on, run C:\resin\bin\httpd.exe

This time waiting, and then out of the 2 windows, carefully see clearly. Be aware that starting the resin Web server and shutting down the server

To use the small window to operate, do not directly to the back of the big window to be clicked off Oh.

 

At this point, the resin service can be seen on the terminal output, HTTP listening to *:8080

This indicates that the resin Web service is already running on the local port 8080.

Verify that:

Here, the resin server has been set up, if only to do their own test JSP or server run such a website

It's completely enough. Of course, always access to 8080 ports is not very convenient, you can manually modify it.

Open C:\resin\conf\resin.ini File:

Look for

Modify the site default directory there are 2 different methods, now the system is using the content of the C:\resin\doc

In the configuration file as long as the relative path doc can be written.

In the middle of <doc-dir>doc</doc-dir> doc this place.

Did you see that?

Yes, in addition

But 、、、 oh, who let me not satisfied yet.

 

Third, hook up the resin into IIS

I first put the IIS6 up, Win2003 the advantage is not to use things usually do not open, hehe, really good.

Follow the steps:

Set up C:\web\jspsite directory in C disk. This is the home directory of the JSP Web site.

Then create a test test.jsp file under the directory.

Enter the following content:

<HTML>
<HEAD>
<title>jsp Simple example</title>
</HEAD>
<BODY>
<% out.println ("Hello, world!"); %>
</BODY>
</HTML>

 

Next, set up the C:\web\dllrun directory in C disk.

Copy the Isapi_srun.dll in the C:\resin\libexec directory to the C:\web\dllrun directory.

As for why to copy the DLL, the reason is that JSP parsing is to be provided through the Resin Third-party ISAPI interface.

Usually when the client submits the URL, as long as the discovery is. Jsp,iis will throw the. JSP to Iis_srun.dll to execute.

 

The back of this directory to be used again, continue to go down:

Start IIS6.0, first adding Web service extensions that allow. JSP suffixes within the Web service extensions.

The extension is filled in at random, I enter JSP here.

This is the WINDOWS2003 IIS6.0 Enhanced security feature that allows you to allow which service extensions are allowed on the server and which are prohibited.

Allow JSP.

In order to see more clearly, we set up a new site.

Open the Site properties, add a new filter inside the ISAPI filter, name randomly, enter a JSP here,

Then enter the executable file, which is the ISAPI filter used by resin to hook up IIS, and enter

C:\web\dllrun\isapi_srun.dll

After confirmation, be aware that the DLL just hooked up will not take effect immediately, and the priority will also show * unknown *

It doesn't matter, don't bother. Continue to go down.

Here we need to do is more important and complex things, that is, modify the resin configuration file.

Carefully study the reference of the configuration file under C:\resin\conf\samples,

Especially to study iis.conf and virtual_host.conf.

 

Here's what I plan to do, and I plan to build a website with a host name to simulate a real server

Environment, the situation of the virtual host.

So I plan to build a JSP site, abu.com point to my IP 127.0.0.1

and 127.0.0.1 Direct access is the default ASP Web site for IIS.

If both are accessible, then it shows that our purpose has been achieved.

 

In order to be able to access the local implementation of the abu.com can be resolved to 127.0.0.1 I modify this computer Hosts file

 

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

It's very important here, but in fact it's two places.

Comment out <doc-dir> comment out the service with the resin 8080 port running

Join

Run, the default is this directory.

And here's the following:

Look carefully at this part of the

Each site is surrounded by <>.

The configuration file is basically well matched.

Add a Resin.ini file below to the previously established Dllrun directory

Add content

Resinconfigserver localhost 6802
Cauchostatus Yes

It means that when you call Isapi_srun.dll, you read the related configuration.

 

Return to IIS and add the host header names.

Add an account to a virtual host user.

Join Guests Group

Then set permissions for the corresponding directory:

Add just the user's permission to the C:\web\jspsite directory and note that you need to give it to read and write.

To the C:\web\dllrun directory just the user Read permission:

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

Name is Jspapppool, and then give system permission to this pool application pool identity.

In fact, here can give a lower permission, the heart of friends can study their own.

Add JSP Web site to this pool to facilitate centralized management.

Add a virtual directory to the JSP's Web site, with the directory named scripts and the executable permissions given.

Finally, don't forget to give this website the right to run as a jsp_user user just now.

 

Reboot the resin and reboot IIS.

Check to see if resin is hooked up to IIS by looking at the ISAPI filter

If the status is a green arrow, it indicates that the system has been successfully hooked up.

Then browse abu.com access test.jsp files

and ASP Web sites can also run

 

Finish the work.



Related Article

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.