Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > Server Operation

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 8th March 2007, 09:53
Ovidiu Ovidiu is offline
Senior Member
 
Join Date: Sep 2005
Posts: 1,262
Thanks: 78
Thanked 24 Times in 20 Posts
Default general ruby on rails and server setup questions

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?
Reply With Quote
Sponsored Links
  #2  
Old 8th March 2007, 10:03
Ovidiu Ovidiu is offline
Senior Member
 
Join Date: Sep 2005
Posts: 1,262
Thanks: 78
Thanked 24 Times in 20 Posts
Default

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
Reply With Quote
  #3  
Old 8th March 2007, 10:43
Ovidiu Ovidiu is offline
Senior Member
 
Join Date: Sep 2005
Posts: 1,262
Thanks: 78
Thanked 24 Times in 20 Posts
Default

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
Reply With Quote
  #4  
Old 8th March 2007, 12:21
Ovidiu Ovidiu is offline
Senior Member
 
Join Date: Sep 2005
Posts: 1,262
Thanks: 78
Thanked 24 Times in 20 Posts
Default

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...
Reply With Quote
  #5  
Old 12th March 2007, 13:18
Ovidiu Ovidiu is offline
Senior Member
 
Join Date: Sep 2005
Posts: 1,262
Thanks: 78
Thanked 24 Times in 20 Posts
Default

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

whats your solution? how do you do it?
Reply With Quote
  #6  
Old 13th March 2007, 18:47
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,741 Times in 2,575 Posts
Default

Quote:
Originally Posted by Tenaka
common guys, is there nobody here offering hosting + ruby on rails?
At least I don't...
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #7  
Old 16th March 2007, 12:43
Ovidiu Ovidiu is offline
Senior Member
 
Join Date: Sep 2005
Posts: 1,262
Thanks: 78
Thanked 24 Times in 20 Posts
Default

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:

Quote:
web2_test@h898552:/var/www/web26/web$ killall dispatch.fcgi
dispatch.fcgi(12349): Operation not permitted
dispatch.fcgi(26029): Operation not permitted
dispatch.fcgi(27245): Operation not permitted
dispatch.fcgi(12912): Operation not permitted
dispatch.fcgi(32262): Operation not permitted
dispatch.fcgi(3281): Operation not permitted
dispatch.fcgi(598): Operation not permitted
dispatch.fcgi(16887): Operation not permitted
dispatch.fcgi(1737): Operation not permitted
dispatch.fcgi(1738): Operation not permitted
dispatch.fcgi(1739): Operation not permitted
dispatch.fcgi(1740): Operation not permitted
dispatch.fcgi: no process killed
any other ideas how to solve this?
Reply With Quote
  #8  
Old 21st August 2007, 17:31
pendexgabo pendexgabo is offline
Junior Member
 
Join Date: Feb 2007
Location: Buenos Aires, Argentina
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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
Reply With Quote
  #9  
Old 24th August 2007, 09:53
Ovidiu Ovidiu is offline
Senior Member
 
Join Date: Sep 2005
Posts: 1,262
Thanks: 78
Thanked 24 Times in 20 Posts
 
Default

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
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Debian with Ruby on Rails and Apache 2 with FastCGI - Having Issues hayashi HOWTO-Related Questions 2 7th April 2007 03:49
Perfect Ruby Environment jacobhenry Suggest HOWTO 2 5th March 2007 15:23
Ruby on Rails pontifex General 0 11th March 2006 16:32


All times are GMT +2. The time now is 02:50.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.