日期:2014-05-16 浏览次数:20842 次
RedHat linux+apache+tomcat+mod_jk 负载均衡安装说明(非原创)
1. 操作系统
RedHat Linux 9.0
2. 所需软件
Apache 2.0.54? 下载地址
http://apache.freelamp.com/httpd/httpd-2.0.54.tar.gz
Tomcat5.5.9??? 下载地址
http://apache.justdn.org/jakarta/tomcat-5/v5.5.9/bin/jakarta-tomcat-5.5.9.tar.gz
Mod_jk 1.2.14? 下载地址
http://apache.justdn.org/jakarta/tomcat-connectors/jk/source/jk-1.2.14/jakarta-tomcat-connectors-1.2.14-src.tar.gz
Jdk 1_5_0_04?? 下载地址
??? http://java.sun.com/j2se/1.5.0/download.jsp
备注:下载时将所需软件包文件保存在/usr/local目录下
3. 安装步骤
A 安装JDK
# cd /usr/local/
# chmod +x jdk-1_5_0_04-linux-i586-rpm.bin
# ./jdk-1.5.0_04-linux-i586-rpm.bin
# cd /usr/java/
# ln -s /usr/java/jdk-1_5_0_04 /usr/local/jdk
# vi /etc/profile
??? #添加如下内容
export JAVA_HOME=/usr/local/jdk
export CLASSPATH=/usr/local/jdk/lib
export PATH=/usr/local/jdk/bin:$PATH
B 安装Apache
# cd /usr/local/
# tar xvfz httpd-2.0.54.tar.gz
# cd httpd-2.0.54
#./configure --prefix=/usr/local/apache --enable-module=so
# make
# make install
# cd /usr/local/apache/conf
# vi ./httpd.conf
将Listen 80 修改为Listen :80
将ServerName 修改为ServerName :80
在DirectoryIndex中添加 index.jsp
? # cd /usr/local/apache/bin/
# ./apachectl configtest
若显示Syntax ok则表明安装成功
#./apachectl start
启动apache服务,访问本机80端口,查看端口是否正常
# ./apachectl stop
关闭服务
备注:prefix定义apache的安装路径
C安装Tomcat
? # cd /usr/local/
? # tar xvfz jakarta-tomcat-5.5.9.tar.gz
? # ln –s /usr/local/jakarta-tomcat-5.5.9 /usr/local/tomcat
? # vi /usr/local/tomcat/bin/catalina.sh
????? JAVA_HOME=/usr/local/jdk
?启动服务后,访问本机8080端口,查看端口是否正常
# /usr/local/tomcat/bin/startup.s