mod_jk integration

118 views
Skip to first unread message

back btn

unread,
Apr 30, 2021, 4:18:04 PM4/30/21
to WildFly

Hi,

I am using the instructions found in a book for administrating wildlfy.

The first four steps are every clear the last step is not on par with the previous 4 steps.


It is unclear where and how am I supposed to check the ajp listener in the current(20.0.1) wildfly ?

After checking where and how I am supposed to update with the following code ?



I have listed all steps in reverse order.


Thanks


STEP 5


14.1.2. Configuring WildFly to receive AJP requests Done with mod_jk, now let’s move to WildFly configuration.

First of all, check that your current version of WildFly includes an ajp listener:


/subsystem=undertow/server=default-server/:read-resource(recursive=false) { "outcome" => "success", "result" => { "default-host" => "default-host", "servlet-container" => "default", "ajp-listener" => {"ajp" => undefined}, "host" => {"default-host" => undefined}, "http-listener" => {"default" => undefined}, "https-listener" => undefined }


}


In our case the ajp-listener is included in the configuration. In case the ajp-listener does not show up in your configuration, then you can add it as follows: /subsystem=undertow/server=default-server/ajp-listener=default-ajp:add(socket- binding=ajp)


So with the above configuration, all incoming requests included in the JKMount directive by Apache configuration, will be transparently routed to WildFly.


STEP 4

worker.list=loadbalancer,status # Define Node1 worker.node1.port=8009 worker.node1.host=localhost

worker.node1.type=ajp13

worker.node1.lbfactor=1

# Define Node2

worker.node2.port=8159

worker.node2.host=localhost

worker.node2.type=ajp13

worker.node2.lbfactor=1

# Load-balancing behavior worker.loadbalancer.type=lb worker.loadbalancer.balance_workers=node1,node2

worker.loadbalancer.sticky_session=1

worker.status.type=status


STEP 3

Now create the file mod-jk.conf in your Apache configuration folder.

This file will contain the mod_jk configuration including the web context we are going to route from Apache to WildFly.


LoadModule jk_module

modules/mod_jk.so


# Where to find workers.properties

JkWorkersFile conf/workers.properties

# Where to put jk logs


JkLogFile logs/mod_jk.log

# Set the jk log level


JkLogLevel info

# Mount your applications


JkMount /myapp/* loadbalancer

JkShmFile logs/jk.shm



Here is a description for the most important settings:

The LoadModule directive references the mod_jk library you have downloaded. You must indicate

the exact same name with the "modules" file path prefix.


The JkMount directive tells Apache which URLs it should forward to the mod_jk module. In the

above file, all requests with URL path /myapp/* are sent to the mod_jk load-balancer.


The JkWorkersFile references in turn the cluster configuration and thus contains the (static) list of

nodes that are part of the Web farm. The worker file, named workers.properties,


 STEP 2

Mod_jk configuration will be stored in a file apart, hence include this line in your httpd.conf: Include conf/mod-jk.conf


STEP 1


14.1.1. Configuring Apache Web server side In order to install mod_jk, as first step download the latest stable Apache mod_jk connectors from http://tomcat.apache.org/download-connectors.cgi .Once completed the download, copy the connector to the modules folder of your Apache 2 distribution:


$ cp mod_jk.so $APACHE_HOME/modules

Reply all
Reply to author
Forward
0 new messages