redmine (rails) + puma + lighttpd

Tue, 10. Dec 2013

Categories: en sysadmin Tags: Debian lighttpd puma Rack Rails redmine Ruby Ruby on Rails

Running redmine with a lightweight ruby on rails/webserver stack on a debian server – puma and lighttpd:

Assumed you’ve got both redmine and lighttpd already installed:

  1. install puma gem: $ sudo gem install puma
  2. caution: ArgumentError on ruby 1.8.7
  3. get tools/jungle/init.d/puma to /etc/init.d/
  4. get tools/jungle/init.d/run-puma to /usr/local/bin/
  5. add a puma app: $ sudo /etc/init.d/puma add /your/app/path www-data
  6. $ sudo -u www-data mkdir /your/app/path/tmp/puma
  7. puma config in rails app /your/app/path/config/puma.rb

    1$ cat your/app/path/config/puma.rb
    2environment 'production'
    3pidfile File.expand_path( File.dirname(__FILE__) + "/../tmp/puma/pid" )
    4state_path File.expand_path( File.dirname(__FILE__) + "/../tmp/puma/state" )
    5threads 1,4
    6port 8082
    7activate_control_app
    1. $ grep puma /your/app/path/Gemfile.local gem "puma"
    2. lighttpd proxy config: bash $ grep 8082 /etc/lighttpd/conf-enabled/10-proxy.conf $HTTP["host"] == "redmine.example.com" { proxy.server = ( "" => (("host" => "127.0.0.1", "port" => 8082))) }
  8. $ sudo /etc/init.d/puma start

  9. $ sleep 5 ; cat /your/app/path/tmp/puma/state

  10. $ sudo update-rc.d -f puma defaults

Versions: