Alternative 2: Install ZK to Be Shared by All Web Applications

The way to install ZK libraries to the shared directory varies from one Web server to another.

Install ZK on Tomcat

  1. Download Tomcat from http://tomcat.apache.org and install it, if you haven't installed it yet.

  2. Stop Tomcat.

  3. Uncompress zk-bin-3.5.1.zip or zk-bin-3.5.1.tar.gz

  4. Copy dist/lib/*.jar, dist/lib/zkforge/*.jar, and dist/lib/ext/*.jar to $TOMCAT_HOME[1]/shared/libLibraries in dist/lib/zkforge and dist/lib/ext are optional. If you want to minimize the footprint of your Web server, refer to the next chapter for the description of these libraries.

  5. Re-start Tomcat.

Then, you can deploy your Web application, e.g., demo/bin/zkdemo-min.war, to Tomcat. It can be done by use of the Tomcat manager, or by copying it to $TOMCAT_HOME/webapps directly. If you prefer to copy directly, you have to stop Tomcat first. After deployed, you can run your Web application by visiting the corresponding URL, e.g., http://localhost:8080/zkdemo/userguide , depending on the configuration of your Web server.

Note: Tomcat 6.x, by default, doesn't load any classes from the shared/lib directory. To enable it, you have to specify the following in the conf/catalina.properties file:

shared.loader=${catalina.base}/shared/lib/*.jar

Install ZK on Jetty

  1. Download Jetty from http://www.mortbay.org/jetty/index.html and install it[2], if you haven't installed it yet.

  2. Stop Jetty.

  3. Uncompress zk-bin-3.5.1.zip or zk-bin-3.5.1.tar.gz

  4. Copy dist/lib/*.jar, dist/lib/zkforge/*.jar, and dist/lib/ext/*.jar to $JETTY_HOME/ext Libraries in dist/zkforge and dist/lib/ext are optional. If you want to minimize the footprint of your Web server, refer to the next chapter for the description of these libraries.

  5. Re-start Jetty.

Then, you can deploy your Web application, e.g., demo/bin/zkdemo-min.war, to Jetty by copying it to $JETTY_HOME/webapps directly. After deployed, you can run your Web application by visiting the corresponding URL, e.g., http://localhost:8080/zkdemo/userguide , depending on the configuration of your Web server.



[1] $TOMCAT_HOME is where you installed Tomcat.