### Deploying to Tomcat 4.1

The example directory paths listed below are based on Solaris or Linux (referred to as UNIX). The instructions are applicable to both UNIX and Windows installations; however, the format of the paths for Windows would use the Windows format, i.e. `C:\JReport\Server` instead of `/opt/JReport/Server`.

It is assumed that:

- Tomcat 4.1 is installed in the `/opt/jakarta-tomcat-4.1` directory.
- The JReport Enterprise Server WAR file jreport.war is located in the `/opt/JReport/Server/bin/distribute` directory. To create the WAR file refer to the instructions in Building a WAR/EAR file to include a self-contained JReport Enterprise Server.

To deploy JReport Enterprise Server to Tomcat 4.1:

1. Start Tomcat by running the `startup.sh` script.
2. Start a web browser session and then open the Tomcat default home page at `http://localhost:8080/index.jsp`. If you are accessing the server remotely, replace localhost with the appropriate host name for your server.
3. Select the Tomcat Manager link or use the URL `http://localhost:8080/manager/html`. You will be challenged for user name and password to login. By default Tomcat does not have a manager and administrator login defined. If you have not already done so, you must edit the `/opt/jakarta-tomcat-4.1/conf/tomcat-users.xml` file to add a user with admin and manager roles. The line should look something like this `<user username="admin" password="admin" roles="admin,manager"/>.` You can now use your new user to login into the manager's web page.
4. Using the Tomcat Web Application Manager, scroll down to the Install dialog, and then use the Browse button to select the Web Application Archive file jreport.war.
5. Access JReport Enterprise Server using the following URLs:

   `http://localhost:8080/jreport/jrserver
   http://localhost:8080/jreport/admin/index.jsp
   http://localhost:8080/jreport/jinfonet/index.jsp`

   You can also access JReport by selecting the /jreport link on the Tomcat Manager web page.

#### Troubleshooting

If you run into problems when using JReport Enterprise Server in Tomcat, send the log files of JReport Enterprise Server to support@jinfonet.com. The following procedure illustrates how to generate the log files:

1. Modify the catalina.sh file in `/opt/jakarta-tomcat-4.1/bin`.

   In the file catalina.sh, add `-Dlogall=true` after the reporthome definition:

       "$JAVA" $JAVA_OPTS \
       -classpath "$JBOSS_CLASSPATH" -Dreporthome=/opt/JReport/Server\
       -Dlogall=true  \
       org.jboss.Main "$@"

2. After editing catalina.sh, start Tomcat using the startup.sh batch file.
3. To get the information about the JReport Enterprise Server environment, you can access `http://localhost:8080/jreport/admin/info.jsp?cmd=info`.
4. Save the output to a file.
5. After reproducing the problem, send support@jinfonet.com the log files in `reporthome/logs.`

   The Tomcat log files may also help to identify the problem. The most useful one is `/opt/jakarta-tomcat-4.1/logs/catalina.out`.