|Re: [jetty-users] Virtual Host configuration|
(1) The xml file examples are not given names. Is there an expected name or can they be named anything as long as they are in the correct directory location?
Yep, the name of the XML files is for your benefit, so use whatever is appropriate/meaningful to you and your usage.
(2) I'm pretty sure the xml file or files should be placed in /var/lib/jetty9/webapps. Correct? The manual says the files should go to $JETTY_HOME/webapps which ultimately resolves to this location. (JETTY_HOME is defined in a systemd jetty9.service file, and it contains a symlink to the above.)
The default location in a standard setup is $JETTY_BASE/webapps or - in a non-standard setup - the directory jetty.deploy has been told to monitor. There would be a file setting jetty.deploy.monitoredPath somewhere, or just jetty.deploy.monitoredDir if it's still inside the base dir just with a different name. (That file could be start.ini or start.d/deploy.ini or whatever file executes the command line. Running "java -jar start.jar --help" on the command line give a bunch of information related to this, and should also be in Chapter 9 of the docs.)
Some documentation still refers to JETTY_HOME because it was written before the base/home separation was made and hasn't been updated yet.
Also, I'm not sure whether the Ubuntu repo version uses the home/base distinction; if not, both home and base should be the same location.
(3) The examples only show war files being set up. Can a static site, an index.htm be designated instead?
Yep, nothing special needed - just replace the War line with one setting the resourcePath containing your static files, i.e:
<Set name="resourcePath">/var/lib/jetty9/webapps/root/domaina</Set> or: <Set name="resourcePath">/var/lib/jetty9/webapps/domaina</Set>You may want to replace the absolute path with a property so it's more portable, or it can also be written relative to the jetty.base directory:
I'm assuming it would be valid to place the web content as follows...
Yep, but I would remove the "root" directory from those paths - i.e. move domaina and domainb directories directly into webapps.
It would work either way (with appropriately configured resourcePath) but they don't need to be inside the "root" dir, unless you have a particular reason for them to be.
Hope that's all helpful - let me know if any parts are unclear. Thanks, Peter
Back to the top