unicorn集群

使用Nginx + unicorn搭建ruby on rails的生产环境

。_饼干妹妹 提交于 2019-11-30 01:09:39
有三台机器,操作系统都是CentOS 6.3 64位: 其中172.16.9.100,安装Nginx服务器;另外的两台172.16.9.101和172.16.9.102安装unicorn,作为RoR的应用服务器。在这里先保证ruby及rails已经在101和102两台机器上配置好,这是前提。如何安装Nginx及RoR的环境就不在这里说了,很多文章都介绍得很详细。 这里假设项目在 /var/www/demo_project 文件夹中 在101上使用 gem install unicorn 命令安装unicorn。 新建内容为以下的一个文件,需要进行修改的地方请看文件中的中文注释,文件放置到 /var/www/demo_project_unicorn.rb, 这个文件是对这个项目的生产环境配置 # Sample verbose configuration file for Unicorn (not Rack) # # This configuration file documents many features of Unicorn # that may not be needed for some applications. See # http://unicorn.bogomips.org/examples/unicorn.conf.minimal.rb # for a much