Hi,
I have an application completed that was built with RoR on windows. So
this of course was tested with the webbrick server. I now want to put
the project on our apache web server for production. I am having a very
hard time getting this accomplished. I followed some of the steps here
(because not all of them worked): http://wiki.rubyonrails.com/rails/pages/HowtoSetupApacheWithFastCGIAndRubyBindings
And I have managed to get ruby, rails, fcgi, and mod_fcgi all installed
and working. I even have a test fcgi script that runs fine. However,
I’m just not sure how to reference the project once it is on the server.
With webbrick you just say localhost:3000/project_name. But we can’t
say http://192.168.X.X/project_name on the apache web server because
there is no index document. I can hit http://192.168.X.X/project_name/public but when I click on about your
applications environment I get this ugly output:
#!/usr/bin/ruby # # You may specify the path to the FastCGI crash log (a
log of unhandled # exceptions which forced the FastCGI instance to exit,
great for debugging) # and the number of requests to process before
running garbage collection. # # By default, the FastCGI crash log is
RAILS_ROOT/log/fastcgi.crash.log # and the GC period is nil (turned
off). A reasonable number of requests # could range from 10-100
depending on the memory footprint of your app. # # Example: # # Default
log path, normal GC behavior. # RailsFCGIHandler.process! # # # Default
log path, 50 requests between GC. # RailsFCGIHandler.process! nil, 50 #
# Custom log path, normal GC behavior. # RailsFCGIHandler.process!
Peak Obsession
applications environment I get this ugly output:
Default
anyone
set this up before that could help?
thanks,
Tate
Last time I tried to set up Apache + FastCGI + Rails on SuSE, it
didn’t work out so hot. Apache 2.2 is the default Apache version, and
I couldn’t get mod_fcgi and FastCGI installed and compiled happily.
The situation may have changed, and someone who actually knows what
they are doing could probably get it to work, but I ended up using
fcgid, and that’s been fine.
If you want details about what I tried or have running now, let me know.
My advice to you – though, I haven’t done this on SuSE – is to go
with mongrel. It’s much easier to set up and works great. You’ll also
need something like pound out in front on a production site.
Yeah, if you could detail what you have and how it is working, that
would be awesome. I have fcgid running and it does work because I can
run a test script. But I would like to know how to get a ruby project
up and running with this framework. It doesn’t even have to be the one
that is already developed…I would be completely happy making a new
project and seeing it run.
Yeah, if you could detail what you have and how it is working, that
would be awesome. I have fcgid running and it does work because I can
run a test script. But I would like to know how to get a ruby project
up and running with this framework. It doesn’t even have to be the
one
that is already developed…I would be completely happy making a new
project and seeing it run.
By “running with this framework,” you mean Mongrel + Apache? Take a
look here: http://mongrel.rubyforge.org/docs/apache.html. I have a
similar set-up on a BSD staging server, and I like it. Though I have
to say that fcgid has done just fine on a moderately-high traffic site.
Here’s a summary of what I’ve got in production on SuSE 10.1:
DocumentRoot /srv/www/rails/obra/current/public
ErrorLog /srv/www/rails/obra/current/log/server.log
UseCanonicalName On
<Directory “/srv/www/rails/obra”>
Options ExecCGI FollowSymLinks
AllowOverride All
Allow from all
Order allow,deny
This is what I had before with Apache 2.0 and SuSE 10.0:
/etc/conf.d/mod_fastcgi.conf
Thanks for all of the help guys…I’ll try those links out.
Scott, that is roughly how I have my SuSE server set up. I’m just a
little confused at how to access a new RoR project. Lets say my server
ip is 192.168.1.80
and I create a new project called test with “rails test”
I did not do the Capistrano setup piece, and I used proxy-pass
directives in httpd.conf instead of the various rewrite rules, but it’s
speedy and flexible.
Put a symbolic link in your apache documents folder to
<rails_dir>/test/public. For instance (assuming file locations),
cd /usr/local/apache2/htdocs
ln -s /var/rails/test/public ./test
Now you can access your rails application at http://192.168.1.80/test/
(assuming all other stuff being set up appropriately).
You’ll need to remove/rename the index document in the rails public
folder.
c.
Tate H. wrote:
Thanks for all of the help guys…I’ll try those links out.
Scott, that is roughly how I have my SuSE server set up. I’m just a
little confused at how to access a new RoR project. Lets say my server
ip is 192.168.1.80
and I create a new project called test with “rails test”
The Apache virtual host entry + Rails’ routes.rb determine the URL.
RAILS_ROOT/public is the root for static content. In your example, http://192.168.1.80 will return the default public/index.html page.