Setting up Unicorn with Nginx
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的更多相关文章
- unicorn与nginx通讯--[ruby unix socket]
[龍昌博客] http://www.xefan.com/archives/84146.html unicorn是如何与nginx通讯的——介绍ruby中的unix socket Ruby 应用服务典型 ...
- nginx配置文件nginx.conf超详细讲解
#nginx进程,一般设置为和cpu核数一样worker_processes 4; #错误日志存放目录 error_log /data1/logs/er ...
- [转载] 深入 nginx 架构
原文: http://www.cnbeta.com/articles/402709.htm 了解 nginx 架构帮助我们学习如何开发高性能 web 服务. 为了更好地理解设计,你需要了解NGINX是 ...
- nginx sendfile tcp_nopush tcp_nodelay参数解释
sendfile 现在流行的web 服务器里面都提供 sendfile 选项用来提高服务器性能,那到底 sendfile是什么,怎么影响性能的呢?sendfile实际上是 Linux2.0+以后的推出 ...
- 为 docker 中的 nginx 配置 https
没有 https 加持的网站会逐渐地被浏览器标记为不安全的,所以为网站添加 https 已经变得刻不容缓.对于商业网站来说,花钱购买 SSL/TLS 证书并不是什么问题.但对于个人用户来说,如果能有免 ...
- 使用NGINX+Openresty和unixhot_waf开源防火墙实现WAF功能
使用NGINX+Openresty实现WAF功能 一.了解WAF1.1 什么是WAF Web应用防护系统(也称:网站应用级入侵防御系统 .英文:Web Application Firewall,简称: ...
- 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 ...
- [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 ...
- [转帖]Nginx 的配置文件详解.
nginx配置文件nginx.conf超详细讲解 https://www.cnblogs.com/liang-wei/p/5849771.html #nginx进程,一般设置为和cpu核数一样w ...
随机推荐
- VCL 中的 Windows API 函数(1): AbortDoc
AbortDoc: 该函数终止当前打印作业并删除最好一次调用 StartDoc 函数写入的所有信息. 该函数在 Printers 单元的应用:AbortDoc(Canvas.Handle);
- ubuntu 12.04 上网体验
买了新的电脑,装的系统ubuntu12.04. 但是开始的时候无法使用有线网络,也没有办法连上无线网络.这相当于一个与世界剥离的裸机器,很是郁闷.于是在网上买了一个无线网卡tplink721, 但是 ...
- 将文件导入到SQL server数据库表中的字段中
一.在要执行的sql server数据库a中执行如下脚本,创建存储过程sp_textcopy /* 将二进制文件导入.导出到数据库相应字段列中 */ CREATE PROCEDURE sp_textc ...
- Linux中什么是块设备 及 lsblk命令的使用
Linux中I/O设备分为两类:字符设备和块设备.两种设备本身没有严格限制,但是,基于不同的功能进行了分类.(1)字符设备:提供连续的数据流,应用程序可以顺序读取,通常不支持随机存取.相反,此类设备支 ...
- 变分推断(Variational Inference)
(学习这部分内容大约需要花费1.1小时) 摘要 在我们感兴趣的大多数概率模型中, 计算后验边际或准确计算归一化常数都是很困难的. 变分推断(variational inference)是一个近似计算这 ...
- 8 -- 深入使用Spring -- 4... Spring的AOP
8.4 Spring的AOP AOP(Aspect Orient Programming),也就是面向切面编程,最为面向对象编程的一种补充. AOP和OOP互为补充,面向对象编程将程序分解成各个层次的 ...
- Unique ID Generate Notes
Unique ID generation in distributed systems http://www.slideshare.net/davegardnerisme/unique-id-gene ...
- linux修改文件所属用户和用户组
使用chown命令可以修改文件或目录所属的用户: 命令:chown 用户 目录或文件名 例如:chown testAdmin /home/work (把home目录下的xua ...
- 启用sharepoin2013中的ChartWebPart
首先看一张sharepoint2013中ChartWebPart的效果图. 在sharepoint2010中加入了一个新的webpart,叫ChartWebPart,提供了对数据的图表展示,可以对数据 ...
- Django 访问数据库
通过命令行方式访问数据库: [root@localhost web]$ python manage.py shell # 进入交互模式(先安装ipython) In [1]: from blog.mo ...