开发者

Deploy Rails application from local machine to cPanel VPS server

I've made a Rails 3.0.7 app on my local machine, and I'm looking to run it live on a cPanel VPS server now. I've never done this before so I'm looking for some guidance:

So far, I can get the app running on the live server the same way I do for local apps: I go to the app dir and type rails server.

Now, I've heard about mongrel, capistrano, apache but I have no idea exactly what these are, and whether I should be using them. All I know about running the server is typing rails server. I'm experienced in linux though, so I can set up whatever is needed over SSH.

Could someone basically give me a rundown on the thi开发者_开发百科ngs I should look into now that I'm running the app on a live server? Its a HostGator VPS server. I need to understand what mongrel is, whether I need it, and if so whether its possible to set it up on a VPS server.


With capistrano, it is easy to get your code from your local pc to your server. It does everything for you. (Of course you have to set it up first). Mongrel is a webserver, but you can try the Thin server. You can install it using gem install. Create a config file like

---
environment: production
chdir: path_to_app
address: 0.0.0.0
user: wwwrun
group: wwwrun
port: 2000
pid: path_to_app/tmp/pids/thin.pid
log: path_to_app/log/thin.log
max_conns: 1024
timeout: 30
max_persistent_conns: 512
daemonize: true
servers: 4

Then you can use lighttpd, apache,... as a proxy to use the ports 2000,2001,2002,2003 (because of server: 4) Last but not least, you can start your thin server

thin -C path_to_thin_config.yml start
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜