网站地图    收藏   

主页 > 系统 > apache教程 >

经典的apache+tomcat虚拟机配置|root@longbank-Apache教程

来源:自学PHP网    时间:2014-10-14 00:06 作者: 阅读:

[导读] ...

安装所需文件:
jdk-1_5_0_06-linux-i586.rpm
http-2.2.0.tar.gz
apache-tomcat-5.5.16.tar.gz
jakarta-tomcat-connectors-jk-1.2.6.tar.gz
将安装软件都放在一个目录下,我暂且放在/usr/local下
(1)JDK的安装
[root@longbank]cd /usr/local
[root@longbank]rpm ivh  jdk-1_5_0_06-linux-i586.rpm
[root@longbank]vi /etc/profile
配置JDK   进入界面后按 i 
JAVA_HOME=/usr/java/jdk1.5.0_06
PATH=$JAVA_HOME/bin:$PATH
CLASSPATH=.:$JAVA_HOME/lib/tools.jar:$JAVA_HOEM/lib/dt.jar
export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE INPUTRC CLASSPATH JAVA_HOME
然后按Esc,接着同时按下shift与:,输入wq保存退出
(1) apache的安装:
[root@longbank] cd /usr/local
[root@longbank] tar zxvf http-2.2.0.tar.gz
[root@longbank] cd httpd-2.2.0
[root@longbank] ./configure --prefix=/usr/local/apache --with-mpm=worker --enable-mods-shared=all
                 --enable-proxy --enable-proxy-http --enable-proxy-ajp --enable-proxy-balancer
                 --enable-proxy-ftp --enable-proxy-connect
                 --enable-so --enable-modules=so
[root@longbank] make
[root@longbank] make install
[root@longbank]vi /etc/profile
配置tomcat  进入界面后按 i 
TOMCAT_HOME=/usr/local/apache-tomcat-5.5.16
在export 中加入TOMCAT_HOME
然后按Esc,接着同时按下shift与:,输入wq保存退出
 
(2)tomcat的安装:
[root@longbank] cd /usr/local
[root@longbank] tar zxvf apache-tomcat-5.5.16.tar.gz
[root@longbank]
(3) Connectors的安装:
[root@longbank] tar zxvf jakarta-tomcat-connectors-jk-1.2.6.tar.gz
[root@longbank] cd jakarta-tomcat-connectors-jk-src/jk/native
[root@longbank] ./buildconf.sh
[root@longbank] ./configure --with-apxs=/usr/local/apache/bin/apxs
[root@longbank] make
[root@longbank] make install
  
[root@longbank] vi /usr/local/apache/conf/httpd.conf
 
listen 80 改为:listen 192.168.10.83:80
注释掉:DocumentRoot /usr/local/apache/htdocs
注释掉:serverAdmin
注释掉:serverName
 
在文件末尾添加如下内容:
 
#add mod_jk module
LoadModule jk_module modules/mod_jk.so
# Update this path to match your modules location
# Where to find workers.properties
# Update this path to match your conf directory location (put workers.properties next to httpd.conf)
 JkWorkersFile /usr/local/apache/conf/workers.properties
# Where to put jk logs
# Update this path to match your logs directory location (put mod_jk.log next to access_log)
 JkLogFile     /usr/local/apache/conf/mod_jk.log
# Set the jk log level [debug/error/info]
 JkLogLevel    info
# Select the log format
 JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
# JkOptions indicate to send SSL KEY SIZE,
 JkOptions     +ForwardKeySize +ForwardURICompat -ForwardDirectories
# JkRequestLogFormat set the request format
 JkRequestLogFormat     "%w %V %T"
# Send everything for context /examples to worker named worker1 (ajp13)
 JkMount /*.jsp worker1
 JkMount /server/* worker1
 
新建此文件/usr/localapache/conf/workers.properties 添加如下内容:
# Define 1 real worker using ajp13
 worker.list=worker1
 # Set properties for worker1 (ajp13)
 worker.worker1.type=ajp13
 worker.worker1.host=localhost
 worker.worker1.port=8009
 worker.worker1.lbfactor=50
 worker.worker1.cachesize=10 "经典的apache+tomcat虚拟机配置"由第二电脑网原创提供,转载请注明:http://www.002pc.com/master/College/Server/Apache/17979.html

自学PHP网专注网站建设学习,PHP程序学习,平面设计学习,以及操作系统学习

京ICP备14009008号-1@版权所有www.zixuephp.com

网站声明:本站所有视频,教程都由网友上传,站长收集和分享给大家学习使用,如由牵扯版权问题请联系站长邮箱904561283@qq.com

添加评论