Table of Contents
The GridSphere User's Guide describes how to install and configure GridSphere. For more information on developing and packaging portlets, please consult the GridSphere PortletReference Guide and the GridSphere Tutorials. The current implementation is based upon the GridSphere Technical Design Document. The GridSphere portal framework comes in both source and binary forms. Binaries can be created from the source code and in both cases, the build environment is generally the same. The GridSphere source code comes with a README file explaining how to build the binary distribution. Both source and binaries come packaged with all the necessary third party libraries and requires a GridSphere compatible servlet container, currently Tomcat 4.1+ and Tomcat 5 are supported
JDK 1.4.2+http://java.sun.com/j2se
Jakarta Ant 1.6+ Ant is used to compile and deploy the GridSphere framework
Jakarta Tomcat Servlet Container Tomcat 4.1+, Tomcat 5.0.25+, is required. (Currently, only Tomcat fully supports the Manager web application that allows for dynamic portlet management.) (Make sure you get the full Tomcat version and not the Light Edition (LE))
You should download the latest source code release of GridSphere at http://www.gridsphere/gridsphere/gridsphere?cid=download and unzip/tar it.
GridSphere uses many quality open source libraries listed below for completeness: It is not recommended to replace the bundled libaries.
Castor is used to provide Java to XML bindings
Hibernate is used to provide SQL based database support
JUnit provides a unit testing framework
Cactus provides a unit testing framework for testing GridSphere in a servlet container
Log4J provides an optimized logging library
Hypersonic SQL database provides a pure Java SQL database
Jakarta Commons utility classes for performing file uploads, etc.
Xalan is used for XSLT processing
In order to build the source distribution or deploy GridSphere to a Tomcat servlet container, you will need to download Jakarta Ant. Ant is also used to run the unit tests.
Download Ant 1.6+ distribution
Unzip ant into your preferred location and set the ANT_HOME environment to point to this location
Copy junit-3.8.1.jar from your GRIDSPHERE_HOME/lib into ANT_HOME/lib (only necessary if you want to run the tests)
Add ANT_HOME/bin to your PATH environment
The Jakarta Tomcat servlet container is required to provide a hosting environment for the GridSphere framework. Make sure you install both Tomcat and GridSphere with normal user permissions or consider creating a special portal user and installing under the portal user id.
Download Jakarta Tomcat distribution (Tomcat 4.1+ or Tomcat 5.0.25+. If you use Tomcat 5.5+ download also the Tomcat's packages: Admin, Deployer and Compat )
Unzip tomcat into your preferred location and set the CATALINA_HOME environment to point to this location
![]() | Important |
|---|---|
| If using Windows, set the path with backslashes e.g C:\MyApps\MyTomcat-4.29! |
The Portlet Manager Portlet requires the Tomcat manager webapp to be configured to
allow the gridsphere user to manage web applications. You must modify
$CATALINA_HOME/conf/tomcat-users.xml and create a user with the manger and admin role. An example is shown:
<user username="gridsphere" password="gridsphere" roles="manager,admin"/>
You must edit the file webapps/gridsphere/WEB-INF/GridSphereServices.xml and edit the
user name and password used in the first Portlet Manager Service entry to be the name and password used in the tomcat-users.xml.
To ensure that clients can't access the manager webapp directly, add as a child of <host>
$CATALINA_HOME/conf/server.xml
the following where $CATALINA_HOME is replaced with the actual path to Tomcat e.g. "/usr/local/tomcat":
<Context path="/manager" debug="0" privileged="true" docBase="$CATALINA_HOME/server/webapps/manager"> <Valve className="org.apache.catalina.valves.RemoteAddrValve" allow="127.0.0.1"/> </Context>
![]() | Important |
|---|---|
| Make sure there are no line-breaks between beginning and closing tags! |
In addition if you are running the portal using HTTPS, then you must import your server's credentials into your java keystore in order for the application manager to work. You can do this using the Java keytool tool as in the following:
keytool -keystore $JAVA_HOME/jre/lib/security/cacerts -import -file
$DER_OR_PEM_ENCODED_CA_CERT -alias $SOME_ALIAS
SOME_ALIAS is something like 'verisignclass3g2ca' or
'equifaxsecureglobalebusinessca1'.
Before deploying GridSphere to a servlet container, various configuration settings can be adjusted to customize layout, database configuration, portlet services and the portlet web applications that are started at run time. Below is a description of the various configuration files and how they are used.
$CATALINA_HOME/webapps/gridsphere/WEB-INF/CustomPortal/portlets directory. The filename may contain
an additional integer suffix ".#" to ensure a priority when the container will load the portlet application. By default,
you will see $CATALINA_HOME/webapps/gridsphere/WEB-INF/CustomPortal/portlets/gridsphere.1 which instructs
the container to load the set of core gridsphere portlets first. Below is a sample directory listing showing
a deployed GridSphere and a couple additional portlet applications:
webapps/gridpshere/WEB-INF/CustomPortal/layouts of your GridSphere
distribution and contain the GuestUserLayout.xml
which defines the guest layout. Initially before a user has logged in, they will see
the layout as presented in GuestUserLayout.xml. The guest layout contains the Login portlet
to allow people to login and little else. This file may be edited to provide additional portlets to guest portal
users. Group layouts specify the layout for a particular group and are stored in
$CATALINA_HOME/webapps/gridsphere/WEB-INF/CustomPortal/layouts/groups. Please see the GridSphere Administartor's Guide for
more information on customizing group layouts.
Users' layouts are persisted and stored in $CATALINA_HOME/webapps/gridsphere/WEB-INF/CustomPortal/layouts/users.
Simply removing any of these layout files will force a new one to be created when a user logs in.
gridsphere/webapps/gridsphere/WEB-INF/CustomPortal/database/hibernate.properties before deploying.
file and comment out the HSQL lines and uncomment the lines for the database you wish to use.
The connection url setting should point to the physical location of your database.
The same applies if you want to deploy any 3rd party webapp which uses persistence.
In addition, install any 3rd party JDBC jar files needed into $CATALINA_HOME/shared/lib
Next, issue "ant create-database" to create the database using the updated configuration.
Finally restart the application server.
gridsphere/webapps/WEB-INF/tmfconfig/tmf.xml.
Please enable the services and the configuration files for the services you want to use. Currently mail and
AOL Aim service are supported. For AIM you need to edit gridsphere/webapps/WEB-INF/tmfconfig/services/aim.xml and
fill in the approriate values for the username/password for the aimbot you wish to use.
For Mail modification of gridsphere/webapps/WEB-INF/tmfconfig/services/mail.xml with the values of
MailServer, Port and Sender is needed. Redeploy gridsphere after making any changes.
As explained in the INSTALL file, GridSphere relies on Ant for its compilation
and deployment. The build script,
build.xml provides various
targets for compiling, deploying, building javadoc api documentation, creating new portlet projects.
From inside the GridSphere source directory, you should be able to issue:
ant installwhich will compile the framework code, create documentation if necessary and deploy GridSphere to a Tomcat container. After the installation completes and you see "BUILD SUCCESFUL", start up the Tomcat container and go to http://127.0.0.1:8080/gridsphere/gridsphere You should now see the running GridSphere portal. If an error occurs, please consult the FAQ and possibly mail the mailing lists if you encounter problems.
Gridsphere is deployed using the HSQL database by default. If you wish to use another hibernate supported database (like
mysql, postgresql) you will need to download the required JDBC drivers from the database vendor and put them
in the
$CATALINA_HOME/shared/lib directory. You are also required to make changes to the
$CATALINA_HOME/webapps/gridsphere/CustomPortal/database/hibernate.properties hibernate
properties file. Next, issue "ant create-database" to create the database using the updated configuration.
Finally restart the application server.
GridSphere's default installation supports Jakarta's Tomcat servlet container. If you want to use Jetty as webserver for the portal you need to change the build.properties file located in the root of the source directory of GridSphere. Change
gridsphere.appserver=tomcat
to
gridsphere.appserver=jetty
Furthermore the environment variable CATALINA_HOME is not used, instead you need to define APPSERVER_HOME
to point to the installationdirectory of the webserver. In future versions support for other servlet containers
might be added. Please substitute all CATALINA_HOME variables used in this guide with APPSERVER_HOME if you
are using the Jetty servlet container.
To update to a recent version of GridSphere, you should first make a backup of your existing GridSphere configuration. To do this backup your $CATALINA_HOME/webapps/gridsphere/WEB-INF/CustomPortal directory. After downloading and installing the newer version of GridSphere using
ant installcopy your existing configuration back to the same location and issue the following command (make sure Tomcat is shutdown):
ant update-databasewhich will update the GridSphere database if any new data fields were added.
GridSphere uses the Log4J logging framework and logs all messages to
$CATALINA_HOME/logs/catalina.out
and to
$CATALINA_HOME/logs/localhost_gridsphere_log.{yyyy-mm-dd}.txt
If you encounter any errors, please look at the log files for more information.
In addition, the logging level can be selectively controlled by configuring the
log4j.properties located in the
config directory of
the GridSphere source directory and then re-deploying.
By default, the portal is configured as http://localhost:8080/gridsphere/gridsphere.
It is possible to change the context by editing the deployed context.
Under Tomcat 4, the context file is located in
$CATALINA_HOME/webapps/gridsphere-context.xml.
Under Tomcat 5, the context file is located in
$CATALINA_HOME/conf/Catalina/localhost/gridsphere.xml
Change the following:
<Context path="/gridsphere" docBase="gridsphere" debug="0" reloadable="false" crossContext="true">
<Logger className="org.apache.catalina.logger.FileLogger"
prefix="localhost_gridsphere_log." suffix=".txt" timestamp="true"/>
</Context>
to
<Context path="/myorg" docBase="myorg" debug="0" reloadable="false" crossContext="true">
<Logger className="org.apache.catalina.logger.FileLogger"
prefix="localhost_gridsphere_log." suffix=".txt" timestamp="true"/>
</Context>
Where the context path element corresponds to your desired context.
![]() | Important |
|---|---|
| First move the file gridsphere.xml over to myorg.xml (or whatever name you specified in the context path) |
![]() | Important |
|---|---|
| Second move the gridsphere webapp to myorg i.e. $CATALINA_HOME/webapps/gridsphere should be moved to $CATALINA_HOME/webapps/myorg |
![]() | Important |
|---|---|
| Third move the $CATALINA_HOME/webapps/myorg/WEB-INF/CustomPortal/portlet/gridsphere.1 file to $CATALINA_HOME/webapps/myorg/WEB-INF/CustomPortal/portlet/myorg.1 |
![]() | Important |
|---|---|
| Finally if you are using the local hsqldb you must edit $CATALINA_HOME/webapps/myorg/WEB-INF/CustomPortal/database/hibernate.properties to use myorg and not gridsphere in the hibernate.connection.url |
Now change the servlet mapping by editing
$CATALINA_HOME/webapps/gridsphere/WEB-INF/web.xml
<servlet-mapping>
<servlet-name>gridsphere</servlet-name>
<url-pattern>/gridsphere/*</url-pattern>
</servlet-mapping>
to
<servlet-mapping>
<servlet-name>gridsphere</servlet-name>
<url-pattern>/start/*</url-pattern>
</servlet-mapping>
All custom settings including the default database are contained in
$CATALINA_HOME/webapps/gridsphere/WEB-INF/CustomPortal. To deploy a new portal configured
with the earlier customizations, simply manually copy over this directory to the new portal
directory. In order for the database to work, you will have to hand edit the
$CATALINA_HOME/webapps/gridsphere/WEB-INF/CustomPortal/database/hibernate.properties
hibernate.connection.url entry to match the new Tomcat location.
If you want to install GridSphere behind Apache httpd2 please read the following section. Download httpd2 from http://httpd.apache.org/download.cgi.
Example 2. configure apache httpd2
tar xzvf httpd-2.0.49.tar.gz
cd httpd-2.0.49
./configure --prefix=/usr/local/apps/httpd-2.0.49 --enable-ssl --with-ssl=/usr/local/apps/openssl-0.9.7d --enable-so
make
make install
![]() | Important |
|---|---|
| Make sure you have at least openssl 0.9.6e installed it is needed by httpd2. |
Example 3. configuring apache/tomcat connectors
tar xzvf jakarta-tomcat-connectors-jk-1.2.5-src.tar.gz
cd jakarta-tomcat-connectors-jk-1.2.5-src/
./configure --with-apache=/usr/local/apps/httpd-2.0.49 --with-java=/usr/local/packages/java
make
cp apache-2.0/mod_jk.so /usr/local/apps/httpd-2.0.49/modules/
Example 4. worker2.properties
worker.list=gridsphere
worker.gridsphere.type=ajp13
worker.gridsphere.host=localhost
worker.gridsphere.port=8009
Example 5. httpd.conf
LoadModule jk_module modules/mod_jk.so
<IfModule mod_jk.c>
JkWorkersFile /usr/local/apps/httpd-2.0.49/conf/workers2.properties
</IfModule>
...
NameVirtualHost YOURIP:80
...
<VirtualHost www.YOURHOST.com:80>
ServerAdmin webmaster@YOURHOST.com
DocumentRoot /var/html
ServerName www.YOURHOST.com
ErrorLog /logs/error_log
CustomLog /logs/access_log common
JkMount /* gridsphere
</VirtualHost>
<VirtualHost www.YOURHOST.com:443>
ServerAdmin webmaster@YOURHOSTS.com
DocumentRoot /var/html
ServerName www.YOURHOST.com
JkMount /* gridsphere
SSLEngine on
SSLCertificateFile /etc/ssl/server.crt
SSLCertificateKeyFile /etc/ssl/server.pem
ErrorLog /logs/error_ssl_log
CustomLog /logs/access_ssl_log common
</VirtualHost>
![]() | Important |
|---|---|
| These are just sample configurations. Please change them to reflect your local installation. |