JSP Environment Configuration August 2001, Japan Station Original: Rosetf Sun's JSP in the Windows system, can be said to be the most samples in various technical languages, the easiest to compromise, and the following is almost covered All JSP simulation environments of Microsoft Platform, you can understand the details of information in conjunction with SUN and other technical websites. JSP provides a unique development environment for creating a highly dynamic web application, and JSP can accommodate 85% of the 85% of the servers including Apache Webserver, IIS4.0. Even if you are "a deep feelings", the author believes that the development of JSP is still necessary. 1, IIS RESIN JSP IIS Web is simple and affected by its management operation and supports ASP. Here you introduce how to use RESIN to make IIS support JSP and servlet. First, install the configuration IIS and RESIN1.1 respectively, make each of them can operate properly. The path of installation of IIS and RESIN 1.1 is as follows: C: / Apache and C: /RESIN1.1. Second, configure IIS 1. Copy IIS_SRun.dll to IIS Scripts Directory "C: / INETPUB / SCRIPTS" 2. Create a configuration file in the C: / INETPUB / SCRIPTS directory (resin.ini) for specifying the configuration file of Resin. . The resin.ini content is as follows: cauchoconfigfile c: /resin1.1/conf/Resin.conf 3. Configuring resin
The configuration in the article is as follows: Windows NT 4.0 JDK1_2_2-001-win.exe Apache_1_3_12_win32.exe apachemodulejserv.dll Tomcat.zip (3.0) 1. Software Download JDK: http://java.sun.com/products/jdk/1.2/ Apache Server: http://www.apache.org/dist/binaries/win32/apache_1_3_12_win32.exe apache jserv: http://jakarta.apache.org/builds/tomcat/release/v3.0/win32/apachemodulejserv.dll Tomcat: http://jakarta.apache.org/builds/tomcat/release/v3.0/tomcat.zip 2, software installation (1) JDK 1, double click on the JDK1_2_2-001-win.exe file for installation, use the default Configuration is installed, the default installation directory of JDK is C: /JDK1.2.2, the default installation directory of JRE C: / Program Files / JavaSoft / JRE / 1.2; 2, restart the computer; 3, update the following environment variables: The C: /JDK1.2.2/bin directory is added to the path; add C: /jdk1.2.2/lib/tools.jar; c: /jdk1.2.2/lib/dt.jar Add to ClassPath. Update: Control Panel -> System -> Environment -> System Variables; 4, Test Applet: 1) Open Command Window; 2) Switch to C: /JDK1.2.2/Demo /Applets/tictActoe Directory; 3) Run AppletViewer Example1 .htm; 4) Everything is normal; 5, Test Application: 1) Create a Test.java file in my D: / hzq / java directory, the content is as follows: public class test {public static void main (string arc []) {System.out.println ("JDK installation is successful, friend!");}}; 2) Open Command window; 3) Switch to D: / hzq / java directory; 4) Run Javac Test.java to compile; 5 ) Running the Java Test to run this program; 6) Everything is normal.
(2) Apache Server 1, double-click the apache_1_3_12_win32.exe file for installation, use the default configuration, the default installation directory is C: / Program Files / Apache Group / Apache, I use $ apache_root instead of installation destination; 2, Modify $ apache_root / conf / httpd.conf: 1) Port is set to the port number used by Apache Web Server, because IIS here is running, IIS uses an 80-port slogan, so I change it into Port 8080, afterwards Enter http: // localhost: 8080 on the browser to access the Apache Web Server server, enter http: // localhost / when you can access IIS, so that two web Server can be used, I use $ apache_port identity 2) DocumentRoot Setting the document root directory, when you enter http: // localhost: $ apache_port / when you enter the browser, the server will read the data from the document root directory, because my program is placed under D: / Hzq, So I set DocumentRoot to D: / Hzq; 3, Apache After installation, I have more Apache Web Server menu groups in the "Start-> Program" menu group, run the install apache as a service, such "Start - > Settings -> Control Panel -> Services, there is more services called Apache, you can use it to start or stop the Apache service; 4, open "Start -> Settings -> Control Panel -> Services", check Apache, press "Start" to start Apache service; 5, I entered http: // localhost: $ apache_port /, I saw all files under D: / Hzq, indicating that the Apache service has been installed successfully. . (Iii) Apache JServ 1, copy files to ApacheModuleJServ.dll $ APACHE_ROOT / modules directory; 2, modify $ APACHE_ROOT / conf / httpd.conf: adding LoadModule jserv_module modules / ApacheModuleJServ.dll in the file to start Apache JServ ; 3, restart the Apache service.
(4) Tomcat 1, use Winzip et al-compression software to extract Tomcat.zip into a directory, I decompressed it to C: /, which will automatically create tomcat subdirectory, so there is more directory in C. C: / tomcat, I use $ Tomcat ID; 2. Open $ apache_root / conf / httpd.conf file, in this file, add this sentence: include $ Tomcat / etc / tomcat.conf in INCLUDE C : / Tomcat/etc/tomcat.conf; 3, modify the port number running in Tomcat, note that Tomcat has a stand-alone HTTP server, it must use a port number that has not been used, I haven't occupied it, I have not occupied. I use $ TOMCAT_PORT ID to Tomcat: 1) Open $ Tomcat / Server.xml; 2) Modify ContextManager: 4, double-click Startup.bat under the $ TOMCAT directory to start Tomcat; 5, enter http on the browser: / / localhost: $ TOMCAT_PORT /, you can see Tomcat Version 3.0 this page indicates that the Tomcat installation is successful; 6. Enter http: // localhost: $ apache_port / examples / servlets /, you can see servlet examples with This page indicates that apache servlet is successful; 7. Enter http: // localhost: $ apache_port / example / jsp /, you can see that the JSP Samples is also successful. . Complete list: JDK: http://java.sun.com/products/jdk/1.2/ Apache Server: http://www.apache.org/dist/binaries/win32/apache_1_3_12_win32.exe apache jserv: http: / /jakarta.apache.org/builds/tomcat/release/v3.0/win32/apachemodulejserv.dll Tomcat: http://jakarta.apache.org/builds/tomcat/release/v3.0/tomcat.zip java (TM 2 SDK 1.2.2-001 Installation INSTRUCTIONS: http://java.sun.com/products/jdk/1.2/install-windows.html 3, IIS Tomcat JSP 1. Description configuration is as follows: Win2000 Server IIS 5.0 (Win2000 comes) Tomcat 3.1 Binary Release. I use Tomcat 3.1 is a compiled version, and there is no instructions for IIS and NT Service in this release, but there is a more detailed help file in TOCMCAT 3.2 Source. According to these help files, you can insert Tomcat as a plugin into IIS.
II. After starting Tomcat installation Tomcat (Slightly installed) Environment variables Tomcat_Home and Java_Home enable them to point to the root directory of Tomcat and JDK. In addition, it is the beginning of the insurance, you can add the path to the path in Path. Then turn on a DOS window to perform Startup.bat. After starting Tomcat, there will be a DOS window display boot condition. At this point, you can see some examples of Tomcat in this point. III. Configuration The next step is how to insert Tomcat into IIS so that the two work together. The following steps: 1, registration in the Windows Registry: Load the jakarta.reg file between Begin and End into the machine, my Tomcat is installed in c: // jakarta-tomcat, you can Environment Modify Jakarta.REG files. Jakarta.reg: --- begin --- Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE / SOFTWARE / Apache Software Foundation / Jakarta Isapi Redirector / 1.0] "extension_uri" = "/ jakarta / isapi_redirect.dll" "log_file" = "c: //jakarta-tomcat//logs//isapi.log "" log_level "=" debug "" worker_file "=" c: //jakarta-tomcat// -///workers.properties "" worker_mount_file "=" C: / /jakarta-tomcat//conf//uriworkermap.properties --- end - Note: The path needs to be changed to your Tomcat installation path. 2. Open IIS Manager, create a virtual directory Jakarta in the Default Web Site, let it point to the directory where ISAPI_Redirect.dll is located. (There may be no DLL in 3.1 bin, you can copy one from the 3.2 Bin / IIS / NT4 / i386 directory. This virtual directory should be set to "Execute". 3, using the IIS Manager, put the isapi_redirect. The DLL is set to "Default Web Site" ISAPI filter, the name can be destined. 4, restart IIS, confirm that the ISAPI filter just added in front of a green upward arrow and restart Tomcat (execute tomcat / bin / shutdown.bat) You can close Tomcat At this time, IIS should have processed * .jsp files. Due to Tomcat settings, the default root is Tomcat / WebApps / root, so you can place a JSP file in this directory (for example, index.jsp) , Then access http://localhost/index.jsp, look at the effect.
If you still can't make the IIS manager -> Default Web Site Properties -> Properties -> Configuration to add an "application map" in the IIS Manager -> Default Web Site Properties -> Properties -> Configuration, map the * .jsp file to isapi_redirect. DLL. 4. Services as NT as NT Service is relatively simple.
First copy JK_NT_SERVICE.EXE from 3.2, then save the following content, named wrapper.properties # # $ header: /Home/cvs/jakarta-tomcat/src/etc/wrapper.properties ,v 1.1 # 2000 / 05/03 11:54:49 Shachor EXP $ # $ revision: 1.1 $ # $ date: 2000/05/03 11:54:49 $ # # jk_service.properties - a Bootstrup file for the tomcat nt service. # # This file provides jk_nt_service with the needed information to # start tomcat at a different process. # # As a general note, the characters $ (and) are used internally to define # macros. Do not use them !!! # # Whenever you see A set of lines such as: # x = value # y = $ () / something # # The final value for y Will be value / something # Normaly All You Will Need To Modify Is The First Two Properties, IE # walapper .tomcat_home and wrapper.java_home. Most of the configuration # is derived from these two. # # # wrapper.tomcat_home should point to the location where you # installed tomcat. This is where you have your conf, webapps and lib # directories. # Wrapper.tomcat_home = d: / tomcat # # wrapper.jav A_Home Should Point To your java installation. Normally # you Should Have a bin and lib Director Beneath it. # wrapper.java_home = d: /jbuilder35/jdk1.2.2 # # ------ Advanced Mode ------ ------------------------------------------ # Make Sure That You Read The How -to Before Making Too Many Changes. # ------------------------------------------ ---------------------------- # # Defining where the service is going to put the standard # Output of tomcat. This is where system .out.println and # system.rr.println goes to. # wrapper.stdout = $ (wrapper.tomcat_home) /jvm.stdout wrapper.stderr =
$ (wrapper.tomcat_home) /jvm.stderr # # additions to the path. Put here directories where you store dlls for # native methods etc. # wrapper.ld_path = d: / wrapper.ld_path = C: / # # Defining the classpath . All the rows that belongs to the class_path # property are concatenated to create the classpath for Tomcat. # # If you have additional locations that you would like to add to the # claspath you should add a new wrapper.class_path =
$ (wrapper.javabin) -classpath $ (wrapper.class_path) $ (wrapp Er.Startup_class) -config $ (wrapper.server_xml) -home $ (wrapper.tomcat_home) After saving, simply modify Wrapper.Tomcat_Home and Wrapper .java_home enables them to point to the Tomcat root directory and JDK root directory. Then run the JK_NT_SERVICE -I
5, apache resin JSP If your website is built under Apache now I want to use JSP, what should I do? You can achieve it through some JSP engines that support apache (such as RESIN, Tomcat, Jser, etc.). Here is how to configure Apache Resin to support the Apache support JSP. 1. Install the configuration of Apache and RESIN separately to operate properly. The path of Apache and Resin are installed as follows: C: / Apache and C: /RESIN1.1. Second, configure Apache to configure Apache to load the RESIN's JSP engine. Increase the following command line to the C: /apache/conf/Http.conf configuration file. LoadModule Aucho_Module 3. Configure RSIN to modify the RSEIN configuration file (C: /RESIN/conf/Resin.conf), specify its working directory of JSP under Apache. Modify below: