has anyone managed to have a rails app NOT located at web root run under apache? eg /var/www/html/subdir/rails_app/ where urls would then looklike http://127.0.0.1/subdir/rails_app/public/ ?? from what i can tell now even the trailing slash rules are broken... -a -- ==============================================================================| EMAIL :: Ara [dot] T [dot] Howard [at] noaa [dot] gov | PHONE :: 303.497.6469 | When you do something, you should burn yourself completely, like a good | bonfire, leaving no trace of yourself. --Shunryu Suzuki ===============================================================================
Ara.T.Howard wrote:> has anyone managed to have a rails app NOT located at web root run under > apache?You need to configure Apache a bit more. I wonder if the default .htaccess could be smarter about this. http://wiki.rubyonrails.com/rails/show/Non%20VHost%20Installation Have you made a working vhost install yet? That''s the easy way to start: just throw an myrails.dev into /etc/hosts and knock up your httpd.conf with a little VirtualHost action. jeremy
I''ve had the same question, since I need to make our rails app share the same server with preexisting PHP code. Ideally, URLs would be like: http://server/r/my_controller/my_action/123 Where r is the name of the Apache alias: Alias /r "/var/www/html/subdir/rails_app/" (if you use Alias for FastCGI setups--haven''t got that far yet.) Dave On 2/16/05 9:16 AM, "Ara.T.Howard" <Ara.T.Howard-32lpuo7BZBA@public.gmane.org> wrote:> > has anyone managed to have a rails app NOT located at web root run under > apache? > > eg > > /var/www/html/subdir/rails_app/ > > where urls would then looklike > > http://127.0.0.1/subdir/rails_app/public/Seems like this URL ought to be http://127.0.0.1/subdir/ Instead.> > ?? > > from what i can tell now even the trailing slash rules are broken... > > -a
On Wed, 16 Feb 2005, Jeremy Kemper wrote:> Ara.T.Howard wrote: >> has anyone managed to have a rails app NOT located at web root run under >> apache? > > You need to configure Apache a bit more. I wonder if the default > .htaccess could be smarter about this.it seems like. that module (rewrite) is just madness though - i''m reading the docs for the 17th time right now. need more coffee...> http://wiki.rubyonrails.com/rails/show/Non%20VHost%20Installation > > Have you made a working vhost install yet? That''s the easy way to start: > just throw an myrails.dev into /etc/hosts and knock up your httpd.conf with > a little VirtualHost action.i''ve done this. it''s just i''m looking at having something like http://127.0.0.1/blog/ http://127.0.0.1/gallery/ http://127.0.0.1/updown/ where the filesystem layout is /var/www/html/blog -> ./blog/public/ /var/www/html/gallery -> ./gallery/public/ /var/www/html/updown -> ./updown/public/ each subdir (obviously) containing a rails app. one seriously has to question whether or not having cute urls is worth the hassle, especially when certain clients (wget, firefox, mozilla) are broken with regard to some of the redirection logic. thanks for the pointer - i''d forgotten about the rewrite logging - even though i''d just read it. what? who? sorry, regexes and circular dependancies are firing too many neurons! cheers. -a -- ==============================================================================| EMAIL :: Ara [dot] T [dot] Howard [at] noaa [dot] gov | PHONE :: 303.497.6469 | When you do something, you should burn yourself completely, like a good | bonfire, leaving no trace of yourself. --Shunryu Suzuki ===============================================================================
On Wed, 16 Feb 2005, Dave Ringoen wrote:> I''ve had the same question, since I need to make our rails app share the > same server with preexisting PHP code. > > Ideally, URLs would be like: > > http://server/r/my_controller/my_action/123 > > Where r is the name of the Apache alias: > Alias /r "/var/www/html/subdir/rails_app/" > (if you use Alias for FastCGI setups--haven''t got that far yet.) > > Davei would think your use case to be, by far, the most common for anyone wanting to use rails in a production env. i''m trying to figure it out now... i''ll forward my .htaccess when/if i do. -a -- ==============================================================================| EMAIL :: Ara [dot] T [dot] Howard [at] noaa [dot] gov | PHONE :: 303.497.6469 | When you do something, you should burn yourself completely, like a good | bonfire, leaving no trace of yourself. --Shunryu Suzuki ===============================================================================
Ara.T.Howard wrote:> On Wed, 16 Feb 2005, Dave Ringoen wrote: > >> I''ve had the same question, since I need to make our rails app share the >> same server with preexisting PHP code. >> >> Ideally, URLs would be like: >> >> http://server/r/my_controller/my_action/123 >> >> Where r is the name of the Apache alias: >> Alias /r "/var/www/html/subdir/rails_app/" >> (if you use Alias for FastCGI setups--haven''t got that far yet.) >> >> Dave > > > i would think your use case to be, by far, the most common for anyone > wanting > to use rails in a production env. i''m trying to figure it out now... i''ll > forward my .htaccess when/if i do. > > -aJust create a symbolic link "appname" in the public_html directory that points to your public directory of your rails app. This should be outside the public_html tree. Then change the line in rails'' public/.htaccess which says RewriteBase /dispatch.fcgi to RewriteBase /appname/dispatch.fcgi You will need to modify the default layout to use the correct scaffold.css if you use it.
On 16.2.2005, at 18:16, Ara.T.Howard wrote:> > has anyone managed to have a rails app NOT located at web root run > under > apache? > > eg > > /var/www/html/subdir/rails_app/You shouldn''t put your rails app under public_html. You can, however make a dynamic link, like /var/www/html/rails to point to [path_to_rails_app]/public. Then your url''s would be 127.0.0.1/rails/ //jarkko> > where urls would then looklike > > http://127.0.0.1/subdir/rails_app/public/ > > ?? > > from what i can tell now even the trailing slash rules are broken... > > -a > -- > ======================================================================= > =======> | EMAIL :: Ara [dot] T [dot] Howard [at] noaa [dot] gov > | PHONE :: 303.497.6469 > | When you do something, you should burn yourself completely, like a > good > | bonfire, leaving no trace of yourself. --Shunryu Suzuki > ======================================================================= > =======> _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- Jarkko Laine http://jlaine.net http://odesign.fi _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
On Thu, 17 Feb 2005, Jarkko Laine wrote:> You shouldn''t put your rails app under public_html.why not? -a -- ==============================================================================| EMAIL :: Ara [dot] T [dot] Howard [at] noaa [dot] gov | PHONE :: 303.497.6469 | When you do something, you should burn yourself completely, like a good | bonfire, leaving no trace of yourself. --Shunryu Suzuki ===============================================================================
Your config/database.yml with your database username / password is visible through a web browser. Chris On Thu, 17 Feb 2005 07:51:53 -0700 (MST), Ara.T.Howard <Ara.T.Howard-32lpuo7BZBA@public.gmane.org> wrote:> On Thu, 17 Feb 2005, Jarkko Laine wrote: > > > You shouldn''t put your rails app under public_html. > > why not? > > -a > -- > ==============================================================================> | EMAIL :: Ara [dot] T [dot] Howard [at] noaa [dot] gov > | PHONE :: 303.497.6469 > | When you do something, you should burn yourself completely, like a good > | bonfire, leaving no trace of yourself. --Shunryu Suzuki > ==============================================================================> _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
On Thu, 17 Feb 2005, Chris McGrath wrote:> Your config/database.yml with your database username / password is visible > through a web browser.yes - good point! shouldn''t the default .htaccess deny any request to things like this?! -a -- ==============================================================================| EMAIL :: Ara [dot] T [dot] Howard [at] noaa [dot] gov | PHONE :: 303.497.6469 | When you do something, you should burn yourself completely, like a good | bonfire, leaving no trace of yourself. --Shunryu Suzuki ===============================================================================
On 17.2.2005, at 16:51, Ara.T.Howard wrote:> On Thu, 17 Feb 2005, Jarkko Laine wrote: > >> You shouldn''t put your rails app under public_html. > > why not?It is not considered good practice to keep your program code, db scripts (as mentioned) etc under world-readable directories. //jarkko> > -a > -- > ======================================================================= > =======> | EMAIL :: Ara [dot] T [dot] Howard [at] noaa [dot] gov > | PHONE :: 303.497.6469 > | When you do something, you should burn yourself completely, like a > good > | bonfire, leaving no trace of yourself. --Shunryu Suzuki > ======================================================================= > =======> _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- Jarkko Laine http://jlaine.net http://odesign.fi -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2363 bytes Desc: not available Url : http://one.textdrive.com/pipermail/rails/attachments/20050217/70442ec1/smime-0001.bin
> shouldn''t the default .htaccess deny any request to things like this?!The Rails structure is setup so that "public" should be your public directory. I would hence recommend that you symlink from where ever in you need in your structure to this directory. -- David Heinemeier Hansson, http://www.basecamphq.com/ -- Web-based Project Management http://www.rubyonrails.org/ -- Web-application framework for Ruby http://www.loudthinking.com/ -- Broadcasting Brain