Configuring ColdFusion in a Distributed Environment (Linux): ColdFusion and Apache ColdFusion is a powerful application server that helps developers build dynamic web applications with ease. It provides a robust scripting language (CFML), seamless database connectivity, and enterprise-level functionalities such as session management, caching, and security. A distributed environment means running different parts of an application on different servers, making it faster and more reliable. ColdFusion, when used with Apache in this setup, helps handle web traffic better and improves performance. This setup reduces downtime and ensures everything runs smoothly. This guide will show you how to set up ColdFusion 2023 (or 2021) with Apache on different servers. A distributed environment means running ColdFusion on one machine and the Web server on a different machine. This guide will show you how to configure ColdFusion 2023 (or 2021) with Apache on different servers.
Step 1: Install and Configure Apache on Server1
- Install Apache on Server1.
- Configure the necessary Apache settings as per your requirements.
Step 2: Install ColdFusion on Server2
- Install ColdFusion 2025 (or 2023) on Server2.
- Configure ColdFusion with all necessary configurations.
Step 3: Copy Required Files from ColdFusion Server to Apache Server
On Server2 (ColdFusion server), find and copy the following files to Server1 (Apache server), ensuring the directory structure remains the same to avoid configuration issues. Ensure that the directory structure on Server1 matches the original directory structure on Server2.
- /opt/ColdFusion2025/jre
- /opt/ColdFusion2025/cfusion/runtime/lib/wsconfig.jar
- /opt/ColdFusion2025/cfusion/runtime/lib/config.properties
- /opt/ColdFusion2025/cfusion/runtime/conf/server.xml
- /opt/ColdFusion2025/config/cluster.xml
- /opt/ColdFusion2025/config/instances.xml
- /opt/ColdFusion2025/cfusion/wwwroot/WEB-INF/web.xml
Note : We need to copy the web.xml
file as it contains some mapping configurations required for monitoring the connector.
Step 4: Run the Web Server Configuration Tool
On Server1 (Apache server), execute the following command to configure Apache:
java -jar /opt/ColdFusion2025/cfusion/runtime/lib/wsconfig.jar -ws Apache -dir /etc/httpd/conf/ -bin /usr/sbin/httpd -script /usr/sbin/apachectl -v
Modify paths based on your environment:
- -script: Path to apachectl
- -dir: Path to Apache configuration files
- -bin: Path to the httpd binary
For Apache2, use the below command:
wsconfig.jar -ws Apache -bin /opt/apache2/bin/httpd -script /opt/apache2/bin/apachectl -dir /opt/apache2/conf -v
Configuration Files
Each time you run the Web Server Configuration Tool, it creates a configuration files and directory. For example, the first time you run the tool in the server configuration, it creates files under cf_root/config/wsconfig/1; the second time, it creates cf_root/config/wsconfig/2; and so on. Each of these subdirectories contains the appropriate platform-specific connector module and web-server-specific supporting files.
Step 5: Modify server.xml on Both Servers
Before making changes, back up the server.xml file on both Server1 and Server2. Then, modify the file as below.
Example:
<Connector protocol=”AJP/1.3″ address=”IP_of_ColdFusion_Server” port=”8022″ redirectPort=”8455″ secret=”20aac1d2-- xxxx-xxxx-xxxx-9f5b-55ba17c23c72″ maxThreads=”500″ connectionTimeout=”60000″ tomcatAuthentication=”false”/>
Path: /opt/ColdFusion2025/cfusion/runtime/conf/server.xml
Step 6: Configure workers.properties on Apache Server
On Apache Server (Server1): Once the connector is configured, change the hostname , from localhost to IP address of the ColdFusion Server (Server2). Modify the workers.properties file accordingly.
On Server1, modify workers.properties in the Apache configuration directory (e.g., /etc/httpd/conf).
Example:
worker.list=cfusion
worker.cfusion.type=ajp13
worker.cfusion.host=IP_of_ColdFusion_Server
worker.cfusion.port=8022
worker.cfusion.heartbeat_servlet_path=/__cf_connector_heartbeat__
worker.cfusion.connection_pool_timeout=60
worker.cfusion.monitoringsecret=ae3782a1-xxxx-xxxx-xxxx-34d85a0921d0
worker.cfusion.secret=20aac1d2-xxxx-xxxx-xxxx-55ba17c23c72
Step 7: Deploy Application
Copy the Application files to both the servers:
- Apache Document Root: /var/www/html
- ColdFusion Root Directory: /opt/ColdFusion2025/cfusion/wwwroot
Step 8: Restart Services
Restart both ColdFusion and Apache to apply the configuration changes.
Step 9: Test Application
Once ColdFusion and Apache have restarted, test the application by accessing its URL through Apache.
In case of connector upgrades in an update, copy the wsconfig.jar from the ColdFusion (Server2) to Apache (Server1) and reconfigure the connector or use the upgrade option.
Use the below command to upgrade the connector binaries:
./wsconfig -upgrade
You must be logged in to post a comment.