Beruflich Dokumente
Kultur Dokumente
Date
October 8, 2010
Target Audience
System Administrator
Software Developer
Application Manager
SUMMARY
This document explains how to install GX WebManager on a Linux environment running an
Apache web server. After completing the tasks described in this Installation Guide, a complete
GX WebManager will be set up (including the GX search engine). This document does not
describe in a step-by-step fashion how to install or configure the other various external
software components external to GX WebManager – For information on installing/configuring
those components, please refer to the documentation provided by the manufacturer(s).
KEY
SYS If ‘SYS’ is shown in the left margin, the text denoted by this marker is meant for system
administrators.
DEV If ‘DEV’ is shown in the left margin, the text denoted by this marker is meant for software
developers.
PREREQUISITES
Familiarity with the Linux operating system
RELATED TOPICS
Management of directory structure for releases, updates, and deployments
Use of the Setup tool
VERSIONING
Version Date Description
1.0 August 13, 2007 Initial version (based on Documentation 8.3 Version 1.7)
1.1 August 14, 2007 Minor modifications after review
1.2 August 21, 2007 Minor modifications after training
1.21 September 04, 2007 Extra LoadModule for Apache added to accommodate SEO
1.3 December 3, 2007 Translated to English and added small changes
1.4 January 9, 2008 Added section on how to create a deploy
1.41 January 29, 2008 Changed URL to download JDK 1.5
1.5 February 8, 2008 Added section on multiple websites
1.51 February 22, 2008 Replaced reference to Appendix with reference to the “EN – GX
WebManager 9 – Installation on Linux – commands.txt” file
1.52 February 26, 2008 Added document ID on title page
1.60 March 4, 2008 Added section on distributed setups; expanded set of setup
parameters of Tomcat (added appendix with explanations)
1.61 March 12, 2008 Fixed minor textual issues
1.62 April 21, 2008 Added JBoss installation/configuration instructions.
1.63 April 24, 2008 Minor changes in Appendix A (settings.xml)
1.64 May 8, 2008 Added remark about reducing the logging amount in Jboss
1.65 May 9, 2008 Removed the TTL parameter from the startup scripts in Tomcat
and Jboss: causes problems in production environments.
1.66 June 4, 2008 Changed the text on how to choose the ID of a cluster node
1.67 June 6, 2008 Corrected minor typos in Appendix C
1.68 June 20, 2008 Applied minor changes in the Distributed WebManager chapter
1.69 July 30, 2008 Minor changes in the Distributed WebManager chapter
1.70 September 9, 2008 Added comment on syncDelay property in distributed section
1.71 December 4, 2008 Corrected one little typo
1.72 December 11, 2008 Added the “user.language” and “user.country” parameters to
the Java startup properties to avoid Locale-issues with Oracle
1.73 December 12, 2008 Removed smart-quotes to improve copy-pasting
1.74 January 6, 2009 Changed hint about filling the my.ini of MySQL
1.75 March 4, 2009 Changed some default settings
1.76 March 13, 2009 Added “sun.net.inetaddr.ttl” to the startup parameters
1.80 April 3, 2009 Added section 4.2 on the changes to the /etc/hosts while
creating a new webinitiative in WebManager. Also added a new
setting for MySQL (if the site runs on MySQL)
1.81 May 14, 2009 Section 1.16 modified
1.90 May 18, 2009 Updated for GX WebManager version 9.8
2.00 August 14, 2009 Updated for GX WebManager version 9.9
2.01 August 18, 2009 Minor edits.
2.10 May 11, 2010 Updated for GX WebManager version 9.12
2.20 October 8, 2010 Updated for GX WebManager version 9.13
TABLE OF CONTENTS
ACTIONS)
SYS This chapter describes how to set up a GX WebManager installation in a Linux production
environment. The result is that all requests for static content (images, style sheets, etc.) are
handled through Apache. Requests for dynamic content (GX WebManager’s HTML) are forwarded
by Apache to GX WebManager which processes the requests. In this document, an environment
will be created with two host names:
Note: Bold text appearing in the examples is project-specific and needs to be modified
specifically for each particular environment.
1. 1 Th e di r e ct ory str u ct ur e
SYS After installing GX WebManager, a folder structure is created. You are free to choose your own
structure, but GX recommends the following:
Note: You can create all or part of this directory structure before starting the entire installation
process. Create the directories marked with before starting the installation.
1. 2 J av a D ev el o p m e nt Ki t
SYS GX WebManager uses the Java SE Development Kit (JDK) that can be downloaded from:
http://java.sun.com/javase/downloads/.
Notes:
For versions of GX WebManager 9.13 and higher, GX highly recommends that you use Java
version 1.6.0_21. If you use Java 5.x, GX WebManager’s performance will be suboptimal.
Use the 32-bit version of Java if possible.
Official support for Java 5 ceased in October 2009.
Download and install JDK 6.0 Update 18 or higher for your platform Example UNIX commands for
the JDK 6.0 installation:
cd /usr
mkdir java
cd java
chmod 700 /tmp/jdk-1_6_0_18-linux-i586-rpm.bin
/tmp/jdk-1_6_0_18-linux-i586-rpm.bin
rm -f /tmp/jdk-1_6_0_18-linux-i586-rpm.bin
ln -sf /usr/java/jdk1.6.0_18 /usr/java/jdk1.6
Tip: Verify that the new JDK is being used: After typing java –version, the Java version
number is displayed. If it is not the correct version, modify the 2 PATH variable to point to the
correct version. For example:
export PATH=/usr/java/jdk1.6/bin:$PATH
1. 3 A p a c h e M av e n
SYS To install GX WebManager, use the Maven build tool. This tool can be downloaded from:
http://maven.apache.org/. Download and install version 2.0.8 or higher. For example:
cd /usr/local/
tar zxf /tmp/apache-maven-2.0.8-bin.tar.gz
rm -rf /tmp/apache-maven-2.0.8*
ln -sf apache-maven-2.0.8 maven
After the installation, Maven will still have to be recorded in the PATH variable and the M2_HOME
variable will need to be set. For example:
export PATH=/usr/local/maven/bin:$PATH
2 export
Setting M2_HOME=/usr/local/maven/
environment variables is best done in the startup script of the shell being used (e.g., “~/.profile” or
“~/.cshrc”). JAVA_HOME=/usr/java/jdk1.6/
export This adds the variable permanently so you do not have to enter the export command over and
over.
Tip: Verify that the new version of Maven is being used. Versions older than 2.0.6 will not work
well when installing GX WebManager. After typing mvn –version, the Maven version number is
displayed. If an older version is indicated, remove the Maven version already on the system.
1. 4 Th e d a t ab a s e
Oracle
MS SQL
MySQL 5.0
Install one of the databases and create a user name and password for someone with permission to
create and fill a table. Example UNIX commands for MySQL in a Red Hat Enterprise Linux 4
environment:
cd /tmp
rpm -i MySQL-server-community-5.0.45-0.rhel4.i386.rpm
rpm -i MySQL-client-community-5.0.45-0.rhel4.i386.rpm
rpm -i MySQL-shared-community-5.0.45-0.rhel4.i386.rpm
/usr/bin/mysqladmin -u root password 'myDBpassword'
The default settings of MySQL need to be adjusted to make it work smoothly with GX
WebManager. Create the file “my.cnf” and place it in the directory “/etc”. The initial contents
of this document should be:
[mysqld]
max_allowed_packet=128M
innodb_buffer_pool_size=256M
[mysqldump]
max_allowed_packet=128M
1. 5 Th e a p pl i c a ti o n s e rve r (T o m c at or J B oss )
1.5.1 Tomcat
cd /vol/www/
tar zxf /tmp/apache-tomcat-5.5.29.tar.gz
mv apache-tomcat-5.5.29 tomcat-mywebsite
rm -f /tmp/apache-tomcat-5.5.29.tar.gz
# Also add the directories for the expanded GX WebManager files
cd tomcat-mywebsite
mkdir deploy
mkdir deploy/appBase
CATALINA_HOME=/vol/www/tomcat-mywebsite
JAVA_HOME=/usr/java/jdk1.6
JAVA_OPTS="${JAVA_OPTS} -Dsun.rmi.dgc.server.gcInterval=600000"
JAVA_OPTS="${JAVA_OPTS} -Dsun.rmi.dgc.client.gcInterval=600000"
JAVA_OPTS="${JAVA_OPTS} -Duser.language=en -Duser.country=US"
JAVA_OPTS="${JAVA_OPTS} -XX:+UseConcMarkSweepGC"
JAVA_OPTS="${JAVA_OPTS} -Djava.awt.headless=true"
JAVA_OPTS="${JAVA_OPTS} -Dwebmanager.clustering.readonly=false"
JAVA_OPTS="${JAVA_OPTS} -Dsun.net.inetaddr.ttl=300"
JAVA_OPTS="${JAVA_OPTS} -
Djavax.xml.transform.TransformerFactory=com.sun.org.apache.xalan.internal.xs
ltc.trax.TransformerFactoryImpl"
JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -Xms512M -XX:MaxPermSize=128m"
JAVA_OPTS="${JAVA_OPTS} -XX:-ReduceInitialCardMarks"
JAVA_OPTS="${JAVA_OPTS} -Dorg.apache.jasper.runtime.JspFactoryImpl.USE_POOL=
false"
The used settings in the above example are good defaults and need no adjusting. The only
parameter that might need another value is the Xmx parameter. The number in the Xmx
parameter determines the maximum RAM allowed for the Java process in which GX WebManager
runs. In this example, the RAM is set at 1024 MB (1 GB). The higher this number is set, the
smoother GX WebManager will run.
Note: See appendix C for more details and explanations on the JAVA_OPTS settings.
Clustering note: the above settings are fine for a standalone setup of GX WebManager and the
setup of a master node in a clustered environment. For a slave node one setting has to be
adjusted: set the property “webmanager.clustering.readonly” to true.
1.5.2 JBoss
SYS If you have already installed Tomcat, skip this section! Only install JBoss if you have not yet
installed Tomcat.
cd /vol/www
unzip /tmp/jboss-4.2.2.GA.zip
mv jboss-4.2.2.GA jboss-mywebsite
rm -f /tmp/jboss-4.2.2.GA.zip
JAVA_OPTS="${JAVA_OPTS} -Dsun.rmi.dgc.server.gcInterval=600000"
JAVA_OPTS="${JAVA_OPTS} -Dsun.rmi.dgc.client.gcInterval=600000"
JAVA_OPTS="${JAVA_OPTS} -Duser.language=en -Duser.country=US"
JAVA_OPTS="${JAVA_OPTS} -XX:+UseConcMarkSweepGC"
JAVA_OPTS="${JAVA_OPTS} -Djava.awt.headless=true"
JAVA_OPTS="${JAVA_OPTS} -Dwebmanager.clustering.readonly=false"
JAVA_OPTS="${JAVA_OPTS} -Dsun.net.inetaddr.ttl=300"
JAVA_OPTS="${JAVA_OPTS} -
Djavax.xml.transform.TransformerFactory=com.sun.org.apache.xalan.internal.xs
ltc.trax.TransformerFactoryImpl"
JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -Xms512M -XX:MaxPermSize=128m"
JAVA_OPTS="${JAVA_OPTS} -XX:-ReduceInitialCardMarks"
JAVA_OPTS="${JAVA_OPTS} -
Dorg.apache.jasper.runtime.JspFactoryImpl.USE_POOL=false"
By default, the settings in the above example need no further adjusting. The only parameter that
you might have to change is the Xmx parameter (highlighted in red above). The value of the Xmx
parameter determines the maximum amount of RAM allowed for the Java process in which GX
WebManager runs. In the above example, the maximum amount of RAM is set to 1024 MB (1 GB).
The higher this number is set, the better the performance you will get running GX WebManager.
Note: See appendix C for more information about the JAVA_OPTS settings.
Clustering note: the above settings are ok for a standalone setup of GX WebManager and the
setup of a master node in a clustered environment. For a slave node one setting has to be
adjusted: set the property “webmanager.clustering.readonly” to true.
By default JBoss comes with three example server configurations: ‘all’, ‘default’ and ‘minimal’.
In order to run GX WebManager, a new configuration (called ‘webmanager’) will have to be
created that is based on the minimal example extended with the JBoss-web module and several
libraries. The creation of a server configuration involves copying the desired components from the
example server configurations. For example:
cd /vol/www/jboss-mywebsite/server
cp -a minimal webmanager
cp -a default/deploy/jboss-web.deployer webmanager/deploy
cp default/lib/el-api.jar webmanager/lib
cp default/lib/jboss-ejb3x.jar webmanager/lib
cp default/lib/jboss-j2ee.jar webmanager/lib
cp default/lib/jboss.jar webmanager/lib
cp default/lib/jboss-jaxws.jar webmanager/lib
cp default/lib/jbosssx.jar webmanager/lib
cp default/lib/jbossws-common.jar webmanager/lib
cp default/lib/jbossws-framework.jar webmanager/lib
cp default/lib/jbossws-spi.jar webmanager/lib
cp default/lib/jsp-api.jar webmanager/lib
cp default/lib/servlet-api.jar webmanager/lib
1. 6 A p a c h e w e b s er v er
SYS Download the latest version of the Apache web server (http://httpd.apache.org/download.cgi)
and install it. There are a few configuration differences between Apache versions 2.0 and 2.2.
Each is explained separately in the following paragraphs.
How to compile Apache is shown in the examples below. It is also possible to use the Apache
included in the package. Because of the Apache package updates, it is recommended that you
configure Apache as far as possible according to the package standards, for example, by including
configuration files instead of modifying the httpd.conf itself.
Installation of httpd
For example:
cd /tmp
tar -zvxf httpd-2.0.63.tar.gz
cd httpd-2.0.63
./configure -prefix=/vol/www/server --enable-mods-shared="mime-magic
rewrite proxy cache disk-cache headers expires info" --enable-so
make
make install
cd ..
rm -rf httpd-2.0.63*
Installation of mod_jk
The mod_jk module is necessary to connect Apache and Tomcat or JBoss. Download the source
from http://www.apache.org/dist/tomcat/tomcat-connectors/jk/source/ and compile it:
cd /tmp
tar -zvxf tomcat-connectors-1.2.25-src.tar.gz
cd tomcat-connectors-1.2.25-src/native
./buildconf.sh
./configure --with-apxs=/vol/www/server/bin/apxs
make
make install
cd ../..
rm -rf tomcat-connectors-1.2.25-src*
Configuration of httpd.conf
<IfModule mod_jk.c>
JkWorkersFile conf/workers.properties
JkLogFile logs/mod_jk.log
JkLogLevel info
</IfModule>
NameVirtualHost *:80
<VirtualHost *:80>
ServerName www.mywebsite.com
DocumentRoot "/vol/www/mywebsite/web-docs/"
ErrorLog logs/www.mywebsite.com_error.log
CustomLog logs/www.mywebsite.com_custom.log common
<Directory "/vol/www/mywebsite/web-docs/">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
<IfModule mod_jk.c>
JkMount /web/* mywebsite
</Ifmodule>
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/web/
RewriteRule ^/(.*)\.htm$ /web/$1.htm [P,L]
</IfModule>
</VirtualHost>
Minimal setup of the VirtualHost for the internal edit environment of GX WebManager:
<VirtualHost *:80>
ServerName edit.mywebsite.com
DocumentRoot "/vol/www/mywebsite/web-docs/"
ErrorLog logs/edit.mywebsite.com_error.log
CustomLog logs/edit.mywebsite.com_custom.log common
<Directory "/vol/www/mywebsite/web-docs/">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
<Directory "/vol/www/mywebsite/web-docs/wm/b/">
ExpiresActive ON
ExpiresDefault "now plus 10 minutes"
Header set Cache-Control "max-age=600"
</Directory>
<IfModule mod_jk.c>
JkMount /web/* mywebsite
</Ifmodule>
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/web/
RewriteRule ^/(.*)\.htm$ /web/$1.htm [P,L]
</IfModule>
</VirtualHost>
The workers.properties
worker.list=mywebsite
worker.mywebsite.port=8009
worker.mywebsite.host=localhost
worker.mywebsite.type=ajp13
worker.mywebsite.connection_pool_timeout=600
Note: Install Apache 2.2 only if no web server has been installed. Skip this section if you have
already installed Apache 2.0 from the previous section (Section 1.6.1).
Installation of httpd
For example:
cd /tmp
tar -zvxf httpd.2.2.15.tar.gz
cd httpd.2.2.15
./configure -prefix=/vol/www/server --enable-mods-shared="mime-magic
rewrite proxy proxy-ajp cache disk-cache headers expires info" --enable-
so
make
make install
cd ..6
rm -rf httpd.2.2.15*
In Apache 2.2, the configuration is clearer because the AJP connector comes standard with it - in
Apache 2.0, the mod_jk module has to be installed separately. The GX WebManager configuration
for Apache 2.2 depends on two files: httpd.conf and httpd-vhosts.conf.
Configuration of httpd.conf
The httpd-vhosts.conf file also needs to be read. Search in the httpd.conf for vhosts and
delete the # at the beginning of the line:
Include conf/extra/httpd-vhosts.conf
Configuration of httpd-vhosts.conf
<VirtualHost *:80>
ServerName www.mywebsite.com
DocumentRoot "/vol/www/mywebsite/web-docs/"
ErrorLog logs/www.mywebsite.com_error.log
CustomLog logs/www.mywebsite.com_custom.log common
<Directory "/vol/www/mywebsite/web-docs/">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
ProxyPass /web/ ajp://localhost:8009/web/
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/web/
RewriteRule ^/(.*)\.htm$ /web/$1.htm [P,L]
</IfModule>
</VirtualHost>
<VirtualHost *:80>
ServerName edit.mywebsite.com
DocumentRoot "/vol/www/mywebsite/web-docs/"
ErrorLog logs/edit.mywebsite.com_error.log
CustomLog logs/edit.mywebsite.com_custom.log common
<Directory "/vol/www/mywebsite/web-docs/">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
<Directory "/vol/www/mywebsite/web-docs/wm/b/">
ExpiresActive ON
ExpiresDefault "now plus 10 minutes"
Header set Cache-Control "max-age=600"
</Directory>
ProxyPass /web/ ajp://localhost:8009/web/
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/web/
RewriteRule ^/(.*)\.htm$ /web/$1.htm [P,L]
</IfModule>
</VirtualHost>
1. 7 U n p ac ki n g GX W e b M a n a g er r el e as e
Before GX WebManager can be configured, the release has to be unpacked. To unpack the GX
WebManager release, proceed as follows:
cd /vol/www/
mkdir webmanager-mywebsite
cd webmanager-mywebsite
unzip /tmp/GX_WebManager_9.12.0_SDK.zip
The GX WebManager configuration is set in settings.xml. This file is located in the root of the
unpacked GX WebManager release (/vol/www/webmanager-mywebsite/). Appendix A gives
additional information about the most important properties that need to be modified in the
settings.xml.
1. 9 C re a ti n g t h e d at a b as e (s )
SYS GX WebManager data is stored in a relational database (MS SQL, MySQL, or Oracle). Create the
databases desired for this installation. A complete GX WebManager installation requi res only one
database. In certain cases (performance/security), it is possible to save specific items in separate
databases. A separate database can be created for the following components:
GX WebManager core (JCR repository storage)
GX WebManager other (‘externaldb’)
This manual describes a configuration that saves both components in one database
(“wm9mywebsite”). The database for MySQL and MS SQL can be created with one single command
and filled with the necessary tables. To create databases and the standard tables for Oracle, it is
required that you use the standard Oracle tools (SQL Plus can be used, for instance). The initial
scripts for all databases are: /vol/www/webmanager-mywebsite/webmanager-sqlscripts/.
cd /vol/www/webmanager-mywebsite
mvn -s settings.xml -P create-mysql-db
# If the content of JCR should be stored in another DB, then run:
# mysqladmin create wm9mywebsite_jcr -u root -p
cd /vol/www/webmanager-mywebsite
mvn -s settings.xml -P create-mssql-db
# If the content of JCR should be stored in another DB, then
# create the DB using the Enterprise Manager
Use SQL Plus, for example, to create the database(s). Run the webmanager-oracle-
scripts.sql script, located in the /vol/www/webmanager-mywebsite/webmanager-
sqlscripts/ directory.
1. 1 0 I nst al l i n g GX W e b M a n a g er r el e as e
SYS The basic server setup is now complete. In this section, the GX WebManager release is installed.
To install the release, proceed as follows:
cd /vol/www/webmanager-mywebsite
mvn -s settings.xml -P configure-jcr-repository
mvn -s settings.xml -P build-project
cd /vol/www/mywebsite/
mkdir web-docs
cd web-docs
unzip /vol/www/webmanager-mywebsite/webmanager-webapps/\
webmanager-static-webapp/target/\
webmanager-static-webapp-1.0-SNAPSHOT.war
cp /vol/www/webmanager-mywebsite/webmanager-webapps/\
webmanager-backend-webapp/target/\
webmanager-backend-webapp-1.0-SNAPSHOT.war .
cd /vol/www/mywebsite/work/edition-bundles
cp /vol/www/webmanager-mywebsite/edition-bundles/*.jar .
cd /vol/www/mywebsite/system/
cp /vol/www/webmanager-mywebsite/settings.xml .
cp /vol/www/webmanager-mywebsite/webmanager-cleansite/target/\
webmanager-cleansite-1.0-SNAPSHOT.jar .
1. 1 1 C o n fi g uri n g T om c a t
SYS For Tomcat, two files still need to be created. Place these files in the /vol/www/tomcat-
mywebsite/conf directory.
<Service name="WebManager">
<Connector port="8009" enableLookups="false" redirectPort="8443"
debug="1" protocol="AJP/1.3" URIEncoding="UTF-8"
emptySessionPath="true" connectionTimeout="600000"/>
<Engine name="WebManager" defaultHost="localhost">
<Realm className="org.apache.catalina.realm.UserDatabaseRealm"
resourceName="WMUserDatabase"/>
<Host name="localhost" unpackWARs="true" autoDeploy="false"
deployOnStartup="true"
appBase="/vol/www/tomcat-mywebsite/deploy/appBase">
<Valve className="org.apache.catalina.authenticator.SingleSignOn"
/>
<Context path="/web"
docBase="/vol/www/tomcat-mywebsite/deploy/webmanager-
backend-webapp-1.0-SNAPSHOT.war">
<Logger className="org.apache.catalina.logger.FileLogger"
directory="logs" prefix="webmanager." suffix=".log"
timestamp="true"/>
</Context>
</Host>
</Engine>
</Service>
</Server>
By default, GX WebManager blocks login requests from the front-end and back-end while it is
starting up. When you try to log in from the front-end or back end while GX WebManager is still in
the startup phase, the following message displays:
If for troubleshooting purposes you want to turn off the blocking mechanism, follow these steps:
Add the following ‘JAVA_OPTS’ property to the beginning of the GX WebManager block:
-Dwebmanager.startupblock.skip=true
For example:
When blocking is turned off, requests from the front-end will return a cached version of
the requested page or a white page with no content when GX WebManager has not
finished the startup process; requests from the backend will show the GX WebManager
login screen, however you will not be able to log in.
To turn blocking back on, change the ‘true’ declaration to ‘false’. For example:
-Dwebmanager.startupblock.skip=false
1. 1 2 C o n fi g uri n g JB os s
First, the server configuration itself needs to be modified. Open the file /vol/www/jboss-
mywebsite/server/webmanager/deploy/jboss-web.deployer/META-INF/jboss-
service.xml and locate the following line:
<attribute name="DefaultSecurityDomain">java:/jaas/other</attribute>
Change it to:
<attribute name="DefaultSecurityDomain">java:/jaas/myweb</attribute>
Now locate for the following snippet at the bottom of the same file:
<depends>jboss:service=TransactionManager</depends>
1.12.2 server.xml
<Server>
<Listener className="org.apache.catalina.core.JasperListener" />
<Service name="jboss.web">
<Connector port="8009" address="${jboss.bind.address}"
protocol="AJP/1.3"
emptySessionPath="true" enableLookups="false" redirectPort="8443" />
<Engine name="jboss.web" defaultHost="${jboss.bind.address}">
<Realm className="org.jboss.web.tomcat.security.JBossSecurityMgrRealm"
certificatePrincipal="org.jboss.security.auth.certs.SubjectDNMapping"
allRolesMode="authOnly"
/>
<Host name="${jboss.bind.address}"
autoDeploy="true" deployOnStartup="true" deployXML="true"
configClass="org.jboss.web.tomcat.security.config.JBossContextConfig">
<Alias>www.mywebsite.com</Alias>
<Alias>edit.mywebsite.com</Alias>
</Host>
</Engine>
</Service>
</Server>
Replace the <Alias/> tags with the hostnames of your website. There is no limit on the number
of aliases you can add.
The last part of the configuration of JBoss involves configuring the users that have login
permissions for diagnostic purposes. First, open the file /vol/www/jboss-
mywebsite/server/webmanager/conf/jboss-service.xml and add the following snippet
just before the </server> tag at the bottom of the file:
<mbean code="org.jboss.security.plugins.JaasSecurityManagerService"
name="jboss.security:service=JaasSecurityManager">
<attribute name="ServerMode">true</attribute>
<attribute name="SecurityManagerClassName">
org.jboss.security.plugins.JaasSecurityManager</attribute>
<attribute name="DefaultUnauthenticatedPrincipal">
anonymous</attribute>
<attribute name="DefaultCacheTimeout">1800</attribute>
<attribute name="DefaultCacheResolution">60</attribute>
<attribute name="DeepCopySubjectMode">false</attribute>
</mbean>
<mbean code="org.jboss.security.auth.login.XMLLoginConfig"
name="jboss.security:service=XMLLoginConfig">
<attribute name="ConfigResource">login-config.xml</attribute>
</mbean>
<mbean code="org.jboss.security.plugins.SecurityConfig"
name="jboss.security:name=SecurityConfig">
<attribute name="LoginConfig">jboss.security:service=XMLLoginConfig
</attribute>
</mbean>
<?xml version='1.0'?>
<!DOCTYPE policy PUBLIC
"-//JBoss//DTD JBOSS Security Config 3.0//EN"
"http://www.jboss.org/j2ee/dtd/security_config.dtd">
<policy>
<application-policy name = "client-login">
<authentication>
<login-module code = "org.jboss.security.ClientLoginModule"
flag = "required">
</login-module>
</authentication>
</application-policy>
Create a password for the wmadmin user by running the following command:
Make a note of the resulting hash code. Now create a file called
/vol/www/jboss-mywebsite/server/webmanager/conf/users.properties
wmadmin=<hash code>
Where <hash code> is the hash code you generated in the previous step.
wmadmin=wmadmin
More users may be created by running the RFC2617Digest tool and adding the users to the
users.properties and roles.properties file as described above.
1. 1 4 Se tti n g p er mi s si on s c o rr e ctly
SYS During installation, the root account is used. After installation, it is recommended that you attach
permissions to certain directories, for example:
New users can be created with the ‘adduser’ command. New groups can be creat ed with the
‘groupadd’ command.
Assuming the above directory structure, users, and groups, the following UNIX commands can be
used:
1. 1 5 M a k e t h e h os t na m es r es olv a bl e
SYS The server on which GX WebManager is installed needs to be able to resolve the hostnames that
are used for the edit environment and the external environment of GX WebManager. In the
example the hostnames are “www.mywebsite.com” and “edit.mywebsite.com”. Add the used
hostnames to the file /etc/hosts if the used hostnames don’t resolve to the right IP address on
the server.
1. 1 6 Se tti n g u p r c s cri p ts
SYS All files are now ready and configured correctly: the Application server (Tomcat or JBoss) and
Apache can be started. Make sure that the GX search engine (if necessary), database, Application
server, and Apache automatically start after a system reboot. Make sure that in the rc scripts for
the Application server the directories are being removed that are temporary for the Application
server, before GX WebManager is started.
An example of rc scripts for Tomcat and the Httpd for Redhat Enterprise Server 4 are included in
the “GXD0060_en - GX WebManager 9 - Installation Linux – commands - yyyymmdd.txt” file.
1. 1 7 C o nt r ol l i n g t h e s t a rt up bl oc k m e c h a n ism
By default, GX WebManager blocks login requests from the front-end and back-end while it is
starting up. When you try to log in from the front-end or back end while GX WebManager is still in
the startup phase, the following message displays:
Note: If GX WebManager receives a request for a page from either the front-end and backend
during the startup sequence between the time that the log messages Server startup in <x>
ms and GX WebManager started successfully in <x> ms appear, the following message
will appear in the browser:
Add the following ‘JAVA_OPTS’ property to the beginning of the GX WebManager block:
-Dwebmanager.startupblock.skip=true
For example:
When blocking is turned off, requests from the front-end will return a cached version of
the requested page or a white page with no content when GX WebManager has not
finished the startup process; requests from the backend will show the GX WebManager
login screen, however you will not be able to log in.
To turn blocking back on, change the ‘true’ declaration to ‘false’. For example:
-Dwebmanager.startupblock.skip=false
This section explains how to create and process deploys. This is done in the following order:
Engineer: How to create a deploy;
Engineer: What items of the deploy should be sent to the system administrator;
System administrator: How to process the delivered files;
System administrator: How to perform a rollback if necessary.
2. 1 C re a ti n g t h e d e pl o y
A deploy is always created with a specific target environment in mind. So, for example, a deploy
can specifically be created for a test environment. For each target environment you need a
separate settings.xml. For a test environment, copy the settings.xml to settings-
test.xml and then adjust the properties in the settings-test.xml file. The typical
properties you should check to ensure they are correct are:
Pathnames
Hostnames
Database properties
Usernames/passwords
After the properties have been set in the target environment, execute the following command in
a DOS shell:
A new folder with the name ‘target’ is created which will contain two folders and one ZIP -file.
2. 2 W h at t o d el i v er t o th e syst e m a d mi ni str at or
DEV After the deploy has been built, a ZIP-file is present in the ‘target’ folder. The default name of
the ZIP-file is “webmanager-webmanager-1.0-SNAPSHOT.zip”. Send the next three files to the
system administrator of the target environment:
1. webmanager-backend-webapp-1.0-SNAPSHOT.war (present in the root of the ZIP-file);
2. webmanager-static-webapp-1.0-SNAPSHOT.war (present in the root of the ZIP-file);
3. Gather all WCBs into one new ZIP-file.
4. All WCBs present in the edition-bundles directory of the unzipped archive.
2. 3 H o w t o pr o c es s t h e d e pl oy
SYS After receiving the files from the developer, the system engineer has to take the following steps
to process those files:
Stop Tomcat.
To support a rollback, backup the following folders and files:
o /vol/www/tomcat-mywebsite/deploy/webmanager-backend-webapp-1.0-
SNAPSHOT.war
o /vol/www/mywebsite/web-docs/static/
o /vol/www/mywebsite/web-docs/wm/
o /vol/www/mywebsite/web-docs/toolbar/
o /vol/www/mywebsite/work/edition-bundles/
o Also create a backup from your relational database
Copy webmanager-backend-webapp-1.0-SNAPSHOT.war to /vol/www/tomcat-
mywebsite/deploy
Unzip the webmanager-static-webapp-1.0-SNAPSHOT.war to
/vol/www/mywebsite/web-docs/ (‘y’ to overwrite ALL)
Unzip the WCB zip-file to /vol/www/mywebsite/work/deploy (‘y’ to overwrite ALL)
Remove the WCBs present in the edition-bundles directory.
Recopy the WCBs that were backed up in the second step above into the
/vol/www/mywebsite/work/edition-bundles/ directory. Use the files in the
edition-bundles directory that were delivered by the engineer.
Remove the content of the following folders:
o vol/www/mywebsite/work/osgi/*
o vol/www/tomcat-mywebsite/deploy/appBase/*
o Tomcat 5.5/work/*
o Tomcat 5.5/temp/*
o vol/www/tomcat-mywebsite/deploy/appBase
Start Tomcat.
2. 4 H o w t o r o l l b ac k a d e pl oy
SYS It is possible that GX WebManager will not start correctly after installing a new deploy. Usually
this is caused by incorrect configuration settings. To immediately switch back to the last known
good configuration, perform these steps:
Stop Tomcat
Restore the files from the backup:
o Copy webmanager-backend-webapp-1.0-SNAPSHOT.war back to
/vol/www/tomcat-mywebsite/deploy/.
o Copy the ‘static’, ‘toolbar’ and ‘wm’ folder back to
/vol/www/mywebsite/web-docs/.
o Remove all files in the /vol/www/mywebsite/work/deploy/ folder.
o Copy the WCBs back to /vol/www/mywebsite/work/deploy.
Start Tomcat.
Note: If GX WebManager receives a request for a page from either the front -end and backend
during the startup sequence between the time that the log messages Server startup in <x>
ms and GX WebManager started successfully in <x> ms appear, the following message
will appear in the browser:
3 MULTIPLE WEBSITES
This chapter describes how to add a new website (also called a ‘webinitiative’ in GX WebManager)
to an existing installation.
3. 1 Ex p a n di n g th e di r e ct or y st r u ct ur e
SYS For each new webinitiative, the directory structure needs to be expanded so the files from the
new webinitiative will have their own place in the total directory structure.
In the directory structure below the new directories are depicted in bold.
/vol/www/tomcat-mywebsite/deploy/appBase
/vol/www/mywebsite/configuration/
/streaming/
/system/
/web-docs/
/work/
/mysecondsite/web-docs/cfg/
/upload/
/upload_mm/
/static/ -> ../../web-docs/static
/wm/ -> ../../web-docs/wm
cd /vol/www/mywebsite/
mkdir mysecondsite
mkdir mysecondsite/web-docs
mkdir mysecondsite/web-docs/cfg
mkdir mysecondsite/web-docs/upload
mkdir mysecondsite/web-docs/upload_mm
cd mysecondsite/web-docs
ln –s ../../web-docs/static static
ln –s ../../web-docs/wm wm
cd /vol/www/mywebsite/
chown –R tomcat.www .
chmod –R a+rX .
3. 2 M a k e t h e n e w h os t n a me s r es ol va bl e
SYS The server on which GX WebManager is installed needs to be able to resolve the hostnames that
are used for the edit environment and the external environment of GX WebManager. In the
example the hostnames are “www.mysecondsite.com” and “edit.mysecondsite.com”. Add the
used hostnames to the file /etc/hosts if the used hostnames don’t resolve to the right IP
address on the server.
3. 3 C h a n g e t h e A p a c h e c o n fi g ur ati o n
SYS When adding a new webinitiative to GX WebManager, the configuration of the Apache webserver
also needs to be changed. In the configuration files the new URLs for the website and its edit
environment need to be present. The change is explained for both Apache version 2.0 and version
2.2.
For the new webinitiative two new VirtualHost entries need to be added to the httpd.conf
file. For the external environment of the website consider the following:
<VirtualHost *:80>
ServerName www.mysecondsite.com
DocumentRoot "/vol/www/mywebsite/mysecondsite/web-docs/"
ErrorLog logs/www.mysecondsite.com_error.log
CustomLog logs/www.mysecondsite.com_custom.log common
<Directory "/vol/www/mywebsite/mysecondsite/web-docs/">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
<IfModule mod_jk.c>
JkMount /web/* mywebsite
</Ifmodule>
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/web/
RewriteRule ^/(.*)\.htm$ /web/$1.htm [P,L]
</IfModule>
</VirtualHost>
The internal edit environment of the new webinitiative also requires the following additions:
<VirtualHost *:80>
ServerName edit.mysecondsite.com
DocumentRoot "/vol/www/mywebsite/mysecondsite/web-docs/"
ErrorLog logs/edit.mysecondsite.com_error.log
CustomLog logs/edit.mysecondsite.com_custom.log common
<Directory "/vol/www/mywebsite/mysecondsite/web-docs/">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
<Directory "/vol/www/mywebsite/mysecondsite/web-docs/wm/b/">
ExpiresActive ON
ExpiresDefault "now plus 10 minutes"
Header set Cache-Control "max-age=600"
</Directory>
<IfModule mod_jk.c>
JkMount /web/* mywebsite
</Ifmodule>
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/web/
RewriteRule ^/(.*)\.htm$ /web/$1.htm [P,L]
</IfModule>
</VirtualHost>
SYS For each new webinitiative in GX WebManager, two new VirtualHost entries to httpd-
vhosts.conf are needed. This file is located in the /vol/www/server/conf/extra directory
of Apache. For the external environment of the website add the following:
<VirtualHost *:80>
ServerName www.mysecondsite.com
DocumentRoot "/vol/www/mywebsite/mysecondsite/web-docs/"
ErrorLog logs/www.mysecondsite.com_error.log
CustomLog logs/www.mysecondsite.com_custom.log common
<Directory "/vol/www/mywebsite/mysecondsite/web-docs/">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
ProxyPass /web/ ajp://localhost:8009/web/
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/web/
RewriteRule ^/(.*)\.htm$ /web/$1.htm [P,L]
G X</IfModule>
SOFTWARE B.V. e-mail info@gxsoftware.com http://www.gxsoftware.com/ 37/64
</VirtualHost>
INSTALLATION in a Linux Production Environment
Example of minimal setup of the VirtualHost for the internal environment of GX WebManager:
<VirtualHost *:80>
ServerName edit.mysecondsite.com
DocumentRoot "/vol/www/mywebsite/mysecondsite/web-docs/"
ErrorLog logs/edit.mysecondsite.com_error.log
CustomLog logs/edit.mysecondsite.com_custom.log common
<Directory "/vol/www/mywebsite/mysecondsite/web-docs/">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
<Directory "/vol/www/mywebsite/mysecondsite/web-docs/wm/b/">
ExpiresActive ON
ExpiresDefault "now plus 10 minutes"
Header set Cache-Control "max-age=600"
</Directory>
ProxyPass /web/ ajp://localhost:8009/web/
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/web/
RewriteRule ^/(.*)\.htm$ /web/$1.htm [P,L]
</IfModule>
</VirtualHost>
3. 4 C o mm u ni c a te t e c h ni c al d et ails to the S o ft w ar e
D ev el o p er
SYS The Software Developer needs the following details from the System Administrator:
Hostname of the website and the edit environment (in the example from this document
this would be www.mysecondsite.com and edit.mysecondsite.com);
The DocumentRoot of the new website (in the example from this document this would be
/vol/www/mywebsite/mysecondsite/web-docs/).
After the Software Developer has received the new configuration.xml from GX, he or she will
send this file to the System Administrator.
SYS The System Administrator saves the new configuration.xml over the old one. Based on the
directory structure in this document, the new configuration.xml has to be saved to
/vol/www/mywebsite/configuration/.
3. 7 C re a t e t h e n e w w e bi niti a ti v e wit hi n GX W e b Ma n a g er
DEV The Software Developer can now create the new Webinitiative within GX WebManager. GX
WebManager has a wizard for creating the new webinitiative. In step 2 of this wizard, technical
details are requested, therefore it’s a good idea to gather this information before starting the
wizard. The required details are:
With the details from the previous table at hand, perform the following tasks in GX WebManager
to create the new webinitiative:
Log into GX WebManager with a user that has either a Developer or Administrator role.
Navigate to Configure > Web Initiative Configuration.
At the top of this window there is a pulldown named ‘Select website’. Select the option
‘<New website>’ to create a new website. If this option is not available, then the license
doesn’t allow creating any more websites. Contact GX to buy the license for an
additional website and to obtain a new configuration.xml.
After selecting the ‘<New website>’ option, a wizard appears. Follow the steps in this
wizard. Based on the example values from this document, the steps in the wizard look
like this:
After the successful conclusion of the wizard, a new webinitiative will be created within GX
WebManager. This webinitiative contains one page: the Homepage. Log into the new webinitiative
with the Developer or Administrator user and create new users.
In the used examples from this document, the login URL for the new webinitiative would be:
http://edit.mysecondsite.com/web/edit
4 DISTRIBUTED WEBMANAG ER
SYS With a standard setup of GX WebManager, the GX WebManager application will be installed on a
single server. There are many reasons to divide the GX WebManager application across more than
one server:
Performance: the capacity of the server (which generates pages for visitors of the
website and is used by the editors) is insufficient.
Security: from security point of view, it can be decided to put the edit environment on a
different server than the servers which generate pages for the site visitors.
Fail-over: to prevent the website from becoming unreachable when one server gets
offline, multiple servers can be configured to ensure the website keeps running.
This section describes which actions should be taken to “remodel” standard GX WebManager setup
to distributed setup. The ultimately achieved architecture can be represented as in following
picture:
Load
balancer
HTTP HTTP
Slave 1 Slave n
(host: www01) (host: www0n)
Master
(hostname: edit01)
Read +
Write
In the above picture all the GX WebManager installations are identical. The only difference
between the Master and the Slaves is that the Master has write permissions to the JCR and the
Slaves only have read access to the JCR. The dashed arrow between the Load balancer and the
Master server represents the choice that has to be made about the Master: will it also serve page s
to visitors of the website, or will it only be available to Editors of GX WebManager?
The next sections describe how to configure the GX WebManager servers, in order to achieve the
above mentioned architecture.
SYS Basically, the installation of GX WebManager on a node in a distributed setup is the same as
installing GX WebManager in a non-distributed setup. The differences are in three areas:
1. Database configuration
2. Whether the GX WebManager instance has write access to the JCR or not
Setup the master node in the cluster just like it is a standalone setup; there are two
differences to setup a master node compared to a standalone setup:
The setup of each slave node is identical to setting up the master node, except for:
o One startup parameter of Tomcat has to change to make sure that the node only
has read access to the database.
SYS There are three settings, which need to be changed / checked in the settings.xml file on each
server in the clustered setup: <activeProfiles>, <webmanager.clustering.id> and
<webmanager.clustering.readonly>.
SYS In the settings.xml of the master server change / check the next properties:
Once the master is running properly, use the settings.xml of the master for each slave node. Two
properties in the settings.xml of the master have to be changed for each node:
The “clustering.id”, which defines the clustering ID of this node. Choose a unique ID
compared to all other IDs in the cluster. If each node in the cluster has its own unique
hostname then this is a good ID to use. In the example of this document this would be:
<webmanager.clustering.id>www01</webmanager.clustering.id>
Check the webmanager.cluster.syncDelay parameter (should be set to 500).
For each slave node, set the “clustering.readonly” setting to true:
<webmanager.clustering.readonly>true</webmanager.clustering.readonly>
4. 3 M a k e s t a ti c c o nt e nt a va il ab le f o r all se rv ers
SYS When an editor places an image on a page within GX WebManager, this image will initially be only
available on the master server. Some sort of mechanism has to be configured in order to make the
static content (such as images) available to all slave servers. The next directories need to be
synchronized from the master to all the slaves:
/vol/www/mywebsite/configuration
/web-docs
In general, for synchronization of the files there are two mechanisms in use: Rsync and NFS.
4.3.1 Rsync 3
‘Rsync is a free software computer program for Unix systems which synchronizes
files and directories from one location to another while minimizing data transf er
using delta encoding when appropriate’
1. All files of the master server are copied to the slave servers.
2. It may take a while before a file from the backend server can be copied to the frontend
servers; this is important for the editors, they might see a ‘broken image’ shortly on one
of the frontend servers.
3. If you call rsync regularly from a cronjob, then make sure you only start rsync if the
previous run has finished.
Read the Wikipedia pages 2 for more information about Rsync (downloads, documentation, etc).
‘A network file system is a file system that supports sharing of files, printers and
resources in the form of persistent storage over a network’
After configuration of NFS, the data will be available on one central place: both master and slave
servers use this data. This has the advantage, that a generated file will be available immediately
to all servers. The disadvantage of NFS is the introduction of a (new) single point of failure.
Read the Wikipedia pages 3 for more information about NFS (downloads, documentation, etc).
3
http://en.wikipedia.org/wiki/Rsync
4
http://en.wikipedia.org/wiki/Distributed_file_system
4. 4 C h a n g e st a rt u p s cr ipt o f T om c a t / JB oss
SYS The Tomcat on every server needs to know if it should startup as a master or slave. This can be
set in the /vol/www/tomcat-mywebsite/bin/catalina.sh. Underneath the first block of
comment lines, there are already a few lines about the JAVA_OPTS parameter (see section 1.5 in
which the lines were added). Check the line on the webmanager.clustering.readonly
property.
JAVA_OPTS="${JAVA_OPTS} –Dwebmanager.clustering.readonly=false"
JAVA_OPTS="${JAVA_OPTS} –Dwebmanager.clustering.readonly=true"
4. 5 C h e c k fi r e w al l se t tin gs
SYS In many configurations, firewalls are placed between the servers. Below is an overview of the
necessary connections to ensure a correct working of GX WebManager:
4. 6 St art a l l n o de s i n t h e cl ust e r
SYS Start GX WebManager on the master server. Wait until all services have started, then start the
slave servers. Although it is possible to start simultaneously, the slaves might start a bit earlier
than the master and thus generate errors in the log. Make sure the whole setup starts again after
a reboot.
5. 1 U p gr a di n g GX We b M a n a g er o n a si n gl e s e rv er
Upgrading the website to a new version of GX WebManager is a similar process to installing a new
deploy. This section describes the steps required to upgrade your website to a new version of
GX WebManager.
Apart from the files as mentioned in What to deliver to the system administrator, you also have to
deliever a new configuration.xml file to the system administrator. Contact GX to receive a
new configuration.xml file.
5. 2 U p gr a di n g GX We b M a n a g er i n a cl us t er e d e nvi r o nm e nt
This addendum explains how GX WebManager’s settings.xml file should be modified to fit the
GX WebManager installation. The modifications are divided into three parts:
General settings
Database settings
5
http://db.apache.org/derby/
Explanation: The reference to GX WebManager’s clean site. The clean site is a file that contains
the default GX WebManager design. After the clean site is read, GX WebManager is ready. The
clean site includes a web initiative, a home page, a workflow, users, etc.
<webmanager.springproperties.filename>classpath:webmanager.
properties</webmanager.springproperties.filename>
By explicitly pointing to the location of the file on the file system if the properties file is
located outside of the GX WebManager deployment, for example:
<webmanager.springproperties.filename>file:/vol/www/mywebsite/condig
uration/spring/webmanager.properties</webmanager.springproperties.fi
lename>
6. 2 M o di fyi n g t h e d at a b as e s e tti n gs
During the configuration of the general activeProfile property, which profiles should be used for
the database are indicated. This manual uses MySQL as a database, so only the MySQL-specific
profiles (externaldb-mysql and jcr-standalone-mysql) are modified.
7. 1 My S QL d i f f er e n c e b et w e e n Wi n d o ws a n d Li n u x
Some problems can occur if development takes place with a MySQL server that runs on Windows.
By default, the MySQL server in Linux uses case-sensitive table names while the MySQL server in
Windows has been set to save table names as case-insensitive.
1. Make the Windows MySQL installation case-sensitive. This can be done by adding
lower_case_table_names=2 to my.ini (located in the root of the MySQL
installation). This option has to be set before GX WebManager is installed on the
database. If the GX WebManager database has been created, use the second option
(below).
2. Set the Linux MySQL installation to case-insensitive. This can be done by adding
lower_case_table_names=1 to /etc/my.cnf. If the database already contains
databases, they have to first be dumped. Next, the variable has to be set, and then the
databases (including the ones from the ZIP file) can be read.
7. 2 GX W e b Ma n a g er ed it e n vir o n me n t d o e s n o t r es p o n d f ast
When the edit environment does not respond fast, check the next settings.
The KeepAlive option in Apache httpd makes sure that when a client makes multiple requests
really fast after each other, the connection stays ‘alive’ during handling all these requests. This
really saves a lot of overhead between the server and the browser. Check the settings of the next
parameters and set them to the next values:
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 5
PARAMETERS
In the catalina.sh of Tomcat, a number of parameters are set through the JAVA_OPTS setting.
This appendix gives an explanation on those parameters.
For specific environments, these values of the parameters can be tailored to the corresponding
requirements. For a full description of the VM options see
http://java.sun.com/javase/technologies/hotspot/vmoptions.jsp
8. 1 G e n er al p ar a m e t er s
8.1.1 -server
The client system is optimal for applications which need fast startup times or small footprints.
The server system is optimal for applications where the overall performance is most important.
Since startup is less important to WebManager than overall performance, the server system should
be used.
These two options set the ‘locale’ of the VM and are mostly used to avoid problems while running
on the Oracle database. The Oracle server is mostly installed with the “en_US” locale. If the VM
(in which GX WebManager is running) communicates with the Oracle server, it uses by default the
locale of the Operating System. If that locale is set to, for example, “nl_NL” then problems might
arise with date formats. To avoid any issues it’s best to set the locale of the VM to “en_US” and
install the Oracle server with that locale too.
8.1.3 –Xmx1024m
This option sets the maximum heap size the Java virtual machine. WebManager uses memory for
caching content from the database. A low value for this option can cause excessive garbage
collection overhead and a lot database accesses. This option should be tuned based on the
performance requirements of the application like number of concurrent users and the size of the
content.
If more memory is assigned to WebManager, more content can be cached in memory and the
overhead of database access can be avoided.
Assigning more memory to the VM will generally improve the performance. However, (excessive)
swapping should be avoided as much as possible. Another drawback of a large heap is the fact
that a Full garbage collection will take more time. If the garbage collector uses a stop -the-world
garbage collection policy, WebManager will be unresponsive for a longer period of time.
8.1.4 –Xms512m
8.1.5 -XX:MaxPermSize=128m
WebManager can load a large number of classes, especially if there are large jar files included in
OSGi bundles. Other reasons for the existence of many files are JSPs or th e use of XSLTC, since
these technologies generate classes on the fly.
Classes are stored in the permanent space of the virtual machine. If there are too many classes in
this space, then a Full Garbage collect will be performed to clean up unused classes. I f this occurs
too often, the performance of the web application will suffer.
If there are more classes than can be fit in the Permanent Space, the VM will perform many Full
Garbage collects and finally throw an OutOfMemoryError: PermGen space, which can result in all
types of faulty behavior.
8.1.6 -Djava.awt.headless=true
This option should be set to make sure the server is able to manipulated images without the
presence of a display.
8.1.7 -Dsun.net.inetaddr.ttl=300
This option determines the number of seconds that the result of a hostname lookup should be
cached in the JVM. The default behavior of the JVM is to cache it until a restart. This, however, is
not desirable on a production environment. By adding this parameter with the value 300, the
result of the hostname lookups stay cached for 5 minutes.
8. 2 G ar b a g e c ol l e ct or p ar a m et ers
The garbage collection algorithm should be tuned to the characteristics of the WebManager
application. WebManager caches content in memory. The content is stored in the tenured space.
Cleaning up this tenured space would usually require a Full garbage collect.
Long, stop-the-world garbage collection pauses should be avoided as much as possible. A long
pause does not only make the site unresponsive, it also causes clients to send duplica te requests
and causes a build-up of open requests on the server.
Stop-the-world pauses can be minimized by using the concurrent mark sweep collector. It
performs most garbage collection activity concurrently, i.e., while the application threads are
running, to keep garbage collection-induced pauses short. This is especially useful if there are
unused processors available on the server.
A slight drawback of this collector is that garbage collection uses some more CPU instructions.
8.2.1 -XX:+UseConcMarkSweepGC
The concurrent mark sweep collector should be activated using the command -line option
-XX:+UseConcMarkSweepGC
8.2.2 -XX:+UseParNewGC
8.2.3 -verbose:gc
The overhead of the garbage collector can be measured and logged by setting the VM option:
-verbose:gc. The duration of the garbage collections are logged in the Tomcat catalina.out.
If the overhead becomes a problem, this log can be used for analyzing and tuning the garbage
collector.
8.2.4 -Dsun.rmi.dgc.client.gcInterval=600000
The content of WebManager is indexed by the WebManager search engine. This search engine is a
separate application which runs in its own virtual machine. RMI is used as the protocol for
communication between the WebManager server and the search engine.
RMI forces periodical Full garbage collections, to make sure all objects in the distributed
environment can be freed. The default interval for this is one minute, which leads to a stop -the-
world full garbage collect every minute. Especially for large heaps this will be a major
performance issues.
Setting this interval to ten minutes will not cause any problems, since the number of RMI calls and
the corresponding garbage is limited. If the full garbage collects still cause problems, this value
could be changed to one hour, e.g. 3600000.
8.2.5 -XX:+HeapDumpOnOutOfMemoryError
8.2.6 -XX:-ReduceInitialCardMarks
A flaw in the implementation of a card-marking performance optimization in the JVM can cause
heap corruption under some circumstances. This issue affects the CMS garbage collector prior to
6u18, and the CMS, G1 and Parallel Garbage Collectors in 6u18. The serial garbage collector is not
affected. Applications most likely to be affected by this issue are those that allocate very large
objects which would not normally fit in Eden, or those that make extensive use of JNI Critical
Sections (JNI Get/Release*Critical).
8.2.7 -Dorg.apache.jasper.runtime.JspFactoryImpl.USE_POOL=false"
This system property disables Tomcat JSP Custom Tags pooling which can cause memory leaks in
GX WebManager.