在apache服务器上我正在尝试执行以下操作:
myapp1.mydomain.com应该打开一个exists-db应用程序
myapp2.mydomain.com应该打开另一个exists-db app等等。
我已阅读文档并尝试了此处给出的所有解决方案,但不幸的是我仍然无法使其正常工作
我在apache conf中有这个:
<VirtualHost xx.xx.xx.xxx:80>
ServerName myapp1.mydomain.com
ProxyRequests off
ProxyPreserveHost on
ProxyPass / http://localhost:8080/exist/apps/myapp1/
ProxyPassReverse / http://localhost:8080/exist/apps/myapp1/
ProxyPassReverseCookiePath /exist /
ProxyPassReverseCookieDomain localhost myapp1.mydomain.com
RewriteEngine on
RewriteRule ^/(.*)$ /$1 [PT]
<VirtualHost>
问题在于,当我在bowser中写“myapp1.mydomain.com”时,它会给出:
Problem accessing /exist/apps/myapp1/exist/apps/myapp1/index.html. Reason:
Document /db/apps/myapp1/exist/apps/myapp1/index.html not found
显然,我做错了什么,所以任何帮助都会受到赞赏!
P.S。通过@adamretter回答问题 - 是的,有一个controller.xql:
xquery version "3.0";
import module namespace login-helper="http://exist-db.org/apps/dashboard/login-helper" at "modules/login-helper.xql";
import module namespace login="http://exist-db.org/xquery/login" at "resource:org/exist/xquery/modules/persistentlogin/login.xql";
declare variable $exist:path external;
declare variable $exist:resource external;
declare variable $exist:controller external;
declare variable $exist:prefix external;
declare variable $exist:root external;
if ($exist:path eq "/") then
(: forward root path to index.xql :)
<dispatch xmlns="http://exist.sourceforge.net/NS/exist">
<redirect url="index.html"/>
</dispatch>
else if (ends-with($exist:resource, ".html")) then
(: the html page is run through view.xql to expand templates :)
<dispatch xmlns="http://exist.sourceforge.net/NS/exist">
<view>
<forward url="{$exist:controller}/modules/view.xql"/>
</view>
<error-handler>
<forward url="{$exist:controller}/error-page.html" method="get"/>
<forward url="{$exist:controller}/modules/view.xql"/>
</error-handler>
</dispatch>
(: Resource paths starting with $shared are loaded from the shared-resources app :)
else if (contains($exist:path, "/$shared/")) then
<dispatch xmlns="http://exist.sourceforge.net/NS/exist">
<forward url="/shared-resources/{substring-after($exist:path, '/$shared/')}">
<set-header name="Cache-Control" value="max-age=3600, must-revalidate"/>
</forward>
</dispatch>
(: images, css are contained in the top /resources/ collection. :)
(: Relative path requests from sub-collections are redirected there :)
else if (contains($exist:path, "/resources/")) then
<dispatch xmlns="http://exist.sourceforge.net/NS/exist">
<forward url="{$exist:controller}/resources/{substring-after($exist:path, '/resources/')}">
<set-header name="Cache-Control" value="max-age=3600, must-revalidate"/>
</forward>
</dispatch>
else
(: everything else is passed through :)
<dispatch xmlns="http://exist.sourceforge.net/NS/exist">
<cache-control cache="yes"/>
</dispatch>