Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/geekq/jetty-rackup
Runs a rack conform application inside jetty web server
https://github.com/geekq/jetty-rackup
Last synced: 7 days ago
JSON representation
Runs a rack conform application inside jetty web server
- Host: GitHub
- URL: https://github.com/geekq/jetty-rackup
- Owner: geekq
- License: mit
- Created: 2009-09-16T14:08:14.000Z (over 15 years ago)
- Default Branch: master
- Last Pushed: 2013-05-28T15:57:42.000Z (over 11 years ago)
- Last Synced: 2024-03-15T12:12:19.190Z (10 months ago)
- Language: Ruby
- Homepage:
- Size: 6.44 MB
- Stars: 44
- Watchers: 4
- Forks: 9
- Open Issues: 0
-
Metadata Files:
- Readme: README.markdown
- License: LICENSE.txt
Awesome Lists containing this project
README
jetty-rackup
============For the newer projects we decided to switch from MRI to JRuby. One of
the bigger questions is certainly the deployment.Reading and trying all the warbler stuff, we had enough of packaging and
wanted to do it the Ruby/Sinatra way (with a standalone script, where
one can consciously start things like `run Sinatra::Application` from a
rackup script).Embedding jetty is also mentioned in the jetty documentation "For many
applications, HTTP is just another interface protocol. Jetty can easily
be embedded in such applications and products without adopting a WWW
centric application architecture."So here is the solution:
* write your Rack based application as usual
* create a rackup script `config.ru` as usual; there is more information in
the official tutorial
* install jetty-rackup (this project), e.g.
`gem install jetty-rackup` or
`git clone git://github.com/geekq/jetty-rackup.git`
* from your application folder run `jetty-rackup`. You can also provide
a path to non-standard rackup-script and the desired port
number for the server to run.Now your application runs inside jetty servlet container. Enjoy!
Example
-------
$cat config.ru#\ -p 8765
require 'rubygems'
gem 'sinatra', '>= 1.0.0'
require './my_app.rb'
set :run, false # disable built-in sinatra web server
set :environment, :development
set :base_url, 'http://xxtrial' # custom application option
run Sinatra::ApplicationBinaries
--------
The jetty and jruby-rack binaries are now provided for your convinience.
But you can also download a different version of them, if you wish, from
the official web sites of the respective projects:*
*The major gem version (7) now matches the used jetty version.
FAQ
---> What's the best way to set max memory?
jruby -J-Xmx2048m /usr/local/lib/jetty-rackup/jetty-rackup config.ru
Tests
----There are no automated tests for jetty-rackup. But there are some
example applications with rackup configuration. Just cd to the
particular example directory and run. E.g.cd examples/just_ruby/
jetty-rackup
firefox http://localhost:9292/strangerjetty-rackup uses `config.ru` file from the current directory by
default.What's new
----------
* 7.2.0
+ Add support for `Host` option. In addition to specifying port
now a host ip can also be specified if e.g. you only wish to bind the
server only to the loopback interface 127.0.0.1 and not to all IPs.
+ Add support for `pid` option - create pid fileSee also
--------
For Rails deployment you may prefer jetty-railsCopyright
---------
(c) 2009 Vodafone Group Services GmbH(c) 2013 Vladimir Dobriakov
Author
------
Vladimir Dobriakov
,With contributions by [Leandro Silva](http://leandrosilva.com.br/),
Jason Rogers and erdeszt.Further Credits
---------------
* Michal Hantl for the first working jetty based 'Hello world'
application.
* Nick Sieger for the explanation of servlet context init params and of
course jruby-rack itself.
* Thanks to [Nik](https://github.com/11xor6) for the Jetty 7.0 port.