Installing and Configuring the ActiveGrid Server

Installing and Configuring the ActiveGrid Server
This chapter also contains the following sections:
Available Editions of the ActiveGrid Server
ActiveGrid currently offers two different commercial editions of the ActiveGrid Server:
The ActiveGrid Server does not include a production-quality database. With this edition of the Server, you use your own database software (Installing and Configuring Databases). This edition of the ActiveGrid Server does include a light, file-based database (SQLite), that hosts the packaged demos. This SQLite database is suitable for development and testing purposes but is not meant for production use.
ActiveGrid Server (DB2 Express-C bundle) bundles the commercial version of the ActiveGrid Server, along with DB2 Express-C. DB2 Express-C is a fully functional database server from IBM. It does not include some of the more advanced features that are included in DB2 Express.
Alternatively, you can download an Open Source edition of the ActiveGrid Server that includes MySQL. Commercial features of the ActiveGrid Server (Role-based access control and web services caching, for example) are not included with this installation (“The Open Source Edition of the ActiveGrid Server” on page 49). To use the commercial version of the ActiveGrid Server with MySQL, install the commercial version of the ActiveGrid Server and use your own MySQL installation (MySQL Server).
System Requirements
This section specifies operating system requirements and hardware recommendations for the ActiveGrid Studio.
Operating System Requirements
The ActiveGrid Server runs on the following operating systems:
Hardware Recommendations
ActiveGrid recommends the following minimum configuration for the ActiveGrid Server:
Installation
This section explains how to install the commercial editions of the ActiveGrid Server. For instructions on installing the Open Source Edition, which bundles MySQL, see “The Open Source Edition of the ActiveGrid Server” on page 49.
Note: The DB2 Express-C bundle edition of the ActiveGrid Server installation includes a silent install of DB2 Express-C using parameters that you submit in the ActiveGrid Server install wizard. This DB2 Express-C instance listens on TCP port 50000. The DB2 Express-C install is located in /opt/IBM/db2/V8.1.
Installing the ActiveGrid Server
To execute the DB2 Express-C edition of the ActiveGrid Server installer, you must be logged in as root. You can install the standard edition of the Server as any user. The install wizard prompts you to enter the following configuration information:
Installation Directory: The installer puts all the files and sub-directories for the ActiveGrid Server in the directory you specify.
Hostname: The hostname for the server. The default value is localhost, which is sufficient for a single-node server. If you plan to use a cluster of servers, then use the same hostname that the other servers in the cluster use to identify this server.
Port Number: The port number for the ActiveGrid Server. If you’re installing as root, you can use any port number. If you installing as a non-root user, use a port number greater than 1024.
Linux user accounts (for DB2 Express-C edition only): The DB2 Express-C installation is included in the ActiveGrid Server installation. This database installation requires you to create the following two Linux user accounts, along with home directories and passwords for the accounts:
An account for the DB2 administration user. By default, the installer names this account db2dasusr1.
If possible, keep the defaults for the user account names and home directories. Note that the fenced user and instance user are the same (for more information on these user accounts, see About the Accounts Created for the DB2 Installation).
The installation process creates a log in the /tmp/bitrock/installer.log file. If you have any problems with your installation, check the installation log for errors.
Addional Notes on Installing the DB2 Express-C Edition
During server installation, you might be prompted for additional installation information for the DB2 Express-C installation. For additional details about the DB2 Express-C installation, refer to the documentation on the IBM web site:
http://www.ibm.com/db2/express
The installer automatically launches the DB2 Express-C Server on completion. You still need to start the ActiveGrid Server by running the start script:
INSTALL_DIR/bin/activegridctl start
Note: The install script creates an initial DB2 Express-C database called testdb1. This database contains the schema for the petstore and compliance demo applications.
Installing in Silent Mode (Batch Installations)
You can install the ActiveGrid Server in silent mode, which is useful for batch installations of the server on multiple machines. The command is different depending on whether you’re installing the DB2 Express-C bundle edition of the ActiveGrid Server:
For the ActiveGrid Server Edition
To run the installer in silent mode, use the following command:
./activegrid-server-commercial-X.X-linux-installer.bin --mode unattended --prefix INSTALL_DIR --port SERVER_PORT --hostname HOSTNAME
where:
X.X is the version of the ActiveGrid Server that you’re installing.
INSTALL_DIR is the directory in which want to install the server.
SERVER_PORT is the main port the ActiveGrid Server listens on. If you leave out the SERVER_PORT argument, the installer uses the default (8080).
HOSTNAME is the hostname that the server listens on. If you leave out the HOSTNAME argument, the installer uses the default (localhost), which is fine for a single-node server configuration. However, if you are using the distributed session management mode, you must set HOSTNAME to the DNS-resolvable name of the machine. This enables the other members of the cluster to reference the machine.
For the DB2-Express C Bundle Edition
To run the installer in silent mode, use the following command:
./activegrid-server-db2-commercial-X.X-linux-installer.bin --mode unattended --prefix INSTALL_DIR --port SERVER_PORT --hostname HOSTNAME --db2dasuser ADMIN_USER --db2daspw ADMIN_USER_PASSWORD --db2dasuserhome ADMIN_USER_HOME --db2instuser INST_USER --db2instpw INST_USER_PASSWORD --db2instuserhome INST_USER_HOME
where:
X.X is the version of the ActiveGrid Server that you’re installing.
INSTALL_DIR is the directory in which want to install the server.
SERVER_PORT is the main port the ActiveGrid Server listens on. If you leave out the SERVER_PORT argument, the installer uses the default (8080).
HOSTNAME is the hostname that the server listens on. If you leave out the HOSTNAME argument, the installer uses the default (localhost), which is fine for a single-node server configuration. However, if you are using the distributed session management mode, you must set HOSTNAME to the DNS-resolvable name of the machine. This enables the other members of the cluster to reference the machine.
ADMIN_USER, ADMIN_USER_PASSWORD and ADMIN_USER_HOME are, respectively, the user name, password and home directory for the DB2 Administrator user. These accounts are created as Linux user accounts (for more information on these user accounts, see About the Accounts Created for the DB2 Installation).
INST_USER, INST_USER_PASSWORD and INST_USER_HOME are, respectively, the user name, password and home directory for the DB2 Instance user. These accounts are created as Linux user accounts (for more information on these user accounts, see About the Accounts Created for the DB2 Installation).
Installer Script Usage
The following table lists the usage for the installer script.
 
 
 
 
The following additional options are relevant only to DB2 Express-C bundle installations:
 
 
 
Uninstalling the ActiveGrid Server
To uninstall the ActiveGrid Server, run the uninstall script, located in the installation directory (INSTALL_DIR). This script uninstalls the ActiveGrid Server, but does not uninstall DB2 Express-C.
What Is Installed
This section covers the following topics:
The ActiveGrid Server Directory Structure
The ActiveGrid Server installation includes the following directories:
INSTALL_DIR: The INSTALL_DIR directory contains the uninstall script, the Start.desktop and Stop.desktop shortcuts (which are mapped to desktop icons) and five sub-directories: 3rdparty, bin, local, lib, and html.
3rdparty: The 3rdparty directory contains the third-party software required by the ActiveGrid Server (Third-Party Components). The 3rdparty directory is organized into the following sub-directories:
apache2: Apache binaries. The configuration files in this directory tree are not used.
python: Python binary and libraries.
php: PHP binary and libraries.
common: common libraries, mainly used for building stack components.
db2installer (DB2 Express-C version only): the installation image and install/uninstall scripts for DB2 Express-C.
sqlite: Contains the sqlite application and associated libraries.
bin: The bin directory contains the scripts for starting and stopping the ActiveGrid Server (activegridctl) and for deploying applications (activegrid_deploy).
local: The local directory contains the files for a single server instance.
conf: configuration files for the server instance. Includes php.ini file.
deployments: application deployment files.
logs: server log files (for example, Apache logs, mysql logs).
lib: The lib directory contains the ActiveGrid product code.
html: The html directory contains the ActiveGrid documentation.
The Bundled DB2 Installation
This section contains some information about the DB2 installation that is bundled with the ActiveGrid Server (DB2 Express-C bundle). For complete information on DB2, refer to the DB2 documentation from IBM:
http://www.ibm.com/db2/express
DB2 Express-C
The commercial edition of the ActiveGrid Server includes DB2 Express-C. In order to reduce the size of the overall download, only the minimum feature set required for testing and development is included in this bundled edition of DB2 Express-C.
If you need a DB2 feature that is not included in the ActiveGrid Server installation, download the full version of DB2 or DB2 Express-C directly from the IBM web site.
About the Accounts Created for the DB2 Installation
The DB2 installation requires an account for the instance owner and an account for the adminstration server user. You are prompted for some information about these accounts when you run the ActiveGrid Server installer. This section provides a little more information about these accounts, and about the fenced user account, which for your ActiveGrid installation is the same as the instance owner account:
Instance owner: This user ID controls all DB2 processes and owns all filesystems and devices used by the databases contained within the instance. The default user is db2inst1 and the default group is db2iadm1.
Fenced user: The fenced user is used to run user defined functions and stored procedures outside of the address space used by the DB2 database. The ActiveGrid Server uses the instance owner as the fenced user.
DB2 administration user: This user ID is used to run the DB2 administration server on your system. The default user is db2dasusr1. The DB2 GUI tools also use this user ID to perform administration tasks against the local server database instances and databases.
Uninstalling DB2 Express-C
For information on uninstalling DB2 Express-C, consult the DB2 Express-C documentation. The installation image that the ActiveGrid installer uses to install DB2 Express-C is located in INSTALL_DIR/3rdparty/db2installer. As part of the DB2 Express-C uninstall process, you might need to run the db2_deinstall script located in that directory.
Third-Party Components
The ActiveGrid Server installation includes some third-party software components that the ActiveGrid Server requires for operation. These third-party components do not interfere or interact with the system binaries (such as /usr/bin/python and /usr/sbin/httpd).
The ActiveGrid Server installation includes the following third-party components:
The installer puts these Python extensions in the site-packages subdirectory of your Python installation.
Note: The packages/files that the installer creates are not registered in the RPM database (or other package management database).
If you need to use the system Python, or other external versions of the included components, see Using Your Own External Packages.
The Demo Applications
The ActiveGrid Server includes the following demo applications:
The ActiveFeeds Demo is an example of an RSS feeds aggregator application. The ActiveFeeds application requires users to log in, after which they can dynamically browse, subscribe to, and view approved RSS feeds.
The ActiveTrade Demo ties together data from two different databases, multiple RSS feeds, and a third-party charting tool.
The Googlezon demo is an example of a composite application that uses the Amazon REST / Google SOAP web services.
To see these demos, use the URLs in the following table. These URLs are based on the default hostname and port number (localhost:8080). If you did not use the defaults, substitute the hostname and port number for your own ActiveGrid Server installation.
 
Installing and Configuring Databases
The commercial edition of the ActiveGrid Server includes DB2 Express-C. The ActiveGrid Server supports a number of other databases, which you can configure and use instead of, or in addition to the DB2 Express-C database. This section explains how to set up these databases to work with ActiveGrid.
The ActiveGrid Server supports the following databases:
SQLite
Support for SQLite is automatically included with the ActiveGrid Server. No additional configuration is necessary.
MySQL Server
In the Python version, support for MySQL Server is automatically enabled. To enable PHP support for MySQL, add the following line to the php.ini file:
extension=pdo_mysql.so
The php.ini file is located in the INSTALL_DIR\local\conf directory.
Note: The Open Source edition of the ActiveGrid Server bundles MySQL Server. For information on this edition of the ActiveGrid Server, see “The Open Source Edition of the ActiveGrid Server” on page 49.
Oracle
This section explains how to enable support of Oracle on Python (“Python Support”) and PHP (“PHP Support”).
Python Support
The ActiveGrid Server supports the cx_Oracle Python extension module. The specific driver you use depends on the version of Oracle you’re using. By default, the 10g version of cx_Oracle is enabled. The 10g cx_Oracle version also works with Oracle 9i. To use Oracle 8i, follow these steps:
1.
Open the directory INSTALL_DIR/3rdparty/Python/lib/Python2.4/site-packages directory.
2.
In that directory, find the following files: cx_Oracle.so.8i, cx_Oracle.so.9i, cx_Oracle.so.10g.
3.
If you have problems with these steps, you might need to reinstall a cx_Oracle downloaded from the following site:
http://starship.python.net/crew/atuining/cx_Oracle
PHP Support
To enable PHP support of Oracle, first install the client-side software from Oracle. You also need to add a line to the php.ini file:
extension=pdo_oci.so
The php.ini file is located in the INSTALL_DIR/local/conf directory.
PostgreSQL
The database driver for PostgreSQL (PyGreSQL 3.6.2) is installed with the ActiveGrid Server. This Python library allows the ActiveGrid Server to communicate with a PostgreSQL database. You must install the database itself and also the native client libraries needed to communicate with PostgreSQL.
To enable PHP support of PostgreSQL, you need to add the following line to the php.ini file:
extension=pdo_pgsql.so
The php.ini file is located in the INSTALL_DIR/local/conf directory.
MS SQL Server
ActiveGrid uses the pymssql (0.7.3 or higher) python module to connect to MS SQL Server. This module is not bundled with the ActiveGrid Server. Download it from the following site:
http://pymssql.sourceforge.net
On Linux systems, pymssql uses FreeTDS (0.6 or higher) as communication layer. FreeTDS is not bundled with ActiveGrid. Download it from the following site:
http://www.freetds.org/
You also need to configure FreeTDS. A simple .freetds.conf entry looks like this:
[somename] # you need to use this name as the
#"Connection String" when you configure
# the data source in the ActiveGrid IDE.
host = <MS SQL Server host>
port = 1433
tds version = 8.0
For more information about how FreeTDS works with pymssql, see the following site:
http://pymssql.sourceforge.net/
The ActiveGrid Server does not currently support connecting to MS SQL Server on PHP.
Configuring and Managing the ActiveGrid Server
This section covers the following topics:
Starting and Stopping the ActiveGrid Server
To start the ActiveGrid Server, navigate to the directory in which you installed the ActiveGrid Server and run the startup script:
/bin/activegridctl start
To stop the ActiveGrid Server, type:
/bin/activegridctl stop
To pre-initialize deployed applications, start the Server with the --init option:
activegridctl start -init
This pre-initializes all deployed applications and then starts the ActiveGrid Server. By default, applications are not preinitialized, so when the server first starts up, each application may behave a little slower. The init option slows the server startup time, but improves initial application performance.
For a full list of startup options, type:
bin/activegridctl --h
Enabling SSL
The ActiveGrid Server supports SSL requests through the mod_ssl Apache module. Much of this setup is specific to Apache mod_ssl. For clarification on these steps, refer to the mod_ssl documentation.
To enable SSL on the ActiveGrid Server, follow these steps:
1.
2.
Generate a self-signed certificate. There is a version of OpenSSL bundled with ActiveGrid Server that you can use for this.
3.
Edit the following lines in the local/conf/ssl.conf file:
SSLCertificateFile /var/tmp/agsa/local/conf/keys/server.crt
SSLCertificateKeyFile /var/tmp/agsa/local/conf/keys/server.key
where server.crt and server.key are the self-signed certificate and the private key respectively.
4.
SSL support is currently enabled at 4433 by default. To use a different port, change all instances of the port specified in the ssl.conf file.
5.
activegridctl start --ssl
Note: If you are using IBM HTTP Server, follow the IBM instructions instead of the instructions provided in this section.
Using Your Own External Packages
The ActiveGrid Server includes all packages that it needs in order to run. ActiveGrid recommends using the packages that are included in the ActiveGrid Server installation. If you do need to use external packages (for example, an external Apache Server), follow the guidelines in this section.
Python
If you need to use a different external Python installation, follow these steps:
1.
Alter the PythonInterpreter directive in Apache's httpd.conf file to point to the correct Python executable.
2.
Apache
If you need to use a different external Apache installation, edit Apache's httpd.conf file to do the following
1.
Include INSTALL_DIR/local/conf/activegrid.conf.
2.
Load the mod_python module.
3.
Add the required PythonInterpreter directive pointing to the correct Python executable.
4.
Set the ServerName parameter to the local hostname followed by the port. The ActiveGrid Server requires this setting for proper operation.
Upgrading the ActiveGrid Server
All logs, configuration files, and temporary files for the ActiveGrid Server are created under the local/ directory (The ActiveGrid Server Directory Structure).
Because a server upgrade wipes out the entire contents of the installation directory, including local/, you should make a copy of the local/ directory before you upgrade.
To upgrade the ActiveGrid Server, follow these steps:
1.
2.
INSTALL_DIR/uninstall
3.
Manually remove the old local/ directory (the one you copied to another location).
4.
Run the installer for the new version of the ActiveGrid Server. Use the same installation directory that the old installation used. This is important because the files in the local/ directory that you copied contain references to the installation directory.
5.
Remove the local/ directory in the new installation and replace it with your copy of the old local/ directory.
6.
Start the ActiveGrid Server. All existing applications and configuration settings from the previous installation are preserved.
 

ActiveGrid
Installation and Deployment Guide
Version 2.0