Install Apache + apachejserv + JSP on Linux

Source: Internet
Author: User
Tags microsoft iis

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; 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; 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 Java ServletProgram. 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. And from the JSP file content, the JSP file programCodeIn part, the syntax is not different from that of the Java Servlet (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/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/jserv. conf

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.