I have seen the introduction of JSP (Java Server Pages) on overseas websites for a long time, saying how it works and how it grows, however, I only know that JSP is not enough, and I still have no chance to use it. I have heard that in UNIX, the configuration of JSP environment is always unknown, so I have never dared to touch it. Later, I found a copy of Zookeeper's website for configuring the JSP environment in Linux. Article For example, if you want to handle the issue, you can immediately handle the issue and try again. Unfortunately, the sub-accounts fail. In this case, you can search for a large BBS in China and find some fragmented configuration methods. These methods are mostly gnujsp0.9x/1.0 with the ApacheJser-1.x.x to run JSP, I are one by one according to the configuration, the result is mostly let the apachejserv run it. JSP cannot be run all the time. Finally, the Creator decided to figure out how to configure the software. As a result, all sets of software were sent back from the official website. The following are the examples used by the creator in the configuration process: apache_1.3.12.tar.gz (from www.apache.org) ApacheJserv-1.1.2.tar.gz (from java.apache.org) gnujsp-1.0.tar.gz (from the Education Network) JSDK-2.0.tar.gz (from the education network) JDK-1.2.2.tar.gz (for Linux, from freesoft.online.sh.cn and www.sun.com) after eight hours, I thought about the security paper in the gnujsp-1.0 and the security paper in the joint head, in addition, the configuration document of the ticket security module added and removed from java.apache.org was written. The author finally successfully configured the JSP environment and successfully ran the bean JSP program. The following describes the Security and configuration principles, processes, precautions, and related points. I. Configuration Requirements: RedHat 5.x or 6.x (the configuration has been passed through during the upgrade in turbolinux 4.02/6.0 bluepoint1.0/2.0 and other systems) jsdk2.0 (in fact, a jsdk with over 70 KB is required. jar) gnujsp1.0 (in fact, it is the need to compile the JAR file only) JDK-1.x.x or JDK-1.2.x (two versions can improve the efficiency through the configuration and configuration) apachejserv1.0 or 1. x. make, GCC, and other programs required by X-producer plugin and function 2. The basic configuration principle should allow JSP to parse correctly and run well, ensure that ajp1.2 (apachejserv protocol1.2) can communicate normally on the local port 8007, And the servlet needs to be able to restore normal traffic, and properly configure the jserv configuration file so that gnujsp can correctly parse the JSP file. In this article, we use the static (always writable) always writable method to initialize apachejserv. 3. In the basic step, you must first ensure that apachejserv is correct and allow access. Then, the configuration file of apachejserv is correctly configured so that gnujsp can parse the JSP file. The following figure shows how to configure: JDK --> jsdk --> Apache (basic configuration) --> apachejserv (configuration/zookeeper) --> Apache (configuration/zookeeper/Security) --> gnujsp --> zookeeper apachejserv configuration file --> zookeeper --> OK 4. zookeeper process 1. What security issues does the JDK actually have, you only need to copy the JDK to a fixed category. This author uses the binary version of The JDK-1.2.2. For those who use 1.1.x, if static methods are selected to merge Apache and apachejserv, when a fault occurs, you can use the DSO mode (it is recommended that the DSO mode is better for the JDK-1.1.x version ). # Tar xfz JDK-1.2.2-linux-i386.tar.gz # mv JDK-1.2.2/www/jdk122, install jsdk and install JDK principle, just remove the package and copy it to a fixed category can be. However, you must know the path of this file because the jsdk. jar file of this package is used in this example. # Tar xfz jsdk-2.0.tar.gz # mv JSDK-2.0/www/jsdk # ls-L/www/jsdk/lib total 80-r -- 1 Root 76453 Jun 28 003 jsdk. jar 3. Apache basic configuration is not actually a real configuration, but it is necessary to generate some necessary configuration when the first package is unwrapped. only one step is required for the H file. It is equivalent to Lifecycle configuration. # Tar xfz apache_1.3.12.tar.gz # cd apache_1.3.12 #./configure # CD .. in this way, a header file such as httpd. H is generated. If these files are not available, apachejserv or php3 configuration will be rejected. 4. commands required for configuring and configuring apachejserv include: -- With-Apache-src =) -- With-JDK-home = (specify the JDK root category) -- With-jsdk = (specify jsdk. jar project. Note that the jsdk of the Large Volume !!!) It is not necessary to renew other products, but it is suggested that you still need to specify the products such as the security program and JDK parallel programming (1 or 2. Here, Java-platform is specified as follows: that is, if the jdk-1.1.x is used, it is 1 (the silence is 1, it can be skipped ). If it is a jdk-1.2.x, it is specified to be 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 depends on Apache configuration. Many articles have explained it. I will not discuss it here. # Cd apache_1.3.12 #. /configure -- prefix =/www/httpd -- activate-module = src/modules/Jserv/libjserv. A # Make # make install 6, gnujsp security, in fact, only need a jar file 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 10 Root 4096 Sep 15 bean_jsp/-RW- r -- 1 Root 125972 Sep 15 gnujsp10.jar-RW-r -- 1 Root 153015 Sep 15 gnujsp10test. jar-RW-r -- 1 Root 37291 Sep 15 servlet-2.0-plus.jar-RW-r -- 1 Root 38826 Sep 15 12: 55 servlet-2.1.jar 7, jserv configuration file such as whether jsp can correct the use of the relationship, is also the focus of this article. The key point is to set the relevant file of jserv: jserv. conf jserv. properties Zone. properties or create a new properties file. The sequence of zookeeper is probably jserv. conf --> jserv. properties --> zone. properties --> Custom properties file. If you need to define a zone named GSP as a false setting, you can follow the steps below to adjust the content: * jserv. conf before deleting this file, set "include/www/Jserv/etc/jserv. conf "added to httpd of Apache. CONF file. This sentence can be put anywhere in the text, but it has been found: it is better to put it at the end of httpd. conf !!!!! Run: # echo "include/www/Jserv/etc/jserv. conf ">/www/httpd/CONF/httpd. after the conf file is ready, use the VI compiler such as zookeeper jserv. conf. If you want to remember all the actions of the Commit (log) jserv, it is best to allow the log and remove the following sentence for attention: apjservlogfile/www/Jserv/logs/mod_jserv.log and find "# mount point for servlet zones, this parameter defines the mount point of servlet zones (similar to the Linux security point ). We will add the following lines: ApJServMount/GSP, find the apjservaction keyword, and add the following lines: apjservaction. JSP/GSP/gnujsp is fixed. the JSP file is parsed to gnujsp. In this case, the jserv. conf file is basically set. * Jserv. properties, you need to set wrapper. classpath, find wrapper. classpath: wrapper. classpath =/www/jdk122/lib/tools. jar then find the line "# servlet zones Parameters", change zones = root to zones = root, GSP (add GSP this zone), and then the following lines are stored in root. properties =/www/Jserv/etc/zone. after properties, add the properties line for defining GSP: GSP. properties =/www/Jserv/etc/GSP. properties is basically jserv. properties is set. * You do not need to set GSP. properties to zone. properties, because a new zone --> GSP is defined for this region, which works with GSP. properties. Find the line # list of repositories, and then add the following rows: repositories =/www/gnujsp/gnujsp10.jar repositories =/www/gnujsp/servlet-2.0-plus.jar repositories =/www/gnujsp/bean_jsp where the third row defines the bean response, this category can be customized. But it must actually exist. Find "# servlet aliases" and add another line: servlet. gnujsp. code = org. gjt. JSP. jspservlet. gnujsp. initargs = checkclass = true, \ (please be careful not to drive your car back) <pagebase =/www/httpd/htdocs, scratchdir =/www/httpd/JSP, \ (please note not to renew your car) <DEBUG = true, compiler = builtin-javac-classpath %: % scratchdir %:/www/gnujsp/servlet-2.0-plus.jar: /www/gnujsp/gnujsp10.jar:/www/gnujsp/bean_jsp-D % scratchdir %-deprecation % source % Where the beginning and end of the second line are actually In the same way, the Delimiter is added to the length question. Please be sure to pay attention to the use of the same line as the volume !!!!!!!, And note that the delimiter cannot be missing. Some of the preceding parameters are described as follows: pagebase allows parsing the initial contents of a JSP file. Scratchdir is the metadata of the generated. Java and. class files. Please note that this object must be writable to the nobody !!! Therefore, you must use the CHOWN command to change the owner and group of this object to nobody. Then, classpath defines the path of the search, including the bean category. Otherwise, bean cannot be used. In addition, you can add multiple similar categories, but you must define them in the above files. So far: the Basic settings are complete. Next, we can continue to improve the performance. 8. First, make sure that you have restarted Apache to make all the settings take effect. Then, you can add "http: // localhost/GSP/Hello" to the zookeeper. If the following error occurs: Example Apache JServ servlet congratulations, apachejserv 1.1.2 is working! The servlets operation is normal. Then, a test is created on the slave node. JSP file: <HTML> <body>
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.