Skip to main content
Participant
March 8, 2023
Question

Can ColdFusion Tomcat prefer IPv4 to IPv6?

  • March 8, 2023
  • 2 replies
  • 472 views

My rhel8.7 server has both IPv6 and IPv4 enabled. It seems ColdFusion and Tomcat are both picking IPv6 instead of IPv4.  I added Java options to the jvm.config "-Djava.net.preferIPv4Stack=true -Djava.net.preferIPv4Addresses=true" but they don't seem to have any effect.  Is there another way to have ColdFusion builtin web server use IPv4?

 

Thanks,

Dan Mather

    This topic has been closed for replies.

    2 replies

    BKBK
    Community Expert
    Community Expert
    March 12, 2023
     

     I added Java options to the jvm.config "-Djava.net.preferIPv4Stack=true -Djava.net.preferIPv4Addresses=true" but they don't seem to have any effect.  Is there another way to have ColdFusion builtin web server use IPv4?


    By @Daniel28757470nidk

     

    What about the following instead?

    -Djava.net.preferIPv4Stack=true -Djava.net.preferIPv6Addresses=false

     

    [I have assumed that there is no address attribute in the <connector> element in server.xml, which is the default.]

    Vikram Kumar M
    Community Manager
    Community Manager
    March 8, 2023

    Hi Dan,

     

    Try to add the "address" attribute in the connector configuration in server.xml and see if it helps. Restart the CF after making changes.

     

    Server.xml is located in \ColdFusion2021\cfusion\runtime\conf directory. 

     

    Example:

     

    <!-- begin connector-->
    <Connector packetSize="65535" protocol="AJP/1.3" port="8020" address="127.0.0.1" redirectPort="8453" secret="57144017-a4c8-4aa5-84c3-8a74b96ce523" maxThreads="500" connectionTimeout="60000" tomcatAuthentication="false"/>
    <!-- end connector-->

     

    Thanks,

    Vikram