Is it possible to have JBoss 7 listening to two AJP ports simultaneously, and how should I connect to it via Apache webserver?

StackOverflow https://stackoverflow.com/questions/13286837

  •  27-11-2021
  •  | 
  •  

Question

I'm trying to connect to my JBoss 7.1 server from an Apache 2 instance which is running on the same machine. So far I've managed to successfully establish a connection between the two instances using the AJP-protocol and port 8009. My problem is that it doesn't seem like it's possible to have the JBoss-server listening to two AJP-ports simultaneously. I've set up the JBoss to listen at port 8009 and 8010, where the AJP on port 8010 is set as "secure" and is only accessed via my Apache HTTPS VirtualHost.

The weird thing is that I've only been able to use ProxyPass with ajp and not http(s), every time I try I get a HTTP 503 Error in return.

Have I misunderstood something, or is this not possible?

My settings at the JBoss server (standalone.xml):

<socket-binding-group name="standard-sockets" default-interface="public" port-offset="${jboss.socket.binding.port-offset:0}">
    [snip]
    <socket-binding name="ajp" port="8009" />
    <socket-binding name="ajps" port="8010" />
    <socket-binding name="http" port="8080"/>
    <socket-binding name="https" port="8443"/>
    [snip]
</socket-binding-group>

<subsystem xmlns="urn:jboss:domain:web:1.1" default-virtual-server="default-host" native="false">
    <connector name="http" protocol="HTTP/1.1" scheme="http" socket-binding="http"/>
    <connector name="AJP" protocol="AJP/1.3" scheme="http" socket-binding="ajp"/>
    <connector name="AJP-Secure" protocol="AJP/1.3" scheme="https" socket-binding="ajps" secure="true"/>
    <connector name="https" protocol="HTTP/1.1" scheme="https" socket-binding="https" secure="true"/>
    <virtual-server name="default-host" enable-welcome-root="true">
        <alias name="localhost"/>
    </virtual-server>
</subsystem>

My Apache settings:

<VirtualHost *:80>
    [snip]
    ProxyRequests off
    <Location /jboss/> # Works
        ProxyPass ajp://127.0.0.1:8009/
        ProxyPassReverse ajp://127.0.0.1:8009/ 
    </Location>
</VirtualHost>

<VirtualHost *:443>
    [snip]
    ProxyRequests off
    <Location /jboss/> # Return HTTP 503
        ProxyPass ajp://127.0.0.1:8010/
        ProxyPassReverse ajp://127.0.0.1:8010/
    </Location>
</VirtualHost>
Was it helpful?

Solution

Ah, found the answer! :D It wasn't a faulty apache or JBoss configuration, it was SE Linux which were makeing all the trouble. I had to let the httpd make network requests, as described here (http://wiki.apache.org/httpd/13PermissionDenied)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top