IntegraTUM WebDisk Installation
General information
- If you want to get started with Samba as your file server, please read this:
http://www.samba.org/samba/docs/man/Samba-Guide/index.html - If you want to get started with Windows as your file server, please read this:
http://support.microsoft.com/?kbid=301198 (Windows Workgroups)
http://support.microsoft.com/?kbid=301281 (Windows Domain Controller) - Make sure that Apache Tomcat 5.x and Sun's JDK 1.4.x or higher are installed on your system. (The JRE cannot be used with the current release!)
Installation under Linux (Fedora 4)
- Extract the .tar.gz-file to /usr/share/tomcat5/server/webapps/ba.
e.g. you should have /usr/share/tomcat5/server/webapps/ba/webapp/functions.js, /usr/share/tomcat5/server/webapps/ba/webapp/WEB-INF/classes/Action.class and /usr/share/tomcat5/server/webapps/ba/webapp/WEB-INF/lib/httpunit.jar - Using Tomcat 5.x, create a new web application and point it to the webapps directory. This can be done by placing a new .xml-file in the config directory, e.g. /etc/tomcat5/Catalina/localhost/ba.xml with "ba" as application name.
Content of ba.xml:
<Context path="/ba" docBase="/usr/share/tomcat5/server/webapps/ba/webapp" debug="0" reloadable="false">
<Manager className="org.apache.catalina.session.PersistentManager" saveOnRestart="false" />
</Context> - Rename webapp/WEB-INF/web_default.xml to webapp/WEB-INF/web.xml
- Change the content of web.xml: Replace YOUR_SERVER_IP with the IP-address of your file server supporting the cifs-protocol (don't use 127.0.0.1 or localhost).
- Create the temporary directory /tmp/webdisk and make it world-writable.
- Please restart Tomcat, wait a bit and navigate with your browser to: http://your_webserver:8080/ba/base/
- The Tomcat logfiles are located at: /var/log/tomcat5/
Installation under Linux (SuSE 9.3)
- Extract the .tar.gz-file to /usr/share/tomcat5/server/webapps/ba.
e.g. you should have /usr/share/tomcat5/server/webapps/ba/webapp/functions.js, /usr/share/tomcat5/server/webapps/ba/webapp/WEB-INF/classes/Action.class and /usr/share/tomcat5/server/webapps/ba/webapp/WEB-INF/lib/httpunit.jar - Using Tomcat 5.x, create a new web application and point it to the webapps directory. This can be done by placing a new .xml-file in the config directory, e.g. /etc/tomcat5/base/Catalina/localhost/ba.xml with "ba" as application name.
Content of ba.xml:
<Context path="/ba" docBase="/usr/share/tomcat5/server/webapps/ba/webapp" debug="0" reloadable="false">
<Manager className="org.apache.catalina.session.PersistentManager" saveOnRestart="false" />
</Context> - Rename webapp/WEB-INF/web_default.xml to webapp/WEB-INF/web.xml
- Change the content of web.xml: Replace YOUR_SERVER_IP with the IP-address of your file server supporting the cifs-protocol (don't use 127.0.0.1 or localhost).
- Create the temporary directory /tmp/webdisk and make it world-writable.
- Please restart Tomcat, wait a bit and navigate with your browser to: http://your_webserver:8080/ba/base/
- The Tomcat logfiles are located at: /var/log/tomcat5/base/
Installation under Windows
- Extract the .zip-file to c:\webdisk\ba.
e.g. you should have c:\webdisk\ba\webapp\functions.js, c:\webdisk\ba\webapp\WEB-INF\classes\Action.class and c:\webdisk\ba\webapp\WEB-INF\lib\httpunit.jar - Using Tomcat 5.x, create a new web application and point it to the webapp directory. This can be done by placing a new .xml-file in the config directory, e.g. c:\tomcat\conf\Catalina\localhost\ba.xml with "ba" as application name. (Assuming you installed Tomcat to c:\tomcat)
Content of ba.xml:
<Context path="/ba" docBase="c:/webdisk/ba/webapp" debug="0" reloadable="false">
<Manager className="org.apache.catalina.session.PersistentManager" saveOnRestart="false" />
</Context> - Rename webapp\WEB-INF\web_default.xml to webapp\WEB-INF\web.xml
- Change the content of web.xml: Replace YOUR_SERVER_IP with the IP-address of your file server supporting the cifs-protocol (don't use 127.0.0.1 or localhost).
- Create the temporary directory c:\tmp\webdisk and make it writable for everyone.
- Please restart Tomcat, wait a bit and navigate with your browser to: http://your_webserver:8080/ba/base/
Using Tomcat + Apache + mod_jk under Windows
Download mod_jk-apache-2.0.55.so (or any newer version) from here and rename it to mod_jk.so.
Add to the end of Apache's httpd.conf:
LoadModule jk_module modules/mod_jk.so JkMount /ba/* ajp13 JkOptions +ForwardURICompatUnparsed
This example assumes that the Tomcat location of the webdisk is http://localhost:8080/ba/base/ and makes http://localhost/ba/base/ working. The ForwardUri-Parameter is needed to get the (unicode) paths correctly in the URL.
Warning:
Using Apache + mod_jk decreases the performance of the system.
I tested a page with 20 items in the tree and 245 items in the list on a WinXP 1.8GHz and 1GB ram, the result was:
Tomcat standalone: 180ms per page Apache + mod_jk + Tomcat: 711ms per page
This means if there are many requests, your server may faster get unresponsive using Apache + mod_jk.
If you are running Linux and Tomcat alone and want to map from port 8080 to 80, you can use a kernel mapping described below.
Tip:
Another way of running Apache and Tomcat together on one box is using 2 IP addresses, one for Apache and one for Tomcat. This way you can split the traffic over two network interface cards.
Optimizing Tomcat
Using Tomcat on port 80 instead of 8080:
Put this into your startup scripts:
iptables -t nat -A OUTPUT -d localhost -p tcp --dport 80 -j\
REDIRECT --to-ports 8080 iptables -t nat -A OUTPUT -d <your-server-ip> -p tcp --dport 80 -j\
REDIRECT --to-ports 8080 iptables -t nat -A PREROUTING -d <your-server-ip> -p tcp --dport 80 -j\
REDIRECT --to-ports 8080
With this option you don't need Apache to forward to port 80.
Enabling Tomcat access logfiles
Add this to your server.xml:
<Valve className="org.apache.catalina.valves.AccessLogValve"
directory="logs" prefix="localhost_access_log." suffix=".txt"
pattern="common" resolveHosts="false"/>
Increase memory assigned to the JVM in catalina.sh/catalina.bat:
Use 1 GB ram, 256 KB stack size:
catalina.sh:
CATALINA_OPTS = "-Xms1024m -Xmx1024m -Xss256k"
catalina.bat:
set CATALINA_OPTS=-Xms1024m -Xmx1024m -Xss256k
Configure uploads in server.xml:
Set upload limit to 100 MB:
<Connector port="8080" ... disableUploadTimeout="true" maxPostSize="100M" />
Enable output compression in server.xml:
<Connector port="8080" ... compression="on" compressionMinSize="512" compressableMimeType="text/html,text/plain" />
Increase the number of threads in server.xml:
<Connector port="8080" maxThreads="300" minSpareThreads="50" maxSpareThreads="150" acceptCount="100" ... />
Other things
Compile your modifications (if not using Eclipse):
Example for compiling IntegraTUM WebDisk 0.44 under Linux/Unix:
cd <webdisk-path> javac -source 1.4 -target 1.4 -d webapp/WEB-INF/classes/ -cp webapp/WEB-INF/lib/log4j-1.2.13.jar: webapp/WEB-INF/lib/junit-3.8.1_tb.jar: webapp/WEB-INF/lib/httpunit.jar:webapp/WEB-INF/lib/js.jar: webapp/WEB-INF/lib/nekohtml.jar:webapp/WEB-INF/lib/xercesImpl.jar: webapp/WEB-INF/lib/Tidy.jar:webapp/WEB-INF/lib/uploadlib.jar: lib/servlet-api.jar:webapp/WEB-INF/lib/jcifs-1.2.15k_a_tb.jar: webdisk_src webdisk_src/webdisk/*.java
(Thanks to Daniel Wilson.)
Example for compiling IntegraTUM WebDisk 0.44 under Windows:
cd <webdisk-path> javac -source 1.4 -target 1.4 -d webapp/WEB-INF/classes/ -cp webapp/WEB-INF/lib/log4j-1.2.13.jar; webapp/WEB-INF/lib/junit-3.8.1_tb.jar; webapp/WEB-INF/lib/httpunit.jar;webapp/WEB-INF/lib/js.jar; webapp/WEB-INF/lib/nekohtml.jar;webapp/WEB-INF/lib/xercesImpl.jar; webapp/WEB-INF/lib/Tidy.jar;webapp/WEB-INF/lib/uploadlib.jar; lib/servlet-api.jar;webapp/WEB-INF/lib/jcifs-1.2.15k_a_tb.jar; webdisk_src webdisk_src/webdisk/*.java
If you prefer Eclipse you can use Ant together with build.xml from the package.