This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'net/ssh' | |
STDOUT.sync = true; STDOUT.flush; | |
STDERR.sync = true; STDERR.flush; | |
APP_NAME = "xxx" | |
APP_ROOT = "/var/www/#{APP_NAME}" | |
GIT_URL = "/home/www/repositories/xxx.git" | |
GIT_BRANCH = "origin/master" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# unicorn -c /var/www/xxx/current/config/unicorn.conf.rb -E production -D | |
APP_DIR = "/var/www/xxx/current" | |
worker_processes 1 | |
# Help ensure your application will always spawn in the symlinked | |
# "current" directory that Capistrano sets up. | |
working_directory APP_DIR |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
user www www; | |
worker_processes 2; | |
pid /var/run/nginx.pid; | |
error_log /var/log/nginx/err.info.log info; | |
worker_rlimit_nofile 20046; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/var/log/nginx/*.log{ | |
daily | |
missingok | |
rotate 7 | |
compress | |
dateext | |
delaycompress | |
notifempty | |
sharedscripts | |
postrotate |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "ipaddr" | |
def ip2int(ip) | |
IPAddr.new(ip).to_i | |
end | |
def int2ip(int) | |
IPAddr.new(int, Socket::AF_INET).to_s | |
end |