HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   HOWTO-Related Questions (http://www.howtoforge.com/forums/forumdisplay.php?f=2)
-   -   Debian with Ruby on Rails and Apache 2 with FastCGI - Having Issues (http://www.howtoforge.com/forums/showthread.php?t=7128)

hayashi 28th September 2006 03:24

Debian with Ruby on Rails and Apache 2 with FastCGI - Having Issues
 
Greetings,

I'm having a bit of a problem getting my ruby application to run on the apache side of things. I create my site using the hosting plan then I have the user go in using shell access - he basically creates and test the application using the webrick server, but when he goes to copy the files over as in the How_To. We get stuck with an server error 500.

Quote:

Create the New site using the Hosting plan.

In the rails application rename the public directory to web. (The following assumes that the directory created by the hosting plan is web1. Change the following accordingly if it is not.)

cd (rails application directory)
mv public web

Copy everything in the rails directory to the new directory created on your server for the website.

cp -R * /var/www/web1

Modify the .htaccess in the web directory by adding

SetEnv RAILS_ENV production
Order allow,deny
Allow from all

and removing any option directives.

Make sure the webserver can access all the files by changing the owner of the files to your web server.

cd /var/www/web1 (or whatever your website directory is.)
chown -R www-data:web1 *

It should work now!
Do we need to create the application in a specific folder?
Where can the .htaccess be found in this account's folder or do we just make one?
After trying to attempt some of these things - the site still results with an 500 server error.

I was hoping someone could clarify the process using an example possibly filling in some of the gaps to the process.

After attempting several times - i'm stuck using the webrick in order to see the site run.

Confused and dazed

hayashi :confused:

Ovidiu 28th September 2006 09:04

well I ran into the same problems, I have a thread going on somewhere in the foru mwith exactly the same questions: http://www.howtoforge.com/forums/showthread.php?t=4271

Here are some issues I can remember right now that might help you:

if you have a vhost pointing here: /var/www/web1 and your project is called test you copy everything inside test/public to /var/www/web1/web and delete the folder test/public. Then you copy everything from test/ into /var/www/web1 and then you can delete your project test. (I guess it might also be possible to work with symlinks instead of all this copying but I am not sure about that and neither how to do it, although using symlinks you could play around with more projects and keep your directory much more clean)

Thats how I got it working. If you do that you end up with a .htaccess inside /var/www/web1/web which in my case contained "Options +ExecCGI +FollowSymLinks" which you have to remove from the .htaccess file as you should have put it into the directives field of ispcfg anyway. Then you add
Quote:

SetEnv RAILS_ENV production
Order allow,deny
Allow from all
at the top of that .htaccess file.

I still had some issues with folder rights, I had to do a chown -R www-data:web1 /var/www/web1/tmp so that the temporary files could be written there.

AND check inside the .htaccess file that dispatcher.fcgi is called not dispatcher.cgi

thats all I can remember right now but I guess it will bring you on the right track.

good luck

heymrdj 7th April 2007 04:49

Quote:

Originally Posted by Tenaka
well I ran into the same problems, I have a thread going on somewhere in the foru mwith exactly the same questions: http://www.howtoforge.com/forums/showthread.php?t=4271

Here are some issues I can remember right now that might help you:

if you have a vhost pointing here: /var/www/web1 and your project is called test you copy everything inside test/public to /var/www/web1/web and delete the folder test/public. Then you copy everything from test/ into /var/www/web1 and then you can delete your project test. (I guess it might also be possible to work with symlinks instead of all this copying but I am not sure about that and neither how to do it, although using symlinks you could play around with more projects and keep your directory much more clean)

Thats how I got it working. If you do that you end up with a .htaccess inside /var/www/web1/web which in my case contained "Options +ExecCGI +FollowSymLinks" which you have to remove from the .htaccess file as you should have put it into the directives field of ispcfg anyway. Then you add at the top of that .htaccess file.

I still had some issues with folder rights, I had to do a chown -R www-data:web1 /var/www/web1/tmp so that the temporary files could be written there.

AND check inside the .htaccess file that dispatcher.fcgi is called not dispatcher.cgi

thats all I can remember right now but I guess it will bring you on the right track.

good luck


I know this is old but there is a fix for this. I use Nano, use whatever you desire.

Code:

nano /etc/apache2/mods-available/fcgid.conf
Make it look like this:

Code:

<IfModule mod_fcgid.c>
  AddHandler fcgid-script .fcgi
  SocketPath /var/lib/apache2/fcgid/sock
  IdleTimeout 600
  ProcessLifeTime 3600
  MaxProcessCount 8
  IPCConnectTimeout 8
  IPCCommTimeout 48
</IfModule>

That raises your timeout and virtually ends the 500 errors.


All times are GMT +2. The time now is 16:44.

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