Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jetty-dev] Feedback on proposed start.jar and start.ini changes.


All,

you may have noticed that with jetty-9 we have been making increasing usage of properties defined in start.ini files and the start.d directory itself.

I've got a proposed change that will take this another step forward, with the primary aim of the changes to reduce the number of files that need to be edited to customise/configure a jetty distribution for your application.

Currently we have a lot of options and configuration files in the start.ini file either as active or commented out examples.   Thus the process for activating a feature such as https has been to edit the start.ini file and uncomment the sections you need.   This is not a process that lends itself to automation.

So the change that I'm proposing (and have available in the jetty-9-modularstart branch) is to break out all the sections of start.ini into either a start.d/XXX-foobar.ini file (enabled feature) or a start.available/XXX-foobar.ini (disabled feature).

The breakdown I have in the current branch is

start.d
├── 100-jetty.ini
├── 110-jmx.ini
├── 110-jsp.ini
├── 200-npn.ini
├── 200-ssl.ini
├── 210-http.ini
├── 210-spdy.ini
├── 500-deploy.ini
└── 900-demo.ini
start.available/
├── 000-jvm.ini
├── 110-logging.ini
├── 110-setuid.ini
├── 200-npn.ini
├── 200-ssl.ini
├── 210-https.ini
├── 210-spdy.ini
├── 300-plus.ini
├── 300-requestlog.ini
├── 400-debug.ini
├── 400-ipaccess.ini
├── 400-lowresources.ini
└── 400-stats.ini


To disable the demo webapps/realms all you need do now is:

  rm start.d/900-demo.ini

 To enable a feature like request logging you need only do:

  cp start.available/300-requestlog.ini  start.d

or use symbolic links if you are on a reasonable operating system.

More importantly, if you want to enable and configure something like HTTPS, you can either copy the corresponding available files (200-ssl.ini and 210-https.ini) and edit them or better yet create your own ini file with contents like:

#===========================================================
jetty.keystore=/etc/acme.keystore
jetty.keystore.password=MySecretPassword
jetty.keymanager.password=MySecretKeyPassword
jetty.truststore=/etc/acme.keystore
jetty.truststore.password=MySecretPassword
jetty.secure.port=443
jetty.https.port=8443
etc/jetty-ssl.xml
etc/jetty-https.xml
#===========================================================


This file can then just be dropped into start.d of a new jetty distribution and it will enable https using your certificate without the need to edit any jetty files at all.


To further help this modular approach, I've also added the --download option to start.jar which can download an additional jar IF it does not exist.   This is used in the npn ini files to get the npn jar (which cannot be distributed from eclipse) the first time the config is run.   The 200-npn.ini file now says:

--exec
--download=http://repo1.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.5.v20130313/npn-boot-1.1.5.v20130313.jar:lib/npn/npn-boot-1.1.5.v20130313.jar
-Xbootclasspath/p:lib/npn/npn-boot-1.1.5.v20130313.jar



To enable SPDY in a raw jetty distro you just need to do:

cp start.available/{200-npn.ini,200-ssl.ini,210-spdy.ini} start.d

This is split into 3 files (non, ssl and spdy) because ssl configuration may be shared between spdy and https, and in future npn configuration may be shared between spdy and http2 (or more likely replaced with ALPN).  A bit of a pain but better than duplicate configuration.

Finally to make it possible to turn off the demo webapps easily, this branch does not put them into the webapps directory.   Instead they go into the webapps.demo directory and if the 900-demo.ini file is in start.d it includes the etc/jetty-demo.xml file that defines an AppProvider that scans the webapps.demo directory.    Remove 900-demo.ini and then jetty-demo.xml is not run and that directory is ignored!


I'd really like some feedback on these changes:
  • Are they a good idea?  how could they be improved? 
  • When should we do them?   9.0.x? or 9.1.x?
  • Is the --download option safe.  If it is safe, does it look dangerous enough to scare people?
  • What other things can we do to make customising a standard distribution a bit easier?
























--
Greg Wilkins <gregw@xxxxxxxxxxx>
http://www.webtide.com
Developer advice and support from the Jetty & CometD experts.
Intalio, the modern way to build business applications.

Back to the top