1

I'm trying to create a workers.properties file to get mod_jk communicating with Apache webserver 2.2.x. The GlassFish 3.1 Administration Document includes the following example for worker.properties:

# Define 1 real worker using ajp13
worker.list=worker1
# Set properties for worker1 (ajp13)
worker.worker1.type=ajp13
worker.worker1.host=localhost
worker.worker1.port=8009
# GlassFish server settings
maxThreads=256

Does this example assume that mod_jk/Glassfish is installed in a different physical server than Apache webserver? More specifically, if in my situation, where Apache webserver and Glassfish and mod_jk are all on the same physical server, do I need to specify the port number (e.g. 8009)?

That is, I thought the concept of ports was to facilitate machine-to-machine communication. If everything's on the same machine, do they even need a port number open to communicate? Or, is port 8009 needed for some other reason? In my situation, I'd like to use Apache webserver as front-end for Glassfish, so Glassfish doesn't directly talk to external clients.

So the main question here is how to adapt the above example file for the case where everything is installed on the same server, and Glassfish used mod_jk as simple pass-through from Apache webserver?

A second question would be, what is the maximum number of maxThreads one can set? (Is this limited by AJP13 protocol, or something else?)

1 Answer 1

2

You have a couple of questions here, i'll try and answer them in order.

That is, I thought the concept of ports was to facilitate machine-to-machine communication. If everything's on the same machine, do they even need a port number open to communicate?

Yes, and no. What ports are used for is to allow multiple IP based services talk to each other. It doesn't necessarily mean it's computer to computer. It only really means you are talking to an IP based service.

So the main question here is how to adapt the above example file for the case where everything is installed on the same server, and Glassfish used mod_jk as simple pass-through from Apache webserver?

The example is correct, you still need to specify the ajp port, otherwise mod_jk will not be able to connect to the instance. Even thought it's on the same machine you are still making an IP socket connection - it's just via the loop back adapter and not an standard adapter like eth0

A second question would be, what is the maximum number of maxThreads one can set? (Is this limited by AJP13 protocol, or something else?)

I think it's just an INT - but i would strongly suggest NOT setting this to the highest settings - start somewhere 256 is a good starting place and monitor what is happening with your app and how many connections it really needs.

4
  • Thanks Zypher! If I have to "open" port 8009, doesn't this mean the external world can access the server through this port and so opening this port makes the server less secure (of course, if this port simply has to be opened, then there's nothing I can do about it)? Or, is the port only visible between webserver and mod_jk?
    – gkdsp
    Feb 8, 2012 at 19:21
  • Also, should port 8009 be TCP or UDP? Should it be opened in IN direction, OUT direction, or both IN and OUT directions?
    – gkdsp
    Feb 8, 2012 at 19:23
  • You shouldn't have to open any ports in the firewall as long as you are communicating on the local loop back adapter. As long as you are communicating on the same host it should just work
    – Zypher
    Feb 8, 2012 at 19:28
  • Ahh, now it's starting to make sense. Thanks so much.
    – gkdsp
    Feb 8, 2012 at 19:38

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .