gpt4 book ai didi

reverse-proxy - 如何在 Mac OS X Mountain Lion Server 中设置 Web 代理服务?

转载 作者:行者123 更新时间:2023-12-02 05:05:36 24 4
gpt4 key购买 nike

我正在尝试利用 Mac OS X Server 中的配置文件而不是直接修改 Apache 的站点文件来为 eXist XML 数据库添加反向代理条目。映射应从 [http://example.com/exist] 到 [http://localhost:8080/exist]。

eXist 已启动并正在运行。

我添加了以下 plist 文件/Library/Server/Web/Config/apache2/webapps/org.exist-db.plist

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">

<!-- See man pages for webapp.plist(5) and webappctl(8) for information about this example webapp.plist -->

<plist version="1.0">
<dict>
<key>includeFiles</key>
<array>
<!-- Include files are activated in virtual host when webapp is started -->
</array>
<key>launchKeys</key>
<array>
<!-- Launchd plists in /Applications/Server.app/Contents/ServerRoot/System/Library/LaunchDaemons are loaded when webapp is started -->
</array>
<key>name</key>
<string>org.exist-db</string>
<key>displayName</key>
<!-- Name shown in Server app -->
<string>eXist Open Source XML Database</string>
<key>proxies</key>
<!-- ProxyPass/ProxyPassReverse directives are activated when webapp is started -->
<dict>
<key>/exist</key>
<!-- Sets up a reverse proxy -->
<dict>
<key>keysAndValues</key>
<string/>
<key>path</key>
<string>/exist</string>
<key>urls</key>
<!-- URLs comprise a proxy_balancer group -->
<array>
<string>http://localhost:8080/exist</string>
</array>
</dict>
</dict>
<key>requiredModuleNames</key>
<array>
<!-- Apache plugin modules are enabled when webapp is started -->
<string>proxy_module</string>
</array>
<key>requiredWebAppNames</key>
<array>
<!-- Required web apps are started when this webapp is started -->
</array>
<key>installationIndicatorFilePath</key>
<!-- The presence of this file indicates web app is installed -->
<string>/Users/cahlander/eXist-trunk</string>
<key>sslPolicy</key>
<!-- Determines webapp SSL behavior -->
<integer>0</integer>
<!-- 0: default, UseSSLWhenEnabled -->
<!-- 1: UseSSLAlways -->
<!-- 2: UseSSLOnlyWhenCertificateIsTrustable -->
<!-- 3: UseSSLNever -->
<!-- 4: UseSSLAndNonSSL -->
</dict>
</plist>

在本地服务器上运行,转到http://example.com:8080/exist有效,但来自另一台机器,转到 http://example.com/exist才不是。此外,“eXist Open Source XML Database”应该在高级设置中显示为网络应用程序。它不是。我做错了什么?

最佳答案

我已经解决了所有悬而未决的问题,但遇到了一个新问题。

仅将以下内容作为 org.exist-db.plist 添加到/Library/Server/Web/Config/apache2/webapps

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">

<!-- See man pages for webapp.plist(5) and webappctl(8) for information about this example webapp.plist -->

<plist version="1.0">
<dict>
<key>includeFiles</key>
<array/>
<key>launchKeys</key>
<array/>
<key>name</key>
<string>org.exist-db</string>
<key>displayName</key>
<!-- Name shown in Server app -->
<string>eXist Open Source XML Database</string>
<key>proxies</key>
<!-- ProxyPass/ProxyPassReverse directives are activated when webapp is started -->
<dict>
<key>/exist</key>
<!-- Sets up a reverse proxy -->
<dict>
<key>keysAndValues</key>
<string/>
<key>path</key>
<string>/exist</string>
<key>urls</key>
<!-- URLs comprise a proxy_balancer group -->
<array>
<string>http://localhost:8080/exist</string>
</array>
</dict>
</dict>
<key>requiredModuleNames</key>
<array>
<!-- Apache plugin modules are enabled when webapp is started -->
<string>proxy_module</string>
</array>
<key>requiredWebAppNames</key>
<array>
<!-- Required web apps are started when this webapp is started -->
</array>
<key>startCommand</key>
<string>/Users/cahlander/eXist-trunk/tools/wrapper/bin/exist.sh start</string>
<key>stopCommand</key>
<string>/Users/cahlander/eXist-trunk/tools/wrapper/bin/exist.sh stop</string>
<key>installationIndicatorFilePath</key>
<!-- The presence of this file indicates web app is installed -->
<string>/Users/cahlander/eXist-trunk/VERSION.txt</string>
<key>sslPolicy</key>
<!-- Determines webapp SSL behavior -->
<integer>0</integer>
<!-- 0: default, UseSSLWhenEnabled -->
<!-- 1: UseSSLAlways -->
<!-- 2: UseSSLOnlyWhenCertificateIsTrustable -->
<!-- 3: UseSSLNever -->
<!-- 4: UseSSLAndNonSSL -->
</dict>
</plist>

它开始了,但没有停止。该条目确实显示在高级设置中。它不会从 GUI 停止。

以下命令行条目将起作用,但在我停止并重新启动后我确实遇到了损坏。

sudo webappctl 启动 org.exist-db

sudo webappctl 停止 org.exist-db

关于reverse-proxy - 如何在 Mac OS X Mountain Lion Server 中设置 Web 代理服务?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12041686/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com