April 18, 2023
Configuring ColdFusion Websocket proxy in distributed mode on Linux
Comments
(0)
April 18, 2023
Configuring ColdFusion Websocket proxy in distributed mode on Linux
(0)

–!> On Server A, Install Apache

–!> On Server B, Install Coldfusion

–!> Copy the below files and JRE directory from Server B to Server A (We need to create the same directory structure on Server A where Apache is installed)

/opt/ColdFusion2021/jre (directory you need to copy the JDK to which coldfusion is pointed to)
/opt/ColdFusion2021/cfusion/lib/wsproxyconfig.jar
/opt/ColdFusion2021/cfusion/runtime/conf/server.xml
/opt/ColdFusion2021/config/instances.xml
/opt/ColdFusion2021/config/cluster.xml

–!> Run wsproxyconfig.jar file to create a connector on Server A ( Apache server)

/opt/ColdFusion2021/jre/bin>./java -jar /opt/ColdFusion2021/cfusion/lib/wsproxyconfig.jar -ws Apache -dir /etc/apache2/

root@no1010042034032:/opt/ColdFusion2021/cfusion/lib# /opt/ColdFusion2021/jre/bin/java -jar wsproxyconfig.jar -ws Apache -dir /etc/apache2/
[Wed Feb 22 17:17:13.664721 2023] [core:warn] [pid 3939809] AH00111: Config variable ${APACHERUNDIR} is not defined
Added the websocket proxy module successfully. Restart the webserver to complete the WebSocket proxy configuration.

–!> Once done wsproxy directory will be created under “/opt/Coldfusion2021/config” with the below contents

root@no1010042034032:/opt/ColdFusion2021/config/wsproxy# ls -lrt
total 8
-rwxrwxrwx 1 root root 118 Feb 22 17:21 wsproxy.properties
drwxrwxrwx 2 root root 4096 Feb 22 17:25 1

–!> Now manually change the IP address to point to Server B IPAddress ( i.e coldfusion Server IP Address) in below files

/opt/ColdFusion2021/config/wsproxy/wsproxy.properties
/opt/ColdFusion2021/config/wsproxy/1/config.ini

–!> Contents of wsproxy.properties will be as mentioned below

#ColdFusion WebServer Proxy Configuration File
#Wed Feb 22 17:17:13 UTC 2023
1=Apache,/etc/apache2/,localhost,8581   (Here change the entry for localhost to point to Coldfusion ServerName or IPAddress)

–!> Contents of config.ini will be as mentioned below

Host=Localhost (Here change the entry for localhost to point to Coldfusion ServerName or IPAddress)
Port=8581
ConnectionPoolSize=10
PacketSize=8192
EnableLogging=false
MessageQueueSize=50000

–!> Once done restart Apache instance on ServerA

–!> Now login to Coldfusion Admin page Navigate to Websockets and select use proxy option and make sure that the port in CF admin page and the port in config.ini matches in this case the port in CF admin page and config.ini should be 8581

–!> Restart Coldfusion instance

–!> In apache2.config or httpd.conf add below virtual host configuration

<VirtualHost *:80>
ServerName ApacheServerIPorHostname 
ProxyPass / http://ColdfusionServerIp:ColdfusionAdminPort/ 
ProxyPassReverse / http://ColdfusionServerIp:ColdfusionAdminPort/
</VirtualHost>

–!> Restart ApacheWebserver

–!> When accessed it masks the Websocket port below is the results

0 Comments
Add Comment