Apach+Tomcat+JDK 的配置方案

原创 2006年06月08日 10:47:00

Apach+Tomcat+JDK 的配置方案


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
  
  下载该文件jdk-1_5_0_04-linux-i586-rpm.bin
  
  下载时将所需软件包文件保存在/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/java
  
  # vi /etc/profile
  
  #
  
  添加如下内容
  
  JAVA_HOME=/usr/java/jdk-1_5_0_04
  
  CLASSPATH=/usr/java/jdk-1_5_0_04/lib/dt.jar:/usr/java/jdk-1_5_0_04/lib/tools.jar
  
  PATH=/usr/java/jdk-1_5_0_04/bin:$PATH
  
  export PATH JAVA_HOME CLASSPATH
  
  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 127.0.0.1:80 (219行)
  
  将ServerName 修改为ServerName LocalHost:80 (291行)
  
  在DirectoryIndex中添加 index.jsp (394行)
  
  # cd /usr/local/apache/bin/
  
  # ./apachectl configtest
  
  显示Syntax ok则表明安装成功
  
  #./apachectl start
  
  启动apache服务,浏览器中访问本机80端口,查看端口是否正常,输入127.0.0.1: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
  
  第46行加入此句
  
  JAVA_HOME=/usr/java/jdk-1_5_0_04
  
  启动服务后,访问本机8080端口,查看端口是否正常(输入127.0.0.1:8080)
  
  # /usr/local/tomcat/bin/startup.sh /startup.bat
  
  关闭服务
  
  # /usr/local/tomcat/bin/shutdown.sh /shutdown.bat
  
  D 安装JK
  
  # cd /usr/local/
  
  # tar xzvf jakarta-tomcat-connectors-1.2.14-src.tar.gz
  
  # cd jakarta-tomcat-connectors-1.2.14-src/jk/native
  
  # chmod 755 buildconf.sh
  
  # ./buildconf.sh
  
  # ./configure --with-apxs=/usr/local/apache/bin/apxs
  
  # make
  
  # make install
  
  # cd /usr/local/jakarta-tomcat-connectors-jk1.2.14-src/jk/native/apache-2.0/
  
  # cp mod_jk.so /usr/local/apache/modules/
  
  E 系统整合
  
  # vi /usr/local/apache/conf/httpd.conf
  
  在文件最末尾加上如下语句
  
  #Load mod_jk
  
  LoadModule jk_module modules/mod_jk.so
  
  # Configure mod_jk
  
  JkWorkersFile conf/workers.properties
  
  JkLogFile logs/mod_jk.log
  
  JkLogLevel info
  
  JkMount /*.jsp loadbalancer
  
  JkMount /servlet/* loadbalancer
  
  JkMount /application/* loadbalancer
  
  #vi /usr/local/apache/conf/workers.properties
  
  添加下列语句
  
  #
  
  # workers.properties
  
  #
  
  # In Unix, we use forward slashes:
  
  ps=/
  
  # list the workers by name
  
  worker.list=tomcat1, tomcat2, loadbalancer
  
  # ------------------------
  
  # First tomcat server
  
  # ------------------------
  
  worker.tomcat1.port=8009
  
  worker.tomcat1.host=127.0.0.1
  
  worker.tomcat1.type=ajp13
  
  # Specify the size of the open connection cache.
  
  #worker.tomcat1.cachesize
  
  #
  
  # Specifies the load balance factor when used with
  
  # a load balancing worker.
  
  # Note:
  
  # ----> lbfactor must be > 0
  
  # ----> Low lbfactor means less work done by the worker.
  
  worker.tomcat1.lbfactor=100
  
  # ------------------------
  
  # Second tomcat server
  
  # ------------------------
  
  worker.tomcat2.port=8009
  
  worker.tomcat2.host=192.168.1.34
  
  worker.tomcat2.type=ajp13
  
  # Specify the size of the open connection cache.
  
  #worker.tomcat2.cachesize
  
  #
  
  # Specifies the load balance factor when used with
  
  # a load balancing worker.
  
  # Note:
  
  # ----> lbfactor must be > 0
  
  # ----> Low lbfactor means less work done by the worker.
  
  worker.tomcat2.lbfactor=100
  
  # ------------------------
  
  # Load Balancer worker
  
  # ------------------------
  
  # The loadbalancer (type lb) worker performs weighted round-robin
  
  # load balancing with sticky sessions.
  
  # Note:
  
  # ----> If a worker dies, the load balancer will check its state
  
  # once in a while. Until then all work is redirected to peer
  
  # worker.
  
  worker.loadbalancer.type=lb
  
  worker.loadbalancer.balanced_workers=tomcat1, tomcat2
  
  #
  
  # END workers.properties
  
  #
  
  #vi /usr/local/tomcat/conf/server.xml
  
  <Connector port="8009"
  
  protocolHandlerClassName="org.apache.jk.server.JkCoyoteHandler"
  
  redirectPort="8443" protocol="AJP/1.3" />  第101行
  
  在119行左右加入如下语句(去注释)
  
  <Engine name="Standalone" defaultHost="localhost" jvmRoute="tomcat1"></Engine>
  
  若第二台tomcat,将jvmRoute的修改为tomcat2
  
  系统整合完毕
  
  启动apache和tomcat服务
  
  # /usr/local/apache/bin/apachectl start
  
  # /usr/local/tomcat/bin/catalina.sh start
  
  将如下内容添加至/etc/rc.d/rc.local文件末尾
  
  以便系统启动后开启apache,tomcat服务
  
  #vi /etc/rc.d/rc.local
  
  添加
  
  /usr/local/tomcat/bin/catalina.sh start
  
  /usr/local/apache/bin/apachectl start

版权声明:本文为博主原创文章,未经博主允许不得转载。

相关文章推荐

仿百度文库方案[openoffice.org 3+swftools+flexpaper](一) 之 tomcat6.0+jdk1.6环境配置

本方案是笔者在网络上收集前人智慧,以及辛苦奋斗探索几周完成的成果。 由于网络上,大部分资料、文章都比较零碎、重复、不够全面。寻找全面系统的介绍该方案的资料实属不易。 本文从一个只会net、...
  • GS_MY
  • GS_MY
  • 2013-07-22 11:30
  • 818

仿百度文库方案[openoffice.org 3+swftools+flexpaper](一) 之 tomcat6.0+jdk1.6环境配置

作者:焱龙 出处:http://star-studio.cnblogs.com/ 申明:作者写博是为了总结经验,和以后的工作参考之用。 如需转载,请尽量保留此申明,并在文章页面明显位置给出原文连接...

Apach Tomcat

  • 2014-01-13 14:59
  • 229KB
  • 下载

Apach tomcat 6.0

  • 2007-04-10 22:40
  • 4.89MB
  • 下载

JRE System Library [jdk1.7]和Server Library [Apache Tomcat v6.0]为绑定错误解决方案

原文链接 今天在用Myeclipse8.6导入一个Java Web工程时,包错,通过单击导入的文件工程名,点击属性(properties),查看java Build Path...

apach-tomcat-6.0免费web服务器

  • 2011-11-16 12:58
  • 5.13MB
  • 下载

关于JDK与Tomcat安装路径修改过后无法正常使用的解放方案

本人在安装Oracle时,不小心把一个目录路径给修改了,该路径中含有JDK和Tomcat安装目录,结果等安装完了才发现了问题。但是又不想去修改Oracle的配置信息,因为 Oracle,JDK,Tom...

JRE System Library [jdk1.7]和Server Library [Apache Tomcat v6.0]错误解决方案

今天在用java EE导入一个Java Web工程时,报了错误,打了个大大的红叉,通过单击导入的文件工程名,点击属性(properties),查看Java Build Path,有如下信息:JRE S...

apach-tomcat

  • 2013-11-25 08:44
  • 8.38MB
  • 下载
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:深度学习:神经网络中的前向传播和反向传播算法推导
举报原因:
原因补充:

(最多只允许输入30个字)