Tomcat 5 Apache 2 JDK 1.4 PHP 4.34 JK2 Mysql 42004-06-09 Small Leather Print from: Ningbo Linux AC Network Address: http://linux.ournal/04
Tomcat 5 Apache 2 JDK 1.4 PHP 4.34 JK2 MYSQL 4
Original version transferred from: cu original address: http://www.chinaunix.net/jh/13/236685.html
This is a little experience under this time to accumulate accumulation. The test is absolutely passed. I use the server is Redhat Linux AS 3.0, the server does not have these software when installing, if you are previously installed, please first After removing it, I will don't have a problem in RedHat 9.0, 8.0, but I need to test it!
1, install JDK
1), upload the latest JDK from Sun, normal installation
./j2sdk-1_4_2_03-linux-i586.bin
RPM-IVH J2SDK-1_4_2_03-Linux-i586.rpm
2), in order to upgrade, it is best to build a soft connection, command: ln -s / usr / java / j2sdk-1_4_2_03 / usr / local / jdk
2, install Apache
1). Download the latest:
http://www.apache.org/dist/httpd/httpd-2.0.47.tar.gz
2). Unpack: TAR XVFZ httpd-2.0.47.tar.gz3). Installation: CD httpd-2.0.47 ./configure --prefix = / usr / local / apache --enable-so make make install4. Review httpd.conf: after adding vi /usr/local/apache/conf/httpd.conf DirectoryIndex index.php his party AddType application / x-httpd-php .php .phtml .php3 .inc his party LoadModule php4_module modules / libphp4 .so (If you want to install the latest PHP, it will be automatically added. If you don't install PHP, then don't add this, do you want to report an error? /etc/rc.d/rc.local plus a line / usr / local / apache / bin / apachectl start
3, install mysql
1), download the latest installation package, please install the RPM package, so the most convenient, easy to use, I am the two bags mysql-server-4.0.13-0.i386.rpm mysql-client-4.0 . 13-0.i386.rpm, please download it from MySql.com.
2), rpm -ivh mysql-server-4.0.13-0.i386.rpm
RPM-IVH mysql-client-4.0.13-0.i386.rpm
4, install PHP
1). Download the latest:
http://www.php.net/get/php-4.3.4.tar.gz/from/this/mirror
2). Unpack: TAR XVFZ PHP-4.3.4.tar.gz3). Installation: CD PHP-4.3.4 ./configure --with-mysql --with-apxs2 = / usr / local / apache / bin / APXS --ENABLE-TRACK-VARS --WITH-GD --WITH-ZLIB --WITH-XML Make Make Install CP php.ini-dist /usr/local/lib/php.ini5, install Tomcat 5
1) Download the latest Tomcat 5
http://www.apache.org/dist/jakarta/tomcat-5/v5.0.16/bin/jakarta-tomcat-5.0.16.tar.gz
2) Unpacking TAR XVFZ JAKARTA-TOMCAT-5.0.16.tar.gz
3), MV Jakarta-Tomcat-5.0.16 / usr / local /
ln -s /usr/local/jakarta-tomcat-5.0.16 / usr / local / Tomcat /
vi /usr/local/tomcat/bin/catalina.sh (Please pay attention to backup when you operate)
After opening CATALINA.SH, insert these lines after the third line:
Java_home = / usr / local / jdk / catalina_home = "/ usr / local / tomcat /" java_opts = "- xms256m -xmx256m" then stores exiting.
4), now you can use /usr/local/tomcat/bin/startup.sh/usr/local/tomcat/bin/shutdown.sh to start or stop Tomcat service.
5),
GroupAdd Tomcat UserAdd -g Tomcat-C "Tomcat User" -d / usr / local / tomcat tomcat passwd Tomcat
Chown -r Tomcat: Tomcat / usr / local / tomcat chown -r Tomcat: Tomcat /usr/local/jakarta-tomcat-5.0.16
6). When startup: vi /etc/rc.d/rc.local plus a line Su - Tomcat -c /usr/local/tomcat/bin/startup.sh
6, install JK2 (this is more important in Dongdong, see clearly, here is the most prone to problems)
1) Download the latest JK2
http://www.apache.org/dist/jakarta/tomcat-connectors/jk2/jakarta-tomcat-connectors-jk2-src-current.tar.gz
2), unpacking tar xvfz jakarta-tomcat-connectors-jk2-src-current.tar.gz
CD JAKARTA-TOMCAT-Connectors-JK2 / JK / NATIVE
./buildconf.sh
./configure --with-apxs2 = / usr / local / apache / bin / apxs
Make
Make Install
CP JK / Build / JK2 / Apache2 / Mod_jk2.so / usr / local / apache / modules
CP JK / Build / JK2 / Apache2 / Jkjni.so / USR / local / apache / modules
4) Add MOD_JK2 to httpd.conf vi /usr/local/apache/conf/httpd.confloadModule JK2_Module Modules / Mod_jk2.so
5), vi /usr/local/tomcat/conf/jk2.properties replace the relevant files of the original location to these
# List of neededed handlers. Handler.list = ChannelSocket, Request # Override the default port for the channel.PhannelSocket.port = 8009
6), vi /usr/local/apache/conf/Workers2.properties This is my configuration file, please refer to modification
# Only at beginnin. in production uncomment it out [Logger.Apache2] level = Debug
[SHM] file = / usr / local / apache / logs / shm.filesize = 1048576
# Example Socket Channel, Override Port and host. [Channel. Socket: localhost: 8009] Port = 8009Host = 127.0.0.1
# Define the worker [AJP13: localhost: 8009] channel = channel: localhost: 8009
# Uri mapping [URI: 128.100.1.49 / *. Jsp] worker = ajp13: localhost: 8009
[URI: www.lawcn.cn / *. jsp] worker = ajp13: localhost: 8009
[URI: www.friendlist.cn / *. jsp] worker = ajp13: localhost: 8009
[URI: www.cnho.com / *. JSP] Worker = ajp13: localhost: 8009 # Only at beginnin. in production uncomment it out [logger.apache2] level = debug
[SHM] file = / usr / local / apache / logs / shm.filesize = 1048576
# Example Socket Channel, Override Port and host. [Channel. Socket: localhost: 8009] Port = 8009Host = 127.0.0.1
# Define the worker [AJP13: localhost: 8009] channel = channel: localhost: 8009
# Uri mapping [URI: 128.100.1.49 / *. Jsp] worker = ajp13: localhost: 8009
[URI: www.lawcn.cn / *. jsp] worker = ajp13: localhost: 8009
[URI: www.friendlist.cn / *. jsp] worker = ajp13: localhost: 8009
[URI: www.cnho.com / *. jsp] worker = ajp13: localhost: 8009
7) http.conf virtual host configuration section
# ............
# 不 不 相关 部分 省 省
NamevirtualHost *
Support@cnho.com
Documentroot / WWW / EBUDDYLIST / WEB-4SX593 / ServerName
www.friendlist.cnServerAlias * .friendlist.cn friendlist.cn ebuddylist.com * .ebuddylist.com ErrorLog logs / www.friendlist.cn-error_log CustomLog logs / www.friendlist.cn-access_log common Options None VirtualHost>
Support@cnho.com
Documentroot / WWW / CNHO / HTML / ServerName
Www.cnho.com
Serveralias * .cnho.com cnho.com errorlog logs / www.cnho.com-error_log customlog logs / www.cnho.com-access_log Common Options None virtualhost>
Support@cnho.com
Documentroot / WWW / LAWCN / ASDF-WEB / ServerName
Www.lawcn.cn
Serveralias * .lawcn.cn lawcn.cn errorlog logs / lawcn.cn-error_log customlog logs / lawcn.cn-access_log Common Options None
8), Server.xml configuration
<-! Editable user database that can also be used by UserDatabaseRealm to authenticate users ->
<-! This Realm uses the UserDatabase configured in the global JNDI resources under the key "UserDatabase" Any edits that are performed against this UserDatabase are immediately available for use by the Realm -..>
->
Host>
Service>
Server>
(This is actually the default in other defaults.
Here the red part of the DocBase = "Lawcn" here is a Lawcn folder in / usr / local / tomcat / webapps / down, I built a soft link in order to let the virtual host user management is convenient.
Ln -s / www / lawcn / asdf-web / / usr / local / tomcat / webapps / lawcn can make users easily manage.
If you have any questions, please come to the question, or go to my forum.
http://bbs.6066.com/list.asp?boardid=29