Skip to main content
August 9, 2007
Answered

Multiple Apache Servers tied to CF8/JRUN?

  • August 9, 2007
  • 1 reply
  • 688 views
I've got CF6 experience over J2EE, but now I'm trying to deploy CF8 over embedded JRUN 4.0 on an OS X Tiger Server (10.4.10) and running into some headaches. From what I can see in the JRUN 4 documentation I need to enable Proxy Service so that I can have multiple web hosts tied into the same CF8 server, but I can't figure out how to do this. The CF8 documentation doesn't talk about embedded JRUN very much. Is there an administrator interface for embedded JRUN or should I attempt to edit jrun.xml by hand? Or am I totally on the wrong track?

Any help would be appreciated.

What follows are the nitty-gritty details.

The JRun / CF8 server is running at 192.168.1.100 and jrun.xml contains the following snippet (the default);

<service class="jrun.servlet.jrpp.JRunProxyService" name="ProxyService">
<attribute name="activeHandlerThreads">50</attribute>
<attribute name="minHandlerThreads">1</attribute>
<attribute name="maxHandlerThreads">1000</attribute>
<attribute name="mapCheck">0</attribute>
<attribute name="threadWaitTimeout">300</attribute>
<attribute name="backlog">500</attribute>
<attribute name="deactivated">false</attribute>
<attribute name="interface">*</attribute>
<attribute name="port">51800</attribute>
<attribute name="timeout">300</attribute>
<!-- set this to false for multi-hosted sites -->
<attribute name="cacheRealPath">false</attribute>
<!--
<attribute name="keyStore">{jrun.rootdir}/lib/keystore</attribute>
<attribute name="keyStorePassword">changeit</attribute>
<attribute name="trustStore">{jrun.rootdir}/lib/trustStore</attribute>
<attribute name="socketFactoryName">jrun.servlet.jrpp.JRunProxySSLServerSocketFactory</attribute>
-->
</service>


The Apache server running on the same machine (192.168.1.100) contains the following connection info in its httpd.conf file. This works beautifully.

# JRun Settings
LoadModule jrun_module /Applications/ColdFusion8/runtime/lib/wsconfig/1/mod_jrun.so
<IfModule mod_jrun.c>
JRunConfig Verbose false
JRunConfig Apialloc false
JRunConfig Ssl false
JRunConfig Ignoresuffixmap false
JRunConfig Serverstore /Applications/ColdFusion8/runtime/lib/wsconfig/1/jrunserver.store
JRunConfig Bootstrap 127.0.0.1:51800
#JRunConfig Errorurl url <optionally redirect to this URL on errors>
#JRunConfig ProxyRetryInterval 600 <number of seconds to wait before trying to reconnect to unreachable clustered server>
#JRunConfig ConnectTimeout 15 <number of seconds to wait on a socket connect to a jrun server>
#JRunConfig RecvTimeout 300 <number of seconds to wait on a socket receive to a jrun server>
#JRunConfig SendTimeout 15 <number of seconds to wait on a socket send to a jrun server>
AddHandler jrun-handler .jsp .jws .cfm .cfml .cfc .cfr .cfswf
</IfModule>


Where I run into trouble is when I enable the following configuration on a second Apache server (at 192.168.1.102). If I enable the following code I get errors. [Yes, /Applications/Coldfusion8 is populated properly, as far as I can tell, but I don't want to launch JRUN / CF8 on this machine.]

# JRun Settings
LoadModule jrun_module /Applications/ColdFusion8/runtime/lib/wsconfig/1/mod_jrun.so
<IfModule mod_jrun.c>
JRunConfig Verbose false
JRunConfig Apialloc false
JRunConfig Ignoresuffixmap false
JRunConfig Ssl false
JRunConfig Serverstore /Applications/ColdFusion8/runtime/lib/wsconfig/1/jrunserver.store
JRunConfig Bootstrap 192.168.1.100:51800
#JRunConfig Errorurl url <optionally redirect to this URL on errors>
#JRunConfig ProxyRetryInterval 600 <number of seconds to wait before trying to reconnect to unreachable clustered server>
#JRunConfig ConnectTimeout 15 <number of seconds to wait on a socket connect to a jrun server>
#JRunConfig RecvTimeout 300 <number of seconds to wait on a socket receive to a jrun server>
#JRunConfig SendTimeout 15 <number of seconds to wait on a socket send to a jrun server>
AddHandler jrun-handler .jsp .jws .cfm .cfml .cfc .cfr .cfswf
</IfModule>


Here are the connection errors that I receive when the Apache server at 192.168.1.102 fires up:

[Thu Aug 9 16:36:40 2007] [notice] jrApache[25761:61918] 255.255.255.255:0 connect failed[54]: 49 49 Can't assign requested address
[Thu Aug 9 16:36:40 2007] [notice] jrApache[25761:61918] could not initialize proxy for fe80:0:0:0:203:93ff:feab:9662%4:51800
[Thu Aug 9 16:36:40 2007] [notice] jrApache[25761:61918] 255.255.255.255:0 connect failed[54]: 49 49 Can't assign requested address
[Thu Aug 9 16:36:40 2007] [notice] jrApache[25761:61918] could not initialize proxy for fe80:0:0:0:203:93ff:fec0:7676%5:51800

---END---
    This topic has been closed for replies.
    Correct answer
    Thanks, TRS-80 for responding. I noticed that IPv6 address in the error log as well, but didn't know what to make of it. OSX Server assigns an IPv6 equivalent for wired network ports by default, so I think that's where that IPv6 address is coming from, but there's also a perfectly valid IPv4 address for the same port as well; for some reason that was being ignored.

    I found out around noon today that my problem was much simpler than I thought. My CF8 server had stopped responding while I was trying to configure the remote server; port 51800 had simply stopped listening. I'm not sure why this happened; it's possible that I made a last minute config change that crashed it. Once I restarted JRun, the JRun connector worked correctly on both Apache servers with zero changes to the config files.

    FYI... On OS X Server, the "Server Admin" program automatically sets up the "Listen" directives you were asking about so Apache 1.3 can handle the multihomed virtual sites. Apache listens on port 16080 but somewhere in the guts of the machine it's being mirrored on port 80. Here's my "remote" Apache server (the one not running ColdFusion):

    Listen *:16080
    Listen 192.168.1.103:16080
    NameVirtualHost 192.168.1.103:16080
    Listen 192.168.1.104:16080
    NameVirtualHost 192.168.1.104:16080
    Listen 192.168.1.105:16080
    NameVirtualHost 192.168.1.105:16080

    1 reply

    Participating Frequently
    August 13, 2007
    You enable the JRun proxy service by setting the deactivated attribute to false. It looks like you've got that part covered.

    In your error log, fe80:0:0:0:203:93ff:feab:9662 is a link-local IPv6 address (for an adapter with physical address 00:03:93:ab:96:62). mod_jrun uses sockaddr_in and inet_addr to retrieve and store IP addreses. Neither of those is IPv6 aware.

    I'm not 100% sure how Mac OS X configures Apache (1.3?) by default, but you can force Apache to use IPv4 addresses by modifying the Listen directive, e.g.:

    # to bind to port 80 on all address
    Listen 0.0.0.0:80
    # to bind to port 80 on a specific address
    Listen 192.168.1.102:80
    Correct answer
    August 13, 2007
    Thanks, TRS-80 for responding. I noticed that IPv6 address in the error log as well, but didn't know what to make of it. OSX Server assigns an IPv6 equivalent for wired network ports by default, so I think that's where that IPv6 address is coming from, but there's also a perfectly valid IPv4 address for the same port as well; for some reason that was being ignored.

    I found out around noon today that my problem was much simpler than I thought. My CF8 server had stopped responding while I was trying to configure the remote server; port 51800 had simply stopped listening. I'm not sure why this happened; it's possible that I made a last minute config change that crashed it. Once I restarted JRun, the JRun connector worked correctly on both Apache servers with zero changes to the config files.

    FYI... On OS X Server, the "Server Admin" program automatically sets up the "Listen" directives you were asking about so Apache 1.3 can handle the multihomed virtual sites. Apache listens on port 16080 but somewhere in the guts of the machine it's being mirrored on port 80. Here's my "remote" Apache server (the one not running ColdFusion):

    Listen *:16080
    Listen 192.168.1.103:16080
    NameVirtualHost 192.168.1.103:16080
    Listen 192.168.1.104:16080
    NameVirtualHost 192.168.1.104:16080
    Listen 192.168.1.105:16080
    NameVirtualHost 192.168.1.105:16080