运行 Pow & MAMP Pro 同时进行
我刚刚从使用 Passenger 切换到使用 POW,因为我不必运行 Apache 服务器来在 POW 上运行 Rails 应用程序。但我没有同时运行 MAMP Pro 和 POW。
有人能同时运行 MAMP Pro 和 POW 吗?
I just switched from using Passenger to using POW because I didn't have to run the Apache server to run rails apps on POW. But I'm not having luck running MAMP Pro and POW simultaneously.
Anyone have any luck running both MAMP Pro and POW?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
还有另一种我更喜欢的方式。您不必过多地修改脚本或其他任何东西。缺点是,您需要运行 MAMP Pro 才能访问您的 Pow 应用程序。
首先,如果您安装了 Pow(在您的情况下确实如此),请使用
curl get.pow.cx/uninstall.sh | 卸载它。嘘。不用担心,所有设置和应用程序都将被保留。
然后,您必须在 Pow 配置文件中添加一行。执行
echo 'export POW_DST_PORT=88' >>> ~/.powconfig
,然后使用curl get.pow.cx | 再次安装 Pow嘘。
现在,打开 MAMP Pro,转到“主机”,然后创建一个新主机。它的名称和选择的目录并不重要(尽管我使用“rails.dev”和保存 Rails 应用程序的文件夹)。 (此外,请取消选择“本地名称解析”的选择框,以防万一。)然后转到“高级”选项卡,并将其填写到标有“自定义虚拟主机常规设置”的文本区域中:
这是源自 < 37signals 的 github wiki 上的 href="https://github.com/37signals/pow/wiki/Running-Pow-with-Apache">Running Pow with Apache 文章,它在出色的 MAMP 上运行良好专业版Snow Leopard 为 1.9.X,Lion 为可怕的 MAMP Pro 2.0.X。
There is another way that I prefer. You don't have to mess with scripts or anything —much. The downside is, you need to have MAMP Pro running to access your Pow apps.
First, if you have Pow installed (which, in your case, you do), uninstall it with
curl get.pow.cx/uninstall.sh | sh
. Not to worry, all settings and applications will be preserved.Then, you have to add a line to Pow configuration file. Do
echo 'export POW_DST_PORT=88' >> ~/.powconfig
, and then install Pow again withcurl get.pow.cx | sh
.Now, open MAMP Pro, go to Hosts, and create a new host. Doesn't matter what it is named and which directory is selected (though I use 'rails.dev' and the folder I keep my Rails apps in). (Also, deselect the select box for "local name resolution", just in case.) Then go to the Advanced tab, and fill this in to the textarea labeled "Customized virtual host general settings":
This is a solution derived from the Running Pow with Apache article on 37signals' github wiki, and it works fine on the great MAMP Pro 1.9.X for Snow Leopard as well as the dreadful MAMP Pro 2.0.X on Lion.
如果您需要在运行 Pow 和 Apache 之间切换,可以使用 shell 脚本: https://gist.github.com/919084
另一个 ruby 脚本可以更改 Pow 的监听端口,因此您仍然可以在端口 80 上运行 Apache:https://gist.github.com/911687
另外,我建议您安装 粉末宝石
There is a shell script if you need to switch between running Pow and Apache: https://gist.github.com/919084
And another script in ruby that changes Pow's listening port, so you can still run Apache on port 80: https://gist.github.com/911687
Also, I would suggest you to install powder gem
如果您发现您的本地 IP 现在转发到 POW 而不是 apache,则需要添加一个空白虚拟主机条目来捕获所有流量。
Just to add to the above if you find that your local ip is now forwarding to POW rather than apache, you need to add a blank virtualhost entry to catch all traffic.