如何在 Mac OS X 上永久运行 Rails 网站
我使用 Ruby on Rails 开发了供个人使用的小型 Web 应用程序。 现在,当我想使用它时,我打开终端并运行 ruby 脚本/服务器来运行 mongrel,然后我转到 Safari 并输入 localhost:3000 来查看我的应用程序。
我想让这个网站在 mac 启动时自动启动,并可能使用其他一些 URL.. 最好只是 http://myapp/
我来自 C#/asp.net 世界,对 apache/mongrel 的东西不太了解。
您知道如何在 mac os x leopard 上配置 Rails/mongrel/apache 以便在启动后协同工作并运行的分步教程吗? (我正在运行 apache,这只是通过选中系统首选项/共享中的复选框来完成的)
i've developed small web app for personal use with Ruby on Rails. Now when i want to use it I open Terminal and run ruby script/server to run mongrel then i go to Safari and type localhost:3000 to see my app.
I'd like to have this site start automatically on startup of mac and possibly to use some other URL.. preferably just http://myapp/
I come from C#/asp.net world and don't know much about apache/mongrel stuff.
Do you know any step by step tutorial how to configure rails/mongrel/apache on mac os x leopard to work together and run after startup, please? (I have apache running, which was done just by checking checkbox in system preferences/sharing)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
苹果的此页面应该包含您需要的所有信息:
http://developer.apple.com/tools/deployonrailsleopard.html
This page by apple should have all the information you need:
http://developer.apple.com/tools/deployonrailsleopard.html
最简单的方法是安装 Apache 的 Passenger Phusion / mod_rails。 这将允许您避开 Mongrel/Thin/etc 的使用,并像 php 一样部署应用程序(将其放在文件夹中然后运行)。
The easiest method would be to install Passenger Phusion / mod_rails for Apache. This will allow you to use sidestep the usage of Mongrel/Thin/etc and deploy apps much like php (stick it in a folder and go).
如果你想在 Mac OS X 上运行它,你可以简单地设置你的网络服务器,我推荐 nginx 和 Phusion 的 Passenger,以及你的数据库服务器在启动时启动,这样每当你的计算机必须重新启动时,它就会让你的网站运行。 当然,如果这是一台将要改变网络并且需要被其他人访问的笔记本电脑,我会建议为其购买一个合适的 VPS,想一想,无论如何,如果这应该是一个生产环境,我会建议这样做。
If you want to run it on Mac OS X you can simply setup your webserver, I recommend nginx with Phusion's Passenger, and your database server to start on boot, that way whenever your computer has to restart it will have your site running. Of course if this is a laptop that will be changing networks and needs to be accessed by other people I would recommend getting a proper VPS for it, come to think of it, I would recommend that anyway if this is supposed to be a production environment.