帮助用MAMP PRO替换Mac工厂安装的apache,以便FileMaker可以与我的其他网站一起使用?

时间:2010-03-14 04:21:44

标签: apache macos mamp filemaker

我正在运行Mac 10.4并且一直在使用MAMP PRO来托管我管理的几个网站。现在我已经安装了FileMaker Pro Server,它迫使我在系统首选项中打开Web共享。那么可以用MAMP PRO的版本替换Apache吗?或者是否可以让FileMaker Pro使用MAMP而不是Web Sharing?如果是这样,我该如何实现呢?

此外,使用FileMaker即时网络发布,如何将我的域名直接链接到FileMaker发布的位置?所以我希望能够做的是输入http:///mydomain.com并将其指向mydomain.com:591/FMI/IWP /

1 个答案:

答案 0 :(得分: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 config中设置重定向

/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中传递的资源取决于filemaker需要的资源。

如果您不关心保留自己的域名,并且希望所有内容代理,那么

</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>