Previous Topic: Create the uriworkermap.properties FileNext Topic: Adjust Related Settings


Update the httpd.conf File

Updating the httpd.conf file is a required task when you set up load balancing.

Follow these steps:

  1. Open the conf/httpd.conf file in the Apache HTTP Server installation directory and update it to include the following specifications:
    Listen 89
    LoadModule jk_module modules/mod_jk.so
    JkWorkersFile conf/workers.properties
    
    <VirtualHost *:89>
     ServerName load balancer host name
    
     JkMountFile conf/uriworkermap.properties
     JkLogFile logs/mod_jk.log
     JkLogLevel debug
    </VirtualHost>
    
  2. Find the following lines:
    JkLogFile logs/mod_jk.log
    JkLogLevel debug
    
  3. (Optional) Replace the lines in the previous step with the following lines:
    JkLogFile "|bin/rotatelogs.exe logs/mod_jk.log.%Y-%m-%d-%H_%M_%S 10M"
    JkLogLevel emerg
    

    This action modifies the mod_jk.log file on your production server to record only critical errors and to enable log automatic rollover when its file size reaches 10 MB.

  4. Add a Listen directive with the port number for every VirtualHost port in the file.

    For example, suppose you have defined a virtual host at port 89, as follows:

    <VirtualHost *:89>
    

    In that case, add the Listen directive for this port in the httpd.conf file, for example:

    Listen 89
    

    Note: The commonly used port is 89.

    This specification enables the Apache HTTP Server to listen on this port and accept incoming requests.

  5. Change the Default Type from text/plain to text/html.
    Note: This setting works well on most browsers. If you experience any difficulty with system performance or display quality after changing this option, return it to its original value.
  6. Save and close the conf/httpd.conf file.
  7. Adjust related settings in other locations.
  8. Disable the HTTP ports of the cluster computers.
  9. Configure the server information for the cluster computers.

You have updated the httpd.conf file.