Sun GlassFish Web Stack 1.5 Installation and Configuration Guide

Documentation for the Current Release (Sun GlassFish Web Stack 1.5) - Draft

Installation and Configuration Guide (All Platforms)


Table of Contents


Sun GlassFish Web Stack Installation and Configuration Guide

This document describes how to install and configure Sun GlassFish Web Stack and its components on Solaris and Linux platforms.

Introduction

Sun GlassFish Web Stack is a complete open source web application platform consisting of Apache, lighttpd, MySQL, PHP, Tomcat, Glassfish, Ruby, and Python. It comes with the support for Memory Caching framework (memcached), Dynamic Trace debugging (DTrace), Xdebug, and advanced PHP security framework (Suhosin).

Sun GlassFish Web Stack is available for Solaris, OpenSolaris, and Red Hat Enterprise Linux.

Sun GlassFish Web Stack Components

The table lists the primary components bundled with Sun GlassFish Web Stack.

Component Name
Package Name
Applicable Platform
Component Type
Component Version
Component Homepage
Apache Server
sun-apache22
Solaris/OpenSolaris/Linux
HTTP Server
2.2.11 http://httpd.apache.org/
lighttpd sun-lighttpd14
Solaris/OpenSolaris/Linux
HTTP Server
1.4.21 http://www.lighttpd.net/
Squid
sun-squid
Solaris/OpenSolaris/Linux
Proxy Server
2.7.STABLE6
http://www.squid-cache.org/
MySQL
sun-mysql51
Solaris/OpenSolaris/Linux 
Database Server
5.1.30
http://www.mysql.com/
MySQL
sun-mysql5
Solaris/OpenSolaris/Linux
Database Server
5.0.67
http://www.mysql.com/
PHP sun-php52
Solaris/OpenSolaris/Linux
Language
5.2.9 http://www.php.net/
Ruby sun-ruby18
Solaris/OpenSolaris
Language 1.8.7 http://www.ruby-lang.org/en/
Python sun-python26
Solaris
Language 2.6.1 http://www.python.org/
memcached sun-memcached
Solaris/OpenSolaris/Linux 
Caching System
1.2.5 http://www.danga.com/memcached/
Apache Tomcat
sun-tomcat6
Solaris/OpenSolaris/Linux 
Application Server
6.0.18 http://tomcat.apache.org/
Sun GlassFish Web Stack Enterprise Manager
sun-wsadmin Solaris/Linux
Administration Tool
1.5
http://www.sun.com/software/solaris/amp/
Sun GlassFish Enterprise Server
sges Solaris/OpenSolaris/Linux
Application Server
2.1 http://www.sun.com/software/products/appsrvr/

Sun GlassFish Web Stack Distributions

Sun GlassFish Web Stack is distributed in two different versions.

  • Native Package Version: This is the non-relocatable version of the Sun GlassFish Web Stack distribution. It can only be installed in the system directories as specified in the Sun GlassFish Web Stack Directory Layout section. This guide deals with the Native Package Version by default.
  • Unbundled IPS/pkg(5) distribution: This distribution is based on the Image Packaging System (IPS). This distribution can be installed in the directory of your choice.

The Unbundled IPS/pkg(5) distribution provides the following significant benefits:

  • Non Root Installation : Supports installation of Sun GlassFish Web Stack without root or administrative privileges.
  • Relocatable Installation : Allows for the installation of multiple copies of the Sun GlassFish Web Stack on the same system.
  • Simplified Add-On Framework : Simplified component install, update and uninstall mechanism.

Installing Sun GlassFish Web Stack

This section discusses the installation of Sun GlassFish Web Stack on Solaris, OpenSolaris, and Linux platforms.

User Permissions

This section explains about the user permissions required for Sun GlassFish Web Stack installation.

Native Package Version

System administration or root privileges are required for performing the Native Package installation.

Unbundled IPS/pkg(5) distribution

Sun GlassFish Web Stack Unbundled IPS/pkg(5) distribution can be installed with or without the administrative or root privileges. When installing as the root user, file and directory ownership as well as run-time identity will match a native package install (e.g., webservd for Apache or Lighttpd). If the required daemon user id doesn't already exist, installation will fail and the user will be prompted to create it manually. When installing as non-root user, all the files and directories will be owned by the user running the installation, and that will be used as the run-time identity as well.

Sun GlassFish Web Stack Operating System Dependencies

Platform specific dependencies exist on Solaris and Red Hat Enterprise Linux platforms. Install the dependent packages first. The following table summarize the dependencies for various Sun GlassFish Web Stack components.

Note
This is not a complete dependency list. Only important packages are listed here.
Warning
Unbundled IPS/pkg(5) distribution of Sun GlassFish Web Stack installer has no way of checking the Operating System dependencies. You must cross check with the following dependency table and install all the required dependent packages prior to installing the respective Sun GlassFish Web Stack Components.

|| Sun GlassFish Web Stack Component || Important Solaris Dependencies || Important Red Hat Enterprise Linux Dependencies ||

Sun GlassFish Web Stack Installer SUNWPython python
Sun GlassFish Web Stack Base Libraries SUNWcar       Core Architecture (Root)
SUNWcakr     Core Solaris Kernel Architecture
SUNWkvm      Core Architecture (KVM)
SUNWcsr       Core Solaris, (Root)
SUNWckr       Core Solaris Kernel (Root)
SUNWcnetr    Core Solaris Network Infrastructure (Root)
SUNWcsu      Core Solaris, (Usr)
SUNWcsd      Core Solaris Devices
SUNWcsl       Core Solaris Libraries
SUNWcslr      Core Solaris Libraries (Root)
SUNWlibsasl    SASL v2
SUNWgss       GSSAPI V2
SUNWkrbu      Kerberos version 5 support (Usr)
SUNWlibC       Sun Workshop Compilers Bundled libC
SUNWlibms     Math & Microtasking Libraries (Usr)
SUNWopenssl-libraries OpenSSL Libraries (Usr)
SUNWfontconfig        Fontconfig library
SUNWfreetype2        FreeType2 Font library
SUNWjpg        jpeg - The Independent JPEG Groups JPEG software
SUNWpng       Portable Network Graphics library
SUNWxwplt      X Window System platform software
SUNWzlib       The Zip compression library
OpenLDAP == 2.3,  Cyrus SASL >= 2.1, OpenSSL, glibc >= 2.5, libstdc++ >= 4.1, freetype
Apache HTTP Server Web Stack Base Libraries (mentioned above)
SUNWlexpt     XML parser library
SUNWpr        Netscape Portable Runtime
SUNWtls        Network Security Services
SUNWcry      Crypt Utilities
Web Stack Base Libraries (mentioned above), expat, perl, postgresql-libs, sqlite , pcre
Lighttpd Web Stack Base Libraries (mentioned above) Web Stack Base Libraries (mentioned above)
Squid Proxy Server Web Stack Base Libraries (mentioned above) Web Stack Base Librares (mentioned above)
MySQL SUNWbash        GNU Bourne-Again shell (bash)
SUNWperl584core  Perl 5.8.4 programming language
Web Stack Base Libraries (mentioned above), perl
PHP Web Stack Base Libraries (mentioned above)
SUNWcry      Crypt Utilities
SUNWlxsl        The XSLT library
SUNWbzip2     Bzip compression library
SUNWxwrtl       X Window System & Graphics Runtime Library Links
Web Stack Base Libraries (mentioned above)
curl, gmp, libidn, libXpm, pcre, bzip2, libjpeg, libpng, libXpm
PHP Postgres Connector SUNWpostgr-82-libs    PostgreSQL 8.2 client libraries postgresql-libs
memcached None libevent
Apache Tomcat Server SUNWj5rt, SUNWj5dev 
JDK 5.0 or higher
Sun GlassFish Web Enterprise Manager Web Stack Base Libraries (mentioned above) sysstat, openssl, freetype, libpng, libX11, expat, libXdmcp, libxml2, curl
Ruby Web Stack Base Libraries(mentioned above), SUNWgcc (available from Solaris 10 companion CD/DVD) Web Stack Base Libraries (mentioned above), gcc
Note
On the Red Hat Enterprise Linux x86_64 version, Sun GlassFish Web Stack also depends upon the 32 bit versions of the listed packages.

Installing Sun GlassFish Web Stack on Solaris and Linux Platforms

Perform the following steps to install Sun GlassFish Web Stack

  1. Download the Sun GlassFish Web Stack package from the Sun GlassFish Web Stack download page, http://www.sun.com/systems/solutions/amp/getit.jsp. The download page provides packages for RedHat Enterprise Linux (x86 and x86_64) and Solaris (x86, x86_64, and Sparc). Download the package which is relevant to your platform.
  2. Extract the tar.gz file containing the Sun GlassFish Web Stack installer.
    gunzip -c xxx.tar.gz | tar xf -
    

    This command will expand the Web Stack installation files into the current directory; you may wish to perform this step within a temporary directory.

  3. Run the installation script to begin the installation. The list of available installer commands are shown in the following table.
Installer Command
Description
Platform
./install -h
Displays the available options with the installer.
Solaris/Linux
./install -v
Prints the debug information during the installation.
Solaris/Linux
./install -X
Adds the platform specific options to the install command.
Solaris/Linux
./install -u
Upgrades the Sun GlassFish Web Stack from earlier versions.
Solaris/Linux
./install amp
Installs the complete AMP stack, which includes Apache HTTP Server, PHP, and MySQL.
Solaris/Linux
./install apache
Installs Apache HTTP Server with additional modules, including mod_fcgid, mod_jk, mod_perl, and mod_security2
Solaris/Linux
./install lighttpd
Installs the lighttpd Web server.
Solaris/Linux 
./install memcached
Installs the memcached memory caching system.
Solaris/Linux
./install mysql
Installs the MySQL database server.
Solaris/Linux
./install php
Installs the PHP language support and additional extensions, including apc, memcache, and mysql.
Solaris/Linux
./install python
Installs the Python language support.
Solaris
./install ruby
Installs the Ruby language support .
Solaris
./install squid
Installs the Squid Proxy Server.
Solaris/Linux
./install tomcat
Installs the Apache Tomcat Application Server.
Solaris/Linux
./install admin
Installs the Sun GlassFish Web Stack Enterprise Manager.
Solaris/Linux

Installing Sun GlassFish Enterprise Server

Sun GlassFish Enterprise Server is shipped with its own installer and can be installed using the GlassFish Enterprise Server intallation waizard. You can install the GlassFish Enterprise Server by executing the installer in the GUI mode:

./sges-2_1-solaris-sparc.bin on Solaris SPARC platform

./sges-2_1-solaris-i586.bin on Solaris x86 platform

./sges-2_1-linux.bin on Linux platform

For more detailed information, see Sun GlassFish Enterprise Server 2.1 Installation Guide.

Installing Sun GlassFish Web Stack on OpenSolaris Platform

For information on installing Sun GlassFish Web Stack on OpenSolaris platform, see Web Stack Getting Started Guide for OpenSolaris

Installing Sun GlassFish Web Stack Unbundled IPS/pkg(5) distribution

The Sun GlassFish Web Stack unbundled IPS/pkg(5) distribution is delivered in the form of a minimized distribution. A small, base set of the Web Stack components are pre-installed. The remaining components are available in a networked based repository. To install additional components or update installed components the Web Stack distribution contains a command line interface (pkg) as well as a graphical user interface (updatetool) to assist with the installation.

Setting up the Unbundled IPS/pkg(5) distribution for Sun GlassFish Web Stack

Perform the following steps to set up the Unbundled IPS/pkg(5) distribution for Sun GlassFish Web Stack

  1. Download the Sun GlassFish Web Stack Unbundled IPS/pkg(5) distribution package from the Sun GlassFish Web Stack download page, http://www.sun.com/systems/solutions/amp/getit.jsp. Download page provides packages for RedHat Enterprise Linux (x86 and x86_64) and Solaris (x86, x86_64, and Sparc). Download the package which is relevant to your platform.
  2. Extract the tar.gz file containing the Sun GlassFish Web Stack Unbundled IPS/pkg(5) distribution into any desired location. 
    gunzip -c webstack-image-* | tar xf -
    
  3. Change into the webstack-1.5 directory (you may rename this directory if you prefer). The same directory will become the installation directory for all the Sun GlassFish Web Stack components. You can move or rename this directory as per your choice. This directory contains the following important binaries that you will use to manage Sun GlassFish Web Stack components
    • ./bin/pkg : Command Line Interface (CLI) for the Unbundled IPS/pkg(5) distribution.
    • ./bin/updatetool : Graphical User Interface (GUI) for the Unbundled IPS/pkg(5) distribution.
    • ./bin/setup-webstack : Post Installation Utility for the Unbundled IPS/pkg(5) distribution. You must run it after installing packages via CLI.
Note
To install and update packages using the Unbundled IPS/pkg(5) distribution, you need a working internet connection.

Using Unbundled IPS/pkg(5) distribution CLI

You can use the ./bin/pkg command to install Sun GlassFish Web Stack packages from command line. Some of the important commands are shown in the following table.

Installer Command
Description
./bin/pkg --help
Brings up the pkg command help.
./bin/pkg list -a
Lists all the available packages and their current status
./bin/pkg install <valid package name>
Installs the given Sun GlassFish Web Stack package.
Note
You need to execute ./bin/setup-webstack after running the command ./bin/pkg install.

You can check the Sun GlassFish Web Stack Components section or the command list -a for a list of valid package names.
For more information on the pkg command, see the pkg(5) man page and the Update Center Wiki.

Using Unbundled IPS/pkg(5) distribution GUI

Sun GlassFish Web Stack Unbundled IPS/pkg(5) distribution ships with GUI tool called the Update Tool. Update Tool can be invoked by using the following command:

./bin/updatetool

You can use the update tool to perform the following tasks :

  • Install new add-on packages
  • Manage package updates
  • View information about the installed packages

To install packages click on the 'Available Add-ons' item available on the sidebar. Select the packages you wish to install and click on the green 'Install' arrow.

To update packages click on the 'Available Updates' item available on the sidebar. Select the packages you wish to update and click on the 'Update' arrow.

For more information on the updatetool, refer to the online help. Online help can be accessed by Clicking 'Help > Contents' on the Main Menubar.

Upgrading to Sun GlassFish Web Stack 1.5

Sun GlassFish Web Stack 1.5 contains a number of important bugfixes, security updates and updated components. See the Sun GlassFish Web Stack 1.5 Release Notes for more information.

You can use the install command with -u switch to perform an automatic upgrade of all the installed packages of the Sun GlassFish Web Stack.

./install -u
Warning
Upgrades done using the system package management tool are not supported and may lead to software corruption.
Note
You can not mix version 1.4 and version 1.5 packages together. You must upgrade all the installed components.

Managing Sun GlassFish Web Stack Services

Sun GlassFish Web Stack installs a number of services on the system. The following table lists the Sun GlassFish Web Stack services and their start / stop commands.

Service Name
Description
Service Enable / Disable Command (Solaris)
Service Start / Stop Command (Linux)
Service Start/Stop Command (Unbundled IPS/pkg(5))
httpd
Apache Web Server
svcadm enable sun-apache22
svcadm disable sun-apache22
/sbin/service sun-apache22 start
/sbin/service sun-apache22 stop
OPT_ROOT/bin/sun-apache22 start
OPT_ROOT/bin/sun-apache22 stop
lighttpd
lighttpd Web Server
svcadm enable sun-lighttpd14
svcadm disable sun-lighttpd14
/sbin/service sun-lighttpd14 start
/sbin/service sun-lighttpd14 stop
OPT_ROOT/bin/sun-lighttpd14 start
OPT_ROOT/bin/sun-lighttpd14 stop
mysqld MySQL Database Server
svcadm enable sun-mysql51
svcadm disable sun-mysql51
/sbin/service start sun-mysql51 start
/sbin/service stop sun-mysql51 stop
OPT_ROOT/bin/sun-mysql51 start
OPT_ROOT/bin/sun-mysql51 stop
memcached
memcached Caching Server
svcadm enable sun-memcached
svcadm enable sun-memcached
/sbin/service sun-memcached start
/sbin/service sun-memcached stop
OPT_ROOT/bin/sun-memcached start
OPT_ROOT/bin/sun-memcached stop
squid
Squid Proxy Server
svcadm enable sun-squid
svcadm disable sun-squid
/sbin/service sun-squid start
/sbin/service sun-squid stop
OPT_ROOT/bin/sun-squid start
OPT_ROOT/bin/sun-squid stop
tomcat
Tomcat Application Server
svcadm enable sun-tomcat6
svcadm disable sun-tomcat6
/sbin/service sun-tomcat6 start
/sbin/service sun-tomcat6 stop
OPT_ROOT/bin/sun-tomcat6 start
OPT_ROOT/bin/sun-tomcat6 stop

       

Automatically Starting Services in Linux

In Linux starting or stopping a service merely causes a service to start or stop for a particular system session only in which the command was run. In order to start a service automatically in Linux, it must be put in system's default runlevel.

For example, to put Apache Web Server in runlevel 3 and 5, following command can be used:

chkconfig --level 35 sun-apache22 on

Sun GlassFish Web Stack Directory Layout

This section discusses the directory layout of Sun GlassFish Web Stack components. Sun GlassFish Web Stack files are installed in three different directories:

OPT_ROOT: Application installation directory.

ETC_ROOT: Application configuration directory.

VAR_ROOT: Application data directory.

The directory paths vary by platform. The following table following table lists the directory location for Solaris, Linux, and OpenSolaris platforms.

Platform
OPT_ROOT
ETC_ROOT
VAR_ROOT
Solaris
/opt/webstack
/etc/opt/webstack
/var/opt/webstack
Linux
/opt/sun/webstack
/etc/opt/sun/webstack
/var/opt/sun/webstack
OpenSolaris
/usr
/etc
/var
Unbundled IPS/pkg(5)
.
/etc
/var

Apache HTTP Server Files

The following list describes the directory layout for Apache HTTP Server and additional plug-in modules:

Directory / File
Description
ETC_ROOT/apache2/2.2/httpd.conf This is the main Apache HTTP Server configuration file.  
ETC_ROOT/apache2/2.2/conf.d/modules-32.load Contains additional server configuration files. By default, server will load all the .conf files placed under this directory. It also has a configuration file modules-32.load which contain LoadModule directive for loading the 32 bundled Apache HTTP server modules.
This file needs to be edited to disable modules which are loaded by default.
 
ETC_ROOT/apache2/2.2/conf.d/modules-64.load Contains additional server configuration files. By default, server will load all the .conf files placed under this directory. It also has 2 additional.load configuration file modules-64.load which contain LoadModule directive for loading the 64-bit bundled Apache HTTP server modules.
This file needs to be edited to disable modules which are loaded by default.
 
ETC_ROOT/apache2/2.2/envvars Contains the environment settings that the server uses at startup.
 
ETC_ROOT/apache2/2.2/samples-conf.d Contains sample .conf files. These are not included in the main configuration file. To use the sample file, copy the file to conf.d directory and modify as necessary.  
OPT_ROOT/apache2/2.2/bin Contains the 32-bit httpd(Prefork MPM) and httpd.worker(Worker MPM) executables as well as other utility programs.  
OPT_ROOT/apache2/2.2/bin/64 Contains the 64-bit httpd (Prefork MPM) and httpd.worker (Worker MPM) executables as well as other utility programs.  
OPT_ROOT/apache2/2.2/manual Contains the Apache HTTP Server manual in HTML format.  
OPT_ROOT/apache2/2.2/include Contains the Apache HTTP Server header files, which are needed for building building additional plug-in modules with apxs(8).  
OPT_ROOT/apache2/2.2/libexec Contains 32-bit loadable modules (DSOs) supplied with the server.  
OPT_ROOT/apache2/2.2/libexec/64 Contains 64-bit loadable modules (DSOs) supplied with the server.  
OPT_ROOT/apache2/2.2/man Contains man pages for the server, utility programs, and mod_perl (if installed). Add this directory to your MANPATH to read the man pages.  
OPT_ROOT/apache2/2.2/lib Contains the 32-bit Apache HTTP Server core libraries including APR and APR-Util.  
OPT_ROOT/apache2/2.2/lib/64 Contains the 64-bit Apache HTTP Server core libraries including APR and APR-Util.  
OPT_ROOT/apache2/2.2/lib/perl Contains the 32-bit modules and library files used by the mod_perl extension (if installed) to Apache HTTP Server.  
VAR_ROOT/apache2/2.2/cgi-bin Default location for the CGI scripts. This can be changed by altering the httpd.conf file and restarting the server.  
VAR_ROOT/apache2/2.2/htdocs Default document root. This can be changed by altering the httpd.conf file and restarting the server.  
VAR_ROOT/apache2/2.2/icons Icons used by the server. Users can modify these icons for fancy indexing. ETC_ROOT/samples-conf.d/autoindex.conf includes sample examples.  
VAR_ROOT/apache2/2.2/libexec Place holder for 32-bit user apache modules. Any 32-bit modules which are added using apxs(8) are copied into this directory.  
VAR_ROOT/apache2/2.2/libexec/64 Place holder for 64-bit user Apache HTTP Server modules. Any 64-bit modules which are added using apxs(8) are copied into this directory.  
VAR_ROOT/apache2/2.2/logs Contains server log files. The formats, names, and locations of the files in this directory can be altered by various configuration directives in the httpd.conf file.  
VAR_ROOT/apache2/2.2/proxy Directory used to cache pages if the caching feature of mod_disk_cache.  

Modules mod_fcgid, mod_jk,mod_security, and mod_dtrace are pre-installed with Apache HTTP Server. For more information about these modules, see http://fastcgi.coremail.cn/doc.htm, http://tomcat.apache.org/connectors-doc/generic_howto/quick.html, http://www.modsecurity.org/documentation/index.html, and http://prefetch.net/projects/apache_modtrace/mod_dtrace.c

MySQL Database Files

The following list describes the directory layout for the MySQL Database Server.

Directory / File
Description
OPT_ROOT/mysql/5.1/bin Contains binaries and scripts.
OPT_ROOT/mysql/5.1/lib Contains libraries for the client API.
OPT_ROOT/mysql/5.1/include Contains header files for the client API.
OPT_ROOT/mysql/5.1/man/man1 Manual pages for client programs.
OPT_ROOT/mysql/5.1/man/man8 Manual pages for server programs.
OPT_ROOT/mysql/5.1/share Shared data: locale, time zone.
OPT_ROOT/mysql/5.1/docs Contains HTML documentation.
OPT_ROOT/mysql/5.1/mysql-test Contains MySQL test programs.
OPT_ROOT/mysql/5.1/sql-bench SQL benchmark test.
OPT_ROOT/mysql/5.1/share/mysql Contains internationalization (I18N) files, sample configuration files, and utility scripts.
VAR_ROOT/mysql/5.1/data Default database data directory.
ETC_ROOT/mysql/5.1 Contains the MySQL configuration file.
OPT_ROOT/mysql/5.1/bin/mysql Client executable.
OPT_ROOT/mysql/5.1/bin/mysqld Server executable.

PHP Files

The following list describes the directory layout for PHP:

Directory / File
Description
OPT_ROOT/php/5.2/bin Contains PHP executables.
OPT_ROOT/php/5.2/lib Contains PHP library files.
OPT_ROOT/php/5.2/modules Contains PHP modules for PHP extensions.
OPT_ROOT/apache2/2.2/libexec Contains the PHP module for Apache 2 (32-bit) prefork MPM and the module name ismod_php5.so.
OPT_ROOT/php/5.2 Contains the default configuration file (php.ini).
ETC_ROOT/php/5.2/conf.d Contains extension specific INI files for each PHP extension . Here, you can enable or disable various extensions that are integrated with the package.
Note
The PHP extensions like APC, DTrace, XDebug, suhosin, and tcpwrap  are disabled by default. To enable these extensions, you need to uncomment the respective line (extensions=<module-name>.so) in the conf.d file.

Ruby Files

The following list describes the directory layout for Ruby:

Directory / File
Description
VAR_ROOT/ruby/1.8/gem_home Contains Ruby gems repository.
OPT_ROOT/ruby/1.8/bin Contains Ruby executable as well as other utility programs, and Ruby gems programs. These programs are linked from /usr/bin

Squid Proxy Server Files

The following list describes the directory layout for Squid Proxy Server:

Directory / File
Description
OPT_ROOT/squid/bin Contains executable for the Squid Proxy Server client and to run the cache.
OPT_ROOT/squid/libexec Contains ibraries.
ETC_ROOT/squid/squid.conf The main configuration file. Modify this file for Squid Proxy Server to work.

Sun GlassFish Web Stack Default Network Ports

Sun GlassFish Web Stack utilizes several network ports by default for regular component operation. The following table lists the ports by component.

Component Default Port Number (Native)
Default Port Number (Unbundled IPS/pkg(5)) for non root install only
Configuration File
Directive
Apache HTTP Server
80 10080
ETC_ROOT/apache2/2.2/httpd.conf
Listen <PortNumber>
lighttpd Web Server
80 10080
ETC_ROOT/lighttpd/1.4/lighttpd.conf
server.port = <PortNumber>
MySQL Database Server
3306 3306
ETC_ROOT/mysql/5.1/my.cnf
[mysqld]
port = <PortNumber>
Squid Proxy Server
3128 3128
ETC_ROOT/squid/squid.conf
http_port <PortNumber>
Apache Tomcat
8080 8080
VAR_ROOT/tomcat/6.0/conf/server.xml
<Service name="Catalina">
<Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443"/>
memcached 11211
11211
  -p (Command line directive)
Sun GlassFish Web Stack Enterprise Manager 8484
8484
ETC_ROOT/admin/server.conf
server.port=8484
collectd
25826
25826
ETC_ROOT/admin/collectd/collectd.conf
Listen "localhost" "25826"
Sun GlassFish Enterprise Server 4848 (for administration)
8080 (for the HTTP listener)
8181 (for the HTTPS listener)
4848 (for administration)
8080 (for the HTTP listener)
8181 (for the HTTPS listener)
GLASSFISH_ROOT/setup.xml <property name="admin.port" value="4848"/>
<property name="instance.port" value="8080"/>
<property name="https.port" value="8181"/>

Extending Sun GlassFish Web Stack

Sun GlassFish Web Stack can be easily extended by using various third party extensions. This enables you to add new features to the existing software. To compile Sun GlassFish Web Stack extensions you need to have mandatory development packages installed on your system.

Compiler Requirments:

Solaris 10: Sun Studio 12 or later.

Red Hat Enterprise Linux: RedHat Supported GCC release from the distribution repository.

Installing PHP extensions

PHP extensions are available in two forms, PECL (PHP Extension Community Library) and PEAR (PHP Extension and Application Repository). PECL extensions are shipped as C source code. PECL extensions are compiled C language extensions linked to the PHP core. As C programs , PECL extensions run more efficiently than PEAR packages. PECL includes modules for XML-parsing, access to additional databases, mail-parsing, embedding Perl or Python in PHP scripts.

A PEAR package is distributed as a gzipped tar file. Each archive consists of source code written in PHP, usually in an object-oriented style. Many PEAR packages can readily be used by developers as ordinary third party code via simple include statements in PHP.

Installing PECL extensions

The PECL extensions need to be compiled to shared object files (.so) before they can be used with PHP.

Some extensions require additional software to successfully build and install. Installation of the extension will fail if the additional software is not found in PATH, and error messages will vary depending on the required software and the extension being installed. Additional software commonly required includes GNU Autoconf and re2c (http://re2c.org/).&nbsp;

After installing Sun Studio, run the following command to download, compile and install the PECL extension:

 # OPT_ROOT/bin/pecl install <extension name>

If you are not sure of the extension name, use the following command to get a list of all the available extensions:

$  OPT_ROOT/bin/pecl list-all

Installing PEAR extensions

Run the following command to download and install the PEAR extension:

# OPT_ROOT/bin/pear install <extension name>

Installing Python extensions

Python extensions are supported through Easy Install. Easy Install is a python module (easy_install) bundled with setuptools that lets you automatically download, build, install, and manage Python packages. easy_install is capable of downloading and installing python extensions from PyPI (Python Package Index) repository.

Installing setuptools (easy_install)

Use the following commands to download and install setuptools. You need have Sun Studio installed in your system to compile setuptools package. Also, verify that Sun GlassFish Web Stack location is present in the system PATH variable. This will avoid any conflict with the existing installation of python.

  1. Download and extract the python setuptools source package from http://pypi.python.org/pypi/setuptools#downloads. Download the tar.gz file (setuptools-0.6c9.tar.gz).
  2. Run the following command to compile and install the setuptools package.
# python setup.py install

Using easy_install

easy_install is very easy to use. Just use the following command to download and install the python extension.

# python easy_install.py <package name>

You can browse through the PyPI repository by visting http://pypi.python.org/pypi

Installing Ruby extensions (RubyGems)

Ruby extensions are supported by RubyGems. RubyGems is a package manager for the Ruby programming language that provides a standard format for distributing Ruby programs and libraries (in a self-contained format called a "gem"), a tool designed to easily manage the installation of gems, and a server for distributing them.

Use the following command to install the ruby extension (gem). Make sure that you have Sun GlassFish Web Stack in PATH variable.

# gem install <gem name>

If you are not sure of gem name, use the following command to get a list of all the available gems:

# gem list -r -d

For instance, when installing the mysql gem, the paths to the MySQL 5.1 client libraries and header files must be provided, as follows:

# gem install mysql --with-mysql-include=/usr/mysql/5.1/include --with-mysql-lib=/usr/mysql/5.1/lib
Note
To use gem, make sure you have direct access to the Internet. If your system is behind a firewall or if it uses a proxy server, set the HTTP_PROXY variable.

The directory referenced by GEM_HOME should be writable. So make sure you execute the following command:

$ chmod -R a+w <GEM_HOME_PATH>

Caution - Do not perform the previously mentioned tasks, if GEM_HOME refers to $HOME/.gem.

Installing Apache Extensions

Additional features for Apache are available in the form of plug-in modules from third parties. These may take the form of a single source file which is built and installed by the user by running apxs, or a more complex build which takes the path to apxs as a configure argument.

Modules are built for 32-bit or 64-bit Apache individually. (A 64-bit build of Apache is not provided for Red Hat Enterprise Linux.)
The compiler used by apxs must match the compiler used to build Apache. On OpenSolaris, and Solaris 10, the cc command found in PATH must be Sun Studio; if gcc is installed, you may have to manipulate PATH to point to Sun Studio first. On Red Hat Enterprise Linux, gcc will be used.
Here is an example module build in which both 32-bit and 64-bit versions of the module are created:

$ pfexec /usr/apache2/2.2/bin/apxs -ci mod_example.c
$ pfexec /usr/apache2/2.2/bin/64/apxs -ci mod_example.c

This will create mod_example.so in directories /var/apache2/2.2/libexec/mod_example.so and /var/apache2/2.2/libexec/64/mod_example.so.
The recommended way to load and configure the module is by creating a file in /etc/apache2/2.2/conf.d with the following contents:

<IfDefine 64bit>
LoadModule example_module /var/apache2/2.2/libexec/64/mod_example.so
</IfDefine>
<IfDefine !64bit>
LoadModule example_module /var/apache2/2.2/libexec/mod_example.so
</IfDefine>
#module configuration directives

Modules which are built using a configure script typically provide a --with-apxs or --with-apxs2 option. Specify the path to either the 32-bit or 64-bit apxs, depending on which mode is required.

Advanced Configuration

Sun GlassFish Web Stack can take advantage of Solaris OS specific features like Solaris Zones, and DTrace. For more information, see:

Labels

server server Delete
developer developer Delete
apache apache Delete
mysql mysql Delete
php php Delete
python python Delete
webstack webstack Delete
netbeans netbeans Delete
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.
  1. Aug 05

    sabroadrace says:

    after i installed webstack 1.4 i'm failed to up apache2 service.the error as ...

    after i installed webstack 1.4 i'm failed to up apache2 service.the error as below.please assist me.TQ

    svc:/network/http:sun-apache22 (Apache 2.2 HTTP server)
    State: maintenance since Wed Aug 05 16:20:17 2009
    Reason: Start method exited with $SMF_EXIT_ERR_FATAL.
    See: http://sun.com/msg/SMF-8000-KS
    See: man -M /opt/webstack/apache2/2.2/man -s 8 httpd
    See: /var/svc/log/network-http:sun-apache22.log
    Impact: This service is not running.
    bash-3.00#

  2. Aug 20

    flod says:

    The link in the section "Installing Sun GlassFish Web Stack on Solaris and Linux...

    The link in the section "Installing Sun GlassFish Web Stack on Solaris and Linux Platforms" to http://www.sun.com/systems/solutions/amp/getit.jsp
    leads to Webstack 1.4 .

    But Sun Webstack 1.5 seems to be there: http://www.sun.com/software/webstack/index.xml

Sign up or Log in to add a comment or watch this page.


The individuals who post here are part of the extended Sun Microsystems community and they might not be employed or in any way formally affiliated with Sun Microsystems. The opinions expressed here are their own, are not necessarily reviewed in advance by anyone but the individual authors, and neither Sun nor any other party necessarily agrees with them.

Copyright 1994-2009 Sun Microsystems, Inc.
Powered by Atlassian Confluence
Sun Guidelines on Public Discourse Privacy Policy Terms of Use Trademarks Site Map Employment Investor Relations Contact