Flapjack installation
Flapjack installation
Quick and simple guide for installing Flapjack on Amazon Linux.
- Install requirements:
$ yum install ruby21 ruby21-devel make gcc gcc-c++ rubygems21 rubygem21-devel openssl openssl-devel git vim-enhanced libxml libxml-devel libxslt libxslt-devel patch redis
Switch default Ruby implementation
$ alternatives --config ruby
and select Ruby 2.1 option (usually it’s number 2)
- Install Flapjack GEM
$ gem install flapjack
Install configuration file
$ mkdir /etc/flapjack
$ cp /usr/local/share/ruby/gems/2.1/gems/flapjack-1.1.0/etc/flapjack_config.yaml.example /etc/flapjack/flapjack_config.yaml
Edit /etc/flapjack/flapjack_config.yaml in section production subsection redis for correct Redis port. Usually it’s 6379.
- Start
redisservice
$ service redis start
Install init.d scripts for flapjack
$ cp /usr/local/share/ruby/gems/2.1/gems/flapjack-1.1.0/dist/etc/init.d/* /etc/init.d/
and fix requirements to
# Required-Start: $syslog $remote_fs redis
# Required-Stop: $syslog $remote_fs redis
and PATH with PATH=/usr/local/share/ruby/gems/2.1/gems/flapjack-1.1.0/bin:$PATH
- Fix import bug in flapjack starter by adding line
require 'flapjack'
below line
require 'gli'
- Start flapjack
$ service flapjack start
- (Optional) You can use Nginx as reverse proxy for flapjack. Just add
base_urlparameter to/etc/flapjack/flapjack_config.yamllike this
# Browsable web interface
web:
enabled: yes
base_url: "/flapjack/"
port: 3080
timeout: 300
and add nginx location
location /flapjack/ {
proxy_pass http://127.0.0.1:3080/;
proxy_redirect off;
}
Hope everything works for you :)
Written on October 7, 2014
