版权归属xaay和Centos服务器构建网站所有,如须转载请注明作者和网站
------------------------------------------------------------------------------------------------------------------------
硬件配置:
AMD 3200+
华硕主板
KST 512M DDR400 *2
120G IDE
软件配置:
httpd-2.0.52-28.ent.centos4
php-4.3.9-3.15
mysql: unknown option
所须要软件:
j2sdk1.42
tomcat 5.028(网上传是最稳定版)
mod_jk
准备工作做完,必须得用ROOT权限安装
-----------------------------------------------------------------------------------------------------------------------------------------------
1、安装J2SDK
#./2sdk-1.4.2_12-oth-JPR:5/j2sdk-1_4_2_12-linux-i586.bin
阅读协议,并同意
#mv j2sdk1.4.2_12 /usr/local
# vi /etc/profile
在文件最后加入
JAVA_HOME=/usr/local/j2sdk1.4.2_12
PATH=$PATH:$JAVA_HOME/bin
CLASSPATH=$JAVA_HOME/lib/tools.jar
export JAVA_HOME CLASSPATH
------------------------------------------------------------------------------------------------------------------------------------------------
2、安装TOMCAT
#tar xzvf jakarta-tomcat-5.0.28.tar.gz
#mv jakarta-tomcat-5.0.28 /usr/local/tomcat
启动TOMCAT
#/usr/local/tomcat/bin/startup.sh
打开看看正常不,记得一定要加HTTP,要不会报错,我已经让玩过好多次了
-----------------------------------------------------------------------------------------------------------------------------------------------
3 安装mod_jk
#rpm -i mod_jk-1.2.6-3jpp_4fc.i386.rpm
-------------------------------------------------------------------------------------------------------------------------------------------------
4 整合APACHE和TOMCAT
# vi /etc/httpd/conf/httpd.conf
找到
LoadModule cgi_module modules/mod_cgi.so
在下面增加:
LoadModule jk_module modules/mod_jk.so
找到
DirectoryIndex index.html index.html.var index.php
在最后面加index.jsp
保存退出
#vi /etc/httpd/conf/workers2.properties (注意是新建的文件)
内容如下:
[channel.socket:localhost:8009]
port=8009
host=localhost
[ajp13:localhost:8009]
channel=channel.socket:localhost:8009
[uri:/*]
worker=ajp13:localhost:8009
[uri:/examples/*]
worker=ajp13:localhost:8009
#vi /usr/local/tomcat/conf/server.xml
找到
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false">
在下面加入:
reloadable="true" crossContext="true"/>
其中/home/mysqladmin为APACHE的默认站点目录
整合完成
----------------------------------------------------------------------------------------------------------------------------------
重启APACHE
# service httpd restart
停止TOMCAT
# /usr/local/tomcat/bin/shutdown.sh
启动TOMCAT
#/usr/local/tomcat/bin/startup.sh
-------------------------------------------------------------------------------------------------------------------------------------
现在测试一下,下载个JSP探针放到APACHE的默认网站目录
打开
/(探针文件名).jsp
(探针文件名).jsp
正常了吧,我自己试了一上午,你们却只要10多分钟就搞定,很不平衡啊,啰嗦几句别介意啊!