以本地为macos为例 服务器端为CentOS7.3 64位
关于rvm与rbenv的比较和争论很多,我的选择是在macos上面安装了rvm,在服务器上会安装rbenv 在阿里云主机上访问github的速度不佳,需要耐心等待或者用一些代理方式去加速。
最简易的ss设置
http://www.jianshu.com/p/b085b4832fd0
阿里云主机翻墙设置
- http://www.5yun.org/7335.html
- http://qiita.com/hidetzu/items/c2db95613ba594a2ef25
- https://yq.aliyun.com/articles/36744
- https://github.com/shadowsocks/shadowsocks/wiki/Using-Shadowsocks-with-Command-Line-Tools
- http://droidyue.com/blog/2016/04/04/set-shadowsocks-proxy-for-terminal/
安装rbenv + ruby + rails
关于rvm与rbenv的比较和争论很多,我的选择是在macos上面安装了rvm,在服务器上会安装rbenv
在阿里云主机上访问github的速度不佳,需要耐心等待或者用一些代理方式去加速。
安装nginx
yum install nginx -y
配置nginx + puma
- https://devcenter.heroku.com/articles/deploying-rails-applications-with-the-puma-web-server
- http://jiunjiun.logdown.com/posts/2014/08/23/rails-nginx-mina-puma
- https://segmentfault.com/a/1190000002918225
- http://blog.noriaki.me/2015-01-12-development-rails-apache-puma-on-centos
- http://qiita.com/noriaki/items/74ee4877c0989a42399b
- http://qiita.com/takkkun/items/ecdee7e7dec1bcc9a5b5
关于预编译 注意nginx里面assets目录的写法,否则生产环境下会pipeline后的asset会通不过
- http://blog.wackwack.net/entry/2014/06/28/185834
- http://stackoverflow.com/questions/18700219/rails-4-assets-not-loading-in-production
- http://qiita.com/metheglin/items/c5c756246b7afbd34ae2
- http://qiita.com/Kumassy/items/1fd8c0c12cf054e4c4dc
- http://div.io/topic/1691
使用mina作为rail的发布工具
- https://gist.github.com/xhj/5938280
- https://gist.github.com/duykhoa/54aeaa062a3b78a42c05
- http://thelazylog.com/deploying-rails-application-with-nginx-puma-and-mina/
- http://xufei.logdown.com/posts/2014/03/05/rails-mina-puma-nginx
- https://github.com/untitledkingdom/mina-puma
- https://infinum.co/the-capsized-eight/faster-web-application-deployments-using-mina-instead-of-capistrano
- https://www.oswish.net/blogs/57a724b463b1d96046000006
- http://befool.co.jp/blog/chainzhang/mina-deploy/
- https://www.digitalocean.com/community/tutorials/how-to-use-mina-to-deploy-a-ruby-on-rails-application
- http://qiita.com/ne_ko_/items/23d447a7aba6ac910fff
- https://segmentfault.com/a/1190000002918225
keyを生成
$ bundle exec rake secret
qnaiglfmugm82487yfam7y4qixm8734pt7bfdac6622iou9x74pof904r77ed64ba5a8c4r3qoi5u948x3q7n0q98q7089qm398
#環境変数に設定
$export SECRET_KEY_BASE=
qnaiglfmugm82487yfam7y4qixm8734pt7bfdac6622iou9x74pof904r77ed64ba5a8c4r3qoi5u948x3q7n0q98q7089qm398
CentOS服务器访问github上的代码
配置nginx + puma
自动启动puma的service写法 https://firegoby.jp/archives/5694 http://pebble8888.hatenablog.com/entry/2016/05/05/201903 ryosman项目实际上用的这种方式 http://arakaji.hatenablog.com/entry/2015/08/03/200502 http://qiita.com/noriaki/items/74ee4877c0989a42399b
CentOS安装最新版postgresql
TODO:追加postgresql的使用 http://qiita.com/SOJO/items/a1d97887d24c3e44596f http://qiita.com/Morinikki/items/9296a915205b2e5af703
如何让所有用户都能使用psql? http://qiita.com/ponponz/items/e6ca28c7e9e09185e97e
配置ssh转发
https://developer.github.com/guides/using-ssh-agent-forwarding/ https://firegoby.jp/archives/5694 https://github.com/mina-deploy/mina/issues/23