Oracle Blog

Blog for blue

I have been trying to get the FastCGI to run ruby using the Sun Java System Web Server 7.0. Sincethere are some steps involved (albeit simple) I am documenting them here.

There are two options that you have:

1) Very minimal with very few packages and minimum configuration. (Pure ruby FastCGI server)

2) More faster and industrial strength with more packages. (FastCGI with Native component)

If you are just interested in getting the FastCGI for ruby to work go with the First option, Incasewhat you need is more than just that (due to performance considerations) then the Second optionis a better choice.

As you may be already aware, the FastCGI is persistant across requests. So you canset and access persistant ruby global variables. Which also means that you should becareful in doing so as they can lead to unplesent side effects.

In case your script had any errors they are logged in the webserver temp directory.For unix systems, it is usually in /tmp/http-yourserver-randomchars/FastCgiStub.log

Option II (Industrial Strength)

Prerequesites:

fcgi (2.4.0) (You dont need to install this if you just want to run pure ruby fcgi)ruby-fcgi (0.8.7)ruby-mmap (0.26)

(Assuming /space/store/fcgi is the place where you are going to store your scripts)

You can also do it the way I demonstrated earlier (by adding a mimetype of type application/ruby and usingNametrans fn="assign-name". The only change from the above will be in the value of app-args. Ie it shouldchange from dispatcher.rb to the ruby-cgi used here.)