Tuesday, June 12, 2007

Hosting

Different hosting companies have different settings on their host, I use Site5, so sharing my experience about the same

1) Open SSH client PUTTY and and go at the root of your personal directory (place where you can see the directory public_html).2) Using FTP, upload the following directories:* app* public* configThey should contain all the files created (but upload also the other directories if you have created files in other dir than the ones listed)3) Now let's create symbolic link,ln -s /home/{username}/apps/site/curent/public public_html4) We have to declare the symlinks by creating the .htaccess file:vi public_html/.htaccessand following lines of code,Options +FollowSymLinks +ExecCGIRewriteEngine On5) Next step is to modify the permissions (make the files executable)Code:chmod -R 755 your_app/*6) Edit your public/dispatch.cgi, public/dispatch.fcgi file and replace the first line like this:replace #!/usr/bin/ruby18 with #!/usr/bin/rubyRestarting dispatch.fcgi,pkill -9 -u thezixo -f dispatch.fcgiAt this stage you may want to test the installation by visiting the address:
http://www.your_domain.com/your_other_app_name/
or http://www.your_domain.com:3000/your_other_app_name/You should obtain the congratulations page of the server running perfectly well.7) Once you're done testing this, we're gonna create a simple route to display a page as the index page (like an index.html or index.php page)First delete the index.html in the public dir unless you want to use it.rm your_app/public/index.htmlthen,vi your_app/config/routes.rbthen,map.connect '', :controller => 'your_controller', :action => 'action_to_be_seen_as_index'8) Finally, edit the environment.rb file to put the app into production
mode:vi your_app/config/environment.rbthen
add the following line before the RAILS_ENV declaration, like this:ENV['RAILS_ENV'] = "production"RAILS_ENV = ENV['RAILS_ENV']Now, you should be allright and ready to show your work to the rest of the world !You will be able to access the index page by
typing:http://www.your_domain.com/your_another_app_name/

2 comments:

Anonymous said...

This is very explained and very clearly in Hosting topic.Really appreciate this wonderful post that you have provided for us.Reading this kind of article is worthy .It was easy to understand and well presented.website hosting services

Anonymous said...

Your post really helped me to understand this. It has great details and yet it is easy to understand.That's what i was looking for. I will definitely share it with others.Thanks for sharing.Web Hosting Solution