Install apache+apachejserv+jsp_jsp programming on Linux

Source: Internet
Author: User
Tags microsoft iis
I.. copyright NOTICE
This document will be published under the GPL.

Second, the Software acquisition
As the saying goes, 工欲善其事, its prerequisite; The following are listed as related resources for the software mentioned in this article, and the Order of the software will be arranged 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/

Third, Software Installation
I. Install Apache Web Server

A. Using RPM

If you are using the RPM suite, after you have obtained the Apache Web Server Suite, just enter the following command to complete the installation:

[Root@localhost root]# Rpm-ivh apache-1.3.xx.i386.rpm (xx on behalf of Apache Web Server version)

B. Using SOURCE

If you are using the source of the Apache Web Server, you must compile the source and install it:

[Root@localhost root]# tar zxvf apache_1.3.xx.tar.gz (XX on behalf of 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=share_core

[Root@localhost apache_1.3.xx]# make clean; make; Make install

After completing the steps above, you have basically completed the installation of Apache Web Server.

II. Installation of JDK

You can get Sun's latest version of the JDK (Java Development kits) from the above location. Please follow these steps to complete the installation of the JDK:

[Root@localhost root]# tar zxvf jdk1_2_2rc2-linux-i386.tar.gz

[Root@localhost root]# MV jdk1.2.2/usr/local/jdk122

After you complete the above steps, you will also need to set up your 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

★ Please NOTE: If you are using JDK 1.1.x version, your CLASSPATH must be set as follows:

Classpath=/path/to/your/jdk/lib/classes.zip:.

Iii. installation of JSDK

★ Please NOTE: If you are using the Java Apache RPM version, skip this section.

You must first obtain and install JSDK (Java Servlet Development kits) in order to make Java Apache work. But in fact, all we need is a small part of the JSDK (a file called Jsdk.jar or Servlet.jar); 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

. Using RPM

If you are using the RPM suite, after you get the Java Apache suite, just enter the following command to complete the installation:

[Root@localhost root]# RPM-IVH apachejserv-1.1-b2.i386.rpm

A. Using SOURCE

If you are using Java Apache source, you must compile the source and install it:

[Root@localhost root]# tar zxvf apachejserv-1.1.tar.gz

[Root@localhost root]# CD ApacheJserv-1.1

[Root@localhost apachejserv-1.1]#./congifure

>--prefix=/usr/local/jsdk/(Set the directory you want to install)

>--with-apxs=/usr/local/apache/bin/apxs (the full path of the Apache APXS)

>--with-jdk-home= $JAVA _home

>--with-java-platform=2 (Set the JDK version you use; 1 for JDK 1.1.x;2 on behalf of JDK 1.2.x)

>--with-jsdk=/usr/local/jsdk/lib/jsdk.jar

[Root@localhost apachejserv-1.1]# make clean; make; Make install

★ Please NOTE: Please read the "Java Apach Test" section first.

V. Installing the GNU JSP

After completing the cumbersome installation steps above, we will continue with the GNU JSP installation. But before I introduce how to install the GNU JSP, I would like to briefly introduce what is JSP and the main function of JSP.

The JSP (Java Server page) was originally a file format on Java server, somewhat similar to the ASP (Active Server page) on MicroSoft IIS Server, with the main feature for dynamic network The page is written ("Dynamic Web page" is not meant to be DHTML) and is connected to the backend database through JDBC and gets, modifies, and edits the data. Of course, the JSP is not only the work of this, it can also be used for example, such as Socket connection functions.

Basically, we can treat JSP files as one of the Java Servlet programs. How do you say that? The JSP file is translated into a Java Servlet program by the JSP translation when it is first read, and the program is compiled and executed. And by the content of the JSP file, the code part of the JSP file, the syntax is not different from the Java servlet (in fact, this part of the translation will be copied to the new Java Servlet Program code). So we are convinced that understanding the writing techniques of the Java Servlet is helpful for writing JSP files.

Next, we will continue with the GNU JSP installation. Before this, please make sure you have obtained the GNU JSP file.

After you obtain the 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 completing the above instructions, we also need to set up a few files:

1./etc/httpd/conf/jserv/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/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%classpath%:%repository%

-D%repository%-deprecation%source%

...

...

3./etc/httpd/conf/jserv/jserv.conf
Related Article

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

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.