4.3. Configuring the Environment

Before running JBoss Enterprise Web Server, set the environment variables and run the post-installation script.

Procedure 4.4. Setting Environment Variables

  1. Log in to an account with local administrator permissions.
  2. Go to Control PanelSystem.
  3. Click on the Advanced tab.
  4. Click the Environment Variables button.
  5. Click the New for System Variables.
  6. Enter the required JAVA_HOME, TMP and TEMP name-value pairs.
  7. You will also need to add <EWS_HOME>\bin to 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

  1. Run the Command Prompt as administrator even if you are logged in as the administrator:
    1. Click the Start button.
    2. Go to All ProgramsAccessories.
    3. Right-click the Command Prompt and select Run as administrator.

    Running Command Prompt in Windows Server 2003

    Windows Server 2003 does not have the User Account Control concept, therefore you only need to run the Command Prompt (cmd.exe).
  2. In the Command Prompt, type the following to change to the etc folder of your Enterprise Web Server installation:
    C:\> cd /D "C:\Program Files\Red Hat\Enterprise Web Server\etc"
  3. Issue the command call postinstall.bat to 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

Follow this procedure to install Tomcat as a service:
  • Run the Command Prompt as administrator:
    1. Click the Start button.
    2. Go to All ProgramsAccessories.
    3. Right-click the Command Prompt and select Run as administrator.

      32-bit vs 64-bit Command Prompt

      On 64-bit Windows, you need to use the 64-bit version of the Command Prompt (cmd.exe). Running the cmd command 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.
    4. Change to the sbin folder in the JBoss Enterprise Web Server installation folder:
      C:\> cd /D "C:\Program Files\Red Hat\Enterprise Web Server\sbin"
    5. In the Command Prompt, run the following command with the required Tomcat version (5 or 6) to install Tomcat:
      call service<VERSION>.bat install
      You can check the service parameters by typing tomcat<VERSION>w.exe.

      Note

      The tomcat<VERSION>w.exe is located in C:\Program Files\Red Hat\Enterprise Web Server\bin

Procedure 4.7. Installing HTTP

Follow this procedure to install Tomcat as a service:
  1. Run the Command Prompt as administrator:
    1. Click the Start button.
    2. Go to All ProgramsAccessories.
    3. Right-click the Command Prompt and select Run as administrator.
  2. Change to the bin folder of your new installation:
    C:\> cd /D "C:\Program Files\Red Hat\Enterprise Web Server\bin"
  3. In the Command Prompt, run the install command:
    httpd -k install
    A Firewall security dialog prompt demanding networking access for the Apache HTTP Server service appears. Click Allow if you wish to access this service from the network.

    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 to Manual
    • World Wide Web... service is configured to listen on a different port
    Alternatively, you can edit the httpd.conf file before installing the service and change the Listen directive to a port that does not collide with the Internet Information Service listening ports.

Procedure 4.8. Configuring log4j

Follow this procedure to use log4j logging in Tomcat:
  1. Change to C:\Program Files\Red Hat\Enterprise Web Server\extras\
  2. 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 C:\Program Files\Red Hat\Enterprise Web Server\extras\tomcat-juli-adapters.jar C:\Program Files\Red Hat\Enterprise Web Server\tomcat6\lib
    • If using Tomcat 5, run the following commands:
      copy log4j.properties ..\tomcat5\common\classes
      copy log4j.jar ..\tomcat5\common\lib

Procedure 4.9. Removing SSL

JBoss Enterprise Web Server supports SSL by default, but it may be removed.
Follow this procedure to remove or again add SSL:
  1. Go to C:\Program Files\Red Hat\Enterprise Web Server\etc\httpd\conf.d
  2. Rename the SSL configuration file:
    • To remove SSL, rename ssl.conf to ssl.conf.disabled.
    • To re-add SSL rename ssl.conf.disabled to ssl.conf.

Procedure 4.10. Configuring mod_jk

To configure the HTTP Server to use mod_jk, the following needs to be defined:
  • available workers (JBoss instances) in the workers.properties file
  • the mod_jk configuration file mod_jk.conf
Follow this procedure to configure the HTTP Server to use mod_jk as its load balancer:
  1. 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).
  2. 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)

    Configuration Samples

    You can also use the sample files mod_jk.conf.sample and workers.properties.sample available in C:\Program Files\Red Hat\Enterprise Web Server\etc\httpd\conf: modify their content as needed and rename them to mod_jk.conf and workers.properties.

Procedure 4.11. Configuring mod_cluster

Follow this procedure to configure the HTTP Server to use mod_cluster as its load balancer:
  1. In the C:\Program Files\Red Hat\Enterprise Web Server\etc\httpd\conf\httpd.conf file, add the hash (#) sign at the beginning of the following line to disable mod_proxy_balancer.so:
    LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
    This module is incompatible with the JBoss HTTP Connector.
  2. Configure the server to load the JBoss HTTP Connector modules:
    1. Create the file C:\Program Files\Red Hat\Enterprise Web Server\etc\httpd\conf\JBoss_HTTP.conf.
    2. Add the following lines to the JBoss_HTTP.conf file:
      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 4.12. Setting Security

Follow this procedure to ensure that the account used to run the services has full control over the C:\Program Files\Red Hat folder and all of its subfolders:
  1. Right-click the C:\Program Files\Red Hat folder and click Properties.
  2. Select the Security tab.
  3. Click the Add.. button and type in LOCAL SERVICE.
  4. Select the Full Control check box for the new LOCAL SERVICE account.
  5. Click the Advanced button.
  6. Inside the Advanced Security Settings for Red Hat dialog, select the Replace permissions on all child objects... check box and click the OK button.
    This procedure is intended for Windows 2003. The equivalent procedure in Windows Server 2008 and Windows Server 2008R2 can slightly differ.