Detailed steps for fully installing Tomcat 5.0 + Apache 2.0

Source: Internet
Author: User


Install JDK:
Download: j2sdk-1_4_1_02-linux-i586.bin
Install JDK on/usr/local/j2sdk1.4.1 _ 02
Establish a soft connection JDK under/usr/local
# Ln-S/usr/local/j2sdk1.4.1 _ 02/usr/local/JDK
[User @ host] # Cat/etc/profile. d/Java. Sh
# Set Java environment
Export java_home =/usr/local/JDK
Export Path = $ path: $ java_home/bin
Export classpath = $ java_home/lib
# Modifying shell file attributes:
# Chmod 755/etc/profile. d/Java. Sh
# Check whether it is correct
# Which Java
/Usr/local/JDK/bin/Java

install Apache:
# cd/usr/local/src/
# tar-xzvf httpd-2.0.47.tar.gz
# cd httpd-2.0.47
# configure Apache to support dynamic module loading
#. /configure
\ "-- with-layout = apache \"
\ "-- prefix =/usr/local/apache \"
\ "-- enable-Module = So \ "
\" -- enable-module = setenvif \ "
\" -- enable-module = rewrite \ "
\" -- with-MPM = prefork \ "
# Make
# make install
# modify HTTP. for more information about conf modification, see apache2.0 documentation
# or
startservers 10
minspareservers 25
maxspareservers 50
serverlimit 2000
maxclients 1500 # requests that can be processed by Apache simultaneously
maxrequestsperchild 10000

install PHP:
download: php-4.3.3.tar.gz
# cd/usr/local/src
# tar-xzvf
# PHP for Apache run in Apache modules mode
. /configure -- with-apxs2 =/usr/local/Apache/bin/apxs
# PHP run like shell run in a separate shell mode
. /configure -- prefix =/usr/local/php
# PHP for apache
. /configure
-- with-apxs2 =/usr/local/Apache/bin/apxs
-- enable-track-vars
-- enable-Debug
-- enable- URL-supported des
-- enable-sockets
-- With-config-file-Path =/usr/local/Apache/conf # PHP. directory of the INI file
# The following parameters are used to install the PHP + GD library
-- With-Gd =/usr/local
-- enable-Gd-native-TTF
-- With-TTF =/usr/local
-- With-JPEG-Dir =/usr/local
-- With-zlib-Dir =/usr/local
-- With-PNG-Dir =/usr/local
# Make
# make install
# ls-L/usr/local/Apache/modules /libphp4.so # installation successful
# modify Apache HTTP. conf
Add
loadmodule php4_module modules/libphp4.so
addtype application/X-httpd-PHP. php

Install Tomcat:
# Cd/usr/local
# Tar-xzvf jakarta-tomcat-4.1.24.tar.gz
# Ln-s jakarta-tomcat-4.1.24 Tomcat
# Test the normal installation of Tomcat:
#/Usr/local/tomcat/bin/startup. Sh
# The IE Tomcat page is displayed normally.

Install JK2:
# Cd/usr/local/src
# Tar-xzvf jakarta-tomcat-connectors-jk2-2.0.2-src.tar.gz
# Cd jakarta-tomcat-connectors-jk2-2.0.2-src
# Cd JK/native2
# Chmod 755 buildconf. Sh
#./Configure -- with-apxs2 =/usr/local/Apache/bin/apxs -- enable-eapi
# Make
# Make install
# Manually release mod_jk2.so if make install fails
# Cd/usr/local/src/jakarta-tomcat-connectors-jk2-2.0.2-src/JK/build/JK2/apache2
# Cp *. So/usr/local/Apache/modules/

Configure $ catlina/CONF/server. xml

DEBUG = \ "0 \"/>
DEBUG = \ "0 \"/>

Port = \ "8080 \" minprocessors = \ "5 \" maxprocessors = \ "75 \"
Enablelookups = \ "True \" redirectport = \ "8443 \"
Acceptcount = \ "100 \" DEBUG = \ "0 \" connectiontimeout = \ "-1 \"
Useurivalidationhack = \ "false \" disableuploadtimeout = \ "True \"/>
Port = \ "8009 \" minprocessors = \ "5 \" maxprocessors = \ "75 \"
Enablelookups = \ "True \" redirectport = \ "8443 \"
Acceptcount = \ "10 \" DEBUG = \ "0 \" connectiontimeout = \ "-1 \"
Useurivalidationhack = \ "false \"
Protocolhandlerclassname = \ "org. Apache. JK. server. jkcoyotehandler \"/>

Prefix = \ "catalina_log. \" suffix = \ ". txt \"
Timestamp = \ "True \"/>

Unpackwars = \ "True \" autodeploy = \ "True \">
Directory = \ "logs \" prefix = \ "localhost_log. \" suffix = \ ". txt \"
Timestamp = \ "True \"/>

# Editing
# Vi/usr/local/tomcat/CONF/jk2.properties
# List of needed handlers.
Handler. List = channelsocket, request
# Override the default port for the channelsocket
Channelsocket. Port = 8009

# Edit a file:
# Vi/usr/local/Apache/CONF/workers2.properties
# Only at beginnin. In production uncomment it out
[Logger. apache2]
Level = debug
[SHM]
File =/usr/local/Apache/logs/SHM. File
Size = 1048576
# Example socket channel, override port and host.
[Channel. Socket: localhost: 8009]
Port = 8009
Host = 127.0.0.1
# Define the worker
[Ajp13: localhost: 8009]
Channel = channel. Socket: localhost: 8009
# URI Mapping
[URI: 192.168.0.90/*. jsp]
Worker = ajp13: localhost: 8009
[URI: 211.167.83.165/*. jsp]
Worker = ajp13: localhost: 8009
# Edit HTTP. conf
# Modify
DocumentRoot \ "/usr/local/tomcat/webapps \"
# Add index. jsp
Directoryindex index.html. var index. jsp

Loadmodule jk2_module modules/mod_jk2.so

Order deny, allow
Deny from all
#
# Order deny, allow
# Deny from all
#

Order allow, deny

Servername
Serveralias WWW
Serveralias localhost
Serveralias 192.168.0.90
Serveralias 211.167.83.165
Serveradmin
DocumentRoot/usr/local/tomcat/webapps
Errorlog logs/home.net-errorlog
Customlog logs/home.net-access. Log common

Jkuriset worker ajp13: localhost: 8009

When configuring server. xml:
The order of Configuration Management ports and connection ports is reversed.
In Catalina. Out, we can observe that:
In this way, you don't have to wait when you connect to Apache.

Port = \ "8009 \" minprocessors = \ "5 \" maxprocessors = \ "75 \"
Enablelookups = \ "True \" redirectport = \ "8443 \"
Acceptcount = \ "10 \" DEBUG = \ "0 \" connectiontimeout = \ "0 \"
Useurivalidationhack = \ "false \"
Protocolhandlerclassname = \ "org. Apache. JK. server. jkcoyotehandler \"/>

Port = "8080 \" minprocessors = \ "5 \" maxprocessors = \ "75 \"
enablelookups = \ "True \" redirectport = \ "8443 \ "
acceptcount = \" 100 \ "DEBUG = \" 0 \ "connectiontimeout = \" 20000 \ "
useurivalidationhack = \" false \ "disableuploadtimeout = \" true \ "/>
# server. XML does not support Chinese comments
# modifications made to Java in the shared/classes directory cannot be immediately reflected to JSP. cannot take effect immediately.
the above installation is also suitable for the jakarta-tomcat-5.0.12 in the following configuration note
# When configuring the jakarta-tomcat-5.0.12, pay attention to the server.
not closed in XML.
BUG:
in Catalina. an error is returned.
In general, Tomcat 5.0 is better than 4. X has improved its performance. fast startup.

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.