Create a JSP running and development environment in Linux

Source: Internet
Author: User
Article Title: Create a JSP running and development environment in Linux. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
   1. Install JDK 1.4.2
  
Although the latest versions of JSK and JRE are 1.5.0, the company's developers are still using 1.4.2.
  
There is nothing to say about the process of installing JRE and JDK. you can install it with an rpm package. Configure the environment variables after installation:
  
Vi/etc/profile
  
Add the following lines at the end of the configuration file:
  
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
  
Save the disk and exit. Run the following command:
  
Source/etc/profile
  
In this way, the environment variable you just wrote takes effect.
  
Check:
  
[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]
  
Then, write a small program to check whether:
  
[Root @ scientific bin] # cd/home/xinsoft/mydev/java/
[Root @ scientific java] # vi test. java
    
Save the disk and exit. Check the following:
    
We have configured JRE1.4.2 + JDK1.4.2.
  
   Ii. install Tomcat
  
Next we will install Tomcat.
  
First download the Tomcat version we need from the http://www.apache.org/, and then 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/
[Root @ 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
  
Add the following at the end of the configuration file:
  
CATALINA_HOME =/usr/local/jakarta-tomcat-5.0.29
  
Export CATALINA_HOME
  
Save the disk and exit, and then: source/etc/profile
  
Make the configured environment variables take effect immediately.
  
Start Tomcat:
    
Then visit Tomcat:
    
We have installed Tomcat.
  
   Iii. Integrate Apache and tomcat with Tomcat-connector
  
My Apache is built on Scientific Linux 4.0 and the version is 2.0.54.
   
First download the appropriate tomcat-connector ctor from the http://archive.apache.org/dist/jakarta/tomcat-connectors/jk2/ to your local device.
  
Copy mod_jk2.so to the modules directory of apache:
  
[Root @ scientific i386] # cp mod_jk2-2.0.43.so/usr/lib/httpd/modules/
  
Edit the httpd. conf file of Apache:
  
Vi/etc/httpd/conf/httpd. conf
    
Edit the Tomcat server. xml file
  
Vi/usr/local/jakarta-tomcat-5.0.29/conf/server. xml
  
Add this line, as shown in:
    
Tomcat 4.x and tomcat 5.x are slightly different in this region. For tomcat5.x, Comment out.
  
Edit jk2.properties of Tomcat
  
Vi/usr/local/jakarta-tomcat-5.0.29/conf/jk2.properties
  
You can leave it unchanged for the moment and set its parameters to the default values of the system;
  
Edit workers2.properties of apache
  
Vi/etc/httpd/conf/workers2.properties
  
Note that multiple mappings can be added for the last uri ing, but the added mappings must be accessible. For example, we add/xinsoft/* ing, you must ensure that the/usr/local/jakarta-tomcat-5.0.29/webapps/xinsoft/directory exists.
  

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.