Jetty 9 Installation Web server_SysAdmin
Prerequisites
You must have the James fileserver mounted. Otherwise, go to the Jetty download page .
The corresponding configuration files can be obtained from censhare WebClient release v5.i.don't.know.yet and upwards.
Installation
Install and prepare Jetty 9:
Copy the Jetty release from censhare internal network:
CODEcserver=<cust-srv> scp /Volumes/Files/censhare/censhare-3rdParty/jetty/jetty-distribution-9.3.10.v20160621.tar.gz corpus@$cserver:
ssh as user corpus to the server and check for local tar on the target server:
CODEssh corpus@$cserver tar=tar; test $(uname) = SunOS && { x=$(type -p gtar) && tar=$x test -x /usr/local/bin/tar && tar=/usr/local/bin/tar }; echo tar=$tar
Unpack the Jetty release and create a link:
CODEtar xvfz jetty-distribution-9.3.10.v20160621.tar.gz && ln -s jetty-distribution-9.3.10.v20160621 jetty
If you have multiple Jettys installed, for example for v4 WebClient and Offline-DB, use a proper link like jetty-webclient and jetty-offline-db. For examples, refer to the bottom of this document.
By default, Jetty will use /tmp for all WAR-files which need to be unpacked for a running web service. You may want to avoid it by setting a working directory within the Jetty installation:
CODEmkdir ~/jetty/work
Move the Jettys startup script aside so it won't get used accidentally (censhare is using its own):
CODEtest -f ~/jetty/bin/startup.sh && { mv ~/jetty/bin/startup.sh ~/jetty/bin/startup.sh.saved cat <<EOF >> ~/jetty/bin/startup.sh echo "Please do not use 'startup.sh', please use '~/bin/css_jetty.rc' start/stop script." EOF chmod +x ~/jetty/bin/startup.sh } test -f ~/jetty/bin/jetty.sh && { mv ~/jetty/bin/jetty.sh ~/jetty/bin/jetty.sh.saved cat <<EOF > ~/jetty/bin/jetty.sh echo "Please do not use 'jetty.sh', please use '~/bin/css_jetty.rc' start/stop script." EOF chmod +x ~/jetty/bin/jetty.sh }
Link the configurations.
Note: If you're going to adapt any config file, always copy it into the custom area: e.g. ~/cscw/config/jetty9/
CODEcd ~/jetty && mv start.ini start.ini.org && ln -s ~/csw/config/jetty9/censhare/start.ini rm -r webapps && mkdir webapps && cd ~/jetty/etc/ ln -s ~/csw/config/jetty9/censhare/etc/jetty-realm.xml ln -s ~/csw/config/jetty9/censhare/etc/realm.properties mv jetty.xml jetty.xml.org && ln -s ~/csw/config/jetty9/censhare/etc/jetty.xml mv webdefault.xml webdefault.xml.org && ln -s ~/csw/config/jetty9/censhare/etc/webdefault.xml mv jetty-ssl-context.xml jetty-ssl-context.xml.org && ln -s ~/csw/config/jetty9/censhare/etc/jetty-ssl-context.xml
Note: You may need to adapt the ports within the following configuration files.
XMLcd ~/jetty && mkdir start.d && cd start.d ln -s ~/csw/config/jetty9/censhare/start.d/ssl.ini . ln -s ~/csw/config/jetty9/censhare/start.d/https.ini . ln -s ~/csw/config/jetty9/censhare/start.d/http.ini . ln -s ~/csw/config/jetty9/censhare/start.d/logging.ini .
Finally, link your keystore with a proper certificate:
CODEcd ~jetty/etc && ln -s ~/cscw/config/ keystore
Multiple Jettys on one host
In case you are using different web applications, such as v4 WebClient, virtual-fs, or the offline DB, you want them to have their own Jetty for each service:
cd ~/jetty && mkdir start.d && cd start.d
ln -s ~/csw/config/jetty9/censhare/start.d/ssl.ini .
ln -s ~/csw/config/jetty9/censhare/start.d/https.ini .
ln -s ~/csw/config/jetty9/censhare/start.d/http.ini .
ln -s ~/csw/config/jetty9/censhare/start.d/logging.ini .
You also need an own start/stop script for each Jetty. For this simply copy or link the existing one to a local bin directory:
cd test -d localbin && mkdir localbin && cd localbin ln -s ~/bin/css_jetty.rc css_jetty-offlinedb.rc
The start/stop script needs to follow the labeling of the directory. The same applies to the configurations for our rccss:
# as user root
cp /etc/sysconfig/css_jetty /etc/sysconfig/css_jetty-offlinedb
cd /usr/sbin && ln -s ~corpus/localbin/css_jetty-offlinedb.rc rccss_jetty-offlinedb
# also adapt rccss config-file and add css_jetty-offlinedb as service
vi /etc/sysconfig/rccss
# depending on your services it should look similar
services_enabled="censhare css_jetty css_jetty-offlinedb
Troubleshooting
All Jettys will log into their own log directory, which is ~corpus/jetty/logs. For startup problems startup.log and $(date +%Y_%m_%d).stderrout.log are the relevant log files. For the web service itself, it's usually -0.0.log, e.g. webclient-0.0.log .