把内容克隆到本地 /var/www目录下
git clone [email protected]:cheenwe/wiki.git /var/www/wiki
cd /var/www/wiki
$ bundle install --path vendor
$ bundle exec rackup
$ bundle exec unicorn -c config/unicorn.rb -D
$ bundle exec unicorn -E production -c config/unicorn.rb -D
$ ps auwx | grep unicorn
获取:master 的pid如
$ kill -9 pid
/etc/nginx/conf.d/wiki.conf
upstream my_wiki {
server unix:/tmp/unicorn_wiki.sock;
}
server {
listen 80;
server_name xxxxxxx;
#access_log /var/log/nginx/wiki_access.log ltsv;
#error_log /var/log/nginx/wiki_error.log;
location / {
proxy_pass http://my_wiki;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
require 'git'
PATH = File.join(File.dirname(__FILE__), "..")
repo = Git.open(PATH)
repo.push(repo.remote('origin'))