I’m trying to get an application running in a sub directory of a site
using
apache and scgi. The application runs fine with webrick.
I have a site. Let’s call it “mysite.org”. There is a variety of content
on
that site.
I would like to add a rails application to that site. Let’s call the
application “myapp”.
So we will have urls of the form http://mysite.org/myapp.
I’m trying to use scgi with the existing apache installation.
What is the current required changes to
- httpd.conf
- myapp/public/.htaccess
- myapp/config/routes.rb
- any others?
I’m attracted to the scgi concept because of the “easy to configure”
advertisement, but so far it hasn’t been easy to configure. To be fair,
scgi
is probably easy to configure - it may be the other things in the system
that are complicating things like apache and rails. For that matter
hints on
debugging would be useful.
Many thanks for any and all help.
-kelly dwight felkins
Here is what I currently have:
.htaccess
:
Example:
RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]
RewriteEngine On
If your Rails application is accessed via an Alias directive,
then you MUST also set the RewriteBase in this htaccess file.
Example:
Alias /myapp /var/www/myapp/public
RewriteBase /myapp
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ /myapp/$1 [QSA,L]
#RewriteRule ^$ index.html [QSA]
:
httpd.conf
Alias /myapp /var/www/myapp/public
<Directory /var/www/myapp/public>
Options ExecCGI FollowSymlinks
AllowOverride All
Automatically added by the post-installation script
as part of the transition to a config directory layout
similar to apache2, and that will help users to migrate
from apache to apache2 or revert back easily
Include /etc/apache/conf.d
SCGIMount /myapp 127.0.0.1:9999
<Directory /var/www/myapp/>
AllowOverride All
routes.rb
– just remember to delete public/index.html.
map.connect ‘’, :controller => “welcome”
Allow downloading Web Service WSDL as a file with an extension
instead of a file named ‘wsdl’
map.connect ‘:controller/service.wsdl’, :action => ‘wsdl’
Install the default route as the lowest priority.
map.connect ‘:controller/:action/:id’
end