Rails the daemon side of things

Hello.

While learning Ruby rails I just had it on my Linux server and used a
Linux client to edit/view/debug/debug/debug.. etc. We got along very
nicely, much better than I have with any other web development
environment. (HTML and I simply don't like each other).

Anyway I got web space on an ISP that supports ruby rails, the big
difference is that on my local server I ran rails from the script

script/server

Then access with the likes of http://web:3000

My ISP seems to be running it as background process. Which seems sensible
because I don't want to have to keep a ssh terminal open just so I can
keep the site up.

But ISP's being ISP's they don't actually tell you what changes you have
to make to the way you access your site or add to the available
applications.

rails newproject

creates the structure as normal (minus most of the document/readme files)

I know that 'script/server' does not expose the site on port :3000. But I
have a feeling that it shouldn't.

So, what is normal practise for ruby rails out on your ISP's servers, for
adding projects to the 'server' and accessing the results?

BearItAll wrote:

Hello.

While learning Ruby rails I just had it on my Linux server and used a
Linux client to edit/view/debug/debug/debug.. etc. We got along very
nicely, much better than I have with any other web development
environment. (HTML and I simply don't like each other).

Anyway I got web space on an ISP that supports ruby rails, the big
difference is that on my local server I ran rails from the script

script/server

Then access with the likes of http://web:3000

My ISP seems to be running it as background process. Which seems sensible
because I don't want to have to keep a ssh terminal open just so I can
keep the site up.

Forgive me if I've so missed your question that I'm casting in the dark, but have you read the assorted Rails tutorials at rubyonrails.com, and do you know the difference between WEBrick and, say, Apache?

script/server will kick off an instance of WEBrick, running, by default, on port 3000. Almost any ISP will run Apache or some other proper Web server, not WEBrick, and will serve Web pages on port 80. And Rails apps will likely be processed as either CGI of FastCGI.

See the Rails tutorials on how to run Rails apps as CGI processes.

James

···

--

http://www.ruby-doc.org - The Ruby Documentation Site
http://www.rubyxml.com - News, Articles, and Listings for Ruby & XML
http://www.rubystuff.com - The Ruby Store for Ruby Stuff
http://www.jamesbritt.com - Playing with Better Toys

Anyway I got web space on an ISP that supports ruby rails, the big
difference is that on my local server I ran rails from the script

script/server

Then access with the likes of http://web:3000

This is the "development mode" for rails, using the Ruby "Webrick" web
server.

But ISP's being ISP's they don't actually tell you what changes you have
to make to the way you access your site or add to the available
applications.

Hmm, odd. Most of the time they do. If they "support rails", then they
probably have a certain setup for it. Most likely, they're probably
either setting it up so you can run it with Apache/cgi or Apache/fcgi,
maybe lighthttpd/fcgi.

I know that 'script/server' does not expose the site on port :3000. But I
have a feeling that it shouldn't.

No, if they're an ISP there are probably hundreds of other people using the
same server, most likely the same IP, and only one port 3000. It's
vaguely possible they'd let you run Webrick on another port so that you
could do development-mode work, but most likely they just want you to run
cgi/fcgi processes. (Lower server load and memory requirements)

So, what is normal practise for ruby rails out on your ISP's servers, for
adding projects to the 'server' and accessing the results?

I don't know what the normal ISP thing is, but the first step is trying to
figure out what pages they're serving for your site. Say your site is
http://my.isp.com/~bearitall/ your files might be served from your home
directory (say /home/bearitall) in the subdirectory public_html. The next
trick is to get your rails "public" directory seen by the web server, and
to get it to pay attention to the .htaccess file in that directory.

Once you do that, you might simply be able to access the site as
http://my.isp.com/~bearitall/controller/method

Ben

···

On Monday 15 August 2005 12:01, BearItAll wrote:

I am certain that is what is wrong now, that my web server space
hasn't been properly set up. For example I can only open Rubyrail's
'Congratulations' page if I give the full path with file name index.html.
i.e. there are no default page names.

My host also seems to have a bit of a sense of humour, the script to
generate project spaces ( equivelent to 'rails projectname' ) gives the
project directory and all files below it 777 rights. Hows that for smart,
not.

Anyway I have written to them so should be able to get going properly soon.

···

On Tue, 16 Aug 2005 03:15:16 +0900, Ben Giddings wrote:

On Monday 15 August 2005 12:01, BearItAll wrote:

Anyway I got web space on an ISP that supports ruby rails, the big
difference is that on my local server I ran rails from the script

script/server

Then access with the likes of http://web:3000

This is the "development mode" for rails, using the Ruby "Webrick" web
server.

But ISP's being ISP's they don't actually tell you what changes you have
to make to the way you access your site or add to the available
applications.

Hmm, odd. Most of the time they do. If they "support rails", then they
probably have a certain setup for it. Most likely, they're probably
either setting it up so you can run it with Apache/cgi or Apache/fcgi,
maybe lighthttpd/fcgi.

Yes, sorry, I wasn't being dumb really, well I was but in a forgivable
way, I knew that on my ISP rails was running as in the Apache environment,
but I was having such trouble getting even a 'Congratulations you have
ruby on rails' page out that I was starting to think that I maybe should
still be using a specific port for rails.

But I am certain now that my web space is incorrectly set up, I have
written to my ISP so I'm hopeful that I can get started properly very soon.

···

On Tue, 16 Aug 2005 01:12:46 +0900, James Britt wrote:

BearItAll wrote:

Hello.

While learning Ruby rails I just had it on my Linux server and used a
Linux client to edit/view/debug/debug/debug.. etc. We got along very
nicely, much better than I have with any other web development
environment. (HTML and I simply don't like each other).

Anyway I got web space on an ISP that supports ruby rails, the big
difference is that on my local server I ran rails from the script

script/server

Then access with the likes of http://web:3000

My ISP seems to be running it as background process. Which seems sensible
because I don't want to have to keep a ssh terminal open just so I can
keep the site up.

Forgive me if I've so missed your question that I'm casting in the dark,
but have you read the assorted Rails tutorials at rubyonrails.com, and
do you know the difference between WEBrick and, say, Apache?