六狼论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博账号登陆

只需一步,快速开始

搜索
查看: 138|回复: 0

apache+jboss整合时jboss有多个项目

[复制链接]

升级  13.67%

69

主题

69

主题

69

主题

举人

Rank: 3Rank: 3

积分
241
 楼主| 发表于 2013-2-7 22:56:58 | 显示全部楼层 |阅读模式
mod_jk.conf文件内容不变
#load jk
LoadModule jk_module modules/mod_jk.so
include jk_conf/vhosts.conf
#workers.properties path
JkWorkersFile jk_conf/workers.properties
#log file
JkLogFile jk_conf/mod_jk.log
JkLogLevel info
JkLogStampFormat "[%a %b %d %H:%M:%S %Y]"
JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories
JkRequestLogFormat "%w %V %T"

#Defining a worker named FITMENT and of type ajp13
worker.list=FITMENT,mytest
#Set properties for FITMENT
worker.FITMENT.type=ajp13
worker.FITMENT.host=127.0.0.1
worker.FITMENT.port=8009
worker.FITMENT.lbfactor=50
worker.FITMENT.cachesize=10
worker.FITMENT.cache_timeout=600
worker.FITMENT.socket_keepalive=1
worker.FITMENT.socket_timeout=300

worker.mytest.type=ajp13
worker.mytest.host=127.0.0.1
worker.mytest.port=8009
worker.mytest.lbfactor=50
worker.mytest.cachesize=10
worker.mytest.cache_timeout=600
worker.mytest.socket_keepalive=1
worker.mytest.socket_timeout=300

上面是workers.properties的内容,list有两个应用,对应着两个jboss项目。使用,符号分隔。


vhosts.conf文件对应了多个虚拟主机
#
# Virtual Hosts
#
# If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at
# <URL:http://httpd.apache.org/docs/2.2/vhosts/>
# for further details before you try to setup virtual hosts.
#
# You may use the command line option '-S' to verify your virtual host
# configuration.

#
# Use name-based virtual hosting.
#
NameVirtualHost *:80

#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ServerName or ServerAlias in any <VirtualHost> block.
#

<VirtualHost liyixing.com:80>
    ServerAdmin liyixing1@gmail.com
    DocumentRoot "D:/soft/jboss/jboss/server/default/deploy"
    ServerName liyixing.com
    ServerAlias my.liyixing.com
    JkMount /*.jsp FITMENT
    JkMount /jmx-console/* FITMENT
    JkMount /web-console/* FITMENT
    #apache will serve the static picture
    JkMount /*.gif FITMENT
    JkMount /*.swf FITMENT
    JkMount /*.bmp FITMENT
    JkMount /*.png FITMENT
    JkMount /*.css FITMENT
    JkMount /*.js FITMENT
    JkMount /*.action FITMENT
    JkMount /*.html FITMENT
    JkMount /*.htm FITMENT
    JkMount /* FITMENT
    JkMount / FITMENT
    ErrorLog "logs/dummy-host.example.com-error_log"
    CustomLog "logs/dummy-host.example.com-access_log" common
</VirtualHost>

<VirtualHost aaa.com:80>
    ServerAdmin liyixing1@gmail.com
    DocumentRoot "D:/test"
    ServerName aaa.com
    ServerAlias my.aaa.com
    JkMount /*.jsp mytest
    JkMount /jmx-console/* mytest
    JkMount /web-console/* mytest
    #apache will serve the static picture
    JkMount /*.gif mytest
    JkMount /*.swf mytest
    JkMount /*.bmp mytest
    JkMount /*.png mytest
    JkMount /*.css mytest
    JkMount /*.js mytest
    JkMount /*.action mytest
    JkMount /*.html mytest
    JkMount /*.htm mytest
    JkMount /* mytest
    JkMount / mytest
    ErrorLog "logs/dummy-host.example.com-error_log"
    CustomLog "logs/dummy-host.example.com-access_log" common
</VirtualHost>
您需要登录后才可以回帖 登录 | 立即注册 新浪微博账号登陆

本版积分规则

快速回复 返回顶部 返回列表