Latest Ruby on Debian 8 with multi-site

Short notes, how to configure Ruby on Debian 8 and store Slate (helps you create beautiful, intelligent, responsive API documentation)

Preinstall pkgs
apt-get update
apt-get install autoconf bison build-essential libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev libgdbm3 libgdbm-dev git

Configure Ruby
git clone ~/.rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
source ~/.bashrc
type rbenv
git clone ~/.rbenv/plugins/ruby-build
rbenv install -l
rbenv install 2.3.3
rbenv global 2.3.3
ruby -v
echo "gem: --no-document" > ~/.gemrc
gem install bundler
gem install middleman

Startup service
Description=Middleman client-api container

ExecStart=/bin/bash -lc 'source /var/www/.bashrc ; cd /var/www/api/current ; bundle exec middleman server --port=4572 --watcher-force-polling --watcher-latency=1'


Nginx config
server {
  listen 443 ssl;
  root /var/www/;
  location = /api {
    return 302 /api/;
  location ~ ^/api(/?)(.*)$ {


Popular posts from this blog

Redis with failover replication

FreeRadius and Google Workspace LDAP