Project WebSynergy Milestone 4 Administration Guide

Chapter 2 Installation

The WebSynergy evaluation bundle by default includes the HSQL database. HSQL, MySQL, Microsoft SQL, and Oracle 10g are the databases supported by WebSynergy.

You can use the evaluation bundle which has the HSQL database embedded with it for quick evaluation. It is a good method to have it up and running fast for reviewing or developing, it has several drawbacks:

Download WebSynergy (standalone). The standalone version which is not bundled with GlassFish, samples, and the HSQL database looks similar to websynergy-for-gfv2.zip. You can configure it to a database installed on your disk. MySQL, Microsoft SQL, and Oracle 10g are the databases supported by WebSynergy. We recommend that if your organization doesn't have a standard for local development databases, you should use MySQL for this, as it is small, free, and very fast.

WebSynergy is best suited to work on GlassFish v2, but it is also supported on other versions of GlassFish and also on other application servers.

Installing the Database, Application Server, and WebSynergy

Follow the below procedure to configure WebSynergy on Solaris with UTF-8 support. For the instructions to install MySQL on various other operating systems, see http://dev.mysql.com/doc/refman/6.0/en/installing.html.

ProcedureTo Install and Configure MySQL

  1. Install MySQL by typing the following commands as superuser.

    # groupadd mysql
    # useradd -g mysql mysql
    # cd /usr/local
    # gunzip install-dir/mysql-VERSION-OS.tar.gz | tar xvf -
    # ln -s install-dir/mysql-VERSION-OS mysql
    # cd mysql
    # chown -R mysql .
    # chgrp -R mysql .
    # scripts/mysql_install_db --user=mysql
    # chown -R root .
    # chown -R mysql data
    # bin/mysqld_safe --user=mysql & *
  2. Log in to the MySQL installation by going to the MySQL installation directory and typing the following command:

    mysql -u root

  3. Create the UTF-8 database by typing the following commands:

    mysql> create database lportal default character set utf8
    mysql> use lportal;
    mysql> create user lportal;
    mysql> grant all privileges on *.* to 'lportal'@'localhost' identified by 'lportal'
    mysql> set password for 'lportal'@'localhost' = password('lportal');
  4. Enable UTF-8 support for MySQL.

    See, To Enable UTF-8 Support for MySQL

ProcedureTo Install GlassFish

Installing and starting GlassFish is a prerequisite for installing WebSynergy.

  1. Download the GlassFish v2 distribution.

    https://glassfish.dev.java.net/public/downloadsindex.html.

  2. Set the environment variable JAVA_HOME to point to the directory in which JDK 1.6 is installed.

  3. Run the following command:

    java -Xmx256m -jar <filename>.jar

  4. Set ANT_HOME to point to the installation of ant 1.7 or above, which is at

    <downloaded-dir>/glassfish/lib/ant directory.

  5. Navigate to the GlassFish directory:

    cd glassfish

  6. Run the following command:

    ant -f setup.xml

  7. Start GlassFish.

    cd bin

    <downloaded-dir>/glassfish/bin>/asadmin start-domain

ProcedureTo Install WebSynergy

  1. Download the standalone version of WebSynergy.

  2. Extract the WebSynergy bundle.

    unzip websynergy-for-gfv2.zip

  3. Navigate to the Application folder.

    cd websynergy/application

  4. Run ant -f install.xml.

    ant -f install.xml
    Buildfile: install.xml
    
    show-user-warning:
       [input] Ant must be 1.7 or greater. JAVA_HOME must be set to JDK 1.5 or greater.
    Glassfish must be running. [RETURN to continue or CONTROL-C to stop]
    
    
    set-glassfish-properties:
       [input] Enter Glassfish Directory  [/opt/glassfish]
    /424/glassfish
       [input] Enter Glassfish Domain (include full path to domain)  [/424/glassfish/domains/domain1]
    
       [input] Enter Glassfish Target  [server]
    
       [input] Enter Glassfish Administrator Password  [adminadmin]
    
       [input] Enter Glassfish Administration Port  [4848]
    
       [input] Is Glassfish Clustered [Yes/No]  [No]
    
    
    set-database-properties:
       [input] Use builtin HSQL or mySQL database  [HSQL]
    mySQL
    
    set-hsql-properties:
    
    set-mssql-properties:
    
    set-mysql-properties:
       [input] Enter Database User Name  [root]
    
       [input] Enter Database User Password  []
    password
       [input] Enter Database Host  [localhost]
    
       [input] Enter Database Port  [3306]
    
       [input] Enter Database Name  [lportal]

    You need to set the application server and database properties in the process of running install.xml. It is also required that Ant must be 1.7 or greater and JDK must be 1.5 or greater (JDK 1.6 is preferred). Also, GlassFish must be running.

ProcedureTo Enable UTF-8 Support for MySQL

You need to make changes to the portal-ext.properties file to enable UTF-8 support for MySQL. The WebSynergy evaluation bundle has a portal-ext.properties file in the GlassFish install-dir/domains/domain1/applications/j2ee-modules/websynergy/WEB-INF/classes. When you are using a WebSynergy bundle which is not including samples, you have to create a portal-ext.properties file. This task describes the process to create a portal-ext.properties file, and making changes to it to enable UTF-8 support for MySQL.

  1. Create a temporary folder. In this example, name the folder as test.

    Equivalent step in the command prompt or in the terminal window of a UNIX like OS:

    mkdir /tmp/test

  2. Copy the portal-impl.jar file to the temp folder.

    Equivalent step in the command prompt or in the terminal window of a UNIX like OS:

    cp GlassFish install-dir/domains/domain1/application/j2ee-modules/websynergy/WEB-INF/lib/portal-impl.jar /tmp/test

  3. Change directory to temp.

    Equivalent step in the command prompt or in the terminal window of SOLARIS or any UNIX like OS:

    cd /tmp/test

  4. Extract the portal-impl.jar file.

    Equivalent step in the command prompt or in the terminal window of a UNIX like OS:

    jar -xvf portal-impl.jar

    After unjar it will have portal.properties file in the same directory.

  5. Open portal.properties and copy the "JDBC" property.

  6. Create a text file (using any text editor) and name it as portal-ext.properties, and paste the "JDBC" property into it.

    #
        # Hypersonic
        #
        jdbc.default.driverClassName=org.hsqldb.jdbcDriver
        jdbc.default.url=jdbc:hsqldb:lportal
        jdbc.default.username=sa
        jdbc.default.password=
    
        #
        # MySQL
        #
        #jdbc.default.driverClassName=com.mysql.jdbc.Driver
        #jdbc.default.url=jdbc:mysql://localhost/lportal?useUnicode=true&characterEncoding=
    UTF-8&useFastDateParsing=false
        #jdbc.default.username=
        #jdbc.default.password=
  7. Comment Hypersonic (HSQL) and uncomment MySQL.

  8. Save the portal-ext.properties file.

  9. Copy the portal-ext.properties file and paste it to GlassFish install-dir/domains/domain1/applications/j2ee-modules/websynergy/WEB-INF/classes.

  10. Restart GlassFish server.