I. Copyright Notice
This file will be published in GPL mode.
2. software acquisition
As the saying goes, to do a good job, you must first sharpen the tool. The following lists the resources obtained by the software mentioned in this article, and arranges the software in the order of installation.
I. Apache Web Server
O http://www.apache.org/
O http://www.redhat.com/
O http://cle.linux.org.tw/
II. JDK
O http://java.sun.com/
III. JSDK
O http://java.sun.com/
IV. Java Apache
O http://java.apache.org/
V. GUN JSP
O http://www.gnu.org/
O http://java.apache.org/
Iii. Software Installation
I. install Apache Web Server
A. Use RPM
If you are using the RPM suite, after you obtain the Apache Web Server suite, you only need to enter the following command to complete the installation:
[Root @ localhost root] # rpm-ivh apache-1.3.xx.i386.rpm (xx stands for Apache Web Server Version)
B. Use SOURCE
If you are using the Source of Apache Web Server, you must compile and install the Source:
[Root @ localhost root] # tar zxvf apache_1.3.xx.tar.gz (xx indicates Apache Web Server Version)
[Root @ localhost root] # cd apache_1.3.xx
[Root @ localhost apache_1.3.xx] #./congifure
> -- Prefix =/usr/local/apache/(set the directory you want to install)
> -- Enable-module = all
> -- Enable-rule = cmd_core
[Root @ localhost apache_1.3.xx] # make clean; make install
After completing the above steps, you have basically completed the installation of Apache Web Server.
II. Install JDK
You can obtain the latest JDK (Java Development Kits) in Sun from the above position ). Follow these steps to complete JDK installation:
[Root @ localhost root] # tar zxvf jdk1_2_2rc2-linux-i386.tar.gz
[Root @ localhost root] # mv jdk1.2.2/usr/local/jdk122
After completing the preceding steps, you also need to set the environment:
[Root @ localhost root] # vi. bash_profile
...
...
JAVA_HOME =/usr/local/jdk122
PATH = $ PATH: $ JAVA_HOME/bin
CLASSPATH =/usr/local/jdk122/lib/tools. jar :.
Export JAVA_HOME
Export PATH CLASSPATH
★Note: If you are using JDK 1.1.x, your CLASSPATH must be set as follows:
CLASSPATH =/path/to/your/jdk/lib/classes.zip :.
III. Install JSDK
★Note: If you are using the Java Apache RPM version, skip this section.
You must first obtain and install JSDK (Java Servlet Development Kits) to make Java Apache operate. But in fact, what we need is only a small part of the JSDK. jar or servlet. jar files); now all you have to do is get the file and set it to your CLASSPATH:
CLASSPATH =/path/to/jsdk/lib/jsdk. jar: $ CLASSPATH
Export CLASSPATH
IV. install Java Apache
. Use RPM
If you are using the RPM kit, after you have obtained the Java Apache kit, you only need to enter the following command to complete the installation:
[Root @ localhost root] # rpm-ivh ApacheJServ-1.1-b2.i386.rpm
A. Use SOURCE
If you are using the Source of Java Apache, you must compile and install the Source:
[Root @ localhost root] # tar zxvf ApacheJServ-1.1.tar.gz
[Root @ localhost root] # ApacheJserv-1.1 cd
[Root @ localhost ApacheJserv-1.1] #./congifure
> -- Prefix =/usr/local/jsdk/(set the directory you want to install)
> -- With-apxs =/usr/local/apache/bin/apxs (full path of apache apxs)
> -- With-jdk-home = $ JAVA_HOME
> -- With-java-platform = 2 (set the JDK version you are using; 1 indicates JDK 1.1.x; 2 indicates JDK 1.2.x)
> -- With-JSDK =/usr/local/jsdk/lib/jsdk. jar
[Root @ localhost ApacheJserv-1.1] # make clean; make install
★Note: Read the [Java Apach test] section first.
V. install GNU JSP
After completing the complex installation steps above, we will continue to install gnu jsp. But before introducing how to install gnu jsp, I would like to briefly introduce what JSP is and the main functions of JSP.
JSP (Java Server Page) is originally a file format on Java Server. The content is a bit similar to ASP (Active Server Page) on MicroSoft IIS Server ), the main function is to write dynamic web pages ("dynamic web pages" here do not refer to DHTML), and to connect to the backend database through JDBC to obtain, modify, and edit information. Of course, JSP can not only work like this, but also perform functions such as Socket connection.
Basically, we can regard JSP files as a Java Servlet program. What should I do? This is because when the JSP file is read for the first time, it will be translated into a Java Servlet program by the JSP translator, and then compiled and executed. In addition, the syntax of the program code in the JSP file is different from that in the Java Servlet File (in fact, this part will be copied to the newly generated Java Servlet program code in an intact manner during translation ). Therefore, we are sure that learning about Java Servlet writing skills is helpful for writing JSP files.
Next, we will continue to install gnu jsp. Before that, make sure that you have obtained the gnu jsp file.
After obtaining gnu jsp, follow these steps to install it:
[Root @ localhost root] # tar zxvf gnujsp_0_9_10.tar.gz
[Root @ localhost root] # mv gnujsp-0.9.10/usr/local/gnujsp
[Root @ localhost root] # cd/home/httpd/servlets
[Root @ localhost servlets] # mkdir compiled
[Root @ localhost servlets] # chown nobody. nobody compiled
After the preceding commands are completed, we need to set several files:
1./etc/httpd/conf/jserv. properties
[Root @ localhost root] # cd/etc/httpd/conf/jserv
[Root @ localhost jserv] # vi jserv. properties
...
...
Wrapper. classpath =/usr/local/gnujsp/lib/gnujsp. jar
...
...
2./etc/httpd/conf/jserv/zone. properties
[Root @ localhost jserv] # vi zone. properties
...
...
Repositories =/home/httpd/servlet,/usr/local/gnujsp. jar
...
...
Servlet. gnujsp. code = org. gjt. jsp. JSPServlet
...
...
Servlet. gnujsp. initArgs = repository =/home/httpd/servlets/
Servlet. gnujsp. initArgs = compiler =/usr/local/jdk122/bin/java
-Classpath %: % repository %
-D % repository %-deprecation % source %
...
...
3./etc/httpd/conf/jserv. conf