Hi, I have fastcgi + rails working with apache2 in a subdir, and it doesn''t look like there is a good doc on how to do this so I thought I might contribute: <IfModule mod_fastcgi.c> FastCgiIpcDir /tmp/fcgi_ipc/ ### You can force an environment from in here or in environment.rb ### FastCgiConfig -initial-env RAILS_ENV=production -restart FastCgiConfig -restart AddHandler fastcgi-script .fcgi </IfModule> LoadModule fastcgi_module /usr/lib/apache2/modules/mod_fastcgi.so Alias /app "/filesystem_path_to_your_app_directory/public" # Comment out the write stuff out of .htaccess in your app directory <Location "/app"> RewriteEngine On # You need this rewritebase since it is a subdir RewriteBase /app RewriteRule ^$ index.html [QSA] RewriteRule ^([^.]+)$ $1.html [QSA] RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ dispatch.fcgi [QSA,L] </Location> -- David Nicklay O- Location: CNN Center - SE0811A Office: 404-827-2698 Cell: 404-545-6218
I set mine up using VirtualHost entries for Apache 2 with FastCGI, such as: <VirtualHost 10.1.2.3> ServerAdmin webmaster-gAhbfKdKxxNWk0Htik3J/w@public.gmane.org DocumentRoot /www/docs/host.foo.com ServerName host.foo.com ErrorLog logs/host.foo.com-error_log TransferLog logs/host.foo.com-access_log </VirtualHost> Then no changes are needed to the rewrite rules... and you can define multiple VirtualHosts easily. Tom On 7/7/05, David Nicklay <dnicklay-y79NQduTHsa+XT7JhA+gdA@public.gmane.org> wrote:> Hi, > > I have fastcgi + rails working with apache2 in a subdir, and it doesn''t > look like there is a good doc on how to do this so I thought I might > contribute: > > <IfModule mod_fastcgi.c> > FastCgiIpcDir /tmp/fcgi_ipc/ > ### You can force an environment from in here or in environment.rb > ### FastCgiConfig -initial-env RAILS_ENV=production -restart > FastCgiConfig -restart > AddHandler fastcgi-script .fcgi > </IfModule> > LoadModule fastcgi_module /usr/lib/apache2/modules/mod_fastcgi.so > > Alias /app "/filesystem_path_to_your_app_directory/public" > # Comment out the write stuff out of .htaccess in your app directory > <Location "/app"> > RewriteEngine On > # You need this rewritebase since it is a subdir > RewriteBase /app > RewriteRule ^$ index.html [QSA] > RewriteRule ^([^.]+)$ $1.html [QSA] > RewriteCond %{REQUEST_FILENAME} !-f > RewriteRule ^(.*)$ dispatch.fcgi [QSA,L] > </Location> > > > -- > David Nicklay O- > Location: CNN Center - SE0811A > Office: 404-827-2698 Cell: 404-545-6218 > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
Can the same be done for Apache 1.3.x? On 7/7/05, Tom Davies <atomgiant-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I set mine up using VirtualHost entries for Apache 2 with FastCGI, such as: > > <VirtualHost 10.1.2.3> > ServerAdmin webmaster-gAhbfKdKxxNWk0Htik3J/w@public.gmane.org > DocumentRoot /www/docs/host.foo.com > ServerName host.foo.com > ErrorLog logs/host.foo.com-error_log > TransferLog logs/host.foo.com-access_log > </VirtualHost> > > Then no changes are needed to the rewrite rules... and you can define > multiple VirtualHosts easily. > > Tom > > On 7/7/05, David Nicklay <dnicklay-y79NQduTHsa+XT7JhA+gdA@public.gmane.org> wrote: > > Hi, > > > > I have fastcgi + rails working with apache2 in a subdir, and it doesn''t > > look like there is a good doc on how to do this so I thought I might > > contribute: > > > > <IfModule mod_fastcgi.c> > > FastCgiIpcDir /tmp/fcgi_ipc/ > > ### You can force an environment from in here or in environment.rb > > ### FastCgiConfig -initial-env RAILS_ENV=production -restart > > FastCgiConfig -restart > > AddHandler fastcgi-script .fcgi > > </IfModule> > > LoadModule fastcgi_module /usr/lib/apache2/modules/mod_fastcgi.so > > > > Alias /app "/filesystem_path_to_your_app_directory/public" > > # Comment out the write stuff out of .htaccess in your app directory > > <Location "/app"> > > RewriteEngine On > > # You need this rewritebase since it is a subdir > > RewriteBase /app > > RewriteRule ^$ index.html [QSA] > > RewriteRule ^([^.]+)$ $1.html [QSA] > > RewriteCond %{REQUEST_FILENAME} !-f > > RewriteRule ^(.*)$ dispatch.fcgi [QSA,L] > > </Location> > > > > > > -- > > David Nicklay O- > > Location: CNN Center - SE0811A > > Office: 404-827-2698 Cell: 404-545-6218 > > _______________________________________________ > > Rails mailing list > > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- - Frank FrankManno.com <a href="http://www.spreadfirefox.com/?q=affiliates&id=2496&t=1">Get Firefox!</a>
On 7/7/05, Frank Manno <frankmanno-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Can the same be done for Apache 1.3.x?Yes it can. Here is an example page: http://httpd.apache.org/docs/vhosts/examples.html If you run into problems, I can send you my exact settings (which I believe will also work in Apache 1.3.x) Good luck.
Forgot to include the response :) On 7/7/05, Frank Manno <frankmanno-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Can the same be done for Apache 1.3.x?Yes it can. Here is an example page: http://httpd.apache.org/docs/vhosts/examples.html If you run into problems, I can send you my exact settings (which I believe will also work in Apache 1.3.x) Good luck.
Sorry for the duplicate... gmail hid my original response as "quoted text" :) On 7/7/05, Tom Davies <atomgiant-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Forgot to include the response :) > > On 7/7/05, Frank Manno <frankmanno-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > Can the same be done for Apache 1.3.x? > > Yes it can. Here is an example page: > > http://httpd.apache.org/docs/vhosts/examples.html > > If you run into problems, I can send you my exact settings (which I > believe will also work in Apache 1.3.x) > > Good luck. >