如何在网络逻辑插件中使用 httpd 配置删除应用程序路径



我开发了一个名为myapp的JSF应用程序,该应用程序部署在托管服务器managedServer1和managedServer2上的weblogic 12c http服务器上,该服务器位于名为mycluster的同一集群中。应用程序可以通过 url http://xx.xx.xx.xx(ip for managedServer1):9080/myapp 访问。

我尝试通过将httpd(httpd.conf)配置为:

<VirtualHost *:80>
ServerName www.mywebsite.com.au
ServerAlias mywebsite.com.au
<Proxy balancer://mycluster>
BalancerMember http://xx.xx.xx.xx1:9080/myapp
BalancerMember http://xx.xx.xx.xx2:9080/myapp
</Proxy>
ProxyRequests off
ProxyPreserveHost On
<Proxy *>
Require all granted
</Proxy>
ProxyPass /myapp balancer://mycluster/
ProxyPassReverse /myapp balancer://mycluster/
ProxyPass / balancer://mycluster/
ProxyPassReverse / balancer://mycluster/
<Location />
Require all granted
</Location>
</VirtualHost>

通过使用此配置,我可以通过 URL 访问我的 jsf 应用程序

http://www.mywebsite.com.au

径直。

不幸的是,由于我的 JSF 应用程序在我的 jsf 页面中有很多 ajax 异步请求,apache 反向代理无法正确处理它,总是导致会话丢失。我必须找到其他方法来满足我的 ajax 请求。

我建议为我的apache http服务器安装weblogic插件。安装插件后,我使用以下方法重新配置我的 httpd.conf

<VirtualHost *:80>
ServerName www.mywebsite.com.au
<IfModule mod_weblogic.c>
WebLogicCluster xx.xx.xx.xx1:9080,xx.xx.xx.xx2:9080
MatchExpression *.xhtml
</IfModule>
<Location /myapp>
SetHandler weblogic-handler
Require all granted
</Location>
</VirtualHost> 

不幸。我必须通过调用 URL 访问我的 JSF 应用程序:

http://www.mywebsite.com.au/myapp

我的问题是:是否有其他方法可以将我的虚拟主机配置为从 root 访问我的 JSF 应用程序?(http://www.mywebsite.com.au)没有应用程序路径的。如果是,请告知!

经过几天的工作,找到解决此问题的方法,httpd.conf 已更新为:

<Location />
SetHandler weblogic-handler
PathTrim /myapp
PathPrepend /myapp
Require all granted
</Location>

通过使用 PathTrim 和 PathPrepend 来映射 URL。系统现在运行良好。

这个问题可能会帮助处于相同情况的任何其他人。

最新更新