The establishment of JSP running and developing environment under Linux

Source: Internet
Author: User
Tags exit variables variable tomcat linux
JS First, install JDK 1.4.2
  


Although the recent version of 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 the 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, 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, check out:


    


can be seen that we have configured the jre1.4.2+jdk1.4.2.


  


Two, install Tomcat


  


below 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/


[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 variable:


  


Vi/etc/profile


  


in configuration file last add:


  


catalina_home=/usr/local/jakarta-tomcat-5.0.29


  


Export Catalina_home


  


disk exit, then: Source/etc/profile


  


the configured environment variable to take effect immediately.


  


Start Tomcat:


    


then visit Tomcat:


 


can be seen Tomcat we also installed.


  


Three, combine Apache with Tomcat
with Tomcat-connector

  


my Apache is scientific Linux 4.0, the version is 2.0.54





first download the appropriate tomcat-connector from http://archive.apache.org/dist/jakarta/tomcat-connectors/jk2/to local.


  


copy mod_jk2.so to the Apache modules directory:


  


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


  


Edit Apache httpd.conf file:


  


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 figure: Add this line: <context path= "docbase=" "debug=" 0 "/>


    


this place tomcat4.x slightly different from the Tomcat 5.x. The Tomcat5.x,<context path= "docbase=" debug= "0"/> can be commented out.


  


edit Tomcat's jk2.properties


  


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


  


can temporarily not change it, so that its parameters are the system defaults;


  


Edit Apache 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.