Ruby on Rails上的phusion乘客

时间:2021-09-24 00:08:01

I have created a website on my machine using rails and now I would like to put it on a server machine ( different machine ) and run it. I have a dedicated server running on linux which uses apachee. Now i am interesting in running the server and running rails website on it. However i am not sure how to do it.

我使用rails在我的机器上创建了一个网站,现在我想将它放在服务器机器(不同的机器)上并运行它。我有一个在linux上运行的专用服务器,它使用apachee。现在我有兴趣运行服务器并在其上运行rails网站。但是我不知道该怎么做。

To my understanding I must use some kind of software to run it, and the one that was selected his phusion passenger but how would i transfer this?

根据我的理解,我必须使用某种软件来运行它,并选择他的错误乘客,但我将如何转移它?

Do I just copy and paste the folder in the server where www exist, if what should i do. I have few gems installed on my machine such as paperclip, rmagic do i need to install them by just bundle install or does phusion passenger will take care of it??

如果我应该怎么做,我只是将文件夹复制并粘贴到存在www的服务器中。我的机器上安装了很少的宝石,比如回形针,rmagic我需要通过捆绑安装来安装它们还是phusion乘客会照顾它?

Thanks in advance!

提前致谢!

2 个解决方案

#1


2  

You have to install Phusion Passenger on your Apache box. Seeing as you are on Linux, the install should be straight forward. www.modrails.com takes you to the Passenger download page.

您必须在Apache机器上安装Phusion Passenger。看到你在Linux上,安装应该是直截了当的。 www.modrails.com带您进入乘客下载页面。

Installing Passenger will not change anything about your app, if your app needs any Gems, you'd still need to run bundle install to get them installed.

安装Passenger不会改变您的应用程序,如果您的应用程序需要任何Gems,您仍需要运行bundle install才能安装它们。

You'll copy your app from your development machine to your deployment machine. Where you put it is your choice. Once Passenger is installed, all it needs to know is where the root of your rails app is. Typically you'd define it in the virtual hosts configuration section of apache, here is an example:

您将应用程序从开发计算机复制到部署计算机。你把它放在哪里是你的选择。一旦安装了Passenger,它需要知道的是rails应用程序的根目录。通常,您可以在apache的虚拟主机配置部分中定义它,这是一个示例:

<VirtualHost *:80>
  SuexecUserGroup "#1000" "#1000"
  ServerName yourdomain.com
  ServerAlias www.yourdomain.com
  ServerAlias www.yourdomain.net
  DocumentRoot /home/yourappdir/public
  CustomLog /home/logs/access_log combined
  ScriptAlias /cgi-bin/ /home/cgi-bin/
  ScriptAlias /fcgi-bin/ /home/fcgi-bin/
  XSendFile On
  <Directory /home/yourappdir/public>
    Options -Indexes IncludesNOEXEC FollowSymLinks -MultiViews
    AllowOverride All
    Order allow,deny
    Allow from all
  </Directory>
  <Directory /home/cgi-bin>
    Order allow,deny
    Allow from all
  </Directory>
  <Directory /home/fcgi-bin>
    Order allow,deny
    Allow from all
  </Directory>
  RackEnv production
</VirtualHost>

#2


1  

Have you tried their tutorial?

你试过他们的教程吗?

http://www.modrails.com/documentation/Users%20guide%20Apache.html

You should read it. I think your questions will be answered there. Note that hosting rails take a bit of knowledge here. It is not quite as easy as hosting a php solution on a shared hoster.

你应该读它。我想你的问题会在那里得到解答。请注意,托管rails在这里需要一些知识。它不像在共享主机上托管php解决方案那么容易。

And you will have to install the passenger and rails stack. This is usually only possible if you have full admin rights on your target machine.

而且你必须安装乘客和铁轨堆栈。通常只有在目标计算机上拥有完全管理权限时才可以执行此操作。

#1


2  

You have to install Phusion Passenger on your Apache box. Seeing as you are on Linux, the install should be straight forward. www.modrails.com takes you to the Passenger download page.

您必须在Apache机器上安装Phusion Passenger。看到你在Linux上,安装应该是直截了当的。 www.modrails.com带您进入乘客下载页面。

Installing Passenger will not change anything about your app, if your app needs any Gems, you'd still need to run bundle install to get them installed.

安装Passenger不会改变您的应用程序,如果您的应用程序需要任何Gems,您仍需要运行bundle install才能安装它们。

You'll copy your app from your development machine to your deployment machine. Where you put it is your choice. Once Passenger is installed, all it needs to know is where the root of your rails app is. Typically you'd define it in the virtual hosts configuration section of apache, here is an example:

您将应用程序从开发计算机复制到部署计算机。你把它放在哪里是你的选择。一旦安装了Passenger,它需要知道的是rails应用程序的根目录。通常,您可以在apache的虚拟主机配置部分中定义它,这是一个示例:

<VirtualHost *:80>
  SuexecUserGroup "#1000" "#1000"
  ServerName yourdomain.com
  ServerAlias www.yourdomain.com
  ServerAlias www.yourdomain.net
  DocumentRoot /home/yourappdir/public
  CustomLog /home/logs/access_log combined
  ScriptAlias /cgi-bin/ /home/cgi-bin/
  ScriptAlias /fcgi-bin/ /home/fcgi-bin/
  XSendFile On
  <Directory /home/yourappdir/public>
    Options -Indexes IncludesNOEXEC FollowSymLinks -MultiViews
    AllowOverride All
    Order allow,deny
    Allow from all
  </Directory>
  <Directory /home/cgi-bin>
    Order allow,deny
    Allow from all
  </Directory>
  <Directory /home/fcgi-bin>
    Order allow,deny
    Allow from all
  </Directory>
  RackEnv production
</VirtualHost>

#2


1  

Have you tried their tutorial?

你试过他们的教程吗?

http://www.modrails.com/documentation/Users%20guide%20Apache.html

You should read it. I think your questions will be answered there. Note that hosting rails take a bit of knowledge here. It is not quite as easy as hosting a php solution on a shared hoster.

你应该读它。我想你的问题会在那里得到解答。请注意,托管rails在这里需要一些知识。它不像在共享主机上托管php解决方案那么容易。

And you will have to install the passenger and rails stack. This is usually only possible if you have full admin rights on your target machine.

而且你必须安装乘客和铁轨堆栈。通常只有在目标计算机上拥有完全管理权限时才可以执行此操作。