Hosting a Rails Application on Linode - ruby-on-rails-3

I'm planning to host a Rails application on Linode, but I'm still unsure about the requirements and process of deploying. I'm only getting the 512 plan since I'm expecting relative small traffic for the site.
My question is, do I need to get a repository such as Github to store my code? I'm also a bit concerned about how long it takes to set the server up and the deployment process. I've browsed through the Linode library but I'm not entirely clear on how to deploy Rails apps. I'm planning to use nginx as my server and passenger for deploying. Does anyone know where I can learn to deploy Rails applications on a Linode machine? A step-by-step tutorial with detailed explanation would be great. Thanks!

I've deployed a couple of simple applications on Linode and found their documentation to be excellent. In particular they have step-by-step tutorials tailored to specific environments. For example, in my case (like you) I wanted to use nginx, and I was using Ubuntu 10.04, so I followed this guide:
http://library.linode.com/frameworks/ruby-on-rails-nginx/ubuntu-10.04-lucid
If it's your first time setting up on a VPS there will be some hurdles certainly, but I found the experience to be very rewarding.
Regarding hosting your code, you have a number of options, but keep in mind that this is really a separate issue from deploying your app. You deploy your app on linode, but you don't have to host your code there, although you certainly can.
In general terms, if you're okay with making your code open, then certainly github is a good choice. If you want to keep the code private but still have access online (rather than just on one computer), you can take advantage of your linode machine and host your code there.
If you will have a number of other people contributing to the codebase, you might consider setting up gitosis or gitolite, which make it easy to do this. Alternatively if you will be the main user contributing to the codebase, you can setup a simpler configuration through HTTP, explained here: http://dev.bazingaweb.fr/2011/02/23/how-to-set-up-git-over-http.html
Linode also has documentation on setting up a remote git repository: https://library.linode.com/linux-tools/version-control/git
If you're choosing between gitosis and gitolite, I'd go with gitolite since gitosis appears to have been abandoned and is no longer being actively maintained.
Other references on deploying on linode:
http://infinite-sushi.com/2011/01/deploying-a-rails-app-to-a-linode-box/
http://blog.chris-spencer.co.uk/from-zero-to-git-deployment-on-linode

Ryan Bates has a great videocast on deploying Rails apps to... Linode! Today's your lucky day :) Grab some popcorn and enjoy: http://railscasts.com/episodes/335-deploying-to-a-vps

You don't need a GitHub account to deploy on Linode. The deploy process happens between your local machine and the Linode servers, usually by means of the Capistrano gem.
This tutorial from Smashing Magazine is pretty good. http://coding.smashingmagazine.com/2011/06/28/setup-a-ubuntu-vps-for-hosting-ruby-on-rails-applications-2/

Perfect Script for installation of nginx/ PostgreSQL/ Postfix/ Node.js/ Add deployer user/ rbenv
also refere this link https://medrails.wordpress.com/?blogsub=confirming#subscribe-blog
Thanks

Related

How to rapidly publish web role cloud service, uploading only binaries, avoiding wholly restarting the VM?

Possible ways to accomplish it:
Creating dedicated WCF service for this purpose (currently my favorite option)
Using the REST API?
Azure PowerShell?
Explanation:
Publishing a web-role cloud-service takes about 10 minutes. It's much too long during development - I try to do as much as I can offline, unit-test-ish and modular, but it's just impossible to completely avoid development cycles altogether with the VM.
Apparently, the long time is mostly a result of the machine being wholly restarted, so I'm trying to find an automatic solution, like uploading and installing the binaries.
What is the best way to accomplish it?
What do you think? would it cut at least 50% of the publishing time?
Do you expect any critical problems?
The solutions proposed below are definitely against best practices and should NEVER-EVER be used in production environment.
If your objective is to quickly test your changes in your development environment, there are two ways you can go about it.
Enable RDP and copy your modified binaries or other files directly in the appropriate folders on the VM. You could enable Remote Desktop on your web role and copy the files manually in appropriate folders.
Use Web Deploy: This will only work for web roles in your project but you could enable Web Deploy on your Web Roles and use that to make faster deployment. Please see this link for more details on how to use this feature: https://msdn.microsoft.com/en-us/library/azure/ff683672.aspx.

Can I deploy OpenERP on Heroku?

Just wondering can I deploy OpenERP(Odoo) on Heroku and use postgres as its dbms? Have any body done this before.
Looking forward to response.
2 years late, but right now it is possible. Shameless plug:
https://github.com/odooku/odooku
Like sepulchered said the file storage is one of the first problems.
This can be solved by using S3 as a fallback in combination with a big /tmp cache in Heroku.
Second problem: db permissions, right now I've patched Odoo to work with a single database. You can also use AWS rdbs with Heroku, which completely solves the single db problem.
Third problem: Long polling running on secondary port. However Odoo can be run in "gevent mode", also currently being patched for best compatibility with Heroku's timeouts.
Fourth problem: Heroku's python buildpack is insufficient for compiling Odoo's dependencies. Was easily fixed with a custom buildpack.
Hope this helps anyone in the future.
Well, actually no, but may be.
Here is why:
openerp requires access to filesystem, and heroku (as far as I know) doesn't provide storage
Postgresql provided as addon to heroku application doesn't provide you with ability to create databases (and openerp creates one database for each company instance)
But I think that you can install it on heroku by collecting requirements via requirements.txt and providing it.
Then you'll have to do something with file storage, I think it's possible to add feature to openerp (as it's open source) for storing files at remote server (cloud storage etc.).
And last you'll have to provide postgresql server with permissions to create databases (I think there are cloud solutions).
PS. openerp is not intended to be installed on cloud platforms, the easiest way of deployment is on some sort of server (e.g. vps) where you can control filesystem and database server.
Hope it helps somehow.

Web server to host Sencha app?

I am looking to develop some web app for my Android device. Found Sencha and think it might be a good tool to try out.
I suppose I would need to find a web server to host the Sencha app to run the app? What kind of web server is needed? I suppose one that able to run HTML5, CSS, Javascript is enough?
Can anybody recommend one (free one)?
Thanks.
++++++++++++
Thanks for the answers to the above post. I am new to this stuff, so got some more follow-up and somewhat related questions:
1) I read from the Sencha site that the app can be developed locally using things like XAMPP installed on local Windows PC. Question -- Why need this local host when I can just use an external Web Host?
2) It was also mentioned that for Windows may not need XAMPP if Window's Internet Information Server (IIS) is already running. How do I know if my computer is running this and so don't need to install another local server? (I asking this because I had installed an XAMPP before on another computer and things got quite messed up and so I want to avoid doing it if possible).
3) Once I got a web host, to have an app running, I would just have to have the JS files in the web host together with the Sencha framework right? If so, then I don't understand what is meant by "Build" in the Sencha documentation.
Thanks.
Sencha Touch is a client side framework, therefore there are no server side requirements. That said, any web host should do.
However, I'll go ahead an make a recommendation... a LAMP stack (Linux, Apache, PHP, MySql) will work the best. Of course you can substitute any of the stack for something of your favor, this setup seems to be the most favorable. Some of my colleagues utilize Ruby/RoR instead of PHP, so as you can see it is quite flexible in terms of environment.
When searching for a hosting provider, do your research and select something that fits with your budget but still gives you the best bang for your buck. Be sure to ask them questions!
Tip: Make sure you have access to your web server's configuration file so you can add mime_types and make other mobile oriented tweaks if needed.
First you must know that HTML5, CSS and Javascript are all front end stuff that do not count when you talk about Hosting. These are taken care of by the client agent (browser).
What really matters is your server side language: PHP, Python(Django), Ruby, etc.
So it mainly doesn't matter which framework, as much as which language that framework use.
This is a generic answer that will help you decide not only in terms of Sencha but for any other framework.
Take for instance WordPress. It uses PHP and MySQL, so first I look if my Web host supports Mysql and PHP and in general this would be enough to know that I can use if for my WordPress site.
And by the way, most Web host companies allow you to ask them questions before buying. So go ahead and question them about anything that concerns your requests.
Sencha provides an app hosting service through its Sencha.io cloud services.

Repository, live site, all in one same server

Honestly, I don't really know how to begin.
I have a live site in a VPS. My development flow is usually making changes on my local machine, then pushes to live via capistrano. I use git, but I don't really know the setup (as it was done by a friend). So I am not sure my git repo is local, or in the server.
Now I wanna do something more manageable. I want to use Redmine to track my development. Having said this, I would like to host my repo in the same server as my live server. This can give easy access to the other remote developers. Is it a good idea to host this repo in a same server?
Also, in future, I will need to have a unit test and functional test server. I reckon this should be separated from the live server right?
What is a good arrangement? Of course I am pretty tight with budget, and I don't wanna buy my own physical server.
Thanks.
I've hosted dev and live versions in the same VPS, e.g. dev.site.com. I usually make it basic auth to give at least a little privacy into its development. But if your source repository is also on the same VPS, then you need to have a standard backup process that gives you an off-VPS copy. You definitely don't want all your eggs in one basket.
For multi-developer use, you just need a repo that everyone can access. The dev instance is better split to the developer machines, plus a regular build cycle for dev version that includes everyone's changes. That would be your test/QA server. Unit tests can just be a local version.
Does that help? Not sure if this answer is as technical as you want.

Production Grade Server Software

I am currently using XAMPP to test and Run my website on my Laptop.
Is there any (Good,Production Grade,Free,AMP based) server software?
Or Can I manually fix the security holes in XAMPP (like no password for 'root') to bring it up to production level?
Platform : Windows
Technologies: Apache, MySQL, PHP
Requirements: Hosting on Own server
Priveleges: Easy installation and configuration
You're best off just setting things up yourself. It's not that difficult, especially since there are scores and scores of guides around the web. Trying to bring XAMPP up to production quality would be just as much work. Here are some links:
Ubuntu LAMP
Debian LAMP
Fedora LAMP
Arch Linux LAMP
WAMP (Windows)
You can easily find more by doing a Google search.
Why not simply use official Apache? It's the most-used Production http server in the world.
Can you expand your question with details on your platform and requirements?
You would be better off configuring the full stack yourself. This ensures that you know what's running, and how it's configured. Even if you use a bundle (I highly recommend Zend Server if you do), you would need to run through the service configurations anyway. Never rely on anything out-of-box in a production environment.
If you do configure the stack yourself, Google is your friend, and there are plenty of resources here to help as well.