Deploying Wikis to Sun Java System Web Server 7.0, Part 1: JSPWiki

   
By Sriram Natarajan, Marina Sum, Updated: June 20, 2007  

As defined in Wikipedia, a wiki is "a type of Web site that allows users to easily add, remove, or otherwise edit and change some available content, sometimes without the need for registration. This ease of interaction and operation makes a wiki an effective tool for collaborative authoring." Literally hundreds of wiki implementations (engines) are available for download from the Internet. For the purpose of this series, we have randomly picked two such implementations, as follows:

  • MediaWiki, which is based on the PHP programming language and the MySQL database management system
  • JSPWiki, which is based on Java servlet and Java Server Pages (JSP) technologies, a subset of the standard Java 2 Platform Enterprise Edition (J2EE platform)

This article, part 1 of a multipart series, explains how to set up, deploy, and configure JSPWiki to Sun Java System Web Server 7.0 (henceforth, Web Server 7.0), Sun's latest Web server release that is currently in technology preview. See this blog for a procedure on how to configure security in JSPWiki with Web Server 7.0.

Besides high-performance optimizations, Web Server 7.0 also includes a Web container that complies with JSP 2.0 and Servlet 2.4 specifications, an integral part of the J2EE 1.4 platform. Also included is a redesigned administration infrastructure with GUI and CLI support for managing both stand-alone and cluster-based installations.

For details on how to set up JSPWiki, see its documentation.

 

Contents
 
Installing Web Server 7.0
Installing JSPWiki
Deploying JSPWiki
Configuring JSPWiki
Making Web Server 7.0 Aware of Configuration Changes
Appendix: Advanced Configuration Files
References


 
Installing Web Server 7.0

First, download the latest Technology Preview release of Web Server 7.0. For details, see its Installation & Migration Guide and this blog.

Installing JSPWiki

JSPWiki is released under the GNU Lesser General Public License (LGPL). Download the latest stable JSPWiki bundle, currently 2.2.33. The latest Beta release is 2.4.15.

Note: Both JSPWiki 2.2.33 and 2.4.15 Beta work well with Web Server 7.0. However, because JSPWiki is in continuous development, at the time you download, you might find a newer release that supersedes those two versions. As long as the release complies with JSP 2.0 and Servlet 2.4 specifications, it should work with Web Server 7.0.

For simplicity, this article assumes that you have downloaded and unpacked the JSPWiki binaries under /tmp for the UNIX or Linux platform and C:\tmp for the Windows platform.

To install JSPWiki:

  1. Unpack the ZIP file into a temporary directory.

    On the UNIX or Linux platform, type:

    % cd jspwiki-temp-dir
    % unzip JSPWiki-2.2.33-bin.zip

    where jspwiki-temp-dir is the location in which you downloaded the bits.

    On the Windows platform, run winzip to extract JSPWiki-2.2.33-bin.zip into jspwiki-temp-dir.

    The related files then reside under the jspwiki-temp-dir /JSPWiki directory.
  2. Browse the files.

    On the UNIX and Linux platforms, type:

    % cd jspwiki-temp-dir /JSPWiki
    % ls

    On the Windows platform, type:

    c:\> cd jspwiki-temp-dir \JSPWiki
    c:\> dir

    The following file names are displayed:

    ChangeLog JSPWiki.war README
    JSPWiki=samplepages.zip LICENSE ReleaseNotes

For an introduction and the installation procedures, read README and ReleaseNotes. Also, README briefly describes the steps for deploying JSPWiki with Apache Tomcat.

The JSPWiki.war file is the key file that enables wiki software like JSPWiki to be deployed on top of Web containers, such as Web Server 7.0, Sun Java System Application Server, or Apache Tomcat.

Deploying JSPWiki

Deployment is the process through which you can host a Web application based on JSP pages or servlets on top of a Web container like Web Server 7.0. Each Web server has its own way of deploying a WAR file. In the case of Web Server 7.0, you can complete this process from either the command-line interface (CLI) or a GUI, the Admin Console. For simplicity, this article describes the process from the Admin Console.

Note: For the procedure from the CLI, see the Sun Java System Web Server 7.0 Administrator's Guide .

For an overview on how to deploy a Web application—that is, a WAR file, such as JSPWiki.war—on the Web Server 7.0 Admin Console, see this blog, which includes a live demo.

To deploy JSPWiki:

  1. Start the Web Server 7.0 Administration Server.

    On the UNIX and Linux platforms, type:

    % cd ws7-install-dir
    % admin-server/bin/startserv

    where ws7-install-dir is the location in which you have installed Web Server 7.0. The default is either /sun/webserver7 or /opt/sun/SUNwbsvr7.

    On the Windows platform, click Start > Programs > Sun Microsystems > Sun Web Server 7.0 > Start Admin Server.
  2. On your browser, log in to the Web Server 7.0 Admin Console at https:// hostname : portnumber, where:

    • hostname is the name of the machine in which you have installed Web Server 7.0. You can also use localhost for hostname.
    • portnumber is the number of the port that you chose while installing Web Server 7.0. By default, the Web Server 7.0 Administration Server runs on port 8989.

    Figure 1 shows the Admin Console.

    Figure 1: Web Server 7.0 Admin Console (Click image for larger view.)
     
  3. Under Virtual Server Tasks, click Add Web Application.

    The Add Web Application wizard is displayed.

    1. Under Location, select "Specify a package file to upload to the Web Server" and specify the WAR file name in the text field.
    2. Under URI, type the URI for the JSPWiki site in the text field, for example, /JSPWiki. Click OK.

    See Figure 2.

    Figure 2: Add Web Application Wizard (Click image for larger view.)
     
    A button, Instance Configured Modified, is displayed in the top right area of the wizard.
  4. Click the Instance Configured Modified button.

    The Manage Web Applications dialog box is displayed. See Figure 3.

    Figure 3: Manage Web Applications Dialog Box (Click image for larger view.)
     
  5. Select the first option (default) under Web Applications and click OK.

    Web Server confirms the configuration changes in a dialog box. See Figure 4.

    Figure 4: Confirmation of Modifications in the Instance Configuration (Click image for larger view.)
     
  6. Click OK.

    The Configuration Instances dialog box is displayed. See Figure 5.

    Figure 5: Configuration Instances Dialog Box (Click image for larger view.)
     
  7. Start or restart the default server instance by selecting the checkbox for the instance and then clicking the Start or Restart button.
Configuring JSPWiki

Now configure JSPWiki: Go to http:// hostname : portnumber /JSPWiki/Install.jsp, where:

  • hostname is the name of the machine in which you have installed Web Server 7.0. You can also use localhost to denote hostname.
  • portnumber is the number of the port that you chose while installing Web Server 7.0. By default, the Web Server 7.0 server instance runs on port 80.

The mandatory options are displayed. See Figure 6.

Figure 6: Mandatory Options for JSPWiki (Click image for larger view.)
 

To minimally configure the options so as to host a JSPWiki site:

  1. For simplicity, keep the default values for Application Name and Base URL.

    Note: The base URL must be same as the value you specified in the URI field while adding the Web application.
  2. Under File Storage, the parameter that specifies where to store all the pages that your users create once JSPWiki is up and running, choose a location that can be regularly backed up.

    If you expect heavy traffic on your JSPWiki site, allocate a large data pool, for example, /export/home/wiki-pages/.
  3. Specify an administrator password and retype the password, as required.
  4. Retain or customize the other parameter defaults.

    As an advanced option, for simpler maintenance, you might want to edit the Log files parameter to reflect the location of the Web server instance's log file directory at /sun/webserver/https- instancename /logs.
  5. Click Configure.

Next, to ensure that JSPWiki authentication is understood within Web Server 7.0, append the following lines to the login.conf line in the /sun/webserver/https- instancename /config/login.conf file:

JSPWiki-container {
    com.ecyrd.jspwiki.auth.login.WebContainerLoginModule SUFFICIENT;
    com.ecyrd.jspwiki.auth.login.CookieAssertionLoginModule SUFFICIENT;
    com.ecyrd.jspwiki.auth.login.AnonymousLoginModule SUFFICIENT;
};
JSPWiki-custom {
    com.ecyrd.jspwiki.auth.login.UserDatabaseLoginModule REQUIRED;
};
 
Making Web Server 7.0 Aware of Configuration Changes

Lastly, make the Web Server 7.0 instance and the Administration Server aware of the configuration changes.

  1. From the Admin Console, click the Instance Configuration Modified button in the top right area to open the Instance Configuration Modified dialog box.
  2. Select the second option under Configuration and click OK.

    See Figure 7.

    Figure 7: Confirmation of Modifications to the Instance Configuration (Click image for larger view.)
     
  3. Start or restart the default server instance by selecting the checkbox for the instance and then clicking the Start or Restart button.

To verify that the configurations are correct, go to http:// hostname : portnumber /JSPWiki/Main.jsp. Figure 8 shows an example of the main page that is displayed.

Figure 8: JSPWiki Main Page (Click image for larger view.)
 

Voilá! You have successfully set up and configured a JSPWiki-based site on top of Web Server 7.0.

Appendix: Advanced Configuration Files

If you deployed the JSPWiki.war file as described in the section "Deploying JSPWiki", jspwiki_webapp_dir, the location where the Administration Server expanded the JSPWiki.war file at deployment, is at ws7-install-dir /https- configname /webapps/ vsname /JSPWiki, where:

  • ws7-install-dir is the top-level location in which the rest of the Web server 7.0 configuration files reside, such as admin-server and https-*.
  • configname is the name of the configuration that you are working on. Typically, it is the same as your host name.
  • vsname is the name of the virtual server. By default, the virtual server shares the same name as configname, which is, eventually, your host name.

The jspwiki.properties file resides under the jspwiki_webapp_dir /WEB-INF directory. That location is also displayed at http:// hostname : portnumber /JSPWiki/Install.jsp. All the changes that you make according to the section "Configuring JSPWiki" through Install.jsp eventually translate into the jspwiki.properties file. For any advanced JSPWiki tuning or setup, you most likely edit that file, too. As a convenience, the jspwiki.properties file contains many comments on how to edit the parameters. For details, see the JSPWiki documentation.

Every time you manually edit the parameters in the jspwiki.properties file, be sure to make the Web Server 7.0 instance and Administration Server aware of your manual changes to the JSPWiki application.

References
Rate and Review
Tell us what you think of the content of this page.
Excellent   Good   Fair   Poor  
Comments:
Your email address (no reply is possible without an address):
Sun Privacy Policy

Note: We are not able to respond to all submitted comments.
Left Curve
Java SDKs and Tools
Right Curve
Left Curve
Java Resources
Right Curve
JavaOne Banner
Java 8 banner (182)