Sun GlassFish Web Space Server 10.0 Installation Guide

ProcedureTo Install Web Space Server Software Into an Existing Sun GlassFish Enterprise Server Configuration

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

Before You Begin

Sun GlassFish v2.1 Enterprise Server software must be installed and running on your system before proceeding with these instructions. See Installing Sun GlassFish Enterprise Server Software for more information about installing GlassFish Enterprise Server software.

  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 the webspace-10.0.6-for-glassfish.zip integration bundle and unzip it in the directory of your choice.


    Tip –

    To avoid the chance of overwriting existing GlassFish configuration settings or files, it is strongly recommended that you not unzip the Web Space Server package into an existing GlassFish directory structure.


    For the remainder of these instructions, the root directory of the existing GlassFish installation is referred to as gf-install-dir, and the directory in which the Web Space Server installer has been unzipped is referred to as ws-install-dir.

  4. Stop the GlassFish domain into which Web Space Server is to be installed.

    For example, if Web Space Server will be installed in domainfoo:


    cd gf-install-dir/bin
    asadmin stop-domain domainfoo
    
  5. Add the following code to the server.policy file in the gf-install-dir/domains/domainfoo directory.

    grant codeBase "file:${com.sun.aas.instanceRoot}/lib/-" {
       permission java.security.AllPermission;
    };
    
    // permissions for Webspace
    grant codeBase "file:${com.sun.aas.instanceRoot}/applications/j2ee-modules/webspace/-" {
       permission java.security.AllPermission;
    };
    
    grant codeBase "file:${com.sun.aas.instanceRoot}/applications/j2ee-modules/saw-web/-" {
      permission java.security.AllPermission;
    }; // Basic set of required permissions granted to all remaining code
    grant {
    ...............
    ...............
    permission java.lang.reflect.ReflectPermission "suppressAccessChecks";
    };
    
    grant codeBase "file:${com.sun.aas.instanceRoot}/applications/j2ee-modules/ruon-web/-" {
    permission java.security.AllPermission;
    };
    
    grant codeBase "file:${com.sun.aas.instanceRoot}/applications/j2ee-modules/wsrp-portlet/-" {
    permission java.security.AllPermission;
    };

    Note –

    Permissions must be granted for any Web application that needs to create database tables, similar to the Webspace example above.


  6. Create a directory named ws-install-dir/var/webspace/war-workspace/customs/webspace/WEB-INF/classes, if it does not already exist, and then change to it.


    mkdir -p ws-install-dir/var/webspace/war-workspace/customs/webspace/WEB-INF/classes
    cd ws-install-dir/var/webspace/war-workspace/customs/webspace/WEB-INF/classes
    
  7. Create and modify a text file named portal-ext.properties, if it does not already exist.

    1. Add or verify the following default properties:


      auto.deploy.glassfish-tomcat.jee.deployment.enabled=true
      auto.deploy.glassfish-tomcat.jee.dm.id=deployer:Sun:AppServer::localhost:4848
      auto.deploy.glassfish-tomcat.jee.dm.user=admin
      auto.deploy.glassfish-tomcat.jee.dm.passwd=adminadmin
    2. Add any non-default properties your configuration may require.

      For example, to use HTTPS, add the following line:


      auto.deploy.glassfish-tomcat.jee.dm.id=deployer:Sun:AppServer::localhost:4848:https
  8. Start the GlassFish domain into which Web Space Server will be installed.

    For example, if Web Space Server will be installed in domainfoo:


    cd gf-install-dir/bin
    asadmin start-domain domainfoo
    
  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. Continue with the next step, below, after configuring your database.

  10. Change to the ws-install-dir/webspace/application directory.

  11. Run the Ant install.xml script.


    ant -f install.xml
    
  12. Follow the prompts to complete the Web Space Server installation in the GlassFish domain you want to use.

    The Web Space Server installer stops the domain you have chosen to use for the installation and installs the Web Space Server configuration and .war files.

  13. Change to the gf-install-dir/bin directory and restart the Sun GlassFish Enterprise Server domain you chose to use during the Web Space Server installation.

    For example:


    cd gf-install-dir/bin
    ./asadmin start-domain domainfoo

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

  14. (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 domain_name/config directory.

    1. Stop the GlassFish domain you are using for Web Space Server.


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

      This domain.xml file is located in the gf-install-dir/domains/domain_name/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 the default domain you are using for Web Space Server.


      gf-install-dir/bin/asadmin start-domain domain_name
      
  15. (All operating systems) Open the Web Space Server site.

    Web Space Server uses whatever HTTP/HTTPS port is defined for your domain. For example:


    http://domainfoo:8080