Sun GlassFish Web Space Server 10.0 Installation Guide

ProcedureTo Install Web Space Server Software Bundled With GlassFish

This procedure describes how to install the Web Space Server ZIP package that includes Sun GlassFish Enterprise Server software. See To Install Web Space Server Software Into an Existing Sun GlassFish Enterprise Server Configuration for instructions on installing the Web Space Server ZIP package that does not include GlassFish. See Getting Sun GlassFish Web Space Server Software for information about all available Web Space Server packages.

Before You Begin

Apache Ant 1.7 or later must be installed on your system before performing the Web Space Server installation. The version of Ant bundled with Sun GlassFish does not work with Web Space Server 10.0. Make sure that Ant 1.7 or later is installed on your system, and that your PATH and ANT_HOME environment variables point to this newer version. You can verify the version of Ant that will be used by default by entering the following command in a command shell for your operating system:


ant -version

Refer to the documentation included with your Ant package for complete installation instructions.

  1. (Mac OS X systems only) Configure your Java environment.

    • If using JDK 1.6, use the Java Preferences application to specify the correct JDK version.

      Also be sure to set JAVA_HOME to point to JDK 1.6.


      export JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home
    • If using JDK 1.5, rename the 14compatibility.jar file.

      The 14compatibility.jar file includes some aspects of the Xalan XSLT processor and the Crimson XML parser that conflict with newer versions of the classes bundled with Web Space Server 10.0.

      Use the following commands to rename the 14compatibility.jar file:


      cd /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/ \
      Classes/.compatibility
      sudo mv 14compatibility.jar 14compatibility.jar.orig
      cd /System/Library/Frameworks/JavaVM.framework/Versions/A/Resources/.compatibility
      sudo mv 14compatibility.jar 14compatibility.jar.orig
  2. (Linux systems only) Increase the maximum limit on files the operating system can open.

    This step is only required on some Linux systems, and resolves an issue in which some of the Web Space Server .war files fail to deploy properly in GlassFish.

    1. Enter the following command to verify the open file limit in your environment:


      ulimit -n
      
    2. If the number returned is 1024 or less, modify the /etc/sysctl.conf and /etc/security/limits.conf files, as follows:

      • /etc/sysctl.conf: Add fs.file-max = 200000

      • /etc/security/limits.conf: Add the following two lines:


        * soft nofile 5000
        * hard nofile 5000
    3. Reboot the system.

  3. Download one of the Web Space Server deployment or evaluation ZIP bundles and unzip it in the directory of your choice.

    For the remainder of these instructions, the directory in which the Web Space Server ZIP file is unpacked is referred to as ws-install-dir.

  4. Change to the ws-install-dir/glassfish2 directory.

  5. Run the Ant setup.xml script.


    ant -f setup.xml
    

    If you want to configure your Sun GlassFish server for clustering, run the setup-cluster.xml script instead.

    The default GlassFish domain and database configuration proceeds. When the “BUILD SUCCESSFUL” message is displayed, the Web Space Server installation is complete.

  6. Change to the ws-install-dir/glassfish2/bin directory and start the Sun GlassFish Enterprise Server default domain.

    Web Space Server software is installed by default in domain1


    cd ws-install-dir/glassfish2/bin
    ./asadmin start-domain

    Some additional Web Space Server configuration occurs as the GlassFish server, database server, and the Web Space Server components are started.

  7. (Mac OS X systems only) Configure the domain.xml file 64–bit JVM.

    When running any 64-bit JVM such as JDK 1.6 (which runs by default in 64-bit mode on Mac OS X), you need to edit the domain.xml file in the GlassFish domain1/config directory.

    1. Stop the GlassFish domain1 server.


      cd ws-install-dir/glassfish2/bin
      ./asadmin stop-domain
    2. Edit the domain.xml file for domain1, changing the PermSize and MaxPermSize property values.

      This domain.xml file is located in the ws-install-dir/glassfish2/domains/domain1/config directory. Change the PermSize and MaxPermSize values as follows:

      • -XX:PermSize=192M to -XX:PermSize=256M

      • -XX:MaxPermSize=192M to -XX:MaxPermSize=256M

    3. Restart domain1.


      ws-install-dir/glassfish2/bin/asadmin start-domain
  8. (All operating systems) Open the Web Space Server default home page.

    Point your Web browser to http://localhost:8080.


    Note –

    The page may take a long time to load the first time after server start. If you see the default GlassFish “Your site is installed” page or an empty page, wait a few minutes and then refresh the page. Subsequent page loads should proceed more rapidly. Also note that repeated attempts to access pages before the server has fully started may result in a “index.jsp resource not found exception,” which could require a server restart.


    Figure 2–2 Web Space Server Example Site Main Screen

    Web Space Server Example Site Main Screen

  9. (Optional) Configure Web Space Server to work with a database other than the default HSQL database.

    In most production environments, you will want to use a database other than the default HSQL database that is bundled with Web Space Server. See Configuring a Database for Use With Web Space Server for detailed instructions.