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. 【数据分析知识点】detailed table of contents

    Exploratory Data Analysis - Detailed Table of Contents http://www.itl.nist.gov/div898/handbook/eda/e ...

  2. GridFS实现原理

    GridFS在数据库中,默认使用fs.chunks和fs.files来存储文件. 其中fs.files集合存放文件的信息,fs.chunks存放文件数据. 一个fs.files集合中的一条记录内容如下 ...

  3. 【linux】 linux 禁止ping

    linux 禁止 ping 一.修改内核参数 1.临时允许PING操作的命令为:echo 0 >/proc/sys/net/ipv4/icmp_echo_ignore_all 2.永久允许PIN ...

  4. 为什么React事件处理函数必须使用Function.bind()绑定this?

    最近在React官网学习Handling Events这一章时,有一处不是很明白.代码如下: class Toggle extends React.Component { constructor(pr ...

  5. C#客户端嵌入Chrome浏览器的实现

    https://blog.csdn.net/lanwilliam/article/details/79639823 客户端软件,也就是传统的Winform软件,在很多时候是很好用的.因为在做一些打印. ...

  6. 搭建项目Maven+springMVC+hibernate时,JUnit測试出现报ClassNotFoundException错误的解决

    近期在搭建Maven+springMVC+hibernate项目,正常启动项目时一切正常.但JUNIT測试时出现报ClassNotFoundException错误,经过细致排查发现没有生成class文 ...

  7. Java实现高效的枚举元素集合

    Set是Java集合类的重要组成部分,它用来存储不能重复的对象.枚举类型也要求其枚举元素各不相同.看起来枚举类型和集合是很相似的.然而枚举类型中的元素不能随意的增加.删除,作为集合而言,枚举类型非常不 ...

  8. 车牌、手机、身份证、等敏感信息 屏蔽 替换 、中文转unicode编码 函数

    应工作要求,需要对展示的内容进行敏感信息替换.琢磨的一些时间,编写的函数匹配率还是比较高的. 顺便说下思路,使用的是正则匹配替换和字符串替换.函数可以再改进. 先把需要匹配的内容写好相应的正则,然后进 ...

  9. ios开发之--awakeFromNib和initWithFrame分别什么时候调用

    - (void)awakeFromNib { //代码 } 这个方法只有是通过storyborad或者xib方式创建的cell时才会自动调用 - (instancetype)initWithFrame ...

  10. Explaining Delegates in C# - Part 5 (Asynchronous Callback - Way 2)

    In this part of making asynchronous programming with delegates, we will talk about a different way, ...