如何将Rails 3.0推送到Apache/MySQL生产服务器
我是一名 Rails 学生,我猜我的问题是一个基本问题,但也没办法。我目前正在参加 Rails 速成课程,重点是使用 Heroku 来测试“生产”应用程序。因此,我非常擅长与 Heroku 集成,但当需要将应用程序推送到我的专用 Apache/mySQL 服务器上时,我不知道该转向哪里。我假设有一个 gem 配置来处理这个问题?我不需要明确的指示 - 如果有人可以指出我正确的方向(使用哪个软件),那就完美了。
I'm a Rails student, and I'm guessing my question is a basic one, but it can't be helped. I'm currently going thru a Rails crash course which focuses on using Heroku to test the "production" app. So I'm pretty good at integrating with Heroku, but I have no idea where to turn when it's time to push the app onto my dedicated Apache/mySQL server. I'm assuming there's a gem configuration to handle this? I don't need explicit instructions - if someone can point me in the right direction (which software to use), that would be perfect.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我相信你正在寻找乘客。
http://www.modrails.com/
I believe you are looking for passenger.
http://www.modrails.com/
使用 capistrano 进行部署+乘客(又名 modrails)作为应用程序和 apache 之间的接口。
Use capistrano for deployment + passenger (aka modrails) as an interface between the app and apache.
只是为了澄清:
这是一个对程序 git 的命令,告诉它将项目的内容复制到与“主”存储库关联的任何地址。你的计算机上安装了 git,Heroku 在他们的服务器上运行 git,并使用一堆时髦的脚本来运行服务器 git 存储库中最终出现的任何内容。
正如您所知,您将无法简单地“推送”到您自己的服务器。
在您自己的服务器上,您通常会有一个 Web 服务器(Apache 或 Nginx 等)来响应静态文件的请求,然后是一个应用程序服务器(maongrel 或乘客或 unicorn...),您的 Web 服务器将向其传递请求。您需要进行一些配置才能使 Web 服务器正确传递请求。到目前为止,让 Rails 应用程序运行的最简单方法是安装 Apache 并使用 Passenger 作为应用程序服务器。
Just to clarify:
is a command to the program git that tells it to copy the contents of the project to whatever address is associated with the "master" repository. You have git installed on your computer and Heroku has git running on their server with a bunch of snazzy scripting to run whatever ends up inside the servers git repository.
Just so you know, you will not be able to simply "push" to your own server.
On your own server you will typically have a web server (Apache or Nginx or something) that will respond to requests for static files and then an app server (maongrel or passenger or unicorn...) to which your web server will pass requests to. You will need to do some configuration to get the web server passing requests on properly. By far the easiest way to get your Rails app running is installing Apache and using Passenger as your app server.