此内容没有您所选择的语言版本。
3.2.2. Configuring the Environment
Before running JBoss Enterprise Web Server, the JAVA_HOME variable needs to be set (refer to Procedure 3.6, “Setting JAVA_HOME”).
Optionally, you can also:
- 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”).
Run the post-installation script once you have set up the environment (refer to Procedure 3.13, “Running the Post-Installation Script”).
Procedure 3.6. Setting JAVA_HOME
Follow this procedure to set the
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
Follow this procedure to create the tomcat user and its parent group:
- At the shell prompt, become the root user.
- Run the following command to create the tomcat user group:
# groupadd -g 91 -r tomcat - 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 - 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>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
Follow this procedure to set up the apache user:
- Run the following commands as the root user to create the apache user group:
# groupadd -g 48 -r apache - 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 - 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 - 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
Procedure 3.9. Removing SSL
JBoss Enterprise Web Server supports SSL by default, but it can be removed.
Follow this procedure to remove or re-add 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
Follow this procedure to add
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/libextras]# cp tomcat-juli-adapters.jar $EWS_HOME/tomcat6/lib - If using Tomcat 5, run the following commands:
extras]# cp log4j.properties ../tomcat5/common/classesextras]# cp log4j.jar ../tomcat5/common/lib
Procedure 3.11. Configuring mod_jk
To configure the HTTP Server to use mod_jk, define the following:
- available workers (JBoss instances) in the
workers.propertiesfile - the mod_jk configuration file
Follow this procedure to configure the HTTP Server to use mod_jk as its load balancer:
- 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
Follow this procedure to configure the HTTP Server to use mod_cluster as its load balancer:
- 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 - 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
Procedure 3.13. Running the Post-Installation Script
Follow this procedure to run 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:
# ./.postinstallNote
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.