简体   繁体   中英

Ruby on Rails on phusion passenger

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.

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??

Thanks in advance!

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.

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.

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:

<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>

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM