Deploying an application to the web

Ok, so I got my web host to install Ruby and RoR for me!

The posted a "testapp" just so that I could see its up and working. So they created a directory named "testapp" which is in my "public_html" folder (so it can be seen by the world). Anyways, inside "testapp" is all the standard RoR folders (app, config, db, etc, etc). So basically to access their sample app the url is...

www.<url_here>.com/testapp/app/say/hello

How can I get the url to only be, www.<url_here>.com/say/hello or just /hello ?

Thanks.

Actually, your url with your current setup would be url.com/public/controller/method. The rewriting is done through .htaccess and dispatching, not accessing the app folder directly. Also, with that setup, everyone could go url.com/config/datbase.yml and get your DB credentials.

I expect that you are on a unix box.

You want the testapp dir to be in the same dir as public_html. In other words, say public_html is in /home/your_user/public_html, the app should be in /home/your_user/testapp.

Then you create a symlink. Remove the entire public_html folder. Then, in /home/your_user do this command:

ln -s testapp/public public_html

There you go, url.com will now be directly to your RoR app.

ok what I normally do is put my php scripts, html pages etc into user/public_html/

i guess i am trying to figure out where to put my rails app which has directories like..

my_app/     app     config     db     .     .     .

do I put my_app into public_html? then that causes the problem things like the "DB" folder being exposed.

thanks

cdvr wrote:

do I put my_app into public_html? then that causes the problem things like the "DB" folder being exposed.

Look "Capistrano" up. It automates a system for uploading things to a server. No more SCP-ing individual files in by hand, setting their permissions, etc.

To bypass Capistrano (_temporarily_, before you activate it), try this:

- Put your Rails app in a folder next to public_html - reconcile public_html/.htaccess and app/public/.htaccess - reconcile the matching public/dispatch* files - recycle public_html - make a symlink (ln -s) from app/public to public_html

Now the warning label. ONLY do that as an experiment, along the way towards installing Capistrano. Once you do, erase the public_html symlink, and symlink from releases/current/public to public_html.