此内容没有您所选择的语言版本。
Installation Guide
for Use with Red Hat JBoss Web Server
Edition 1.0.2
Abstract
Chapter 1. Introduction 复制链接链接已复制到粘贴板!
1.1. Components 复制链接链接已复制到粘贴板!
- Apache Tomcat is a servlet container in accordance with Java Servlet Specification. JBoss Enterprise Web Server contains Apache Tomcat 6 and Apache Tomcat 5.
- Apache Native is a Tomcat library, which improves Tomcat scalability, performance, and integration with native server technologies. It also contains an implementation of APR (Apache Portable Runtime). APR is a binary protocol for communication of Apache HTTP Server and Apache Tomcat.
- Apache Tomcat Connectors (mod_jk, mod_cluster) are connectors between Apache HTTP Server and Apache Tomcat. Note that mod_cluster is a JBoss native load balancer and is more efficient, reliable, and scalable than mod_jk.
- Apache HTTP Server is an open-source web server developed by the Apache Software Foundation. The implementation follows the current HTTP standards.
Note
The delivered Apache HTTP Server by default provides the support for the Secure Socket Layer (SSL) protocol. To remove it, refer to the section on removing SSL for your installation. - Hibernate is an object-relational mapping framework. The delivered Hibernate contains Hibernate Core, Hibernate Annotations, Hibernate EntityManager with JPA 1.0 APIs.
Important
Important
1.2. Supported Operating Systems 复制链接链接已复制到粘贴板!
- Red Hat Enterprise Linux 6, latest update (x86, x86_64)
- Red Hat Enterprise Linux 5, latest update (x86, x86_64)
- Red Hat Enterprise Linux 4, latest update (x86, x86_64)
- Solaris 10 (x86, x86_64, SPARC64)
- Solaris 9 (x86, SPARC32, SPARC64)
- Windows Server 2008 R2 (x86, x86_64)
- Windows Server 2003 SP2 (x86, x86_64)
1.3. Supported Connector Configurations 复制链接链接已复制到粘贴板!
- Apache HTTP Server + mod_cluster + JBoss EAP 5.x
- Apache HTTP Server + mod_cluster + Tomcat 6
- Apache HTTP Server + mod_jk + JBoss EAP 5.x
- Apache HTTP Server + mod_jk + Tomcat 5
- Apache HTTP Server + mod_jk + Tomcat 6
Important
1.4. Installation and Upgrade 复制链接链接已复制到粘贴板!
1.5. Source Files 复制链接链接已复制到粘贴板!
Part I. Installation 复制链接链接已复制到粘贴板!
- for Red Hat Enterprise Linux Chapter 3, Installing Enterprise Web Server on Red Hat Enterprise Linux
Chapter 2. Prerequisites 复制链接链接已复制到粘贴板!
- Enough disk space for the JBoss Enterprise Web Server installation.
- Enough space for your applications.
- from a ZIP file available on the Red Hat Customer Portal (refer to Section 3.2, “Installing Enterprise Web Server from a ZIP File”)
Note
With a ZIP installation, JBoss Enterprise Web Server can be extracted and installed in any location. - from RPM packages from Red Hat Network (RHN, refer to Section 3.2, “Installing Enterprise Web Server from a ZIP File”)
Note
Installation from RPM packages integrates the web server with theservicecommand and installs its resources into absolute paths.
Warning
3.1. Prerequisites 复制链接链接已复制到粘贴板!
- Supported Java version is installed (refer to Procedure 3.1, “Installing Java”).
- Required packages are installed (refer to Procedure 3.2, “Installing Required Packages”).
- The classpathx-jaf package is removed (refer to Procedure 3.3, “Removing classpathx-jaf”)
Procedure 3.1. Installing Java
- Subscribe your system to the appropriate channel:
- RHEL Server Supplementary for Red Hat Enterprise Linux 6
- RHEL Supplementary for Red Hat Enterprise Linux 5
- Extras for Red Hat Enterprise Linux 4
- On the command line, as the root user run the command to install Java 1.6:
- On Red Hat Enterprise Linux 5 and Red Hat Enterprise Linux 6, execute the
yum installcommand:yum install java-1.6.0-<VENDOR>-devel
# yum install java-1.6.0-<VENDOR>-develCopy to Clipboard Copied! Toggle word wrap Toggle overflow Substitute <VENDOR> withsun,ibm, oropenjdk. - On Red Hat Enterprise Linux 4, execute the
up2datecommand:up2date java-1.6.0-<VENDOR>-devel
# up2date java-1.6.0-<VENDOR>-develCopy to Clipboard Copied! Toggle word wrap Toggle overflow Substitute <VENDOR> withsunoribm.
- Run the following commands as the root user (if switching from another user, make sure to run the command
su -) to make sure the correct JDK is in use:alternatives --config java
# alternatives --config javaCopy to Clipboard Copied! Toggle word wrap Toggle overflow alternatives --config javac
# alternatives --config javacCopy to Clipboard Copied! Toggle word wrap Toggle overflow These commands return lists of available JDK versions with the version in use marked with a plus (+) sign. If the set JDK is not the desired option, switch to the right JDK as instructed on the command line.Important
Any software that makes use of thejavaandjavaccommands is using the JDK set by alternatives. Switching java alternatives may negatively influence running of such software. - Install the required packages (refer to Procedure 3.2, “Installing Required Packages”)
Procedure 3.2. Installing Required Packages
- Depending on your operating system version, run the respective installation command as the root user:
- On Red Hat Enterprise Linux 6 and 5:
yum install distcache pcre
# yum install distcache pcreCopy to Clipboard Copied! Toggle word wrap Toggle overflow - On Red Hat Enterprise Linux 4:
up2date distcache pcre
# up2date distcache pcreCopy to Clipboard Copied! Toggle word wrap Toggle overflow
- When prompted, press y to proceed.
- When the installation is complete, run the following command to check that the packages are installed:
rpm -q distache pcre
# rpm -q distache pcreCopy to Clipboard Copied! Toggle word wrap Toggle overflow If the packages are installed, the command output shows the package names with their version numbers. - Install JBoss Enterprise Web Server either from a ZIP file (Section 3.2, “Installing Enterprise Web Server from a ZIP File”) or from RPMs (Section 3.3, “Installing Enterprise Web Server from RPM Packages”).
Procedure 3.3. Removing classpathx-jaf
- At the shell prompt, become the root user.
- Depending on your Red Hat Enterprise Linux version, run the respective command to uninstall the package:
- On Red Hat Enterprise Linux 5 and 6:
yum remove classpathx-jaf
# yum remove classpathx-jafCopy to Clipboard Copied! Toggle word wrap Toggle overflow - On Red Hat Enterprise Linux 4:
rpm -e classpathx-jaf
# rpm -e classpathx-jafCopy to Clipboard Copied! Toggle word wrap Toggle overflow
3.2. Installing Enterprise Web Server from a ZIP File 复制链接链接已复制到粘贴板!
3.2.1. Downloading and Extracting the ZIP File 复制链接链接已复制到粘贴板!
Procedure 3.4. Downloading the Enterprise Web Server ZIP File
- Open http://access.redhat.com in your web browser.
- In the upper right corner, click the button.
- Enter your login information and click .
- Hover over the option in the menu bar at the top of the page and under JBoss Enterprise Middleware in the displayed menu, click Downloads.
- In the Product drop-down box column, click .
- On the Software Downloads page, select the product version in the Version drop-down box and in the Releases tab below, click the
JBoss EWSlink with the correct version. - On the Software Details page, click the button next to the File drop-down box.
Note
Make sure the file is intended for your operating system and architecture. - Confirm the file download.
- After the ZIP file has downloaded successfully, follow Procedure 3.5, “Extracting the ZIP File” to extract the JBoss Enterprise Web Server ZIP file.
Procedure 3.5. Extracting the ZIP File
- On the command line, change to the directory with the ZIP file.
- Run the following
unzipcommand:Substitute FILE_NAME with the name of the downloaded file and TARGET_DIRECTORY with the path to the target directory.unzip <FILE_NAME> -d <TARGET_DIRECTORY>
unzip <FILE_NAME> -d <TARGET_DIRECTORY>Copy to Clipboard Copied! Toggle word wrap Toggle overflow After the ZIP file is extracted, configure the environment properly before running JBoss Enterprise Web Server (refer to Section 3.2.2, “Configuring the Environment”).Note
The target directory and thus the installation directory of the JBoss Enterprise Web Server is referred to as$EWS_HOME. The formatting <EWS_HOME> is used to indicate that the entire path to the directory is used; for example <EWS_HOME>/httpd could refer to the/opt/jboss-ews-1.0/httpdpath.
3.2.2. Configuring the Environment 复制链接链接已复制到粘贴板!
- create apache and tomcat users to allow a secure and simple user management (refer to Procedure 3.8, “Setting the apache User” and Procedure 3.7, “Creating tomcat User”);
- remove the SSL support (refer to Procedure 3.9, “Removing SSL”);
- add log4j logging (refer to Procedure 3.10, “Configuring log4j”);
- enable mod_jk or mod_cluster (refer to Procedure 3.11, “Configuring mod_jk” and Procedure 3.12, “Configuring mod_cluster”).
Procedure 3.6. Setting JAVA_HOME
JAVA_HOME variable of your Tomcat to point to a supported Java:
- In the
bindirectory of your Tomcat (either$EWS_HOME/tomcat5/binor$EWS_HOME/tomcat6/bin), create thesetenv.shfile (for example, issue the commandvim tomcat<VERSION>/bin/setenv.sh). - Add the JAVA_HOME path definition into the file; for example
export JAVA_HOME=/usr/lib/jvm/jre-1.6.0-openjdk.x86_64
Procedure 3.7. Creating tomcat User
- At the shell prompt, become the root user.
- Run the following command to create the tomcat user group:
groupadd -g 91 -r tomcat
# groupadd -g 91 -r tomcatCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Go to $EWS_HOME.
- From $EWS_HOME, run the following command to create the tomcat user in the tomcat user group:
useradd -c "Tomcat" -u 91 -g tomcat -s /bin/sh -r -d /home/tomcat tomcat
# useradd -c "Tomcat" -u 91 -g tomcat -s /bin/sh -r -d /home/tomcat tomcatCopy to Clipboard Copied! Toggle word wrap Toggle overflow - From $EWS_HOME, run the following command to assign the ownership of the tomcat directories to the
tomcatuser and allow the user to run the tomcat service:chown -R tomcat:tomcat tomcat<VERSION>
# chown -R tomcat:tomcat tomcat<VERSION>Copy to Clipboard Copied! Toggle word wrap Toggle overflow Substitute <VERSION> with the respective tomcat version number (5or6). - From $EWS_HOME, issue the command
ls -land check if the tomcat user is the owner of the Tomcat directory. - Make sure that the
tomcatuser has the execution permission to all parent directories.
Procedure 3.8. Setting the apache User
- Run the following commands as the root user to create the apache user group:
groupadd -g 48 -r apache
# groupadd -g 48 -r apacheCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Run the following command to create the apache user in the apache user group:
useradd -c "Apache" -u 48 -g apache -s /bin/sh -r -d /home/apache apache
# useradd -c "Apache" -u 48 -g apache -s /bin/sh -r -d /home/apache apacheCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Change to
$EWS_HOMEand run the following command to assign the ownership of the apache directories to theapacheuser and allow the user to runhttpd:chown -R apache:apache httpd
# chown -R apache:apache httpdCopy to Clipboard Copied! Toggle word wrap Toggle overflow - From $EWS_HOME, issue the command
ls -land check that theapacheuser has execution permission to the respective Apache install path. Output is similar to the following:drwxrwxr-- 11 apache apache 4096 Feb 14 06:52 httpd
drwxrwxr-- 11 apache apache 4096 Feb 14 06:52 httpdCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Procedure 3.9. Removing SSL
- Go to the
$EWS_HOME/httpd/conf.d/directory. - Rename the SSL configuration file:
- To remove SSL, rename
ssl.conftossl.conf.disabled. - To re-add SSL, rename
ssl.conf.disabledtossl.conf.
Procedure 3.10. Configuring log4j
log4j logging to Tomcat:
- Go to the
$EWS_HOME/extras/directory. - Copy the
log4j.jarandlog4j.propertiesfiles to thelibdirectory of the Tomcat directory:- If using Tomcat 6, run the following commands:
extras]# cp log4j.jar log4j.properties ../tomcat6/lib
extras]# cp log4j.jar log4j.properties ../tomcat6/libCopy to Clipboard Copied! Toggle word wrap Toggle overflow extras]# cp tomcat-juli-adapters.jar $EWS_HOME/tomcat6/lib
extras]# cp tomcat-juli-adapters.jar $EWS_HOME/tomcat6/libCopy to Clipboard Copied! Toggle word wrap Toggle overflow - If using Tomcat 5, run the following commands:
extras]# cp log4j.properties ../tomcat5/common/classes
extras]# cp log4j.properties ../tomcat5/common/classesCopy to Clipboard Copied! Toggle word wrap Toggle overflow extras]# cp log4j.jar ../tomcat5/common/lib
extras]# cp log4j.jar ../tomcat5/common/libCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Procedure 3.11. Configuring mod_jk
- available workers (JBoss instances) in the
workers.propertiesfile - the mod_jk configuration file
- In the
$EWS_HOME/httpd/conf/directory, create workers.properties - In the
$EWS_HOME/httpd/conf.d/directory, create mod_jk.conf.Note
You can also use the template files from the jboss-ews-docs-1.0.2.zip file (the file is available at the Red Hat Customer Portal ): after you have downloaded and unzipped the file, copy the sample filesmod_jk.conf.sampleandworkers.properties.samplefrom the $EWS_HOME/doc/mod_jk/ to the locations defined in Step 1 and Step 2. Rename them (drop thesampleextension) and modify their content as needed (to refer to Section 3.2.6, “Additional Resources”).
Procedure 3.12. Configuring mod_cluster
- In the
<EWS_HOME>/httpd/conf/httpd.conffile, add the hash (#) sign at the beginning of the following line to disable mod_proxy_balancer.so:This module is incompatible with the JBoss HTTP Connector.LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
LoadModule proxy_balancer_module modules/mod_proxy_balancer.soCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Configure the server to load the JBoss HTTP Connector modules:
- In the
$EWS_HOME/httpd/conf.d/directory, create theJBoss_HTTP.conffile. - Add the following lines to the
JBoss_HTTP.conffile:LoadModule slotmem_module modules/mod_slotmem.so LoadModule manager_module modules/mod_manager.so LoadModule proxy_cluster_module modules/mod_proxy_cluster.so LoadModule advertise_module modules/mod_advertise.so
LoadModule slotmem_module modules/mod_slotmem.so LoadModule manager_module modules/mod_manager.so LoadModule proxy_cluster_module modules/mod_proxy_cluster.so LoadModule advertise_module modules/mod_advertise.soCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Procedure 3.13. Running the Post-Installation Script
- At the shell prompt, become the root user.
- Change to the
/opt/jboss-ews-2.0/httpddirectory. - Run the following command:
./.postinstall
# ./.postinstallCopy to Clipboard Copied! Toggle word wrap Toggle overflow Note
The system uses the /opt directory as a default directory for installing JBoss Enterprise Web Server. Make sure the /opt directory is present during installation.
3.2.3. Running Enterprise Web Server 复制链接链接已复制到粘贴板!
- Tomcat (5 or 6, refer to Section 3.2.3.1, “Running Tomcat”)
- HTTP server (Section 3.2.3.2, “Running HTTP”)
3.2.3.1. Running Tomcat 复制链接链接已复制到粘贴板!
Important
- The tomcat user is created (refer to Procedure 3.7, “Creating tomcat User”).
- JAVA_HOME is set correctly (refer to Procedure 3.6, “Setting JAVA_HOME”).
3.2.3.1.1. Running Tomcat as a Program 复制链接链接已复制到粘贴板!
startup.shscriptRun the following command as the root user with the respective Tomcat version (5or6):The system reads the configuration file and changes to the user and group to the tomcat user account (that is, Tomcat is always run under the tomcat user). By default,sh <EWS_HOME>/tomcat<VERSION>/bin/startup.sh
# sh <EWS_HOME>/tomcat<VERSION>/bin/startup.shCopy to Clipboard Copied! Toggle word wrap Toggle overflow tomcat-nativeis automatically added to theLD_LIBRARY_PATHand-Djava.library.pathduring Tomcat startup.catalina.shscriptRun the following command with the respective Tomcat version (5or6) :sh <EWS_HOME>/tomcat<VERSION>/bin/catalina.sh
# sh <EWS_HOME>/tomcat<VERSION>/bin/catalina.shCopy to Clipboard Copied! Toggle word wrap Toggle overflow - custom script, which calls
catalina.sh
3.2.3.1.2. Running Tomcat as a Service 复制链接链接已复制到粘贴板!
3.2.3.2. Running HTTP 复制链接链接已复制到粘贴板!
<EWS_HOME>/httpd/sbin/ and run the following command as the root user:
./apachectl start
# ./apachectl start
3.2.4. Stopping Enterprise Web Server 复制链接链接已复制到粘贴板!
3.2.4.1. Stopping Tomcat 复制链接链接已复制到粘贴板!
sh <EWS_HOME>/tomcat<VERSION>/bin/shutdown.sh
# sh <EWS_HOME>/tomcat<VERSION>/bin/shutdown.sh
3.2.4.2. Stopping HTTP 复制链接链接已复制到粘贴板!
<EWS_HOME>/httpd/sbin/ and run the following command as the root user:
apachectl stop
# apachectl stop
3.2.5. ZIP Installation Structure 复制链接链接已复制到粘贴板!
`-- jboss-ews-1.0
|-- extras (includes log4j)
|-- httpd (includes modules, configuration files, executable for the HTTP Server)
|-- tomcat5
`-- tomcat6
`-- jboss-ews-1.0
|-- extras (includes log4j)
|-- httpd (includes modules, configuration files, executable for the HTTP Server)
|-- tomcat5
`-- tomcat6
3.2.6. Additional Resources 复制链接链接已复制到粘贴板!
jboss-ews-docs-1.0.2.zip and jboss-ews-src-1.0.2.zip files available at the Red Hat Customer Portal and extract them to $EWS_HOME. On extraction, doc and src directories are created, which contain the documentation and examples, and source code.
3.3. Installing Enterprise Web Server from RPM Packages 复制链接链接已复制到粘贴板!
3.3.1. RPM Packages 复制链接链接已复制到粘贴板!
RPM Packages for Red Hat Enterprise Linux 5 and 6
- Tomcat 6:
- tomcat6tomcat6-webappstomcat6-admin-webapps
- Tomcat 5:
- tomcat5tomcat5-webappstomcat5-admin-webapps
- Tomcat Native:
- tomcat-native
- HTTP Server:
- httpd
- mod_jk:
- mod_jk-ap20
- mod_cluster:
- mod_cluster-tomcat6mod_cluster-native
- log4j:
- tomcat6-log4j
- mod_ssl:
- mod_ssl
- Hibernate:
- hibernate3
- JK Status Ant tasks:
- tomcat-jkstatus-ant
Important
In the next release, the tomcat-jkstatus-ant library will be deprecated.
RPM Packages for Red Hat Enterprise Linux 4
- Tomcat 6:
- tomcat6tomcat6-webappstomcat6-admin-webapps
- Tomcat 5:
- tomcat5tomcat5-webappstomcat5-admin-webapps
- Tomcat Native:
- tomcat-native
- HTTP Server:
- httpd22
- mod_jk:
- mod_jk-ap20
- mod_cluster:
- mod_cluster-tomcat6mod_cluster-native
- log4j:
- tomcat6-log4j
- mod_ssl:
- mod_ssl22
- Hibernate:
- hibernate3
- JK Status Ant tasks:
- tomcat-jkstatus-ant
Important
In the next release, the tomcat-jkstatus-ant library will be deprecated. - Xerces2 Java Parser:
- xerces-j2
Note
Xerces2 Java Parser is a Tomcat 5 dependency. If you are using Tomcat 6, the package is installed atomatically as a dependency. However, if you are installing only the tomcat5 package, make sure to install xerces-j2 before.
- on Red Hat Enterprise Linux 6:
- jb-ews-1-i386-server-6-rpm
- jb-ews-1-x86_64-server-6-rpm
- on Red Hat Enterprise Linux 5:
- jb-ews-1-i386-server-5-rpm
- jb-ews-1-x86_64-server-5-rpm
- on Red Hat Enterprise Linux 4:
- jb-ews-1-i386-as-4-rpm
- jb-ews-1-x86_64-as-4-rpm
- jb-ews-1-i386-es-4-rpm
- jb-ews-1-x86_64-es-4-rpm
3.3.3. Installing Enterprise Web Server from RPM Files 复制链接链接已复制到粘贴板!
Procedure 3.14. Subscribing to Red Hat Network Enterprise Channels
- Go to Red Hat Network Enterprise.
- Unsubscribe your system from the
Red Hat Application Stackchannel. - Subscribe to the JBoss Enterprise Web Server channels (refer to Section 3.3.2, “RHN Channels for JBoss Enterprise Web Server Installation Packages”).
- Ensure that
exactarchis set to the correct value:- On Red Hat Enterprise Linux 4, skip this step and proceed to Procedure 3.15, “Installing Enterprise Web Server from RPM Packages”.
- On Red Hat Enterprise Linux 6 and Red Hat Enterprise Linux 5, open
/etc/yum.conffor editing and set theexactarchvalue to0:exactarch=0
exactarch=0Copy to Clipboard Copied! Toggle word wrap Toggle overflow If the directive is not present, add it to the file.
Procedure 3.15. Installing Enterprise Web Server from RPM Packages
- At the shell prompt, become the root user.
- Depending on your operating system, run the installation command:
- On Red Hat Enterprise Linux 6 and Red Hat Enterprise Linux 5:
yum install <LIST_OF_PACKAGES>
# yum install <LIST_OF_PACKAGES>Copy to Clipboard Copied! Toggle word wrap Toggle overflow Substitute the <LIST_OF_PACKAGES> with names of the packages separated with spaces.To install all JBoss Enterprise Web Server packages, run this command:yum install tomcat6 tomcat6-webapps tomcat6-admin-webapps tomcat5.noarch tomcat5-webapps.noarch tomcat5-admin-webapps.noarch tomcat-native httpd mod_jk-ap20 mod_cluster-tomcat6 mod_cluster-native tomcat6-log4j mod_ssl hibernate3 tomcat-jkstatus-ant
# yum install tomcat6 tomcat6-webapps tomcat6-admin-webapps tomcat5.noarch tomcat5-webapps.noarch tomcat5-admin-webapps.noarch tomcat-native httpd mod_jk-ap20 mod_cluster-tomcat6 mod_cluster-native tomcat6-log4j mod_ssl hibernate3 tomcat-jkstatus-antCopy to Clipboard Copied! Toggle word wrap Toggle overflow Note
Unless package.noarch is specified for Tomcat 5 packages, yum fetches all Tomcat 5 packages from the base channel instead of the JBoss Enterprise Web Server channel. - On Red Hat Enterprise Linux 4:
up2date <LIST_OF_PACKAGES>
# up2date <LIST_OF_PACKAGES>Copy to Clipboard Copied! Toggle word wrap Toggle overflow Substitute the <LIST_OF_PACKAGES> with names of the packages divided by spaces.To install all JBoss Enterprise Web Server packages, run this command:up2date tomcat6 tomcat6-webapps tomcat6-admin-webapps xerces-j2 tomcat5 tomcat5-webapps tomcat5-admin-webapps tomcat-native httpd22 mod_jk-ap20 mod_cluster-tomcat6 mod_cluster-native tomcat6-log4j mod_ssl22 hibernate3 tomcat-jkstatus-ant
# up2date tomcat6 tomcat6-webapps tomcat6-admin-webapps xerces-j2 tomcat5 tomcat5-webapps tomcat5-admin-webapps tomcat-native httpd22 mod_jk-ap20 mod_cluster-tomcat6 mod_cluster-native tomcat6-log4j mod_ssl22 hibernate3 tomcat-jkstatus-antCopy to Clipboard Copied! Toggle word wrap Toggle overflow
- Ensure that
exactarchis set to the correct value:- On Red Hat Enterprise Linux 4, skip this step.
- On Red Hat Enterprise Linux 6 and Red Hat Enterprise Linux 5, open
/etc/yum.conffor editing and set theexactarchvalue to1:exactarch=1
exactarch=1Copy to Clipboard Copied! Toggle word wrap Toggle overflow
- Run the following command and verify the system is using the correct javac and java (for details refer to Procedure 3.1, “Installing Java”).
3.3.4. Configuring the Environment 复制链接链接已复制到粘贴板!
- remove SSL (refer to Procedure 3.16, “Removing SSL”);
- add log4j logging (refer to Procedure 3.18, “Removing log4j From Tomcat 6”);
- enable mod_jk or mod_cluster (refer to Procedure 3.20, “Configuring mod_jk” and Procedure 3.21, “Configuring mod_cluster”)
Procedure 3.16. Removing SSL
- At the shell prompt, become the root user.
- Run the respective uninstall command:
- on Red Hat Enterprise Linux 6 and Red Hat Enterprise Linux 5:
yum remove mod_ssl
# yum remove mod_sslCopy to Clipboard Copied! Toggle word wrap Toggle overflow - on Red Hat Enterprise Linux 4:
rpm -e mod_ssl22
# rpm -e mod_ssl22Copy to Clipboard Copied! Toggle word wrap Toggle overflow
For tomcat6, the log4j support is provided by the tomcat6-log4j package and is enabled on package installation (refer to Procedure 3.15, “Installing Enterprise Web Server from RPM Packages”). To enable log4j on tomcat5, copy the respective log4j resources from the tomcat6 to the tomcat5 directory (refer to Procedure 3.17, “Adding log4j on tomcat5”)
Procedure 3.17. Adding log4j on tomcat5
- Install the
tomcat6-log4jRPM package. - From
/usr/share/java/tomcat6/, copy:log4j.jarto/usr/share/tomcat5/common/libandlog4j.propertiesto/usr/share/tomcat5/common/classes.
Procedure 3.18. Removing log4j From Tomcat 6
- At the shell prompt, become the root user.
- Run the respective uninstall command:
- on Red Hat Enterprise Linux 6 and Red Hat Enterprise Linux 5:
yum remove tomcat6-log4j
# yum remove tomcat6-log4jCopy to Clipboard Copied! Toggle word wrap Toggle overflow - on Red Hat Enterprise Linux 4:
rpm -e tomcat6-log4j
# rpm -e tomcat6-log4jCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Procedure 3.19. Removing log4j From Tomcat 5
- Remove the
log4j.jarfile from the/usr/share/tomcat5/common/libdirectory. - Remove the
log4j.propertiesfile from the/usr/share/tomcat5/common/classesdirectory.
Procedure 3.20. Configuring mod_jk
- Install the template
mod_jkconfiguration file:cp /usr/share/doc/mod_jk-ap20-*/mod_jk.conf.sample /etc/httpd/conf.d/mod_jk.conf
# cp /usr/share/doc/mod_jk-ap20-*/mod_jk.conf.sample /etc/httpd/conf.d/mod_jk.confCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Install the template
workers.propertiesfile:cp /usr/share/doc/mod_jk-ap20-*/workers.properties.sample /etc/httpd/conf/workers.properties
# cp /usr/share/doc/mod_jk-ap20-*/workers.properties.sample /etc/httpd/conf/workers.propertiesCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Add worker mappings to
workers.properties. For example:# Mount the Servlet context to the ajp20 worker /jmx-console=loadbalancer /jmx-console/*=loadbalancer /web-console=loadbalancer /web-console/*=loadbalancer
# Mount the Servlet context to the ajp20 worker /jmx-console=loadbalancer /jmx-console/*=loadbalancer /web-console=loadbalancer /web-console/*=loadbalancerCopy to Clipboard Copied! Toggle word wrap Toggle overflow Note
The default configuration is adequate for low-traffic web sites. For optimization information for moderate and high-load web sites, refer to http://kbase.redhat.com/faq/docs/DOC-15836.
Procedure 3.21. Configuring mod_cluster
- In the
/etc/httpd/conf/httpd.conffile, add the hash (#) sign at the beginning of the following line to disable mod_proxy_balancer.so:This module is incompatible with the JBoss HTTP Connector.LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
LoadModule proxy_balancer_module modules/mod_proxy_balancer.soCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Configure the server to load the JBoss HTTP Connector modules:
- Create the file
/etc/httpd/conf.d/JBoss_HTTP.conf. - Add the following lines to the
JBoss_HTTP.conffile:LoadModule slotmem_module modules/mod_slotmem.so LoadModule manager_module modules/mod_manager.so LoadModule proxy_cluster_module modules/mod_proxy_cluster.so LoadModule advertise_module modules/mod_advertise.so
LoadModule slotmem_module modules/mod_slotmem.so LoadModule manager_module modules/mod_manager.so LoadModule proxy_cluster_module modules/mod_proxy_cluster.so LoadModule advertise_module modules/mod_advertise.soCopy to Clipboard Copied! Toggle word wrap Toggle overflow
3.3.5. Setting the Service Boot Behavior 复制链接链接已复制到粘贴板!
- From the command line, issue the following command with the <SERVICE_NAME> replaced with the respective service name (
tomcat6ortomcat5, andhttpdorhttpd22)For details refer to the chkconfig man page.chkconfig <SERVICE_NAME> on
chkconfig <SERVICE_NAME> onCopy to Clipboard Copied! Toggle word wrap Toggle overflow - To use the Service Configuration tool, issue the command
system-config-servicesand change the service setting in the displayed window.
3.3.6. Running Enterprise Web Server 复制链接链接已复制到粘贴板!
- Tomcat (5 or 6, refer to Procedure 3.22, “Running Tomcat”)
- HTTP server (Procedure 3.23, “Running HTTP”)
Procedure 3.22. Running Tomcat
Important
tomcat:
- At the shell prompt, become the root user.
- Run the following
startcommand with the <VERSION> substituted with the correct Tomcat version (5or6):service tomcat<VERSION> start
# service tomcat<VERSION> startCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Go to http://localhost:8080 in your web browser to verify that Tomcat is running. The Apache Software Foundation page appears.
Note
In JBoss Enterprise Web Server installations from the RPM packages, the only supported way of running Tomcat is the running described in this section.
Procedure 3.23. Running HTTP
httpd:
- At the shell prompt, become the root user.
- Run the following
startcommand:- On Red Hat Enterprise Linux 6 or Red Hat Enterprise Linux 5:
service httpd start
# service httpd startCopy to Clipboard Copied! Toggle word wrap Toggle overflow - On Red Hat Enterprise Linux 4:
service httpd22 start
# service httpd22 startCopy to Clipboard Copied! Toggle word wrap Toggle overflow
3.3.7. Stopping Enterprise Web Server 复制链接链接已复制到粘贴板!
Procedure 3.24. Stopping Tomcat
tomcat:
- At the shell prompt, become the root user.
- Run the following
startcommand with the <VERSION> substituted with the correct Tomcat version (5or6):service tomcat<VERSION> stop
# service tomcat<VERSION> stopCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Go to http://localhost:8080 in your web browser to verify that Tomcat is no longer running.
Procedure 3.25. Stopping HTTP
httpd:
- At the shell prompt, become the root user.
- Run the following
stopcommand:- On Red Hat Enterprise Linux 6 or Red Hat Enterprise Linux 5:
service httpd stop
# service httpd stopCopy to Clipboard Copied! Toggle word wrap Toggle overflow - On Red Hat Enterprise Linux 4:
service httpd22 stop
# service httpd22 stopCopy to Clipboard Copied! Toggle word wrap Toggle overflow
3.3.8. Additional Documentation 复制链接链接已复制到粘贴板!
up2date in Red Hat Enterprise Linux 4 and yum install in Red Hat Enterprise Linux 5 and Red Hat Enterprise Linux 6 followed by the list of required documentation packages.
- The following documentation packages are available for Red Hat Enterprise Linux 6 and Red Hat Enterprise Linux 5:
- for Tomcat 5:
- tomcat5-webapps
- for Tomcat 6:
- mod_jk-manualhttpd-manualtomcat6-docs-webapp
- The following documentation packages are available for Red Hat Enterprise Linux 4:
- for Tomcat 5:
- tomcat5-webapps
- for Tomcat 6:
- mod_jk-manualhttpd22-manualtomcat6-docs-webapp
Chapter 4. Installing Enterprise Web Server on Windows 复制链接链接已复制到粘贴板!
4.1. Prerequisites 复制链接链接已复制到粘贴板!
Procedure 4.1. Installing Java
- Go to the Oracle homepage.
- Download JDK 1.6 for your operating system from the web site.
- Go to the download location.
- Double-click the downloaded file to start the Java installation.
- Proceed as instructed in the displayed installation window.
4.2. Downloading and Extracting Installation File 复制链接链接已复制到粘贴板!
Procedure 4.2. Downloading the Enterprise Web Service ZIP File
- Open http://access.redhat.com in your web browser.
- In the right upper corner, click the button.
- Enter your login information and click .
- Hover over the option in the menu bar at the top of the page and click Downloads under JBoss Enterprise Middleware in the displayed menu.
- In the Product drop-down menu, click .
- On the Releases tab, click the
JBoss EWSlink for Windows with the correct architecture and version. - On the Software Details page, click the button next to the File drop-down box.
Note
Make sure the file is intended for your operating system and architecture. - Confirm the file download.
Procedure 4.3. Extracting the ZIP File
- Right-click the file and select
Extract All.... - Click .
- When prompted for the extract location, click and navigate to
C:\Program Files. - Click .
Note
Files are extracted inC:\Program Files\Red Hat\Enterprise Web Server. If you wish to change the httpd configuration (for example, add mod_cluster), edit thehttpd.conffile in theC:\Program Files\Red Hat\Enterprise Web Server\etc\httpd\conffolder.
4.3. Configuring the Environment 复制链接链接已复制到粘贴板!
Procedure 4.4. Setting Environment Variables
- Log in to an account with local administrator permissions.
- Go to → .
- Click on the Advanced tab.
- Click the button.
- Click the for System Variables.
- Enter the required
JAVA_HOME,TMPandTEMPname-value pairs. - You will also need to add
<EWS_HOME>\binto the PATH environment variable of the user the service runs under. This is SYSTEM by default. Without this, the SSL Connector will fail to work.
Procedure 4.5. Running the Post-Installation Script
- Run the Command Prompt as administrator even if you are logged in as the administrator:
- Click the button.
- Go to → .
- Right-click the Command Prompt and select
Run as administrator.
Note
Windows Server 2003 does not have the User Account Control concept, therefore you only need to run the Command Prompt (cmd.exe). - In the Command Prompt, type the following to change to the
etcfolder of your Enterprise Web Server installation:cd /D "C:\Program Files\Red Hat\Enterprise Web Server\etc"
C:\> cd /D "C:\Program Files\Red Hat\Enterprise Web Server\etc"Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Issue the command
call postinstall.batto run the post-installation script.The script creates the required symbolic links (Junction Points) for temporary logging and configuration directories.
Procedure 4.6. Installing Tomcat
- Run the Command Prompt as administrator:
- Click the button.
- Go to → .
- Right-click the Command Prompt and select
Run as administrator.Note
On 64-bit Windows, you need to use the 64-bit version of the Command Prompt (cmd.exe). Running thecmdcommand from a 32-bit application launches a 32-bit Command Prompt instance. This causes the service setup script to fail with a File Not Found warning. - Change to the
sbinfolder in the JBoss Enterprise Web Server installation folder:cd /D "C:\Program Files\Red Hat\Enterprise Web Server\sbin"
C:\> cd /D "C:\Program Files\Red Hat\Enterprise Web Server\sbin"Copy to Clipboard Copied! Toggle word wrap Toggle overflow - In the Command Prompt, run the following command with the required Tomcat version (5 or 6) to install Tomcat:
call service<VERSION>.bat install
call service<VERSION>.bat installCopy to Clipboard Copied! Toggle word wrap Toggle overflow You can check the service parameters by typingtomcat<VERSION>w.exe.Note
The tomcat<VERSION>w.exe is located inC:\Program Files\Red Hat\Enterprise Web Server\bin
Procedure 4.7. Installing HTTP
- Run the Command Prompt as administrator:
- Click the button.
- Go to → .
- Right-click the Command Prompt and select
Run as administrator.
- Change to the
binfolder of your new installation:cd /D "C:\Program Files\Red Hat\Enterprise Web Server\bin"
C:\> cd /D "C:\Program Files\Red Hat\Enterprise Web Server\bin"Copy to Clipboard Copied! Toggle word wrap Toggle overflow - In the Command Prompt, run the
installcommand:A Firewall security dialog prompt demanding networking access for the Apache HTTP Server service appears. Click if you wish to access this service from the network.httpd -k install
httpd -k installCopy to Clipboard Copied! Toggle word wrap Toggle overflow Note
By default, Apache HTTP Server is configured to listen on port 80. If you have Microsoft IIS installed, ensure the following:World Wide Web...service is stopped and the Startup Type is set toManualWorld Wide Web...service is configured to listen on a different port
Alternatively, you can edit thehttpd.conffile before installing the service and change theListendirective to a port that does not collide with the Internet Information Service listening ports.
Procedure 4.8. Configuring log4j
log4j logging in Tomcat:
- Change to
C:\Program Files\Red Hat\Enterprise Web Server\extras\ - Copy the respective log4j files to the Tomcat folder:
- If using Tomcat 6, run the following commands:
copy log4j.jar log4j.properties ..\tomcat6\lib
copy log4j.jar log4j.properties ..\tomcat6\libCopy to Clipboard Copied! Toggle word wrap Toggle overflow copy C:\Program Files\Red Hat\Enterprise Web Server\extras\tomcat-juli-adapters.jar C:\Program Files\Red Hat\Enterprise Web Server\tomcat6\lib
copy C:\Program Files\Red Hat\Enterprise Web Server\extras\tomcat-juli-adapters.jar C:\Program Files\Red Hat\Enterprise Web Server\tomcat6\libCopy to Clipboard Copied! Toggle word wrap Toggle overflow - If using Tomcat 5, run the following commands:
copy log4j.properties ..\tomcat5\common\classes
copy log4j.properties ..\tomcat5\common\classesCopy to Clipboard Copied! Toggle word wrap Toggle overflow copy log4j.jar ..\tomcat5\common\lib
copy log4j.jar ..\tomcat5\common\libCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Procedure 4.9. Removing SSL
- Go to
C:\Program Files\Red Hat\Enterprise Web Server\etc\httpd\conf.d - Rename the SSL configuration file:
- To remove SSL, rename
ssl.conftossl.conf.disabled. - To re-add SSL rename
ssl.conf.disabledtossl.conf.
Procedure 4.10. Configuring mod_jk
- available workers (JBoss instances) in the
workers.propertiesfile - the mod_jk configuration file
mod_jk.conf
- In
C:\Program Files\Red Hat\Enterprise Web Server\etc\httpd\conf\create workers.properties (refer to http://tomcat.apache.org/connectors-doc/reference/apache.html). - In
C:\Program Files\Red Hat\Enterprise Web Server\etc\httpd\conf.d\, create mod_jk.conf (refer to http://tomcat.apache.org/connectors-doc/reference/apache.html)Note
You can also use the sample filesmod_jk.conf.sampleandworkers.properties.sampleavailable inC:\Program Files\Red Hat\Enterprise Web Server\etc\httpd\conf: modify their content as needed and rename them tomod_jk.confandworkers.properties.
Procedure 4.11. Configuring mod_cluster
- In the
C:\Program Files\Red Hat\Enterprise Web Server\etc\httpd\conf\httpd.conffile, add the hash (#) sign at the beginning of the following line to disable mod_proxy_balancer.so:This module is incompatible with the JBoss HTTP Connector.LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
LoadModule proxy_balancer_module modules/mod_proxy_balancer.soCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Configure the server to load the JBoss HTTP Connector modules:
- Create the file
C:\Program Files\Red Hat\Enterprise Web Server\etc\httpd\conf\JBoss_HTTP.conf. - Add the following lines to the
JBoss_HTTP.conffile:LoadModule slotmem_module modules/mod_slotmem.so LoadModule manager_module modules/mod_manager.so LoadModule proxy_cluster_module modules/mod_proxy_cluster.so LoadModule advertise_module modules/mod_advertise.so
LoadModule slotmem_module modules/mod_slotmem.so LoadModule manager_module modules/mod_manager.so LoadModule proxy_cluster_module modules/mod_proxy_cluster.so LoadModule advertise_module modules/mod_advertise.soCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Procedure 4.12. Setting Security
C:\Program Files\Red Hat folder and all of its subfolders:
- Right-click the
C:\Program Files\Red Hatfolder and clickProperties. - Select the
Securitytab. - Click the button and type in
LOCAL SERVICE. - Select the
Full Controlcheck box for the newLOCAL SERVICEaccount. - Click the button.
- Inside the Advanced Security Settings for Red Hat dialog, select the
Replace permissions on all child objects...check box and click the button.This procedure is intended for Windows 2003. The equivalent procedure in Windows Server 2008 and Windows Server 2008R2 can slightly differ.
4.4. Running Enterprise Web Server 复制链接链接已复制到粘贴板!
Procedure 4.13. Running Enterprise Web Server from the Command Prompt
- Run the Command Prompt as administrator:
- Click the button.
- Go to → .
- Right-click the Command Prompt and select
Run as administrator.
- On the Command Prompt, issue the following command to run the tomcat service:
net start tomcat<VERSION>
net start tomcat<VERSION>Copy to Clipboard Copied! Toggle word wrap Toggle overflow - On the Command Prompt, run the following command to run the httpd service:
net start httpd
net start httpdCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Procedure 4.14. Running Enterprise Web Server from the Computer Management Tool
- Run the Command Prompt as administrator:
- Click the button.
- Go to → .
- Right-click the Command Prompt and select
Run as administrator.
- Go to → →
- In the Services dialog, right-click the name of the service (
httpdortomcat) and click or .
Note
catalina.bat run.
C:\windows\System32\ directory and PATH directories, and check for DLLs library conflicting with those shipped with Enterprise Web Server. In particular, look for libeay32.dil, ssleay32.dll, and libssl32.dll.
4.5. Stopping Enterprise Web Server 复制链接链接已复制到粘贴板!
Procedure 4.15. Stopping Enterprise Web Server from the Command Prompt
- Run the Command Prompt as administrator:
- Click the button.
- Go to → .
- Right-click the Command Prompt and select
Run as administrator.
- On the Command Prompt, issue the following command to run the tomcat service:
net stop tomcat<VERSION>
net stop tomcat<VERSION>Copy to Clipboard Copied! Toggle word wrap Toggle overflow - On the Command Prompt, run the following command to run the httpd service:
net stop httpd
net stop httpdCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Procedure 4.16. Stopping Enterprise Web Server from the Computer Management Tool
- Run the Command Prompt as administrator:
- Click the button.
- Go to → .
- Right-click the Command Prompt and select
Run as administrator.
- Go to → →
- In the Services dialog, right-click the name of the service (
httpdortomcat) and click .
4.6. Folder Structure 复制链接链接已复制到粘贴板!
- The
binandsbindirectories contain the executable files for Apache HTTP Server and Tomcat. - The
etcfolder contains configuration files for Apache HTTP Server and the post-installation script. - The
sharefolder contains Apache Tomcat 5 and 6 installations and shared Java JARs. - The
varcontains four sub-directories:-
cache - The
cachecontains resources cached by the server.. -
log - This
logfolder contains the log files for HTTP Server and Tomcat. -
www - Apache HTTP Server looks in this folder for web content in the
defaultconfiguration. -
run - The
runfolder contains PID files.
-
Chapter 5. Installing Enterprise Web Server on Solaris 复制链接链接已复制到粘贴板!
- from a ZIP file
- from Solaris packages
5.1. Prerequisites 复制链接链接已复制到粘贴板!
Procedure 5.1. Installing Java
- Go to the Oracle homepage.
- Download JDK 1.6.0 from the web site (http://www.oracle.com/technetwork/java/javase/downloads/index.html).
- Go to the download location.
- Run the Java installation file.
- Go to
usr. - Issue the following command to display the current Java symbolic link:
ls -lad java
ls -lad javaCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Remove the link:
rm java
rm javaCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Create a java symbolic link to the JDK 1.6.0:
ln -sf /usr/jdk/<JDK>
ln -sf /usr/jdk/<JDK>Copy to Clipboard Copied! Toggle word wrap Toggle overflow
5.2. Downloading Installation Files 复制链接链接已复制到粘贴板!
Procedure 5.2. Downloading Solaris Packages or ZIP Files
- Open https://access.redhat.com in your web browser.
- In the right upper corner, click the button.
- Enter your login information and click .
- Hover over the option in the menu bar at the top of the page and click Downloads under JBoss Enterprise Middleware in the displayed menu.
- In the Product drop-down box column of the displayed page, select wait for the page to refresh.
- On the Releases tab, click the JBoss EWS link for your operating system and architecture.
- On the Software Details page, click the button next to the File drop-down box.
Note
Make sure the file is intended for your operating system and architecture. - Confirm the file download.
5.3. Extracting and Installing Enterprise Web Server 复制链接链接已复制到粘贴板!
Procedure 5.3. Extracting and Installing EWS from a ZIP File
- At the shell prompt, become the root user.
- Change to the directory with the ZIP file.
- Run the following command to extract the package to
opt:Substitute the <FILE_NAME> with the name of the downloaded ZIP file.unzip <FILE_NAME> -d /opt
# unzip <FILE_NAME> -d /optCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Issue the following commands to run the post-installation script:The post-installation process creates the tomcat and apache users and groups, and directories:
cd /opt/redhat/ews/etc sh .postinstall
cd /opt/redhat/ews/etc sh .postinstallCopy to Clipboard Copied! Toggle word wrap Toggle overflow - The users and groups
apachewith an ID of 48 andtomcatwith an ID of 91. Theapacherunshttpd, while thetomcatuser runstomcat. - Additional directories the
tomcatgroup has write permissions to:/var/logs/tomcat5/var/logs/tomcat6
Note
The system uses the /opt directory as a default directory for installing JBoss Enterprise Web Server. Make sure the /opt directory is present during installation.
Procedure 5.4. Extracting and Installing EWS from Solaris Packages
/opt/redhat/ews directory. As a part of the installation, the package installer executes custom scripts, which set up the apache and tomcat user accounts.
- At the shell prompt, become the root user.
- Run the following
gunzipandpkgaddcommands to decompress and install the package:gunzip RHATews-1.0.*
gunzip RHATews-1.0.*Copy to Clipboard Copied! Toggle word wrap Toggle overflow The command returns an output similar to the following:pkgadd -d RHATews-1.0.*
pkgadd -d RHATews-1.0.*Copy to Clipboard Copied! Toggle word wrap Toggle overflow The following packages are available: 1 RHATews JBoss Enterprise Web Server (i386) 1.0.0,REV=2.el5 Select package(s) you wish to process (or 'all' to process all packages). (default: all) [?,??,q]:
The following packages are available: 1 RHATews JBoss Enterprise Web Server (i386) 1.0.0,REV=2.el5 Select package(s) you wish to process (or 'all' to process all packages). (default: all) [?,??,q]:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Type
1or pressenterto confirm the installation. The following information appears:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Type
yand pressenterwhen prompted to confirm the installation. Installation starts and the following appears:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Issue the following command to display the package information:
pkginfo -l RHATews
pkginfo -l RHATewsCopy to Clipboard Copied! Toggle word wrap Toggle overflow Note
During installation, the system generates a notice that theJAVA_HOMEenvironment variable is not set. You need to set this variable specifically for the Tomcat you wish to run (refer to Procedure 5.5, “Configuring Tomcat” section). - Run the following command with the respective Tomcat version to execute the
catalina.shscript:/opt/redhat/ews/share/tomcat<VERSION>/bin/catalina.sh
/opt/redhat/ews/share/tomcat<VERSION>/bin/catalina.shCopy to Clipboard Copied! Toggle word wrap Toggle overflow Thecatalina.shscript detects the running JVM version and adds the /opt/redhat/ews/lib path (/opt/redhat/ews/lib64 for 64 bit JVM) to the library path.
5.4. Configuring the Environment 复制链接链接已复制到粘贴板!
- remove SSL (refer to Procedure 5.6, “Removing SSL”);
- add log4j logging (refer to Procedure 5.7, “Configuring log4j”);
- enable mod_jk or mod_cluster (refer to Procedure 5.8, “Configuring mod_jk” and Procedure 5.9, “Configuring mod_cluster”).
Procedure 5.5. Configuring Tomcat
JAVA_HOME variable to point to a supported JDK (1.6.0):
- Locate the
tomcatconfiguration file:- For Tomcat 5:
/opt/redhat/ews/etc/sysconfig/tomcat5 - For Tomcat 6:
/opt/redhat/ews/etc/sysconfig/tomcat6
- Open the configuration file and delete the hash (#) sign at the beginning of the following line:
JAVA_HOME="/usr/java"
# JAVA_HOME="/usr/java"Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Procedure 5.6. Removing SSL
- Go to
/opt/redhat/ews/etc/httpd/conf.d - Rename the SSL configuration file:
- To remove SSL, rename
ssl.conftossl.conf.disabled. - To re-enable the SSL, rename
ssl.conf.disabledtossl.conf.
Procedure 5.7. Configuring log4j
log4j logging to Tomcat:
- Go to the
/opt/redhat/ews/share/extrasdirectory. - Copy the
log4j.jarandlog4j.propertiesfiles to thelibdirectory of the Tomcat directory:- If using Tomcat 6, run the following commands:
extras]# cp log4j.jar log4j.properties ../tomcat6/lib
extras]# cp log4j.jar log4j.properties ../tomcat6/libCopy to Clipboard Copied! Toggle word wrap Toggle overflow extras] # cp tomcat-juli-adapters.jar /opt/redhat/ews/share/tomcat6/lib
extras] # cp tomcat-juli-adapters.jar /opt/redhat/ews/share/tomcat6/libCopy to Clipboard Copied! Toggle word wrap Toggle overflow - If using Tomcat 5, run the following commands:
extras]# cp log4j.properties ../tomcat5/common/classes
extras]# cp log4j.properties ../tomcat5/common/classesCopy to Clipboard Copied! Toggle word wrap Toggle overflow extras]# cp log4j.jar ../tomcat5/common/lib
extras]# cp log4j.jar ../tomcat5/common/libCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Procedure 5.8. Configuring mod_jk
- available workers (JBoss instances) in the
workers.propertiesfile - the mod_jk configuration file mod_jk.conf
- Create a workers.properties file in
/opt/rehat/ews/etc/httpd/conf/httpd/conf/(refer to http://tomcat.apache.org/connectors-doc/reference/apache.html). - Create a mod_jk.conf in
/opt/rehat/ews/etc/httpd/conf/httpd/conf.d/, (refer to http://tomcat.apache.org/connectors-doc/reference/apache.html).Note
You can also copy and modify the sample filesmod_jk.conf.sampleandworkers.properties.sampleavailable in /opt/rehat/ews/etc/httpd/conf/httpd/conf/: modify their content as needed and rename them tomod_jk.confandworkers.properties.
Procedure 5.9. Configuring mod_cluster
- From Red Hat Customer Portal, download the jboss-ep-native ZIP file for your operating system and architecture.
- Unzip the downloaded file.
- In the location, where you have extracted the file, change to
jboss-ep-<VERSION> /native/lib[64]/httpd/modules - Run the following command to copy mod_cluster modules to
/opt/redhat/ews/lib[64]/httpd/modules:modules]# cp mod_advertise.so mod_manager.so mod_proxy_cluster.so mod_slotmem.so -t /usr/lib[64]/httpd/modules
modules]# cp mod_advertise.so mod_manager.so mod_proxy_cluster.so mod_slotmem.so -t /usr/lib[64]/httpd/modulesCopy to Clipboard Copied! Toggle word wrap Toggle overflow - In
/opt/redhat/ews/httpd/conf/httpd.confadd a hash (#) sign at the beginning of the following line to disable the mod_proxy_balancer module:This module is incompatible with the JBoss HTTP Connector.LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
LoadModule proxy_balancer_module modules/mod_proxy_balancer.soCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Configure the server to load the JBoss HTTP Connector modules:
- Create the file
/opt/redhat/ews/httpd/conf.d/JBoss_HTTP.conf. - Add the following lines to the file JBoss_HTTP.conf:
LoadModule slotmem_module modules/mod_slotmem.so LoadModule manager_module modules/mod_manager.so LoadModule proxy_cluster_module modules/mod_proxy_cluster.so LoadModule advertise_module modules/mod_advertise.so
LoadModule slotmem_module modules/mod_slotmem.so LoadModule manager_module modules/mod_manager.so LoadModule proxy_cluster_module modules/mod_proxy_cluster.so LoadModule advertise_module modules/mod_advertise.soCopy to Clipboard Copied! Toggle word wrap Toggle overflow
5.5. Running Enterprise Web Server 复制链接链接已复制到粘贴板!
5.5.1. Running Tomcat 复制链接链接已复制到粘贴板!
Important
5.5.1.1. Running Tomcat as a Program 复制链接链接已复制到粘贴板!
tomcat[5,6] script in the sbin directory or the catalina script in the lib directory:
- To start Tomcat with the tomcat script, run the following command as the root user with the respective Tomcat version (
5or6):The system reads the configuration file and changes to the user and group of the tomcat user account (that is, Tomcat is always run under the tomcat user). By default,/opt/redhat/ews/sbin/tomcat<VERSION> start
/opt/redhat/ews/sbin/tomcat<VERSION> startCopy to Clipboard Copied! Toggle word wrap Toggle overflow tomcat-nativeis automatically added to theLD_LIBRARY_PATHand-Djava.library.pathduring Tomcat startup. - To start Tomcat with the
catalina.shscript, run the following command with the respective Tomcat version (5or6) :The/opt/redhat/ews/share/tomcat<VERSION>/bin/catalina.sh
/opt/redhat/ews/share/tomcat<VERSION>/bin/catalina.shCopy to Clipboard Copied! Toggle word wrap Toggle overflow catalina.shscript detects the running JVM version and adds the/opt/redhat/ews/lib/path (/opt/redhat/ews/lib64for 64 bit JVM) to the library path.
5.5.1.2. Running Tomcat as a Service 复制链接链接已复制到粘贴板!
init.d or you can create and use your own system daemon script with jsvc or tanukiwrapper.
ln -s /opt/redhat/ews/etc/init.d/tomcat<VERSION> /etc/rc3.d/S70tomcat<VERSION> ln -s /opt/redhat/ews/etc/init.d/tomcat<VERSION> /etc/rcS.d/K20tomcat<VERSION>
ln -s /opt/redhat/ews/etc/init.d/tomcat<VERSION> /etc/rc3.d/S70tomcat<VERSION>
ln -s /opt/redhat/ews/etc/init.d/tomcat<VERSION> /etc/rcS.d/K20tomcat<VERSION>
init level numbers (for information on how define init level numbers consult your Solaris documentation). The preferred method of service management is through the Solaris Service Management Facility. In order to read more about this facility, consult the smf(5) manual.
5.5.2. Running HTTP Server 复制链接链接已复制到粘贴板!
apachectl script, which is located inside the /opt/redhat/ews/sbin directory. The apachectl script uses the configuration file /opt/redhat/ews/etc/sysconfig/httpd. In this file you can edit and select startup parameters, such as the running of mpm.
httpd configuration files are located inside the /opt/redhat/ews/etc/httpd directory. By default all supported modules are loaded and enabled (refer to Appendix A, Supported HTTP Modules). To disable some of the modules, comment out the respective modules in the httpd.conf file (for module description refer to http://httpd.apache.org/docs/2.2/mod/).
Procedure 5.10. Running HTTP Server
- Run the command line as the root user.
- Run the following command to start the HTTP Server:
sbin/apachectl start
sbin/apachectl startCopy to Clipboard Copied! Toggle word wrap Toggle overflow If you want your server to continue running automatically after a system reboot, add a call to theapachectlscript to your system startup files.Note
For complete documentation on how to start and stop the HTTP Server, refer to the files,docs/httpd/invoking.htmlanddocs/httpd/stopping.htmlrespectively.
5.6. Stopping Enterprise Web Server 复制链接链接已复制到粘贴板!
Procedure 5.11. Stopping Tomcat Running a Service
- At the shell prompt, become the root user.
- Execute the following command with the respective Tomcat version (
5or6) to stop Tomcat started from with the Tomcat script in thebindirectory:sbin/tomcat<VERSION> stop
sbin/tomcat<VERSION> stopCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Procedure 5.12. Stopping Tomcat Running a Program
- At the shell prompt, change to
/opt/redhat/ews/share/tomcat<VERSION>/bin. - Execute the following command with the respective Tomcat version (
5or6) to stop Tomcat started from with the Tomcat script in thebindirectory:sh shutdown.sh
sh shutdown.shCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Procedure 5.13. Stopping HTTP Server
- Run the command line as the root user.
- Run the following command to stop the HTTP Server:
sbin/apachectl stop
sbin/apachectl stopCopy to Clipboard Copied! Toggle word wrap Toggle overflow
5.7. Uninstalling the Package in Solaris 复制链接链接已复制到粘贴板!
- Issue the following command to uninstall the package:
pkgrm RHATews
pkgrm RHATewsCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Remove the following directories:
/opt/redhat/ews/var/run/tomcat5/var/run/tomcat6/var/cache/tomcat5/var/cache/tomcat6/var/log/httpd/var/cache/mod_ssl/var/cache/mod_proxy
5.8. Solaris Directory Structure 复制链接链接已复制到粘贴板!
- Native Solaris packages require the absolute location
- Solaris (and other non-Red Hat Enterprise Linux platforms) must ship and build all the dependent components such as
openldap,openssl,db4andcyrus-sasl.
Part II. Upgrade 复制链接链接已复制到粘贴板!
- for Red Hat Enterprise Linux Chapter 6, Upgrading Enterprise Web Server on Red Hat Enterprise Linux
6.1. Upgrading ZIP Installation 复制链接链接已复制到粘贴板!
- Back up your applications and custom settings.
- Install the new JBoss Enterprise Web Server version (refer to Section 3.2, “Installing Enterprise Web Server from a ZIP File”).
- Copy the applications and custom settings to the directory with the new JBoss Enterprise Web Server installation.
- Make sure all applications work correctly before removing their backups.
6.2. Upgrading RPM Installation 复制链接链接已复制到粘贴板!
Note
Procedure 6.1. Upgrading JBoss Enterprise Web Server on Red Hat Enterprise Linux 5
- At the shell prompt, become the root user.
- Run the following command to remove the classpathx-jaf package:
yum remove classpathx-jaf
# yum remove classpathx-jafCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Run the upgrade command:
yum upgrade
# yum upgradeCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Procedure 6.2. Upgrading JBoss Enterprise Web Server on Red Hat Enterprise Linux 4
- At the shell prompt, become the root user.
- Run the following command:
up2date -u
# up2date -uCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Chapter 7. Upgrading Enterprise Web Server on Windows 复制链接链接已复制到粘贴板!
- Back up your applications and custom settings.
- Install the new JBoss Enterprise Web Server version (refer to Chapter 4, Installing Enterprise Web Server on Windows).
- Copy the applications and custom settings to the directory with the new JBoss Enterprise Web Server installation (
C:\Program Files\Red Hat\Enterprise Web Server). - Make sure all applications work correctly before removing the backup.
Chapter 8. Upgrading Enterprise Web Server on Solaris 复制链接链接已复制到粘贴板!
- Back up your applications and custom settings.
- Install the new JBoss Enterprise Web Server version (refer to Chapter 5, Installing Enterprise Web Server on Solaris).
- Copy the applications and custom settings to the directory with the new JBoss Enterprise Web Server installation (
/opt/redhat/ews/). - Make sure all the applications work correctly before removing the backup.
Chapter 9. Hibernate on Enterprise Web Server 复制链接链接已复制到粘贴板!
context.xml). However, persistence.xml and web.xml are required. The example below shows a setting with tomcat connection pooling mechanism.
/META-INF/context.xmldefines the connection pools Tomcat should create.Example 9.1. context.xml
Copy to Clipboard Copied! Toggle word wrap Toggle overflow /WEB-INF/classes/META-INF/persistence.xmlis a JPA configuration file. It defines how the application configures Hibernate to consume connections from the Tomcat pool. If you are using Hibernate API directly, use a similar configuration inhibernate.cfg.xml.Example 9.2. persistence.xml
Copy to Clipboard Copied! Toggle word wrap Toggle overflow /WEB-INF/web.xmlis a regular web application deployment file, which tells Tomcat which datasource it consumes. In Example 9.3, “web.xml” the datasource isjdbc/DsWebAppDB.Example 9.3. web.xml
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Procedure 10.1. Configuring User Permissions on a Unix Operating System
Note
httpd and Tomcat directories.
- At the shell prompt, become the root user.
- Run the following command to add the user, under which JON Agent runs to the tomcat and apache user groups:
useradd -G tomcat,apache <RHQ_AGENT_USER>
# useradd -G tomcat,apache <RHQ_AGENT_USER>Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Procedure 10.2. Configuring Monitoring
- Open the
startupfile of the respective JBoss Enterprise Web Server instance for editing:- on Red Hat Enterprise Linux installed from a ZIP file open
$EWS_HOME/tomcat<VERSION>/bin/startup.sh - on Red Hat Enterprise Linux installed from a RPM files open
/usr/sbin/tomcat<VERSION> - on Solaris open
/opt/redhat/ews/tomcat<VERSION>/bin/startup.sh - on Windows open
C:\Program Files\Red Hat\Enterprise Web Server\sbin\tomcat<VERSION>.sh
- Define an available port for JMX monitoring. Make sure it is not blocked by any firewall. To do so, to the JAVA_OPTS variable in the startup file, add the following line and substitute PORT_NUMBER with the number of the port dedicated to monitoring:
- on Red Hat Enterprise Linux and Solaris:
JAVA_OPTS="${JAVA_OPTS} -Dcom.sun.management.jmxremote.port=PORT_NUMBER"JAVA_OPTS="${JAVA_OPTS} -Dcom.sun.management.jmxremote.port=PORT_NUMBER"Copy to Clipboard Copied! Toggle word wrap Toggle overflow - on Windows:
set "JAVA_OPTS=%JAVA_OPTS% -Dcom.sun.management.jmxremote.port=PORT_NUMBER"
set "JAVA_OPTS=%JAVA_OPTS% -Dcom.sun.management.jmxremote.port=PORT_NUMBER"Copy to Clipboard Copied! Toggle word wrap Toggle overflow
- If you want to disable authentication and SSL for development purposes, add the following lines to the JAVA_OPTS variable in the startup file:
JAVA_OPTS="${JAVA_OPTS} -Dcom.sun.management.jmxremote.ssl=false" JAVA_OPTS="${JAVA_OPTS} -Dcom.sun.management.jmxremote.authenticate=false"JAVA_OPTS="${JAVA_OPTS} -Dcom.sun.management.jmxremote.ssl=false" JAVA_OPTS="${JAVA_OPTS} -Dcom.sun.management.jmxremote.authenticate=false"Copy to Clipboard Copied! Toggle word wrap Toggle overflow Important
In production environments, add the following lines to the JAVA_OPTS variable in the startup file to secure JMX with SSL and restrict the access with a firewall:- on Red Hat Enterprise Linux and Solaris
JAVA_OPTS="${JAVA_OPTS} -Dcom.sun.management.jmxremote.access.file=$EWS_HOME/jmxremote.access" JAVA_OPTS="${JAVA_OPTS} -Dcom.sun.management.jmxremote.password.file=$EWS_HOME/jmxremote.password"JAVA_OPTS="${JAVA_OPTS} -Dcom.sun.management.jmxremote.access.file=$EWS_HOME/jmxremote.access" JAVA_OPTS="${JAVA_OPTS} -Dcom.sun.management.jmxremote.password.file=$EWS_HOME/jmxremote.password"Copy to Clipboard Copied! Toggle word wrap Toggle overflow - on Windows:
set "JAVA_OPTS=%JAVA_OPTS% -Dcom.sun.management.jmxremote.access.file=c:\Program Files\Red Hat\Enterprise Web Server\jmxremote.access" set "JAVA_OPTS=%JAVA_OPTS% -Dcom.sun.management.jmxremote.password.file=c:\Program Files\Red Hat\Enterprise Web Server\jmxremote.password"
set "JAVA_OPTS=%JAVA_OPTS% -Dcom.sun.management.jmxremote.access.file=c:\Program Files\Red Hat\Enterprise Web Server\jmxremote.access" set "JAVA_OPTS=%JAVA_OPTS% -Dcom.sun.management.jmxremote.password.file=c:\Program Files\Red Hat\Enterprise Web Server\jmxremote.password"Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Note
The JON httpd plugin needs a specific directory to monitor the HTTP Server:- on Solaris and Red Hat Enterprise Linux:
/etc/httpd - on Windows:
C:\apache
If the respective directory does not exist, create it before launching the JON agent.For further information about JBoss Operating Network refer to the Discovery chapter of the Basic Administration Guide.
Appendix A. Supported HTTP Modules 复制链接链接已复制到粘贴板!
- mod_filter.so
- mod_filter.so
- mod_substitute.so
- mod_version.so
- mod_usertrack.so
- mod_authn_alias.so
- mod_vhost_alias.so
- mod_headers.so
- mod_authz_host.so
- mod_dumpio.so
- mod_ssl.so
- mod_userdir.so
- mod_authn_dbd.so
- mod_env.so
- mod_ldap.so
- mod_expires.so
- mod_logio.so
- mod_authn_default.so
- mod_proxy_scgi.so
- mod_negotiation.so
- mod_disk_cache.so
- mod_authn_file.so
- mod_autoindex.so
- mod_auth_basic.so
- mod_proxy_http.so
- mod_setenvif.so
- mod_proxy.so
- mod_suexec.so
- mod_dav.so
- mod_asis.so
- mod_alias.so
- mod_proxy_balancer.so
- mod_log_forensic.so
- mod_mime_magic.so
- mod_deflate.so
- mod_proxy_connect.so
- mod_dav_fs.so
- mod_cgi.so
- mod_dbd.so
- mod_mem_cache.so
- mod_cgid.so
- mod_auth_digest.so
- mod_authz_owner.so
- mod_include.so
- mod_proxy_ajp.so
- mod_reqtimeout.so
- mod_authn_anon.so
- mod_status.so
- mod_cern_meta.so
- mod_log_config.so
- mod_cache.so
- mod_dir.so
- mod_proxy_ftp.so
- mod_ext_filter.so
- mod_authz_user.so
- mod_mime.so
- mod_unique_id.so
- mod_authz_default.so
- mod_ident.so
- mod_file_cache.so
- mod_speling.so
- mod_actions.so
- mod_authnz_ldap.so
- mod_authn_dbm.so
- mod_rewrite.so
- mod_authz_groupfile.so
- mod_imagemap.so
- mod_info.so
- mod_authz_dbm.so
Appendix B. Revision History 复制链接链接已复制到粘贴板!
| Revision History | |||||
|---|---|---|---|---|---|
| Revision 1.0.2-61 | Wed Feb 11 2015 | ||||
| |||||
| Revision 1.0.2-59 | Thu Sep 05 2013 | ||||
| |||||
| Revision 1.0.2-53 | Thu Jul 21 2011 | ||||
| |||||
| Revision 1.0.2-50 | Tue Jun 21 2011 | ||||
| |||||