2013-02-08 65 views
0

我的JBoss 7.1(standalone.xml)被配置是這樣的:與JBoss和的ProxyPass的Apache問題

<subsystem xmlns="urn:jboss:domain:web:1.1" default-virtual-server="default-host" native="false"> 
      <connector name="http" protocol="HTTP/1.1" scheme="http" socket-binding="http"/> 
      <connector name="ajp" protocol="AJP/1.3" scheme="http" socket-binding="ajp"/> 
      <virtual-server name="default-host" enable-welcome-root="false" default-web-module="mydefaultapp"> 
       <alias name="localhost"/> 
       <alias name="www.mydefaultapp.it"/> 
      </virtual-server> 
      <virtual-server name="secondApp" enable-welcome-root="false" default-web-module="secondApp"> 
       <alias name="www.secondapp.com"/> 
      </virtual-server> 
     </subsystem> 

'mydefaultapp' 定義 「/」 作爲在JBoss中-web.xml文件上下文根和是與mod_jk的完美運行:

<VirtualHost *:80> 
     ServerName  www.mydefaultapp.it 

     DocumentRoot /var/www/mydefaultapp 
     <Directory /> 
       Options FollowSymLinks 
       AllowOverride None 
     </Directory> 
     <Directory /var/www/mydefaultapp> 
       Options Indexes FollowSymLinks MultiViews 
       AllowOverride None 
       Order allow,deny 
       allow from all 
     </Directory> 

     ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ 
     <Directory "/usr/lib/cgi-bin"> 
       AllowOverride None 
       Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch 
       Order allow,deny 
       Allow from all 
     </Directory> 

     ErrorLog ${APACHE_LOG_DIR}/error.log 
     LogLevel warn 
     CustomLog ${APACHE_LOG_DIR}/access.log combined 

     SetEnvIf Request_URI "/foto/*" no-jk 
     JkMount/ajp13 
     JkMount /* ajp13 

</VirtualHost> 

現在我有「secondapp」戰爭則認爲「/ secondapp」這沒有定義上下文根。如果我試圖用「/」上下文根部署它,我得到這個錯誤:

INSTALL: Failed to process phase INSTALL of deployment "foo.war" Caused by: org.jboss.msc.service.DuplicateServiceException: Service jboss.web.deployment.default-host./.realm is already registered

如果我和部署「/ secondapp」上下文根沒有什麼作品。只需www.secondapp.com結束於404未找到錯誤。

一個可能的解決方案將使用HTTP代理此配置:

<VirtualHost *:80> 
    ServerName www.secondapp.com 
    ProxyPass  / http://localhost:8080/secondapp/ 
    ProxyPassReverse/ http://localhost:8080/secondapp/ 
</VirtualHost> 

這似乎工作,但......我無法訪問JSF資源(我不斷收到登錄表單,有一些問題,我的安全)

你能否建議我有兩個域名,兩個與JBoss 7.1 + Apache2 + mod_jk的戰爭的正確配置。記住第一個有「/」上下文根,而第二個有「/ secondapp」

回答