Build JSP Environment _jsp programming on Linux

Source: Internet
Author: User
Tags mkdir unpack wrapper
I've seen the introduction of JSP (Java Server Pages) in a Web site all the time long ago, saying how good it is and how strong it is, but just know that JSP is not wrong, but it has never been used. Listen to the UNIX configuration JSP environment Aleppo is complex, so never dared to touch.   Later, at Taiwan's Station, I found an article in Taiwan that had been written to configure the JSP environment under Linux, for example, to get the baby, and to try it on the horse.   It was a pity to aloe the picture. To find some of the largest BBS in the country, visit a few previous lifetime, find some fragmented configuration methods. These methods are mostly gnujsp0.9x/1.0 with apachejser-1.x.x to run the JSP, I have to do the same configuration, the end of the top is to let Apachejserv running the line.   has been unable to run the JSP. The last person decided to make a unique approach to the configuration, and all the packages were downloaded from the official web site. The following is the package software used in the pen configuration process: apache_1.3.12.tar.gz (download from www.apache.org) apachejserv-1.1.2.tar.gz (download from java.apache.org) Gnujsp-1.0.tar.gz (from the Education Web) jsdk-2.0.tar.gz (from the Education Web) jdk-1.2.2.tar.gz (for Linux version, Downloaded from freesoft.online.sh.cn and www.sun.com) for 8 of hours, the installation documents in gnujsp-1.0 and the complex HT several installation articles,   And with the simple installation configuration article downloaded from java.apache.org, the pen finally succeeded in successfully configuring the JSP environment and successfully adapted the bean's JSP program. The following is a detailed description of the principles, processes, considerations, and key points of installation and configuration. One, configuration requirements RedHat 5.x or 6.x (the pen in Turbolinux 4.02/6.0 bluepoint1.0/2.0 and other systems are translated, configured through) JSDK2.0 (in fact, the need for a more than 70 K Jsdk.jar) Gnujsp1.   0 (in fact, you need a jar file inside) jdk-1.x.x or jdk-1.2.x (both versions are able to translate and configure) ApacheJserv1.0 or 1.x.x translations required MAKE,GCC and other programs, translators and functions library, basic configuration principles To enable the JSP to correctly parse and run well, you needMake sure that ajp1.2 (Apachejserv protocol1.2) can communicate normally at local port 8007, that the servlet needs to be able to perform properly, and that the Jserv configuration file is properly configured so that gnujsp is correctly parsing the JSP file. This article uses the static (meditation) Translation method to translate apachejserv. The basic step is to ensure that Apachejserv is correctly translated and tested.   Then you are sure to configure the Apachejserv configuration file so that gnujsp can parse the JSP file. The following is an installation step diagram: Jdk-->jsdk-->apache (Basic configuration)-->apachejserv (configuration/translation)-->apache (Configuration/Translator/installation)-->gnujsp--> Edit Apachejserv Profile--> Test-->ok Four, detailed process 1, install JDK there is no installation, just need to copy JDK to a fixed catalogue on it. This pen uses the JDK-1.2.2 two-bit version.   For 1.1.x readers, if you choose a static way to the Apache and Apachejserv, the fault can be used in the DSO mode (recommended jdk-1.1.x version of the DSO mode is better). #tar XFZ jdk-1.2.2-linux-i386.tar.gz #mv jdk-1.2.2/www/jdk122 2, install JSDK and install JDK, only need to unpack and then handcuff to a fixed catalogue.   It's important to note that this is actually just a Jsdk.jar file for this package, so be sure to know the path to the file. #tar xfz jsdk-2.0.tar.gz #mv jsdk-2.0/www/jsdk #ls-L/www/jsdk/lib total 80-r--r--r--1 root root 76453 June 28 01 : Jsdk.jar 3, Apache basic configuration This is not really a configuration, it's just a step to generate some required. h files The first time you unpack.   Relative to the preset configuration.   #tar xfz apache_1.3.12.tar.gz #cd apache_1.3.12 #./configure #cd. This generates a head file such as Httpd.h. If you don't have these files,, the configuration of Apachejserv or Php3 will be wrong. 4, Apachejserv configuration and translation the instructions that need to be used are at least:--with-apache-src= (Specify the path of the Apache source code, used in static translation)--with-jdk-home= (specify JDK root)--   with-jsdk= (designated Jsdk.jar, note that the JSDK!!!) As for others, it is not necessary to write, but the advice is to specify such as installation of the record, JDK number (1 or 2). Where Java-platform is specified: That is, if the jdk-1.1.x is used is 1 (the default is 1, you can not write).   If it is jdk-1.2.x, the designation is 2. #tar xfz apachejserv-1.1.2.tar.gz #cd ApacheJserv-1.1.2 #./configure--with-apache-src=. /apache_1.3.12--prefix=/www/jserv \ >--with-jdk-home=/www/jdk122--with-java-platform=2 \ >--with-JSDK=/www/ Jsdk/lib/jsdk.jar--disable-debugging #make #make install #cd.   5, Apache configuration translation about Apache configuration Many of the documents are stated, this is not 贅. #cd apache_1.3.12 #./configure--prefix=/www/httpd--activate-module=src/modules/jserv/libjserv.a #make #make Install   6, gnujsp installation is actually just need a few jar files in the gnujsp-1.0. #tar xfz gnujsp-1.0.tar.gz #mkdir/www/gnujsp #cp gnujsp-1.0/lib/*.jar/www/gnujsp #mkdir/www/gnujsp/bean_jsp #ls-  l/www/gnujsp drwxr-xr-x root 4096 Sep 15:56 bean_jsp/ -rw-rw-r--1 root 125972 Sep 12:55 gnujsp10.jar-rw-rw-r--1 root root 153015 Sep 12:55 w-rw-r--1 root 37291 Sep 12:55 servlet-2.0-plus.jar-rw-r--r--1 root root 38826 Sep 12:55 Servlet-2.1.jar 7   , jserv configuration file Editing this is the key to whether the JSP is able to parse correctly, and is the focus of this article. The key point is to set up a Jserv file: jserv.conf jserv.properties zone.properties or a new properties file, edit the order is probably: Jserv.conf-->jserv   .properties-->zone.properties--> properties file. Now that you need to define a zone called GSP, then you can edit the contents of the following steps and methods: *jserv.conf before editing this file, please make the word "include/www/jserv/etc/jserv.conf" Add to Apache's httpd.conf file.   The document says that this can be put anywhere, but practices found that it's best to put it at the end of HTTPD.CONF!!!!! You can run this way: #echo "include/www/jserv/etc/jserv.conf" >>/www/httpd/conf/httpd.conf, and then edit jserv.conf with an example VI editor. If you want to record all of Jserv's actions, it's best to allow log to remove the following sentence: Apjservlogfile/www/jserv/logs/mod_jserv.log and then find "# Mount point for servlet zones "This line, this is the mount point of the definition servlet zones (like Linux installation point). Let's join this line: APJSERVMOUNT/GSP/GSP then find the Apjservaction keyword and add the following: ApJservaction. jsp/gsp/gnujsp this is a definition. The JSP file is parsed for gnujsp.   So the jserv.conf file is basically set. *jserv.properties here to set the Wrapper.classpath, find the Wrapper.classpath keyword, add the following line: wrapper.classpath=/www/jdk122/lib/ Tools.jar then find the "# Servlet Zones Parameters" line, modify Zones=root to: ZONES=ROOT,GSP (add GSP this zone) and then the following lines in Root.properties=/www   After/jserv/etc/zone.properties add the properties line of the definition GSP: gsp.properties=/www/jserv/etc/gsp.properties   Basically the jserv.properties is ready.   *gsp.properties to Zone.properties there is no need for a setup, because it defines a new ZONE--&GT;GSP, and it works with Gsp.properties. Find: # List of repositories this line, and then add the following lines: Repositories=/www/gnujsp/gnujsp10.jar repositories=/www/gnujsp/ Servlet-2.0-plus.jar repositories=/www/gnujsp/bean_jsp The third line of the bean's response is defined, and the catalogue can be defined.   But there must be real. Find the "# Servlet aliases" line and add a name line: Servlet.gnujsp.code=org.gjt.jsp.jspservlet servlet.gnujsp.initargs=checkclass=true, (Please be careful not to return to the car) <pagebase=/www/httpd/htdocs,scratchdir=/www/httpd/jsp,\ (please be careful not to return to the car) <debug=true,compiler= Builtin-javac-classpath%classpath%:%scratchdir%:/www/gnujsp/servlet-2.0-plus.jar:/www/gnujsp/gnujsp10.jar:/www/gnujsp/bean_jsp-d%scratchdir%-deprecation% Source% the second line starts at the end and it is the same, since the space question adds the line symbol.   Please be careful to use the same line of!!!!!!!, and note that the symbols can not be missing any one. Some of the parameters are explained: Pagebase means to allow parsing of the JSP file's starting catalogue. ScratchDir is a temporary record of the generated. Java and. class files. Please be aware that this catalogue must be written for nobody!!! So you have to use the Chown command to change the owner and group of this recording to nobody. The classpath is then defined as the path to the search, which includes the Bean's record, and no way to use the bean.   You can also add a few more types of records, but there must be a definition in the above document. At this point: The basic setup is complete. Then you can test it. 8. Test first, make sure you've rebooted Apache to get all the settings in effect. Then you can enter "Http://localhost/gsp/Hello" in the browser, if it appears: Example Apache jserv Servlet Congratulations, Apachejserv 1.1.2 is Workin   G! So it says that Servlets is normal. And then, is to create a test.jsp file:
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.