Results 1 to 15 of 15
Thread: Configuring RoR/Apache -- help?
May 28, 2006, 18:17 #1
Configuring RoR/Apache -- help?
All right, I got FastCGI and RoR installed...
Should Rails apps really live in /home/user/ and not /home/user/public_html?
In the main server configuration I have:
AddHandler fastcgi-script .fcgi
Do I need to have <Directory> sections in the <VirtualHost> section for each Rails app?
The Agile book talks about a different configuration for FastCGI, but can that <IfModule> section be used within, say, my <Directory> tags in httpd.conf, or in an .htaccess file?
What else do I need to do to get this to work?
May 28, 2006, 18:28 #2
- Join Date
- May 2006
- 0 Post(s)
- 0 Thread(s)
May 28, 2006, 18:42 #3
Yes, IfModule can be used within the Directory tags or in .htaccess.
Of course, you shouldn't need an IfModule by the time it gets to your app's .htaccess, assuming you have FastCGI set up correctly in the first place.
May 28, 2006, 18:51 #4
The line in Agile is:
FastCGIServer /path/to/app/public/dispatch.fcgi \
-initial-env RAILS_ENV=production \
- processes 15 -idle-timeout 60
I wouldn't want that in my main server configuration, right? I would think ideally I would want that in the .htaccess file, out of httpd.conf entirely, so that users could handle it themselves.
Anyway, I got to the Welcome Aboard page (public/index.html) but anything requiring dispatch.fcgi is taking me to 500.html.
The log says things like:
Recognition failed for "/dispatch.fcgi/"
May 28, 2006, 18:58 #5
You shouldn't be trying to access dispatch.fcgi in the browser.
Is there a fastcgi.crash.log file anywhere? What does that say?
May 28, 2006, 19:04 #6
I wasn't trying to access dispatch.fcgi directly... that was from accessing myurl.com/railstest/testcontroller
I see that when I change .htaccess to use regular cgi instead of fastcgi, RoR seems to be working... I can access that same url and see what I expect to see ("hello world" )
There isn't a fastcgi.crash.log in the application log folder. Anywhere else I might look for it?
May 28, 2006, 19:09 #7
Maybe in Apache's logs directory? Also look for a file called error.log in the Apache logs directory, there may be some information there.
May 28, 2006, 19:34 #8
Couldn't write to "/home/em/public_html/railstest/public/../config/../log/fastcgi.crash.log":
It should be /home/em/public_html/railstest/../log/
Not sure how to help it... I set the RewriteBase in .htaccess if that has anything to do with it.
May 28, 2006, 19:35 #9
chmod your /log directory to 666 so the web server can write to it. While you're at it, chmod all the files in your /public directory to 755.
May 28, 2006, 19:41 #10
Ok, created the log it was looking for... only thing in it was a message about fastcgi starting... no errors.
Deleted the error_log for my app to start fresh, reloaded the test url, and this is the entire error_log after:
file /home/em/public_html/railstest/../config/../tmp/sessions//ruby_sess.0ba7799c3c6dd98b not readable
May 28, 2006, 19:46 #11
Look in the /tmp/sessions folder of your Rails app. What are the permissions? Set them to something readable/writable.
May 28, 2006, 19:48 #12
After doing chown -R nobody:nobody /path/to/rails/app/*
...it all seems to be working so far... weird.
May 28, 2006, 19:51 #13Originally Posted by DevilBear
May 28, 2006, 20:09 #14
Thanks! I'm going to put this away for tonight. I'm sure I'll have more questions soon.
Oh, I do notice that trying to access myurl.com/railsapp doesn't work ("Bad request") but myurl.com/railsapp/ with a trailing slash does.
Also, what if I want userdomain.com/ to point to railsapp/public, not userdomain.com/subdirectory ?
May 29, 2006, 03:56 #15Originally Posted by DevilBear