The establishment of JSP running and developing environment under Linux system

Source: Internet
Author: User
Tags exit end variables version tomcat linux
Js

First, install JDK 1.4.2

Although the recent version of the Jsk and JRE is 1.5.0, the company's developers are unified by 1.4.2.

The process of installing JRE and JDK is nothing to say, install with RPM package, fool will. Configure the environment variables after loading:

Vi/etc/profile

At the end of this configuration file, add a few lines:

Java_home=/usr/local/java/jdk1.4.2_08 classpath=.:/ Usr/local/java/jdk1.4.2_08/lib/dt.jar:    /usr/local/java/jdk1.4.2_08/lib/tools.jar PATH=/usr/local/java/ Jdk1.4.2_08/bin: $PATH export PATH java_home CLASSPATH
Then save and exit and execute:

Source/etc/profile

In this way, the environment variables that have just been written are in effect.

Test:

[Imga] [Root@scientific bin]# java-version java Version "1.4.2_08" Java (TM) 2 Runtime environment, Standard Edition (build 1.4 .2_08-b03) Java HotSpot (TM) Client VM (build 1.4.2_08-b03, Mixed mode) [Root@scientific Bin]#[/imga]
And then write a small program to test:

[Root@scientific bin]# cd/home/xinsoft/mydev/java/[root@scientific java]# VI Test.java

Save and check out:

We have already configured the jre1.4.2+jdk1.4.2.

second, the installation of Tomcat

Next we'll install Tomcat.

First download the Tomcat version we need from http://www.apache.org/and install it.

[Root@scientific v5.0.29]# cp jakarta-tomcat-5.0.29.tar.gz.tar/usr/local/[root@scientific v5.0.29]# cd/usr/local/[R Oot@scientific local]# chmod +x jakarta-tomcat-5.0.29.tar.gz.tar [root@scientific local]# tar ZXPF Jakarta-tomcat-5.0.29.tar.gz.tar

Next Configure the environment variables:

Vi/etc/profile
At the end of the configuration file, add:

catalina_home=/usr/local/jakarta-tomcat-5.0.29 Export Catalina_home
Save to exit, and then: Source/etc/profile to make the configured environment variable take effect immediately.

Start Tomcat:

Then visit Tomcat:

See, Tomcat, we're packed.

Iii. integrating Apache with Tomcat with Tomcat-connector

My Apache is scientific Linux 4.0, with a version of 2.0.54. First download the appropriate tomcat-connector from the http://archive.apache.org/dist/jakarta/tomcat-connectors/jk2/to the local.

Copy the mod_jk2.so to the Apache modules directory:

[Root@scientific i386]# CP mod_jk2-2.0.43.so/usr/lib/httpd/modules/

To edit Apache httpd.conf files:

Vi/etc/httpd/conf/httpd.conf

Edit Tomcat's Server.xml file:

Vi/usr/local/jakarta-tomcat-5.0.29/conf/server.xml
As shown in the following illustration: Add this line:

This place tomcat4.x and Tomcat 5.x slightly different. For tomcat5.x, you can comment out.

Edit Tomcat's jk2.properties:

Vi/usr/local/jakarta-tomcat-5.0.29/conf/jk2.properties

You can temporarily not change it, so that its parameters are the system defaults; edit Apache's workers2.properties:

Vi/etc/httpd/conf/workers2.properties

Note The final URI mapping, which allows you to add multiple mappings, but the added mappings must be accessible. For example, in the above figure we have added/xinsoft/* mapping, we must ensure that the/usr/local/jakarta-tomcat-5.0.29/webapps/xinsoft/directory exists.



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.