i have glassfish 4.1 running and checked the JK-Listener option on http-listener-2:

JK Listener checked

also i already installed apache (sudo yum install httpd) and created the following file on /etc/httpd/conf.d:


ProxyPass /painel ajp://localhost:8181/painel

ProxyPassReverse /painel ajp://localhost:8181/painel

But all that i got trying to use the ajp protocol was the 503 http error.

What i am missing?

if i change the protocol from ajp to http and port to 8080, it works. But the idea was to use the ajp.

Any help is welcome.

2 Answers 2


You've likely run into an issue with SELinux.

By default the web server can only make outbound connections to a limited range of ports:

# semanage port -l | grep http
http_cache_port_t              tcp      8080, 8118, 8123, 10001-10010
http_cache_port_t              udp      3130
http_port_t                    tcp      80, 81, 443, 488, 8008, 8009, 8443, 9000
pegasus_http_port_t            tcp      5988
pegasus_https_port_t           tcp      5989

Port 8181 isn't in that list.

So you have two options. You can either:

  1. Add your desired port to the allowed ports list:

    # semanage port -a -t http_port_t -p tcp 8181
  2. Run Glassfish on one of the existing allowed ports.


I know that this is an old post but I run into the same problem. My problem was the selinux and after I run the following:

setsebool -P httpd_can_network_connect 1

everything works fine!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.