How to enable AJP port in Payara Micro and Use Apache server as proxy

362 Views Asked by At

I am using Payara micro community edition to deploy a microservice REST APIs. I need to enable AJP port so that the Apache proxy server listens to the AJP port 8192.

java -jar payara-micro-5.2020.5.jar --deploydir ./payara/webapps --rootDir ./payara --postbootcommandfile ./payara/postboot.txt

./payara/webapps folder contains the microservice WAR file.

postboot.txt content:

create-network-listener --protocol http-listener-1 --listeneraddress 0.0.0.0 --listenerport 8192--jkenabled true jk-connector

The command execution has no issues and following ports are enabled "Http Port(s)": "8080, 8192".

I am able to use the microservice APIs locally (http://localhost:8192/). But the requests from Apache proxy shows Bad Gateway error.

Am I missing some configuration for AJP port enabling in Payara Micro?

1

There are 1 best solutions below

0
Saroj Padhy On

AJP port is enabled for Payara by adding this line in the domain.xml

<network-listener protocol="jk-listener" jk-enabled="true" port="8192" name="jk-connector" thread-pool="http-thread-pool" transport="tcp"></network-listener>