Child pages
  • Apache HTTP Server Configuration
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 9 Next »

3.1 Configure Apache HTTP Server

  • Install downloaded Apache HTTP Server.
  • Apply any standard configuration that you want/need (ServerName, ServerAdmin, ...) if any is needed to make HTTP server operational.
  • Copy your mod_jk-1.2.28-httpd-2.2.3.so to [randd:yourApacheHTTPServerDir]/modules and rename it to mod_jk.so. (name might be slightly different depending on OS; see instructions on download page)

  • In [randd:yourApacheHTTPServerDir]/conf/httpd.conf (for more info on available options, see http://tomcat.apache.org/connectors-doc/webserver_howto/apache.html) add these lines after all other LoadModule lines:

    LoadModule jk_module modules/mod_jk.so
    # JK/Worker configuration
    
        # Where to find workers.properties
        JkWorkersFile conf/workers.properties
        # Where to put jk logs
        JkLogFile logs/mod_jk.log
        # Set the jk log level [debug/error/info]
        JkLogLevel    info
        JkMount /* loadbalancer
    
        # In case you want to be able to monitor JK status
        # <Location /jkmanager/>
        #    JkMount jkstatus
        #    Order deny,allow
        #    Deny from all
        #    Allow from 127.0.0.1
        # </Location>
    
  • Copy worker.properties file from [randd:yourServoyApplicationServerDir]/terracotta to [randd:yourApacheHTTPServerDir]/conf. It will load balance a cluster of two Servoy Servers, running on 2 different machines, both using port 8009. You will need to change the "worker.servoyX.host" entries in "worker.properties" file to the correct hostnames of your Servoy Application Servers. It is recommended to use port 8009 as well for all workers (default). If you have more/less than two servers, create/remove sections and update worker.list and worker.loadbalancer.balance_workers lines. For more information on how to tune your workers, see http://tomcat.apache.org/connectors-doc/reference/workers.html.

You have a possibility to monitor and control worker activity by uncommenting the "jkstatus" related comments in worker.properties and httpd.conf and accessing "[randd:yourServerUrl]/jkmanager/". This page will also allow you to activate/disable workers. You should add a worker for each Servoy Application Server that you will possibly start in your cluster, even if you do not plan to have them started all at once. There is no problem if only a part of those Servoy Application Servers are started. Load-balancing will work on servers defined in the worker.properties file that are also available. If you do define workers for Servoy Application Servers that are not started, disable them from the jkmanager page in order to avoid delays caused by load-balancer trying to check the availability of these workers.

3.2 Configure each Servoy Tomcat Server in the cluster to work with the AJP 1.3 connector

This will describe how to set up the two Tomcat Servers in your Servoy installations as used by original worker.properties file above. You can adapt it when using more Servoy installations.

  • Assume Servoy is installed twice, once on "servoyServer1Host" and once on "servoyServer2Host".
  • In [randd:servoy_install_folder]/application_server/server/conf/server.xml:

    • Change line "<Engine name="Catalina" defaultHost="localhost">" into "<Engine jvmRoute="servoy1" name="Catalina" defaultHost="localhost">"; for second server use "servoy2".
    • Add the following connector before the already declared one in both installations:
      <Connector port="8009"
                 enableLookups="false" maxThreads="500" connectionTimeout="60000"
                 redirectPort="8443" useBodyEncodingForURI="true" protocol="AJP/1.3"/>
      

When you start the 2 Servoy Application Servers and the Apache HTTP server and you access the Apache HTTP server you will be automatically using one of the two Servoy Servers in a weighted round-robin load balancing with sticky sessions manner.

  • No labels