ColdFusion Introduction

From WikiOD

Remarks[edit | edit source]

This section provides an overview of what coldfusion is, and why a developer might want to use it.

It should also mention any large subjects within coldfusion, and link out to the related topics. Since the Documentation for coldfusion is new, you may need to create initial versions of those related topics.

Versions[edit | edit source]

Version Release Date
Cold Fusion version 1.0 1995-07-02
Cold Fusion version 1.5 1996-01-01
Cold Fusion version 2.0 1996-10-01
Cold Fusion version 3.0 1997-06-01
Cold Fusion version 3.1 1998-01-01
ColdFusion version 4.0 1998-11-01
ColdFusion version 4.5.1 1999-11-01
ColdFusion version 5.0 2001-06-01
ColdFusion MX version 6.0 2002-05-01
ColdFusion MX version 6.1 2003-07-01
ColdFusion MX 7 2005-02-07
ColdFusion 8 2007-07-30
ColdFusion 9 2009-10-05
ColdFusion 10 2012-05-15
ColdFusion 11 2014-04-29
ColdFusion 2016 2016-02-16

Hello World[edit | edit source]

File: test.cfm

Tag Implementation

<cfoutput>Hello World!</cfoutput>

CFScript Implementation

<cfscript>
writeOutput("Hello World!");
</cfscript>

Installation or Setup[edit | edit source]

Linux (Ubuntu) Installation[edit | edit source]

Lucee (Open Source)[edit | edit source]

ColdFusion / CFML Interpretor[edit | edit source]

Download the appropriate file from their site (http://lucee.org/downloads.html) and execute their installer

wget http://cdn.lucee.org/downloader.cfm/id/155/file/lucee-5.0.0.252-pl0-linux-x64-installer.run
sudo chmod +x lucee-5.0.0.252-pl0-linux-x64-installer.run
sudo ./lucee-5.0.0.252-pl0-linux-x64-installer.run

Step through installer.

Nginx[edit | edit source]

Install Nginx on your server

sudo apt-get install nginx

Edit your /etc/nginx/sites-available/default

server {
    listen 80;
    server_name _;

    root /opt/lucee/tomcat/webapps/ROOT;
    index index.cfm index.html index.htm;

    #Lucee Admin should always proxy to Lucee
    location /lucee {
        include lucee.conf;
    }

    #Pretty URLs
    location / {
        try_files $uri /index.cfm$uri?$is_args$args;
        include lucee.conf;
    }

    location ~ \.cfm {
        include lucee.conf;
    }

    location ~ \.cfc {
        include lucee.conf;
    }
}

Edit /etc/nginx/lucee.conf

proxy_pass http://127.0.0.1:8888;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;

Reload nginx

sudo service nginx reload

Access the Lucee Server admin here:

127.0.0.1/lucee/admin/server.cfm

or

127.0.0.1:8888/lucee/admin/server.cfm

Your root web directory lives here:

/opt/lucee/tomcat/webapps/ROOT

Adobe (Closed Source)[edit | edit source]

ColdFusion / CFML Interpretor[edit | edit source]

Download the appropriate file from their site (https://www.adobe.com/products/coldfusion/download-trial/try.html) and execute their installer

wget <URL>/ColdFusion_2016_WWEJ_linux64.bin
sudo chmod +x ColdFusion_2016_WWEJ_linux64.bin
sudo ./ColdFusion_2016_WWEJ_linux64.bin

Step through installer. Make sure you select the internal web server (port 8500)

Nginx[edit | edit source]

Install Nginx on your server

sudo apt-get install nginx

Edit your /etc/nginx/sites-available/default

server {
    listen 80;
    server_name _;

    root /opt/coldfusion2016/cfusion/wwwroot;
    index index.cfm index.html index.htm;

    location / {
        try_files $uri $uri/ =404;
    }

    location ^~ /CFIDE/administrator {
        deny all;
    }

    location ~* \.(cfm|cfml|cfc|html)$ {
        include /etc/nginx/conf/dc_tomcat_connector.conf;
    }

    location ^~ /rest {
        include tomcatconf;
    }
}

Edit /etc/nginx/tomcat.conf

proxy_pass http://127.0.0.1:8500;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $http_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;

Reload nginx

sudo service nginx reload

Access the Adobe ColdFusion Server admin here:

127.0.0.1:8500/CFIDE/administrator/index.cfm

Your root web directory lives here:

/opt/coldfusion2016/cfusion/wwwroot

Credit:Stack_Overflow_Documentation