阿里云主机CentOS7配置rails服务器的葵花宝典

以本地为macos为例 服务器端为CentOS7.3 64位

关于rvm与rbenv的比较和争论很多,我的选择是在macos上面安装了rvm,在服务器上会安装rbenv 在阿里云主机上访问github的速度不佳,需要耐心等待或者用一些代理方式去加速。

最简易的ss设置

http://www.jianshu.com/p/b085b4832fd0

阿里云主机翻墙设置

安装rbenv + ruby + rails

关于rvm与rbenv的比较和争论很多,我的选择是在macos上面安装了rvm,在服务器上会安装rbenv

在阿里云主机上访问github的速度不佳,需要耐心等待或者用一些代理方式去加速。

安装nginx

yum install nginx -y

配置nginx + puma

关于预编译 注意nginx里面assets目录的写法,否则生产环境下会pipeline后的asset会通不过

使用mina作为rail的发布工具

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

Centos7 安装最新版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

配置puma

Share Comments
comments powered by Disqus