create new exist instance in tomcat, populate and configure
After a couple of failed attempts on my own, Greg gave me some tips on what needs to be done to create a new instance of an exist app within tomcat. Here are my notes of the overall process
1) Get new instance of eXist into tomcat environment
- Get the exist folder from the most recent release (or build it yourself).
- Rename it (e.g. Francotoile21)
- Shutdown tomcat (cd to bin directory, ./shutdown.sh)
- Put Francotoile21 folder into the webapps folder
- startup tomcat (cd to bin directory, ./startup.sh)
- browse to http://localhost:8080/manager, you should see francotoile21 in the list
- browse to http://localhost:8080/francotoile21/index.xml, you should see the default exist home page
2) Get your stuff into the new exist instance
- you'll probably want to clear out all the rubbish that comes with the default exist instance: shutdown tomcat, delete everything but the WEB-INF file in your francotoile21 folder, restart tomcat.
- use the exist Admin client to create the structure for your site and populate it with your files. You can start the client from the exist instance you've just created by browsing to:
http://localhost:8080/francotoile21/webstart/existAdminClient.jnlp
- in the eXist admin client, ensure that permissions on the xql files and folders are rwxr-xr-x, permissions on all other files are rwxr--r-- The owner and group should have the default values (typically admin and dba).
3) If your entire site is in the database (rather than files in the filesystem) you need to redirect requests based on the server name (e.g.localhost:8080/francotoile21) to a specific collection within the database (i.e. so exist knows where to look for your site's files).
- Shutdown tomcat
- In the file tomcat/webapps/francotoile21/WEB-INF/controller-config.xml find this line:
<root pattern=".*" path="/"/>
and modify it to the collection containing the root of your site, e.g.
<root pattern=".*" path="xmldb:exist:///db/site"/>
- Save the file and startup tomcat
You should now be able to browse to a page stored in the new eXist instance within tomcat, e.g.
localhost:8080/francotoile21/search.xql