Integration of apache and tomcat-Linux Enterprise Application-Linux server application information. For details, refer to the following section. Author: Cyber Night Watch
First, let's talk about the environment and requirements.
The operating system is ubuntu6.06 server (8.04 LTS has been released, but we are not familiar with it yet. We still use 6.06). We have installed jdk and set environment variables, apache and tomcat are also running normally (apache is obtained from apt-get install)
Idea: a jsp website consists of many jsp pages and static pages. jsp, of course, is handled by tomcat,
Due to its own limitations, the processing speed of static pages will be slow, while apache itself will process static pages very quickly, so the idea is
The page is dumped to tomcat for processing, while the static page is left to apache for processing.
Configuration process
1. apt-get install libapache2-mod-jk (install apache jk module, which is a good place for ubuntu, convenient), and then enter the/etc/apache2/mod-enabled # directory, ls to check if jk exists. load. If yes, the module is successfully installed.
2. Edit the workers. properties file in the/etc/apache/# directory. The content is as follows:
Workers. tomcat_home = (your tomcat home directory)
Workers. apache_log = (set where to record logs)
Workers. java_home = (jdk directory)
Ps =/
Worker. list = worker1
3. Add the following content at the end of the apache main configuration file.
# Set workers. properties of mod_jk
JkWorkersFile/etc/apache2/workers. properties (workers. properties directory)
# Where to put jk logs
JkLogFile/var/log/apache2/mod_jk.log (jk log)
# Having the permissions to write the runtime status log
JkShmFile/var/log/apache2/jk-runtime-status
# Set the jk log level [debug/error/info]
JkLogLevel info
# Select the log format
JkLogStampFormat "[% a % B % d % H: % M: % S % Y]" (log generation format)
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