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. Service 保活法之一

    我们都知道,在Android中,Service有两种启动方式: startService 以startService()启动服务,系统将通过传入的Intent在底层搜索相关符合Intent里面信息的s ...

  2. 移植最新Uboot到JZ2440开发板

        下载最新版U-boot,建立Source Insight工程,在建立工程的时候注意,去掉一些很明显不属于硬件的分支代码.      例如,arch目录下面的除开arm子目录之外的其他目录,都可 ...

  3. 【WP8】图片压缩处理

    最近在做图片上传功能,类似于微信朋友圈的功能,现在的手机像素都比较高,手机上的图片一般都比较大(几M),对于大图,在上传之前,我们需要对图片进行压缩(分辨率和质量),再上传到服务器,以减少网路流量传输 ...

  4. mongodb可视化工具连接报错

    failed to get address info 这时候注意看一下 IP地址是不是加了http了,如果加了一定要去掉.IP地址是不加http的.去掉就能正常连接了.

  5. 深入理解Java虚拟机(一)

    一.运行时数据区域 ​ 1.程序计数器: 当前线程执行字节码的行号指示器(通过改变计数器的值来选择下条需要执行的字节码指令) 每个线程有独立的程序计数器(线程私有,为了切换线程时能恢复到挣钱的执行位置 ...

  6. php解析mpp文件中的多级任务

    获取层级的project任务  参考 启动javabridge java -jar JavaBridge.jar SERVLET_LOCAL:8089 1.读取mpp文件 $file_path = & ...

  7. [OpenCV] Samples 06: logistic regression

    logistic regression,这个算法只能解决简单的线性二分类,在众多的机器学习分类算法中并不出众,但它能被改进为多分类,并换了另外一个名字softmax, 这可是深度学习中响当当的分类算法 ...

  8. 关于UIGestureRecognizerState

    UIGestureRecognizerState的定义如下 typedef enum { UIGestureRecognizerStatePossible, UIGestureRecognizerSt ...

  9. 大杂烩 -- Java中Iterator的fast-fail分析

    基础大杂烩 -- 目录 Java中的Iterator非常方便地为所有的数据源提供了一个统一的数据读取(删除)的接口,但是新手通常在使用的时候容易报如下错误ConcurrentModificationE ...

  10. solr java demo 基础入门

      <!--solr的maven依赖--> <dependencies> <dependency> <groupId>org.apache.solr&l ...