Paste a Web Server (IIS, Apache) Article integrating Tomcat 4

Source: Internet
Author: User
Tags apache tomcat
Tomcat iis howto: how to mount Tomcat into IIS

1. My installation environment is w2k (Simplified Chinese server version), iis5
Tomcat 4.03
Http://jakarta.apache.org/builds/jakarta-tomcat-4.0/release/v4.0.3/bin/jakarta-tomcat-4.0.3.exe

Isapi_redirect.dll
Http://jakarta.apache.org/builds/jakarta-tomcat/release/v3.3/bin/win32/i386/
Put it in {tomcathome} \ bin \ IIS \ i386 \ isapi_redirect.dll

Or download the zip package containing the following configurations.
Http://members.ozemail.com.au /~ Lampante/howto/tomcat/iisnt/tc4ntiis.zip must not be mentioned or because there is a configuration file. Copy the configuration file to the specified directory.

2. Ensure that Tomcat can be correctly executed

3. Edit iis_redirect.reg

Mount the iis_redirect.reg file between begin and end to the machine, and install Tomcat in E: \ Tomcat 4.0. You can modify the iis_redirect.reg file according to your environment.
Iis_redirect.reg: The Directory of each row must be correct.
--- Begin ---
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE \ SOFTWARE \ Apache Software Foundation \ Jakarta ISAPI redirector \ 1.0]
"Extension_uri" = "/Jakarta/isapi_redirect.dll"
"LOG_FILE" = "E: \ Tomcat 4.0 \ logs \ ISAPI. log"
"Log_level" = "debug"
"Worker_file" = "E: \ Tomcat 4.0 \ conf \ workers. properties"
"Worker_mount_file" = "E: \ Tomcat 4.0 \ conf \ uriworkermap. properties"
--- End ---
Note: The path must be changed to the installation path of your tomcat.

4. Configure IIS

(1) Open the IIS manager and create a virtual directory Jakarta in "Default web site" to direct its path to the directory where isapi_redirect.dll is located. The virtual directory should be set to "executable ".
(2) Use the IIS manager to set isapi_redirect.dll to the ISAPI filter of "Default web site". The name can start.
(3) Restart IIS. Check that a green up arrow is marked before the added ISAPI filter and restart Tomcat (execute Tomcat \ bin \ shutdown. BAT can disable Tomcat) at this time, IIS should be able to process *. JSP file. In Tomcat settings, the default root is Tomcat \ webapps \, so you can place a JSP file (such as index. JSP), and then access http: // localhost/index. JSP. Check the effect.

If IIS cannot process JSP files according to the above method, you can try to add an "Application ing" in IIS Manager> default web site Properties> main directory> configuration ", set *. the JSP file is mapped to isapi_redirect.dll.

5. Set the Tomcat settings file

Edit worker. properties File

Modify the following environment Configuration:

Workers. tomcat_home = E: \ Tomcat 4.0
Workers. java_home = E: \ jdk1.3.1

Edit uriworkermap. properties File

Add any web sites that IIS needs to serve to Tomcat:

#
# Default worker to be used through our Mappings
#
Default. worker = ajp13

#
# Sites to be redirected to Tomcat
#
/Examples = $ (default. worker)
/Examples/* = $ (default. worker)

Edit server. xml file

Open the % atathome % \ conf \ Server. xml file

The default AJP Connector is not activated. Uncomment the following parts to activate it.

$ Tomcathome/CONF/server. xml: (74th rows in the original file ^_^)

<! --
<Connector classname = "org. Apache. AJP. tomcat4.ajp13connector"
Port = "8009" minprocessors = "5" maxprocessors = "75"
Acceptcount = "10" DEBUG = "0"/>
-->

At this point, it is best to restart the machine to access http: // localhost/Examples

Additional Tomcat IIS howto original address: Please note that this article is very detailed and can be done once
Http://jakarta.apache.org/cvsweb/index.cgi /~ Checkout ~ /Jakarta-Tomcat/etc/tomcat-iis-howto.html? Rev= 1.4 & Content-Type = text/html

And how to setup Tomcat 4.0.1 on Windows 2000 with IIS and NT Service:
Http://members.ozemail.com.au /~ Lampante/howto/tomcat/iisnt/

Apache + Tomcat

I. Required software:
1. jdk1.3, which is required by all Java programs
2. Apache Web Server 1.3 or above.
3. mod_jk, a plug-in developed by Jakarta to support tomcat, which is more powerful than apachejserv, because apachejserv can only be used on Apache but not other webservers, mod_jk can be used together with many servers. You can go
Bytes.
4. Jakarta Tomcat

Ii. Set Apache

Copy mod_jk.dll to $ {apache_home}/modules /.

Modify CONF/httpd. conf and add the following lines:

Loadmodule jk_module modules/mod_jk.dll
# Tomcat4.x
Jkworkersfile "E: \ Apache Tomcat 4.0 \ conf \ workers. properties"
# Tomcat3.x
# Include "{tomcat_home} \ conf \ mod_jk.conf-auto"
Jklogfile logs/mod_jk.log
Jkloglevel info
Jklogstampformat "[% A % B % d % H: % m: % S % Y]"
# Tomcat4.x
Jkmount/* ajp13
# Tomcat3.x
# Jkmount/* ajp12

The configuration above contains different tomcat3.x and tomcat4.x. Brief Description: jkworkersfile specifies the work file required for mod_jk. After jkmount, all requests are sent to Tomcat through the apj12 protocol, let Tomcat handle it.

3. Run Tomcat and Apache first. Try your JSP and servlet!

Accelerate Apache

You know, if your web server uses Apache, you will have the opportunity to install a software module to speed up Website access, up to 10 times! This is not just a boast. You can understand the principles. The module is mod_gzip. It compresses Apache pages by using the same compression algorithm as gzip. If possible, it can compress the pages into one of ten copies of the original size. If a 10 k page is uploaded to 1 K, this is 10 times faster. Of course, the general web page can only be 3-6 times. That's pretty good. Right. Even a large website like Google uses this technology. Are you not keeping up with me?

I will tell you how to install this kind of things in three steps: 1. Download, 2. modify configurations, 3. Test. Take windows as an example: Linux is also similar </P>

1. Download

Download apachemodulegzip. dll from http://www.remotecommunications.com/apache/mod_gzip

2. installation and configuration

Copy apachemodulegzip. DLL to $ {apachehome}/modules.

Modify httpd. conf and add the following lines:

Loadmodule gzip_module modules/apachemodulegzip. dll
Mod_gzip_on Yes
Mod_gzip_minimum_file_size 300
Mod_gzip_maximum_file_size 0
Mod_gzip_maximum_inmem_size 100000
Mod_gzip_keep_workfiles No
# Setting temporary folders
Mod_gzip_temp_dir c: \ Temp
Mod_gzip_item_include file \. html $
Mod_gzip_item_include file \. jsp $
Mod_gzip_item_include file \. php $
Mod_gzip_item_include file \. pl $
Mod_gzip_item_include mime ^ text /.*
Mod_gzip_item_include mime ^ application/X-httpd-PHP
Mod_gzip_item_include mime ^ httpd/Unix-directory $
Mod_gzip_item_include handler ^ Perl-script $
Mod_gzip_item_include handler ^ server-Status $
Mod_gzip_item_include handler ^ server-Info $
Mod_gzip_item_exclude file \. CSS $
Mod_gzip_item_exclude file \. js $
Mod_gzip_item_exclude mime ^ image /.*

3. Modify and Test

Before the announcement, we should test the habit of being a good programmer. To minimize the impact on user browsing, we can use the new Apache driver on port 8080 or use commands to control the directory where mod_gzip works, instead of using mod_gzip all at once.
The usage is as follows:

Mod_gzip Configuration

You can use ie4 or Netscape to perform a comprehensive test. If there is no problem, you can make your users happy to find that the 'xx website is so fast now. '

Mod_gzip is amazing. A large k HTML document can be uploaded to the user end as long as 12 K. The more you use this technology, the more high your users will be impressed with your website. However, there must be some loss. Because decompression is performed on the client, the effect has something to do with the user's browser. I tested that msie4, 5, 5.5, Netscape 4.5, and 6 run well. However, Java, JPG, and GIF cannot be compressed.
Note that the configuration instructions are provided in several tomcat configuration files. </P>

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.