此内容没有您所选择的语言版本。
2.4.2. Configuring the Environment
Before running JBoss Enterprise Web Server, the JAVA_HOME variable must be set (see Procedure 2.6, “Setting JAVA_HOME”).
Optionally, you can also:
- create apache and tomcat users to allow a secure and simple user management (see Procedure 2.8, “Setting the apache User” and Procedure 2.7, “Creating tomcat User”);
- remove the SSL support (see Procedure 2.9, “Removing SSL”);
- add log4j logging (see Procedure 2.10, “Configuring log4j”);
- enable mod_jk or mod_cluster (see Procedure 2.11, “Configuring mod_jk” and Procedure 2.12, “Configuring mod_cluster”).
Run the post-installation script once you have set up the environment (see Procedure 2.13, “Running the Post-Installation Script”).
Configure the server to allow the JBoss ON discovery and give JBoss ON the needed access to allow JBoss Operations Network to monitor JBoss Enterprise Web Server (see Chapter 6, Monitoring Enterprise Web Server with JBoss Operations Network).
Procedure 2.6. Setting JAVA_HOME
- In the
bin
directory of your Tomcat (either$EWS_HOME/tomcat6/bin
or$EWS_HOME/tomcat7/bin
), create thesetenv.sh
file.For example, run 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 2.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
# groupadd -g 91 -r tomcat
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Go to /opt/jboss-ews-2.1.
- From /opt/jboss-ews-2.1, 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 tomcat
# useradd -c "Tomcat" -u 91 -g tomcat -s /bin/sh -r tomcat
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - From /opt/jboss-ews-2.1, run the following command to assign the ownership of the tomcat directories to the
tomcat
user and allow the user to run the tomcat service:chown -R tomcat:tomcat tomcat<VERSION>
# chown -R tomcat:tomcat tomcat<VERSION> 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 (6
or7
). - From /opt/jboss-ews-2.1, issue the command
ls -l
and check if the tomcat user is the owner of the Tomcat directory. - Make sure that the
tomcat
user has the execution permission to all parent directories.
Procedure 2.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
# groupadd -g 48 -r apache
Copy 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 apache
# useradd -c "Apache" -u 48 -g apache -s /bin/sh -r apache
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Change to
/opt/jboss-ews-2.1
and run the following command to assign the ownership of the apache directories to theapache
user and allow the user to runhttpd
:chown -R apache:apache httpd
# chown -R apache:apache httpd
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - From /opt/jboss-ews-2.1, issue the command
ls -l
and check that theapache
user 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 httpd
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Procedure 2.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
/opt/jboss-ews-2.1/httpd/conf.d/
directory. - Rename the SSL configuration file:
- To remove SSL, rename
ssl.conf
tossl.conf.disabled
. - To re-add SSL, rename
ssl.conf.disabled
tossl.conf
.
Procedure 2.10. Configuring log4j
Follow this procedure to add
log4j
logging to Tomcat:
- Go to the
/opt/jboss-ews-2.1/extras/
directory. - Copy the
log4j-eap6.jar
,log4j.properties
, andtomcat-juli-adapters.jar
files to thelib
directory of the Tomcat directory.For example:cp log4j.properties ../tomcat<VERSION>/lib/
# cp log4j.properties ../tomcat<VERSION>/lib/
Copy to Clipboard Copied! Toggle word wrap Toggle overflow cp log4j-eap6.jar ../tomcat<VERSION>/lib/
# cp log4j-eap6.jar ../tomcat<VERSION>/lib/
Copy to Clipboard Copied! Toggle word wrap Toggle overflow cp tomcat-juli-adapters.jar ../tomcat<VERSION>/lib/
# cp tomcat-juli-adapters.jar ../tomcat<VERSION>/lib/
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Replace <VERSION> with the respective Tomcat version number (6
or7
). - Replace
tomcat-juli.jar
file in your Tomcatbin
directory with thetomcat-juli.jar
file from/opt/jboss-ews-2.1/extras/
:cp tomcat-juli.jar ../tomcat<VERSION>/bin/
# cp tomcat-juli.jar ../tomcat<VERSION>/bin/
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Procedure 2.11. Configuring mod_jk
To configure the HTTP Server to use mod_jk, define the following:
- available workers (JBoss instances) in the
workers.properties
file - the mod_jk configuration file
Follow this procedure to configure the HTTP Server to use mod_jk as its load balancer:
- In the
/opt/jboss-ews-2.1/httpd/conf/
directory, createworkers.properties
. - In the
/opt/jboss-ews-2.1/httpd/conf.d/
directory, createmod_jk.conf
.Note
You can also use the template files from thejboss-ews-docs-2.1.0.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.sample
andworkers.properties.sample
from the /opt/jboss-ews-2.1/doc/mod_jk/ to the locations defined in Step 1 and Step 2. Rename them (drop thesample
extension) and modify their content as needed (see Section 2.4.7, “Additional Resources”).
Procedure 2.12. Configuring mod_cluster
- The mod_cluster configuration can be customized in
/opt/jboss-ews-2.1/httpd/conf.d/mod_cluster.conf
.For more information about customizing mod_cluster, see the JBoss HTTP Connector section of the HTTP Connectors and Load Balancing Guide.
Procedure 2.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.1/httpd
directory. - Run the following command:
./.postinstall
# ./.postinstall
Copy to Clipboard Copied! Toggle word wrap Toggle overflow