您可以修改与此绑定的系统 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>