Apache Tomcat is the recommended servlet container to use with uPortal 3.2. While uPortal 3.2 requires a Servlet 2.5-compatible servlet container and another servlet container may be used, most uPortal implementers deploy to Apache Tomcat. Choosing Tomcat 6.x will likely allow uPortal adopters to get the best advice from the community.
Installing Apache Tomcat
Linux/Unix Installation
1. Download Apache Tomcat 6.x
2. Untar the package as follows:
tar -xvf apache-tomcat-6.0.26.tar.gz
3.Rename your install to something more meaningful:
mv apache-tomcat-6.0.26 uportal-tomcat
4.Set your environment variables:
export JAVA_HOME=/path/to/your/java export TOMCAT_HOME=/path/to/your/tomcat
5.Test your Tomcat installation
a. First, start tomcat
TOMCAT_HOME/bin/startup.sh
b. Go to http://localhost:8080/
You should see the Apache Tomcat Welcome screen
c. Shutdown tomcat
TOMCAT_HOME/bin/shutdown.sh
Windows Installation
1. Download Apache Tomcat 6.x for Windows
2. Unzip the download into a suitable direcoty. For example, you may unzip the file into the C:\ directory. This will create a directory like C:\apache-tomcat-6.x containing your Tomcat files.
3. You will need to create two environment variables CATALINA_HOME and JAVA_HOME
CATALINA_HOME : C:\apache-tomcat-6.x JAVA_HOME : C:\Program Files\Java\jdk1.x
For Windows (different versions may vary) you can create these environment variables by doing the following: right-click 'My Computer' select properties and then the Advanced tab. Then click Environment Variables and under System variables click New. From here, you can enter the name and value for CATALINA_HOME and again for JAVA_HOME if it's not already created.
4. Start tomcat. Try starting up tomcat by running the C:\apache-tomcat-6.x\bin\startup.bat batch file. Point your browser to http://localhost:8080 and you should see the default Tomcat home page (see above image). To shutdown the server run C:\apache-tomcat-6.x\bin\shutdown.bat batch file.
Further Tomcat Configurations
JVM settings
- Examples of JVM settings
- uPortal Heap Tuning
Fronting Apache Tomcat with Apache Http
Incomplete...work in progress
1. Download the Apache Tomcat connector
2. You will need to adjust the Apache Tomcat server.xml file to utilize the connector as follows:
- Shutdown tomcat
- Open server.xml for editing (/path/to/your/apache-tomcat/conf/server.xml)
- Comment out the default connector as shown below:
<!-- Define a non-SSL HTTP/1.1 Connector on port 8080 <Connector port="8080" maxHttpHeaderSize="8192" maxThreads="150" minSpareThreads="25" maxSpareThreads="75" enableLookups="false" redirectPort="8443" acceptCount="100" connectionTimeout="20000" disableUploadTimeout="true" URIEncoding="UTF-8"/> -->
- Now, uncomment the following connector block:
<!-- Define an AJP 1.3 Connector on port 8009 --> <Connector port="8009" enableLookups="false" redirectPort="8443" protocol="AJP/1.3" />
- You may adjust the port (port="8009") if you wish.
3. Now, you need to do some configuring on Apache Httpd to connect to Tomcat. You have two options:
Option #1 mod_jk
Note: Configuring with IIS : http://tomcat.apache.org/connectors-doc/reference/iis.html
- Navigate to your Apache config directory
cd /path/to/apache/config
- Open httpd.conf for editing and locate the LoadModule section and make sure you have the mod_jk path defined (path may vary).
LoadModule jk_module "/usr/lib/httpd/modules/mod_jk.so"
- In the same file, httpd.conf, define the IfModule directive
<IfModule mod_jk.c> JkWorkersFile "/path/to/apache/config/workers.properties" JkLogFile "/path/to/apache/logs/mod_jk.log" JkLogLevel debug JkMount /*.jsp worker1 JkMount /path/to/portal/* worker1 </IfModule> JkMountCopy All
- Now, we need to configure the workers.properties file ( You may include the workers.properties file in the apache config directory, but the path must match with the httpd.conf file where you defined the JkWorkersFile path above.)
More information about workers.properties can be found here.
#Below is an example of a workers.properties file. # Define 1 real worker using ajp13 worker.list=worker1 # Set properties for worker1 (ajp13) worker.worker1.type=ajp13 worker.worker1.host=<your host address> # Set the port accordingly. You may adjust the port below worker.worker1.port=8443 # Below may vary as these are just examples of what can be included. worker.worker1.lbfactor=50 worker.worker1.cachesize=10 worker.worker1.cache_timeout=600 worker.worker1.socket_keepalive=1 worker.worker1.socket_timeout=300
Option #2 mod_proxy
References
SSL configuration
uPortal Specific Notes
Shared Libraries
uPortal places libraries in CATALINA_BASE/shared/lib The default Tomcat 6.0 download does not enable libraries to be loaded from this directory. To resolve this you must edit CATALINA_BASE/conf/catalina.properties and change the line that begins "shared.loader=" to the following:
shared.loader=${catalina.base}/shared/classes,${catalina.base}/shared/lib/*.jar
Shared Sessions
Jasig portlets, as well as many other popular JSR-168 portlets, rely on the ability to share user session data between the portal web application and portlet applications. To enable this feature in Tomcat, you must add the emptySessionPath="true" parameter to the in-use connector.
<Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" emptySessionPath="true"/>
GZipping HTML
Browser-side performance may be improved somewhat by GZip-ping downloaded content where appropriate. uPortal 3.2 already GZips CSS and JavaScript. uPortal does not, however, GZip the uPortal page itself.
GZipping of HTML content can be performed via Tomcat. To enable this functionality, set compression="on" in the in-use tomcat connector, and set the list of compressable mime types. More information about this feature can be found in the Tomcat configuration page.
<Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" emptySessionPath="true" compression="on" compressableMimeType="text/html,text/xml,text/plain"/>
Example Installations
- Servlet Container Installation/Configuration instructions for Windows OS (Chris Doyle - John Hopkins University)
- CalPoly Tomcat Configurations