2

我正在运行 Mac 10.4,并且一直在使用 MAMP PRO 托管我管理的多个网站。现在我已经安装了 FileMaker Pro Server,它会强制我在系统偏好设置中打开 Web 共享。那么是否可以用 MAMP PRO 的版本替换 Apache?或者是否可以让 FileMaker Pro 使用 MAMP 而不是 Web 共享?如果是这样,我怎样才能做到这一点?

此外,使用 FileMaker Instant Web Publishing,我如何将我的域链接直接链接到 FileMaker 发布它的位置?所以我想要做的是输入http:///mydomain.com并直接到 mydomain.com:591/FMI/IWP/

4

1 回答 1

2

您可以修改与此绑定的系统 launchd.plist,以便启动您的自定义 apache 安装。

您可以通过编辑以下内容来做到这一点:

/System/Library/LaunchDaemons/org.apache.httpd.plist

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>Disabled</key>
    <true/>
    <key>Label</key>
    <string>org.apache.httpd</string>
    <key>ProgramArguments</key>
    <array>
        <string>/usr/sbin/httpd</string>
        <string>-D</string>
        <string>FOREGROUND</string>
    </array>
    <key>OnDemand</key>
    <false/>
    <key>SHAuthorizationRight</key>
    <string>system.preferences</string>
</dict>
</plist>

将 /usr/sbin/httpd 字符串更改为自定义 apache 安装的路径。确保首先或从命令行禁用 Web 共享:

launchctl unload -w /System/Library/LaunchDaemons/org.apache.httpd.plist

编辑后,单击 Web 共享按钮或从命令行:

launchctl load -w /System/Library/LaunchDaemons/org.apache.httpd.plist

对于第二个问题,您可以在 apache 配置中设置重定向

/path/to/apache2/conf/httpd.conf

不完全确定 MAMP 的位置,一般语法是:

Redirect / http://mydomain.com:591/FMI/IWP/

将这些包装在条件中通常是一个好习惯

<IfModule alias_module>
    Redirect / http://mydomain.com:591/FMI/IWP/
</IfModule>

而且我认为代理传递请求会是一个更优雅的解决方案

</IfModule>
<IfModule proxy_module>
  ProxyRequests Off
  <Proxy *>
    Order deny,allow
    Deny from all
    Allow from localhost
  </Proxy>
  <Location /filemaker/>
    ProxyPass /filemaker/ http://www.google.com/
    ProxyPassReverse /filemaker/ http://www.google.com/
    ProxyPass /images http://www.google.com/images
    ProxyPass /extern_js http://www.google.com/extern_js
    ProxyPass /intl http://www.google.com/intl
    ProxyPass /csi http://www.google.com/csi
  </Location>
</IfModule>

在这个例子中,我只需要访问http://localhost/filemaker,它就会显示 google 页面。您在 ProxyPass 中传递的资源取决于文件制作者的需求。

如果您不关心保留您的域并且想要代理所有内容,您会

</IfModule>
<IfModule proxy_module>
  ProxyRequests Off
  <Proxy *>
    Order deny,allow
    Deny from all
    Allow from localhost
  </Proxy>
    ProxyPass / http://www.google.com/
    ProxyPassReverse / http://www.google.com/
</IfModule>
于 2010-04-06T03:48:33.383 回答