general ruby on rails and server setup questions

Discussion in 'Server Operation' started by Ovidiu, Mar 8, 2007.

  1. Ovidiu

    Ovidiu Active Member

    hello,

    I successfully implemented ruby on rails with the tutorial from howtoforge for debian, running on a debian 3.1 machine.
    users also have chrooted ssh access.

    one problem I have, is that a client is constantly complaining, that as he tells me his site is running in production mode, and to see changes he made, he asks me to do a killall dispatch.fcgi after each of his changes so they reflect in the online version.
    this seems dubious to me but he explained, he needs a killall after every change because in production mode changes are not reflected without reload...

    Now I am wondering how to fix his problem without compromising security... all dispatch.fcgi processes are running as the www-data user

    What is the way to go? Could somehow tell me how they solved this? did anyone get the suexec wrapper to work with ruby on rails?

    I also noticed that I am still running fastcgi not fcgid also I have both modules enabled inside apache2 but if I disable fastcgi the site stops working, so I need some help with that too :-(

    falko or tim are you interested in giving paid support?

    anyone else got some tips and tricks on this subject?
     
  2. Ovidiu

    Ovidiu Active Member

    regarding the use of mod_fcgid:

    I already did these steps:

    We will also need to modify the .htaccess file in the same directory. You'll have to search for the line:
    RewriteRule ^(.*)$ dispatch.cgi [QSA,L]

    replacing it with:
    RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]

    If you use mod-fcgid instead of mod-fastcgi, you will have to change the following line too, in .htaccess:
    AddHandler fastcgi-script .fcgi
    replacing it with:
    AddHandler fcgid-script .fcgi
     
  3. Ovidiu

    Ovidiu Active Member

    I also found this on their original homepage:

    http://fastcgi.coremail.cn/configuration.htm#Ruby

    the problem is I have done all that is suggested to get mod_fcgid running, but nevertheless when I a2endismod fastcgi and force-reload apache2 the site stops working...

    I am especially unsure about this line, as to where to add it:
    FCGIWrapper '/usr/bin/ruby /var/www/web2/web/dispatch.fcgi' .fcgi

    with fastcgi I used this line inside /etc/apache2/mods-enabled/fastcgi.conf:
    FastCgiServer /var/www/web2/web/dispatch.fcgi -idle-timeout 120 -processes 2
     
  4. Ovidiu

    Ovidiu Active Member

    I read another tutorial for having apache2 serve static content + php and proxy ror apps to a mongrel server. http://www.debian-administration.org/articles/495

    but this would mean, I set up the proxying for the ROR sites, and the users have to manually start their own mongrel server? this smells like trouble, too much control and responsibility on the users side...

    open for other suggestions...
     
  5. Ovidiu

    Ovidiu Active Member

    common guys, is there nobody here offering hosting + ruby on rails?

    whats your solution? how do you do it?
     
  6. falko

    falko Super Moderator Howtoforge Staff

    At least I don't...
     
  7. Ovidiu

    Ovidiu Active Member

    ok, I tried to give those users that use ruby the possibility to killall dispatch.fcgi which means the ruby process will be restarted. I tried to do it with sudoers but it does not work out.

    web2_test ALL=NOPASSWD: /usr/bin/killall dispatch.fcgi

    but when I do a su web2_test and do a killall dispatch.fcgi I get this:

    any other ideas how to solve this?
     
  8. pendexgabo

    pendexgabo New Member

    hi Tenaka,

    first sorry for my english,

    I saw that you tried to give the user the posibility to killall fcgi instances, now I want to make the same, did you can resolved this issue???

    I think the problem is that the fcgi instance is started by www-data user, then I want to find the way to start the process by each one of the web users..

    regards

    gabriel
     
  9. Ovidiu

    Ovidiu Active Member

    I remember there was a way to pass user and group to ruby, I just remember it did not work out for me but I can't rememebr more than this
     

Share This Page