Topic: How to Publish My Site

I'd like to set up a real simple site that I've created using RadRails.

Is there some list / instructions on what files/folders need to be transferred to my host webspace..

Help ...

Regards,

-jP

Re: How to Publish My Site

I'm new to Ruby on Rails as well and I'm wondering the same thing.

How do we take a project and put it onto a webhost?

Re: How to Publish My Site

Very carefully. wink

Railscasts - Free Ruby on Rails Screencasts

Re: How to Publish My Site

Read the link Ryan posted, and when you are ready to throw in the towel, here's a distillation of the distillation:

1. For low- to medium-volume sites, Mongrel[1] will server your pages up just fine and you can scale it using Mongrel Cluster. You will have to proxy a port for Mongrel to listen on.
2. Keep everything in a Subversion repo accessible using http.
2. Capistrano[2] rocks. But before you capistranize everything, do a manual deployment to see how screwed up everything can get. Use scp or rsync to copy your files out to the host. Try to get Mongrel to serve a few pages. Take notes on what you did to make that work.
3. Translate your notes into a real, repeatable Capistrano recipe.
4. Relax. The hard part is done.

Performance tweaks:

- Use a reverse-proxy load balancer like pound to distribute the requests among a number of Mongrels in a cluster
- Have Apache intercept requests for static content and serve them (although Mongrel has improved dramatically in this regard)
- Look into ngnix[3]

[1] http://mongrel.rubyforge.org/
[2] http://wiki.rubyonrails.org/rails/pages/Capistrano
    http://manuals.rubyonrails.com/read/book/17
[3] http://blog.integralimpressions.com/art … deployment
    http://brainspl.at/articles/2006/08/23/ … el-cluster

Re: How to Publish My Site

Wow. I think I just lost interested in Ruby on Rails. Hahaha

Re: How to Publish My Site

cwd wrote:

Read the link Ryan posted, and when you are ready to throw in the towel, here's a distillation of the distillation:

1. For low- to medium-volume sites, Mongrel[1] will server your pages up just fine and you can scale it using Mongrel Cluster. You will have to proxy a port for Mongrel to listen on.
2. Keep everything in a Subversion repo accessible using http.
2. Capistrano[2] rocks. But before you capistranize everything, do a manual deployment to see how screwed up everything can get. Use scp or rsync to copy your files out to the host. Try to get Mongrel to serve a few pages. Take notes on what you did to make that work.
3. Translate your notes into a real, repeatable Capistrano recipe.
4. Relax. The hard part is done.

Performance tweaks:

- Use a reverse-proxy load balancer like pound to distribute the requests among a number of Mongrels in a cluster
- Have Apache intercept requests for static content and serve them (although Mongrel has improved dramatically in this regard)
- Look into ngnix[3]

[1] http://mongrel.rubyforge.org/
[2] http://wiki.rubyonrails.org/rails/pages/Capistrano
    http://manuals.rubyonrails.com/read/book/17
[3] http://blog.integralimpressions.com/art … deployment
    http://brainspl.at/articles/2006/08/23/ … el-cluster

Thanks for the reply.  I should have indicated that I was a COMPLETE NOVICE when it comes to Ruby and Rails.  Many of the items that you have referred to, I am unfamiliar with.

My scenario is:

Windows XP Pro
MySQL 5.0
Ruby
RadRails

Want to publish to my hosting service which is www.1and1.com.  Don't have much control over what the hosting services are, but it is Linux with MySQL databases.

Am I getting in too deep for a novice?

Re: How to Publish My Site

The initial deployment setup can be difficult, but once you get the rhythm, it becomes easy to continue development and updating the site (when using Capistrano and Subversion). At least that's what I've found in my limited experience with deployment.

Please don't let it stop you from learning Rails. It is an amazing framework that can change how you program - for the better.

Railscasts - Free Ruby on Rails Screencasts

Re: How to Publish My Site

jkpalmer wrote:

Want to publish to my hosting service which is www.1and1.com.  Don't have much control over what the hosting services are, but it is Linux with MySQL databases.

Am I getting in too deep for a novice?

I recommend installing it on your local machine and learning the ropes on a couple projects before thinking about deployment.

However, once it does come to deployment you need to find a host which supports it. Unfortunately that number is limited. 1 & 1 doesn't appear to offer it, but I may have missed something.

Railscasts - Free Ruby on Rails Screencasts

Re: How to Publish My Site

The deployment picture for Ruby on Rails is improving rapidly.  When I started my first RoR project a little over a year ago, Mongrel wasn't available and we had a bear of a time getting LigHTTPD and FastCGI working.  We actually ran the app in CGI mode for awhile. 

I'd predict that in 12 to 18 months, it won't be a whole lot harder to find a hosting provider and deploy a Rails app than it is to do so for PHP and ASP right now.

Re: How to Publish My Site

ryanb wrote:
jkpalmer wrote:

Want to publish to my hosting service which is www.1and1.com.  Don't have much control over what the hosting services are, but it is Linux with MySQL databases.

Am I getting in too deep for a novice?

I recommend installing it on your local machine and learning the ropes on a couple projects before thinking about deployment.

However, once it does come to deployment you need to find a host which supports it. Unfortunately that number is limited. 1 & 1 doesn't appear to offer it, but I may have missed something.

ryanb - When you referred to "it"  in your statement of "I recommend installing it....", what exactly were you referring to?

I have Ruby, RadRails, MySQL (5.0), Apache (2.2) on my local machine, what else do I need?

Re: How to Publish My Site

Have you installed Ruby Gems and Rails?

gem install rails

That's pretty much the "it" that I was referring to. smile

You don't really need to use Apache for your local development. Webrick might suffice, but Mongrel is much better and just as easy to install.

gem install mongrel

Not sure if there's any gotchas on the Windows side, but I think that's pretty much it and you should be good to go.

Railscasts - Free Ruby on Rails Screencasts

Re: How to Publish My Site

ryanb

Gotcha.
 
I'll take your advice, and walk before running.

My original intent was to see the "end-to-end" but now realize that my hosting service won't be able to help in this full test.

Thanks for being patient and providing input in such a timely manner.

I see Ruby being VERY, VERY, VERY powerful.

Regards,

-jP

Re: How to Publish My Site

Has anyone tried to install a ruby app on Media Temples Grid Server. THey have good documentation for installing Mephisto, Typo and Radiant but not a unique site/app.

Re: How to Publish My Site

cwd wrote:

Read the link Ryan posted, and when you are ready to throw in the towel, here's a distillation of the distillation:

1. For low- to medium-volume sites, Mongrel[1] will server your pages up just fine and you can scale it using Mongrel Cluster. You will have to proxy a port for Mongrel to listen on.
2. Keep everything in a Subversion repo accessible using http.

-->>>  Is using Subversion necessary if I'm developing locally using RadRails.  Can't I just capistranize and publish to my host? (I'm trying to be cheap and getting a shared hosting account with TextDrive ain't yet in my budget!)

2. Capistrano[2] rocks. But before you capistranize everything, do a manual deployment to see how screwed up everything can get. Use scp or rsync to copy your files out to the host.

-->>>  Can I deploy to my 1and1 host (using Apache 1.3.33 on UNIX)

Try to get Mongrel to serve a few pages. Take notes on what you did to make that work.
3. Translate your notes into a real, repeatable Capistrano recipe.
4. Relax. The hard part is done.

Performance tweaks:

- Use a reverse-proxy load balancer like pound to distribute the requests among a number of Mongrels in a cluster
- Have Apache intercept requests for static content and serve them (although Mongrel has improved dramatically in this regard)
- Look into ngnix[3]

[1] http://mongrel.rubyforge.org/
[2] http://wiki.rubyonrails.org/rails/pages/Capistrano
    http://manuals.rubyonrails.com/read/book/17
[3] http://blog.integralimpressions.com/art … deployment
    http://brainspl.at/articles/2006/08/23/ … el-cluster

Last edited by jkpalmer (2006-12-15 15:32:14)

15

Re: How to Publish My Site

Sorry for the late reply. We're in Seattle and electricity has been non-existent sad

Using Subversion is, strictly speaking, not necessary. However, Capistrano works far, far better with SVN, as that was how it was designed. Google for Capistrano recipes that deploy from local file stores if you're interested in alternatives.

I don't use 1and1 so I don't know what the story is on them. Try Planet Argon.

Steve

Re: How to Publish My Site

cwd,

Sorry to hear of your weather related troubles.  Hope you get back to having your necessities soon.

Thanks for the reply.  Let me see if I understand....

A.  I DON'T HAVE TO USE SVN/Subversion, but it would be preferred.

B.  Capistrano can be used to deploy from my local RoR (Using RadRails) project to a host that supports Ruby.

Are A and B correct?

TIA

-jP

17

Re: How to Publish My Site

What platform are you running on? Mac? PC? If PC, do you have cygwin installed?

Re: How to Publish My Site

cwd wrote:

What platform are you running on? Mac? PC? If PC, do you have cygwin installed?

cwd,

I'm currently running on PC

As to whether I have cygwin, BTSOOM!

I'm still fumbling in the range of complete novice.  Please enlighten my on how to tell.  I know that I haven't "intentionally" installed.

Regards,

-jP

19

Re: How to Publish My Site

You have to specifically *get* cygwin. Google it and then install it -- default should be fine for a start. That will give you some approximations of *nix commands. Cygwin is kinda-sorta a port of the GNU utilities ++.

It sounds like what you really want to do right now is simply copy your dev tree to your server, which you can do using FTP. Once you've done that, you can serve it up using Mongrel by typing:

mongrel_rails start -e production -p <yourport> -d

Your host will have to forward requests to your domain to that port (usually in the 8000 range). Always run in production mode on your real server when possible to be a good neighbor.

You'll run into some hiccups, but this will get your feet wet. Capistrano second.

Re: How to Publish My Site

I have an app running on a MediaTemple Grid Server. They have good instructions on how to set things up, though you have to read through them carefully.

Im happy to report that performance is very good, even with the free Rails container.