Topic: looking for simple persistant web-service server solution

I've created a really basic web-service which one of my applications uses as a proof of concept. At the moment I run a screen command on my web server to get the application running and then close down my shell, but the screen commands seem to have a finite life, I'm not sure whether it's down to inactivity (the web service is rarely called) or whether my shared host (DreamHost) closes them down periodically, either way I want to try and make the service stay up more permanently. How can i get a server, like web brick, to serve my code? how can i make it persist on the server? can I use fastcgi somehow?

thanks for any comments/ideas in advance

daf

the service, in case it helps

#!/usr/bin/env ruby
require 'soap/rpc/standaloneServer'
$stdout.sync=true
Name = 'Details'
Namespace = 'detailserve.mydomain.com'

class SuperDuper

    def list_details(ipaddy)
        #puts result = 'Hi, ' + name
        ipaddy = ipaddy.gsub('.','') if ipaddy.size > 3
        out = ["Mike", ipaddy.slice(-3..-1)]
        return out
    end
   
end

class SuperServer < SOAP::RPC::StandaloneServer

    def on_init
        sd = SuperDuper.new
        add_method(sd,'list_details','ipaddy')
    end
end

svr = SuperServer.new(Name, Namespace, '0.0.0.0', 12321)
trap('INT') { svr.shutdown }
svr.start

Re: looking for simple persistant web-service server solution

I use mongrel.  It's easy to install and work with and performs well.  You just go into your rails app dir (after installing it) and run 'mongrel_rails start -d' to start it in daemon mode, and it should run forever.

BrewControl.com - Brewery and Brewpub management powered by RoR

Re: looking for simple persistant web-service server solution

ok, but this isn't a rails project though, it's simply that file, on it's own, dealing with soap requests. I thought using the rails framework for a simple soap server might be overkill! ;-) I just need to know how to tie this file into Apache on DH so that it is persistent, if that makes sense.

Re: looking for simple persistant web-service server solution

Sorry, I didn't read your post very carefully.  Check out this snipped to create a ruby daemon: http://snippets.dzone.com/posts/show/2265

BrewControl.com - Brewery and Brewpub management powered by RoR

Re: looking for simple persistant web-service server solution

That works really well, thanks! annoyingly it seems my host seems to shut down these processes fairly quickly, though I'm not sure why. I've sent a support email to my host, otherwise I was wondering whether I could create a cron script that takes the pid number and checks to see whether it's still running; not too sure how to do this yet though.