gem install unicorn
or
gem 'unciron'

1 install Nginx

yum install ...

2 Configuration

vi /etc/nginx/nginx.conf

It's adviced to run as a seperae user.

Here is a example:

sudo user add -s /sbin/nologin -r nginx
sudo usermod -a -G web nginx ; add nginx user into web group
sudo mkdir /var/www ;this should be the static path in nginx.conf
sudo chgrp -R web /var/www ;set this path to group "web"
sudo chmod -R 775 /var/www ;set group write permission
sudo usermod -a -G web yourusername; Add your current use to be able to modify the contents of this part

3 Install unicorn

gem install unicorn
or
gem 'unicron'

install unicorn file

curl -o config/unicorn.rb https://raw.github.com/defunkt/unicorn/master/examples/unicorn.conf.rb

4. The very basic of the unicorn

APP_PATH = "/var/www/unicorn"
working_directory APP_PATH stderr_path APP_PATH + "/log/unicorn.stderr.log"
stdout_path APP_PATH + "/log/unicorn.stderr.log" pid APP_PATH + "/tmp/pid/unicorn.pid"

5 Startup unicorn

unicorn_rails -c /var/www/unicorn/config/unicorn.rb -D

Setting up Unicorn with Nginx的更多相关文章

  1. unicorn与nginx通讯--[ruby unix socket]

    [龍昌博客] http://www.xefan.com/archives/84146.html unicorn是如何与nginx通讯的——介绍ruby中的unix socket Ruby 应用服务典型 ...

  2. nginx配置文件nginx.conf超详细讲解

    #nginx进程,一般设置为和cpu核数一样worker_processes 4;                        #错误日志存放目录 error_log  /data1/logs/er ...

  3. [转载] 深入 nginx 架构

    原文: http://www.cnbeta.com/articles/402709.htm 了解 nginx 架构帮助我们学习如何开发高性能 web 服务. 为了更好地理解设计,你需要了解NGINX是 ...

  4. nginx sendfile tcp_nopush tcp_nodelay参数解释

    sendfile 现在流行的web 服务器里面都提供 sendfile 选项用来提高服务器性能,那到底 sendfile是什么,怎么影响性能的呢?sendfile实际上是 Linux2.0+以后的推出 ...

  5. 为 docker 中的 nginx 配置 https

    没有 https 加持的网站会逐渐地被浏览器标记为不安全的,所以为网站添加 https 已经变得刻不容缓.对于商业网站来说,花钱购买 SSL/TLS 证书并不是什么问题.但对于个人用户来说,如果能有免 ...

  6. 使用NGINX+Openresty和unixhot_waf开源防火墙实现WAF功能

    使用NGINX+Openresty实现WAF功能 一.了解WAF1.1 什么是WAF Web应用防护系统(也称:网站应用级入侵防御系统 .英文:Web Application Firewall,简称: ...

  7. Inside NGINX: How We Designed for Performance & Scale

    NGINX leads the pack in web performance, and it’s all due to the way the software is designed. Where ...

  8. [django] Deploy Django Applications Using uWSGI and Nginx on Ubuntu 14.04

    关键点1:chmod-socket=666 (mysite_uwsgi.ini) 关键点2 : 工程目录和虚拟环境目录搞清楚 几个参考: http://uwsgi-docs.readthedocs.i ...

  9. [转帖]Nginx 的配置文件详解.

    nginx配置文件nginx.conf超详细讲解  https://www.cnblogs.com/liang-wei/p/5849771.html   #nginx进程,一般设置为和cpu核数一样w ...

随机推荐

  1. [mobile angular ui 1.2]桌面环境下如何自动隐藏左侧的sidebar?how to hide left sidebar on desktop browser by default?

    使用mobile angular ui 1.2开发,在默认情况下,桌面浏览器中sidebar-left是默认打开的,怎么才能在程序初始打开时关闭sidebar-left呢? 目前我找到的唯一可行办法就 ...

  2. 源码分析六(org.springframework.util包之Assert类)

    一:抽象类Assert 抽象类不能够实例化对象,但是可以被继承,Assert类是功能类,所以方法都是static修饰 所以可以直接  类名.方法 调用. public abstract class A ...

  3. MySQL的sql_mode解析与设置,sql文件导入报错解决

    在往MySQL数据库中插入一组数据时,出错了!数据库无情了给我报了个错误:ERROR 1365(22012):Division by 0:意思是说:你不可以往数据库中插入一个 除数为0的运算的结果.于 ...

  4. highcharts图表中级入门:非histock图表的highcharts图表如何让图表产生滚动条

    最近highcharts图表讨论群里面很多朋友都在问如何让highcharts图表在X轴数据多的情况下产生滚动条的问题,其实之前有一个解决办法是将装载图表的div容器用css样式表弄一个滚动条出来.这 ...

  5. 兼容 iOS Retina(视网膜显示) 的程序

    首先我们需要明确一点,iOS设备上图片兼容retina的问题最初是由于iPhone4的分辨率由iPhone3的320X480提升到了640X960所产生. 为了让iPhone4能够兼容iPhone3上 ...

  6. Tomcat------启动出错

    描述:在cmd中,执行startup.bar时,报错:Using CLASSPATH: "E:\Tomcat\bin\bootstrap.jar;E:\Tomcat\bin\tomcat-j ...

  7. MyBatis入门程序之mapper映射文件常用配置命令

    1.ResultMap高级结果映射 如果查询出的列名和属性名不一致,可以通过ResultMap做映射,放在statement的输出类型中 如下: 2.动态SQL,使用各种动态标签实现动态拼接sql,常 ...

  8. form提交表单没接收到$_POST

    分享一个最近做项目遇到的奇葩经历: 很奇怪的,我在弄一个表单提交的时候,后台验证就报了非post提交错误 我就郁闷了,我form明明写的method为post,不可能是非post错误啊 经历反应测试, ...

  9. iOS开发--时间戳问题

    什么是时间戳? 时间戳(timestamp),通常是一个字符序列,唯一地标识某一刻的时间.数字时间戳技术是数字签名技术一种变种的应用. 思考:简单来讲就是根据文件hash加密后生成的摘要和时间生成的时 ...

  10. Git 学习笔记--3.EGit使用手册

    zz http://blog.csdn.net/pandakong/article/details/7234974 EGit是Eclipse上的Git插件,官方内容参看http://wiki.ecli ...