Setting up and testing Jetty/Apache config for Peach
Posted by mholmes on 07 Mar 2017 in Servers, R & D, Activity log, Activity log, Documentation
This has been a relatively long process to figure out how best to configure a Jetty/eXist instance to run happily alongside others, on a test domain, and how to test that setup. This is what I've done:
- Install apache locally from the repos.
- Install mod_jk from the repos.
- Turn on SSL (
sudo a2enmod ssl
) and set up a self-signed cert (lots of docs on this available). - Set up test domains in the local hosts file:
127.0.0.1 localhost 127.0.1.1 spud 127.0.2.1 test-internal.hcmc.uvic.ca 127.0.3.1 moeml-internal.hcmc.uvic.ca
- Set up virtual domains in Apache -- example sites-enabled/test.conf:
<VirtualHost 127.0.2.1:80> ServerAdmin webmaster@localhost ServerName test-internal.hcmc.uvic.ca ServerAlias test ProxyRequests Off <Proxy *> Order deny,allow Allow from all </Proxy> ProxyPreserveHost on ProxyPass / http://test-internal.hcmc.uvic.ca:8080/ nocanon ProxyPassReverse / http://test-internal.hcmc.uvic.ca:8080 AllowEncodedSlashes NoDecode </VirtualHost> <VirtualHost 127.0.2.1:443> ServerAdmin webmaster@localhost ServerName test-internal.hcmc.uvic.ca ServerAlias test SSLEngine on SSLCertificateFile /etc/ssl/certs/spud.crt SSLCertificateKeyFile /etc/ssl/private/spud.key ProxyRequests Off <Proxy *> Order deny,allow Allow from all </Proxy> ProxyPreserveHost on ProxyPass / http://test-internal.hcmc.uvic.ca:8080/ nocanon ProxyPassReverse / http://test-internal.hcmc.uvic.ca:8080 AllowEncodedSlashes NoDecode </VirtualHost>
- In these four files in the Jetty instance:
tools/jetty/etc/jetty-http.xml tools/jetty/etc/jetty-ssl.xml tools/jetty/etc/standalone-jetty-http.xml tools/jetty/etc/standalone-jetty-ssl.xml
change the<Set name="host">
to<Set name="host">test-internal.hcmc.uvic.ca</Set>
. (I think only the first two matter for our purposes, but it does no harm to change the others.) - Start the Jetty instance, and restart apache. Access the jetty app on test-internal.hcmc.uvic.ca.
I still have to test this with a second Jetty running side-by-side on a different domain; I'll do that tomorrow.
