RedHat6.2 server configuration solution (ix): Apache & Tomcat

Source: Internet
Author: User
Tags uncompress
Article Title: RedHat6.2 server configuration solution (9): Apache & Tomcat. 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.
Author: Tang haijing
  
Chapter 9 integration of Apache and Tomcat in Linux
9.1 required RPM package:
Jdk1_2_2_006-linux-i386.tar.gz
  
Jakarta-tomcat.tar.gz,
  
Mod_jserv.so
  
9.2 software installation:
9.2.1 install jdk1.2.2
  
(1) uncompress the package
  
Tar xvzf jdk1_2_2_006-linux-i386.tar.gz
  
(2) Directory Processing
  
Ln-s jdk1.2.2 jdk
  
Ln-s jdk/jre
  
(3) set $ JAVA_HOME, $ CLASSPATH
  
Vi/root/. bash_profile
  
Join:
  
JAVA_HOME =/usr/local/jdk
  
Export JAVA_HOME
  
CLASSPATH =/usr/local/jdk/lib:/usr/local/jre/lib
  
Export CLASSPATH
  
PATH = $ PATH:/usr/local/jdk/bin:/usr/local/jre/bin
  
Note: JDK installation ends here.
  
9.2.2 install tomcat
  
(1) uncompress the package
  
Tar xvzf jakarta-tomcat.tar.gz
  
(2) run the tomcat server
  
Cd/usr/local/jakarta-tomcat/bin
  
./Startup. sh start (end tomcat server with./shutdown. sh stop)
  
Lynx http: // localhost: 8080/
  
After seeing jsp/servlet and running its example program, your tomcat server is successfully installed.
  
9.2.3 connect to apache
  
(1) Introduction:
  
Tomcat itself is actually a web server. We can connect it to other web servers such as apache. These two servers can be different from the same machine. The following operations are performed on the same machine.
  
(2) copy the. so file
  
Cp mod_jserv.so/usr/local/apache/libexec
  
(3) modify the Apache configuration file and add support for tomcat.
  
Cp/usr/local/jakarta-tomcat/conf/tomcat. conf/usr/local/apache/conf/tomcat. conf
  
Vi/usr/local/apache/conf/httpd. conf
  
Add Include/usr/local/apache/conf/tomcat. conf
  
9.2.4 Test
  
Restart your apache and then run the tomcat server
  
Lynx http: // localhost/examples/
  
If you see the jsp and servlet directories, your apche and tomcat have been connected successfully.
  
9.2.5 some instructions:
  
If your jsp/servlet cannot run or has errors, your CLASSPATH settings are generally incorrect. If your apache is compiled by yourself, open -- enable-module = so when compiling apache.
  
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.