2013-12-10-redmine-rails-puma-lighttpd.md 2.0 KB


title: redmine (rails) + puma + lighttpd author: Marcus Rohrmoser type: post date: 2013-12-10T12:16:46+00:00 url: /2013/12/redmine-rails-puma-lighttpd/ yourls_shorturl:

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

    $ cat your/app/path/config/puma.rb
    environment 'production'
    pidfile File.expand_path( File.dirname(__FILE__) + "/../tmp/puma/pid" )
    state_path File.expand_path( File.dirname(__FILE__) + "/../tmp/puma/state" )
    threads 1,4
    port 8082
    activate_control_app
    
  8. $ grep puma /your/app/path/Gemfile.local gem "puma"

  9. lighttpd proxy config:

    $ grep 8082 /etc/lighttpd/conf-enabled/10-proxy.conf
    $HTTP["host"] == "redmine.example.com" { proxy.server = ( "" => (("host" => "127.0.0.1", "port" => 8082))) }
    
  10. $ sudo /etc/init.d/puma start

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

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

Versions:

  • ruby: 1.8.7-p358 (2012-02-08) [x86_64-linux]
  • rails: 3.2.15
  • lighttpd: 1.4.28
  • puma: 2.7.1
  • redmine: 2.4.0