TOMCAT 5.0 + Apache 2.0 Complete Installation Steps Detailed _ server

Source: Internet
Author: User
Tags chmod install php

Install JDK:
Download: J2sdk-1_4_1_02-linux-i586.bin
Install JDK in/usr/local/j2sdk1.4.1_02
Setting up 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
#更改shell文件属性:
#chmod 755/etc/profile.d/java.sh
#查看是否正确
#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
#配置apache supports 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
#修改http. conf specific modifications Please refer to apache2.0 documentation
# or view
Startservers 10
Minspareservers 25
Maxspareservers 50
Serverlimit 2000
MaxClients 1500 #Apache可以同时处理的请求
Maxrequestsperchild 10000

Install PHP:
Download: php-4.3.3.tar.gz
#cd/USR/LOCAL/SRC
#tar-XZVF
#php for Apache running in Apache modules
./configure--with-apxs2=/usr/local/apache/bin/apxs
#php run like Shell runs in a separate shell
./configure--prefix=/usr/local/php
#php for Apache
./configure
--with-apxs2=/usr/local/apache/bin/apxs
--enable-track-vars
--enable-debug
--enable-url-includes
--enable-sockets
--with-config-file-path=/usr/local/apache/conf the directory #php. ini file
#下面的参数是安装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 #存在 installed successfully
#修改apache http.conf
Add to
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
#测试Tomcat正常安装:
#/usr/local/tomcat/bin/startup.sh
#通过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
#如果make install is not successful and needs to be published manually mod_jk2.so
#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\"/>



#编辑
#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

#编辑文件:
#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
#编辑http. conf
#修改
DocumentRoot \ "/usr/local/tomcat/webapps\"
#添加index. jsp
DirectoryIndex index.html 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


At the time of configuring Server.xml:
Configure management ports and port order of connections upside down
The catalina.out can be observed:
So when you connect with Apache, you don't have to wait.

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 annotations in Chinese
#对 shared/classes Directory of Java changes can not immediately respond to the JSP bid. No immediate effect.
The above installation is also suitable for jakarta-tomcat-5.0.12 in the following configuration note
When #在配置 jakarta-tomcat-5.0.12, pay attention to server.xml.
Not closed.
Bugs:
In the Catalina.out reported an error.
Overall, the performance of Tomcat 5.0 is better than that of 4.x. It starts faster.

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.