- 论坛徽章:
- 0
|
哎~~一直都没人。。。
后来自己baidu了很多,算是解决了,顺便把方法提出来 我把配置贴出来吧
apache上的http.conf上添加配置:
NameVirtualHost *:80
<VirtualHost *:80>
ServerAdmin webmaster@dummy-host.example.com
DocumentRoot /var/www/test/test1/
ServerName www.test1.com
ServerAlias www.test1.com
JkMount /* loadbalancer
ErrorLog "logs/dummy-host.example.com-error_log"
CustomLog "logs/dummy-host.example.com-access_log" common
<Directory "/var/www/test/test1/">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
<VirtualHost *:80>
ServerAdmin webmaster@dummy-host2.example.com
DocumentRoot /var/www/test/test2/
ServerName www.test2.com
JkMount /* loadbalancer
ErrorLog "logs/dummy-host2.example.com-error_log"
CustomLog "logs/dummy-host2.example.com-access_log" common
<Directory "/var/www/test/test2/">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
——————————————————————————————————
jboss中项目的 test1项目里WEB-INF里的jboss-web.xml中如下:
?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE jboss-web
PUBLIC "-//JBoss//DTD Web Application 2.3V2//EN"
"http://www.jboss.org/j2ee/dtd/jboss-web_3_2.dtd">
<jboss-web>
<context-root>/</context-root>
<virtual-host>www.test1.com</virtual-host>
</jboss-web>
jboss中项目的 test2项目里WEB-INF里的jboss-web.xml中如下:
?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE jboss-web
PUBLIC "-//JBoss//DTD Web Application 2.3V2//EN"
"http://www.jboss.org/j2ee/dtd/jboss-web_3_2.dtd">
<jboss-web>
<context-root>/</context-root>
<virtual-host>www.test2.com</virtual-host>
</jboss-web> |
|