Blog

01
February 2015

Gavin Pickin

Setting up Lucee in my Dev Environment - Changing Ports

CFML Server, cfObjective, Lucee, Migrating to Railo, Server Admin, Tools and IDEs

A while back now, I released a series of posts on setting up Apache along with  Railo, ColdFusion, in a multi engine setup, including some ways to make it easier to maintain virtual hosts in Apache, and Railo. Now, I’m getting the Lucee Express setup on my Dev environment, so I thought it would be a good time to rehash some of that, and see whats different, or what I’m doing differently these days.

Lucee was just announced a few days ago, so the Express is designed for all OSes, the installers are in the queue, but they have not been released yet, so this does not cover an installer options. We’re assuming you went to www.lucee.org and clicked on downloads, and downloaded and unzipped the Lucee Express Folder.

For the sake of simplicity, I’m going to set a few blog variables
{{ServerDir}} - Home Directory for the Lucee Express Directory

I’m running on Mac OSX, so unless you’re on Windows, most of these commands should line up similarly.

I open up my terminal and browse to 
{{ServerDir}}/bin

Then run
./startup.sh

The default port is 8888 so I open a browser, and type in the following:
http://127.0.0.1:8888

Hey PRESTO - Lucee is up and running, and you can see the prettier start page… shown below.



Diving into the Lucee Configuration - 3 ports to configure.

Not usually an issue with conflicts, but depending what you intend to run… you might need to consider a naming convention. Last year I spoke at CF.Objective() about setting up a multiple engine environment, so I’m going to steal a little info from there to see what ports CF10 and CF11 default to.
I usually use a system with these ports, so it makes sense and you reduce conflicts. There are 3 types of ports.

HTTP Port
This is the port you add to the browser to view sites using this server. For example, above i browsed to 127.0.0.1:8888 to view the Lucee startup page. CF9 CF10 and CF11 usually default to 8500, and Railo is 8080 or 8500 depending on the install you have. 
To be safe, I usually use 8500 + Version. Since Lucee is starting at 4.5 I’m going to assign Lucee 4.
CF9 would be 8509
CF10 would be 8510
CF11 would be 8511
Railo would be 8501
Lucee would be 8504

AJP Port
This is the port that Apache or nginx would communicate on, for passing requests from the web server through to the Servlet engine. This is commonly 8009 for Railo / Lucee, CF10 is 8012, and CF11 is usually 8014, so again I assign a numbering convention.
AJP Ports are 8020 + Version
CF9 would be 8029
CF10 would be 8030
CF11 would be 8031
Railo would be 8021
Lucee would be 8024

Shutdown Port
This is the port that the CFML Servlet listens to, for stopping and restarting the engine… this is obviously vitally important as the other 2, so we’ll implement a numbering system for them too.
Shutdown port is 8000 + Version
CF9 would be 8009
CF10 would be 8010
CF11 would be 8011
Railo would be 8001
Lucee would be 8004

If you want to learn how to adjust all the other CFML engines, you can look up my previous posts, and pull up my slides… available at www.gpickin.com/cfo2014/

Lets update Lucee to follow my numbering system.

First, run the following to shutdown lucee
{{ServerDir}}/bin/shutdown.sh

Edit {{ServerDir}}/conf/server.xml

HTTP Port
Approximately line 69 you will see the following line
<Connector port="8888" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" />

Update the port to 
<Connector port=“8504" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" />

AJP Port
Approximately line 91 you will see the following line
<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />

Update the port to 
<Connector port="8024" protocol="AJP/1.3" redirectPort="8443" />

Shutdown
Approximately Line 22 you will see the following line
<Server port="8005" shutdown="SHUTDOWN">

Update to 
<Server port="8004" shutdown="SHUTDOWN">

Once you have made these changes, save server.xml

If you forgot to shut down the server before making the changes, and you run the shutdown.sh command now, it will try and shut lucee down on the new port, where its not listening, so you can force shutdown or reset the port temporarily.

Then, run the following to startup lucee with the new settings
{{ServerDir}}/bin/startup.sh

If you still have lucee’s startup page open, on 127.0.0.1:8888 reload the browser, and you’ll see no response.
Change the port to 8504 and you’ll see the startup page, running on the new http port.

Check back in the next posts for how to make the Server.xml file easier to add sites with includes, and adding config for Apache Virtual Sites.

Thanks for reading.
 

Blog Search