[Collection] JSP environment configuration

xiaoxiao2021-03-06  40

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 Four, test 1. Run IIS, start the JSP engine of Resin ( Run C: /RESIN1.1/bin/srun.exe) 2, put a JSP file (Test.jsp) into the c: / inetpub / wwwroot directory of IIS, Test.jsp is as follows: <% @ page language = java> 2 2 = <% = 2 2%> Browse http: // localhost: Port / Test.jsp. You will see: 2 2 = 4 This result Note: Port is the port number, the debug environment NT4.0 Iis resin1.1 2, Apache Tomcat Servlet JSP This only discusses how to install Apache on Windows NT 4.0 Servlet JSP.

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 = line . # wrapper.class_path = $ (wrapper.tomcat_home) / classes wrapper.class_path = $ (wrapper.tomcat_home) /lib/xml.jar wrapper.class_path = $ (wrapper.tomcat_home) /lib/webserver.jar wrapper.class_path = $ (wrapper.tomcat_home) /lib/servet.jar wrapper.class_path = $ (wrapper.tomcat_home) /lib/jasper.jar # # this is where javac is located in jdk1.2.x # wrapper.class_path = $ (Wrapper .java_home) /lib/tools.jar # # and a tribute to jdk1.1.x # wrapper.class_path = $ (wrapper.java_home) /lib/classes.zip # # this is the java interpre set for running tomcat # wrapper .javabin = $ (WRAPP er.java_home) /bin/java.exe # # This is Tomcat's startup class (the class that contains Tomcat's # starting point. # wrapper.startup_class = org.apache.tomcat.startup.Tomcat # # This is the location where tomcat's server .xml configuration file # is located. # wrapper.server_xml = $ (wrapper.tomcat_home) /conf/server.xml # # The NT service uses aJP12 to shutdown Tomcat. The wrapper.shutdown_port # tells the service the identity of the port that Is buy by ajp12. # wrapper.shutdown_port = 8007 # # this is the command line that used to start tomcat. You can * add * extra # parameters to it but you can not remove anything. # wrapper.cmd_line =

$ (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 The service name can be random, such as Tomcat or Jakarta, etc. The path of Wrapper.properties should be a full path (including the file name of Wrapper.properties) example: jk_nt_service -i jakarta d: /wrapper.properties This in the control panel -> service, we can see a service called Jakarta, You can start or abort it here. 4, JSWDK JSP 1, download JDK (Java 2 SDK, Standard Edition, V1.2.2) at http://java.sun.com/jdk/. 2, download JSWDK (JavaServer Web Development Kit 1.0.1) at http://java.sun.com/products/jsp/. Linux users can download Tomcat 3.0 at ttp: //jakarta.apache.org/. 3. Installing the Windows NT environment as an example, JDK installation is first running the downloaded JDK1_2_2_2-win.exe, then modify the system environment parameters, add [x:] / jdk1.2.2 / bin in the PATH parameter and add new Environmental parameter classpath = [x:] / jdk1.2.2 / lib / Tools.jar, where [x:] is a hard disk that installs JDK (C:, D:, etc.). JSWDK installation requires JSwDK1_0_1-win.zip with directory to the root directory (C: /, D: /, etc.), and then you can find /jswdk-1.0.1/ directory on your hard drive. If you don't want to keep JSWDK, you can delete this directory, no system files and registry legacy issues. More detailed installation process and the JDK under Solaris / Unix and Linux, the Tomcat installation can refer to the installation instructions in the obtained file package. 4. Starts the Windows NT environment as an example, execute StartServer.bat in /jswdk-1.0.1/ directory, you can start a web server that supports JSP web technology in JSWDK. In order not to conflict with existing web servers (such as IIS, PWS, etc.), JSWDK's web server uses an 8080 port. After typing http: // localhost: 8080 or http://127.0.0.1:8080, if you can see the JSWDK's welcome page, the JSP experiment environment has been built, and you can enter the next experiment. To turn off the web server, run StopServer.bat. The document directory of the web server included in the JSWDK is /jswdk-1.0.1/webpages in the default state, the main document is index.html and index.jsp.jsp.jsp in the default state. That is to say, HTTP: // localhost: 8080 is equal to access /jswdk-1.0.1/webpages/index.html.

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: IV. After the test is completed, Apache has supported JSP and servlet. Run Apache, launch the RESIN's JSP engine (running C: /RESIN1.1/bin/srun.exe). The JSP running directory is under the HTDOCS of Apache, while the servlet runs to "c: / apache / htdocs / web-inf / class". Put a JSP file (Test.jsp) into the HTDOCS directory of Apache, Test.jsp is as follows: <% @ Page Language = Java?> 2 2 = <% = 2 2%> Browse http: // localhost: Port / Test.jsp You will see: 2 2 = 4. Note: Debug Environment WIN98 APACHE_1_3_12 RESIN 1.1, Port is the web server port number. Original: rosetf

转载请注明原文地址:https://www.9cbs.com/read-85639.html

New Post(0)