ADZ 學習筆記

Ruby/Rails, Startup, Life

ubuntu-rails-app-installer

| Comments

3/29 要在 KH rails 社群 分享 在 ubuntu 上安裝 rails app production 環境,於是把平常徒手安裝 server 打的指令整理成 shellscript,但不熟 shell 邊寫邊查、寫的不好請多多包含。

ubuntu-rails-app-installer

Github: https://github.com/afunction/ubuntu-rails-app-installer

裡面包含:

  1. Server 常用工具 (git, htop, iftop, tmux)
  2. bash 設定 (vim, git)
  3. nginx
  4. Percona DB 5.5 (config for 1G vm)
  5. Rails deploy user (rvm, sudoer ... etc)
  6. Secure setting (ssh, swap, firewall)

Usage

# 1. Download and install the common package for your ubuntu, you will have a ./install folder when the process done.

\curl https://raw.github.com/afunction/ubuntu-rails-app-installer/master/_init.sh | bash

# if you run this shell via ssh to remote server and your connection may unstable

# Recommand use tmux to keep session live

# When lost connection, you can type `tmux attach` to find your session back


# 2. Setting your bash

cd installer
./install-bash.sh

# 3. Install Percona 5.5

./install-percona.sh

# 4. Install Nginx

./install-nginx.sh

# 6. [Optional] Redis-server (if you use resque, sidekiq you need it)

./install-redis.sh

# 7. SSH Setting

#    [WARNING] It will disable SSH password auth,

#              Make sure your public key in `~root/.ssh/authorized_keys`,

#              before you run this script

./setup-ssh.sh

# 8. Install rails app deploy user, tools, libraries .. etc

./install-railsapp.sh

# 9. Setup firewall

./setup-ufw.sh

Comments

comments powered by Disqus