Tomcat-connectors for configuring Apache2.2 + tomcat 6 virtual hosts in Linux

Source: Internet
Author: User
Target: configure apache2.2 and Tomcat 6 virtual hosts in Linux. In some cases, apache2.2 cannot forward requests to tomcat (for example, directly processing the display of static pages ), therefore, there is no way to differentiate between dynamic and static projects by using simple policies such as ajp proxy. In this

Target: configure apache2.2 and Tomcat 6 virtual hosts in Linux. In some cases, apache2.2 cannot forward requests to tomcat (for example, directly processing the display of static pages ), therefore, there is no way to differentiate between dynamic and static projects by using simple policies such as ajp proxy. In this regard, tomcat was prepared early and tomcat-connectors was launched for support.

Preliminary installation:

1. apache has been fully installed in the/usr/local/apache2.2 directory, and the web service port is 80. Apache it works is started! Prompt

 

2. tomcat6 has been installed in the/usr/local/tomcat6 directory. Port 8009 Development. the web service port is 8080. After startup, it is the deployment page of tomcat.

I have deployed two jsp projects MicTrader and MicSeller under tomcat6 webapps. Pass

Http: // ip: 8080/MicTrader and http: // ip: 8080/MicSeller can access

3. jdk has been installed and the above two services are available

4. for linux RedHat4, the related compilation package is OK.

Download:

1. connector package: Apache Tomcat Connectors (mod_jk) 1.2.30 for Linux i586

Command: wget http://www.apache.org/dist/tomcat/tomcat-connectors/jk/binaries/linux/jk-1.2.30/i586/mod_jk-1.2.30-httpd-2.2.X.so

Note:

2. the downloaded so File name: mod_jk-1.2.30-httpd-2.2.X.so
Copy and rename the file to:/usr/local/apache2.2/modules/mod_jk.so

Grant the system read and write permissions to the File: cd/usr/local/apache2.2/modules

Chmod 777 mod_jk.so

3. configure related files (back up one copy before the operation)

(1) configure httpd. conf. Note: add by kongqz internally. I added them all. It mainly loads the mod_jk.so module and configures the virtual host.
#
# This is the main Apache HTTP server configuration file. It contains
# Configuration directives that give the server its instructions.
# See For detailed information.
# In particle, see
# URL: http://httpd.apache.org/docs/2.2/mod/directives.html>
# For a discussion of each configuration directive.
#
# Do NOT simply read the instructions in here without understanding
# What they do. Theyre here only as hints or reminders. If you are unsure
# Consult the online docs. You have been warned.
#
# Configuration and logfile names: If the filenames you specify for example
# Of the servers control files begin with "/" (or "drive:/" for Win32),
# Server will use that explicit path. If the filenames do * not * begin
# With "/", the value of ServerRoot is prepended -- so "logs/foo_log"
# With ServerRoot set to "/usr/local/apache2.2" will be interpreted by
# Server as "/usr/local/apache2.2/logs/foo_log ".
#
# ServerRoot: The top of the directory tree under which the servers
# Configuration, error, and log files are kept.
#
# Do not add a slash at the end of the directory path. If you point
# ServerRoot at a non-local disk, be sure to point the LockFile directive
# At a local disk. If you want to share the same ServerRoot for multiple
# Httpd daemons, you will need to change at least LockFile and PidFile.
#
ServerRoot "/usr/local/apache2.2"
#
# Listen: Allows you to bind Apache to specific IP addresses and/or
# Ports, instead of the default. See also
# Directive.
#
# Change this to Listen on specific IP addresses as shown below
# Prevent Apache from glomming onto all bound IP addresses.
#
# Listen 12.34.56.78: 80
Listen 80
#
# Dynamic Shared Object (DSO) Support
#
# To be able to use the functionality of a module which was built as a DSO you
# Have to place corresponding 'loadmodule lines at this location so
# Directives contained in it are actually available _ before _ they are used.
# Statically compiled modules (those listed by 'httpd-l) do not need
# To be loaded here.
#
# Example:
# LoadModule foo_module modules/mod_foo.so
#
LoadModule authn_file_module modules/mod_authn_file.so
LoadModule authn_dbm_module modules/mod_authn_dbm.so
LoadModule authn_anon_module modules/mod_authn_anon.so
LoadModule authn_dbd_module modules/mod_authn_dbd.so
LoadModule authn_default_module modules/mod_authn_default.so
LoadModule authz_host_module modules/mod_authz_host.so
LoadModule authz_groupfile_module modules/mod_authz_groupfile.so
LoadModule authz_user_module modules/mod_authz_user.so
LoadModule authz_dbm_module modules/mod_authz_dbm.so
LoadModule authz_owner_module modules/mod_authz_owner.so
LoadModule authz_default_module modules/mod_authz_default.so
LoadModule auth_basic_module modules/mod_auth_basic.so
LoadModule auth_digest_module modules/mod_auth_digest.so
LoadModule dbd_module modules/mod_dbd.so
LoadModule dumpio_module modules/mod_dumpio.so
LoadModule reqtimeout_module modules/mod_reqtimeout.so
LoadModule ext_filter_module modules/mod_ext_filter.so
LoadModule include_module modules/mod_include.so
LoadModule filter_module modules/mod_filter.so
LoadModule substitute_module modules/mod_substitute.so
LoadModule deflate_module modules/mod_deflate.so
LoadModule log_config_module modules/mod_log_config.so
LoadModule log_forensic_module modules/mod_log_forensic.so
LoadModule logio_module modules/mod_logio.so
LoadModule env_module modules/mod_env.so
LoadModule mime_magic_module modules/mod_mime_magic.so
LoadModule cern_meta_module modules/mod_cern_meta.so
LoadModule expires_module modules/mod_expires.so
LoadModule headers_module modules/mod_headers.so
LoadModule ident_module modules/mod_ident.so
LoadModule usertrack_module modules/mod_usertrack.so
LoadModule unique_id_module modules/mod_unique_id.so
LoadModule setenvif_module modules/mod_setenvif.so
LoadModule version_module modules/mod_version.so
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_connect_module modules/mod_proxy_connect.so
LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
LoadModule proxy_http_module modules/mod_proxy_http.so
LoadModule proxy_scgi_module modules/mod_proxy_scgi.so
LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
LoadModule mime_module modules/mod_mime.so
LoadModule dav_module modules/mod_dav.so
LoadModule status_module modules/mod_status.so
LoadModule autoindex_module modules/mod_autoindex.so
LoadModule asis_module modules/mod_asis.so
LoadModule info_module modules/mod_info.so
LoadModule cgi_module modules/mod_cgi.so
LoadModule dav_fs_module modules/mod_dav_fs.so
LoadModule vhost_alias_module modules/mod_vhost_alias.so
LoadModule negotiation_module modules/mod_negotiation.so
LoadModule dir_module modules/mod_dir.so
LoadModule imagemap_module modules/mod_imagemap.so
LoadModule actions_module modules/mod_actions.so
LoadModule speling_module modules/mod_speling.so
LoadModule userdir_module modules/mod_userdir.so
LoadModule alias_module modules/mod_alias.so
LoadModule rewrite_module modules/mod_rewrite.so
# Add by kongqz 20101214
LoadModule jk_module modules/mod_jk.so
# AddModule mod_jk.c
Include/usr/local/apache2.2/conf/mod_jk.conf


#
# If you wish httpd to run as a different user or group, you must run
# Httpd as root initially and it will switch.
#
# User/Group: The name (or

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.