ColdFusion 10 instance creation path issue

When ColdFusion 7 was released back in 2005, the ColdFusion team gave us the ability to create new instances (assuming we were running in multi-server mode) directly from the ColdFusion Administrator of the default 'cfusion' instance.

There were a number of quirks with the instance creation process, which resulted in some of us sticking with the old manual process as used in CF6.1

One of the instance creation issues related to new instances inheriting paths pointing to the cfusion instance rather than the path for the newly created instance.

This bug has found it's way into ColdFusion 10. Thankfully it's incredibly easy to work around.

Let me demonstrate the issue, and how to fix it.

To create additional instances with ColdFusion 10, you need to be running ColdFusion Enterprise, or be running in trial or developer mode. If you log into the default installation instance, called 'cfusion', you'll have the ability to create additional instances via the Enterprise Manager option.

What actually happens when you create a new instance, is that this cfusion instance is effectively cloned, thereby inheriting settings you've configured. There's obviously pros and cons to this.

One of the cons is that with pages such as Charting or Logging Settings, you simply need to 'touch' the pages (i.e. click submit without making any changes), and the default path of /ColdFusion10/cfusion/logs will find it's way into new instances you create.

if you don't 'touch' the page then the correct path of /ColdFusion10/<newinstance>/logs will correctly be set.

Thankfully you can just manually correct the paths if required.

I logged this as a bug back in 2005/6, and have done so again for ColdFusion 10. The bug number is 3208658 and can be viewed at https://bugbase.adobe.com/index.cfm?event=bug&id=3208658

Running Multiple Tomcat Instances

We've been doing a fair bit of work with Tomcat for a while now. It was partly instigated by the knowledge that ColdFusion 10 was going to use Tomcat under the hood (in replace of JRun), but we've also been doing work deploying Railo as well as some Java apps (deploying as WAR files).

One of the things we're so used to is the ability to run multiple instances of ColdFusion on JRun, and we wanted to do the same with Tomcat. As such, this entry is a generic walkthrough to get up and running with multiple instances of Tomcat.

The first thing you need to do is get a hold of Tomcat. Go grab the most recent version from http://tomcat.apache.org (v7.0.27 as of writing).

We like to install Tomcat versions inside a master ApacheTomcat folder, e.g. /opt/ApacheTomcat/apache-tomcat-7.0.27

Once you've extracted Tomcat, take a look at the contents of the folder. You'll find some text files, and more importantly a bunch of folders:

  • bin
    • contains all the binaries and scripts for running Tomcat
  • conf
    • configuration files including server.xml and web.xml
  • lib
    • the libraries that make Tomcat work
  • logs
    • funnily enough, logs
  • temp
    • used for temporary files
  • webapps
    • this is where we put our apps
  • work
    • folder used by Tomcat to write out files needed during runtime, including generated code for JSPs, class files, serialised sessions

An important part of any Tomcat installation is environment variables. There are 5 different variables that interact with Tomcat, two of which are mandatory:

Mandatory

  • CATALINA_HOME
  • JAVA_HOME

Optional

  • CATALINA_BASE
  • CATALINA_TMPDIR
  • CLASSPATH

All three optional variables can be calculated using CATALINA_HOME

The usual way

Under a normal install, we really only care about CATALINA_HOME. By default, this variable points to the Tomcat root folder, so using our set up, it points to /opt/ApacheTomcat/apache-tomcat-7.0.27

This gives access to the /bin and /lib folders, and allows all other environment variables to be set when we run startup.sh (found in the /bin folder).

And this is the important part. Instead of allowing CATALINA_BASE to be set automatically, we want to explicitly set it. That's the key to multiple instances.

Configuring Multiple Instances

Create two new folders inside your CATALINA_HOME folder, e.g.

/opt/ApacheTomcat/apache-tomcat-7.0.27/instance1
/opt/ApacheTomcat/apache-tomcat-7.0.27/instance2

Copy the following folders (and their contents) from CATALINA_HOME, and paste them into the two directories you created above:

  • /conf
  • /logs
  • /temp
  • /webapps
  • /work

(You might want to delete the contents of your copied log folders).

Next we need to configure the 3 different ports that each Tomcat instance will use. These are the connector port, the AJP port, and the shutdown port.

  • Connector port
    • What Tomcat uses to communicate with the outside world. Default: 8080
  • AJP port
    • If you're going to be connecting to Apache (or IIS), then you'll be looking to use AJP rather than the "basic" connector. AJP is a binary protocol and is therefore faster than the default connector. Default: 8009
  • Shutdown port
    • Tomcat uses a port as part of it's shutdown process. It communicates with this port to shutdown cleanly, and therefore it has to be unique per instance. Default: 8005

Let's start by opening and editing /instance1/conf/server.xml. Find the blocks similar to below for the three connector ports

<server port="8005" shutdown="SHUTDOWN">
.....
<connector connectiontimeout="20000" port="8080" protocol="org.apache.coyote.http11.Http11NioProtocol" redirectport="8443">

<connector port="8009" protocol="AJP/1.3" redirectport="8443">
</connector></connector></server>

Change the ports to something like:

<server port="8105" shutdown="SHUTDOWN">
.....
<connector connectiontimeout="20000" port="8181" protocol="org.apache.coyote.http11.Http11NioProtocol" redirectport="8443">
<connector port="8109" protocol="AJP/1.3" redirectport="8443">
</connector></connector></server>

Do the same for the second instance, providing different port numbers again.

Let's now create some startup/shutdown scripts for our instances. Create a new file called instance1-startup.sh in CATALINA_HOME/bin

Add the following to the script:

export CATALINA_BASE=/opt/ApacheTomcat/apache-tomcat-7.0.27/instance1
cd $CATALINA_HOME/bin
./startup.sh

Create another new file called instance1-shutdown.sh in CATALINA_HOME/bin, and add the following:

export CATALINA_BASE=/opt/ApacheTomcat/apache-tomcat-7.0.27/instance1
cd $CATALINA_HOME/bin
./shutdown.sh

Do the same for instance2, being careful to change the paths.

You can now run ./instance1-startup.sh and ./instance1-shutdown.sh to start/stop your first instance, as well as your other scripts to control your other instances.

Congratulations, you're now running multiple instances of Tomcat, which can be accessed via (depending on the port numbers you chose above)
http://localhost:8181
http://localhost:8282

You can now deploy your ColdFusion and Railo WAR files directly into an instances webapps folders, e.g.
/opt/ApacheTomcat/apache-tomcat-7.0.27/instance1/webapps

Adobe ColdFusion 10 available now

With the release of ColdFusion 10, Adobe's Enterprise application server for Rapid Application Development, there's a lot to get excited about.

HTML5 features heavily in the new release, with support for dynamic and interactive charting, web sockets, and video. RESTful web services are delivered out of the box. Improved Java integration as well the the move from JRun to Tomcat as the underlying JEE servlet container are just some of the new features.

You can find a full list of what's new, on the ColdFusion 10 Family section at http://www.adobe.com/uk/products/coldfusion-family.html

ColdFusion 10 is available now, and as an authorised reseller, Fuzzy Orange can help you with all your licensing requirements. Contact us for a quote, or for more information on how we can help you get the best out of ColdFusion 10.

Adobe MAX 2011

Two months from now, approximately 5,000 designers, developers, managers, technologists and more will once again descend upon LA for the 2011 edition of Adobe MAX.

This will be the fourth time Fuzzy Orange have been involved in a speaking capacity; 2007 in Barcelona and 2009, 2010 in LA.

For this years conference, Matt Gifford and myself will both be jetting in to present on a number of topics.

Matt Gifford

OWASP Enterprise Security API and available methods to help lock down a ColdFusion Application (Unconference)

Monday, October 3rd, 2.00 p.m. - 2.50 p.m.

Mobile Apps from 0 to 90: Powered by ColdFusion (BYOD Lab)

Tuesday, October 4th, 8.00 a.m. - 9.30 a.m.
In this 90 minute lab, you'll use Adobe Flash Builder to develop a mobile application from the ground up, compiling it as an Adobe AIR app. Learn how to create and push views, add a tabbed menu interface, and call and manage remote data from a ColdFusion web server. You'll also debug and deploy the final application to your mobile Android device.

Darwin Development (Unconference)

TBC
Evolution. It's a wonderful thing, and something that needs to occur for natural progression and the continuing advancement of ideas. As we see the modern trends, development paradigms and design practices evolve into different areas utilising newer technologies, should we really be saying goodbye to our old ways in favour of the new approach? Join Matt Gifford as he invites you to partake in a presentation with an emphasis on attendee input (with rewards) in a discussion to help understand what makes the web great, how we communicate in the modern world, and as a result whether or not we should leave the big screen behind entirely in favour of new formats.

Andy Allan

Adobe ColdFusion and modern Web front ends (Preconference Lab)

Sunday, October 2nd, 9.00 a.m. - 5.00 p.m.
Adobe ColdFusion works very well with most javascript frameworks and especially well with jQuery. See how ColdFusion, jQuery, and mobile web standard development can catapult your ColdFusion development to the latest and greatest.

In addition to presenting, we'll also be networking like crazy, catching up with old friends and new, and taking part in as much ColdFusion related fun as possible.

See you in LA!!

New Book: Object Orientated Programming in ColdFusion

Our very own Matt Gifford recently saw all his hard work, long hours and caffeine addiction pay off with the release of his very first book, Object Orientated Programming in ColdFusion. Released by Packt Publishing, this 192 page book is a short but concise manual on how to design and build your ColdFusion Components (CFCs), use Inheritance, encapsulate your code, deal with portability, work with Service Layers and so on and so forth.

Object Orientated Programming in ColdFusion

The book is a fantastic read for those CFML developers who need a little help in making the jump to working with CFCs, or implement Object Orientated principles. It's also a great refresher for those who have already made the jump.

Visit the publishers page for full details, including special offers.

https://www.packtpub.com/object-oriented-programming-in-coldfusion/book











Adobe MAX 2010

Matt (Gifford) and myself will be heading out to LA a week on Saturday for Adobe MAX 2010.

We'll both be giving a hands on Lab entitled "Search Made Easy: Full Test Search with ColdFusion and Solr" at 8am on Tuesday 26th and again at 8.30am on Wednesday 27th.

Additionally, we'll both be giving presentations at the ColdFusion Unconference.

I'll be presenting on "Search and Destory: The Rock Star Approach to ColdFusion and Solr" at 3pm on Monday 25th. This session will dive into some of the unknowns such as configuration, security, monitoring, as well as some other rather nifty tricks.

Matt will be presenting "ColdFusion as a Service: How to Extend 'The Awesome'". This will be an updated version of Matt's session from Scotch on the Road 2009.

So come along, say hello, give us abuse (accompanied by donuts) and we'll maybe even buy you a beer.

Adobe ColdFusion 9 Enterprise & Adobe ColdFusion Builder 1 Bundle Promotion

Adobe are running a ColdFusion Enterprise promotion, whereby if you purchase a new ColdFusion 9 license, or upgrade to ColdFusion 9, you will receive 3 FREE ColdFusion Builder Licenses as well.

What is included in the ColdFusion 9 & ColdFusion Builder bundle promotion?

For the same cost as a single unit of ColdFusion 9 enterprise (full, upgrade or upsell), a customer will receive a single unit of ColdFusion 9 enterprise & 3 units of ColdFusion Builder 1, each of which includes a unit of Flash Builder 4 standard. CF ENT Unit type Bundle Price

How long will this promotion be available?

This promotion runs until January 1st, 2011.

Is platinum M&S available for this bundle?

It sure is. Just mention that you are looking for Platinum Support.

How do I buy?

Simply call Fuzzy Orange on +44 (0)131 200 6019 or email info@fuzzyorange.co.uk

Scotch on the Rocks 2011

"Painting the Forth Bridge". This phrase was used to identify the fact that painting one of Edinburgh's iconic structures was a never ending job. The current painting of the bridge however, is slightly different in that a new approach has been taken that will see the paint work have an expected life of anywhere between 25 and 40 years, thereby eliminating the need to repaint continuously.

Organising Scotch on the Rocks (and I would imagine any conference) is somewhat similar to Painting the Forth Bridge. As soon as you're done, you start organising for the next year.

Now, we wouldn't persist in running the conference every year if we didn't enjoy it, but with anything in life, we're looking to streamline our approach so that we can spend less time on ... well, the time consuming areas. This was made a tad more difficult the last two years due to the economy and the fact we had to adapt or die.

I'm delighted to say that our 5 year plan, which was conceived in 2008 after things headed south, has proved to be fruitful.

Scotch on the Rocks 2011: March 3-4, 2011

2011 will see the conference head home to Edinburgh after 2 years traveling. Taking place at the Apex International hotel, in the Edinburgh Grassmarket, underneath the skyline dominating Edinburgh Castle, Europe's longest running ColdFusion conference will bring the best of the best from the world of ColdFusion, Flex, AIR, HTML5 and more to Edinburgh on March 3rd and 4th.

Tickets are already on sale, and in fact are already 50% sold out after just two weeks. For more information on the 2011 conference, and to purchase your ticket, head over to http://www.sotr.eu.

Our 3 year paint

Just like the painting of the bridge, we've managed to reduce some of the repetitiveness. One of the biggest tasks with organising a conference is finding a venue. For the next 3 years (2011-2013) we will be at the Apex International Hotel and this reduces our workload considerably. It also allows us to build up a good relationship with the hotel, and with that comes the opportunity to provide better deals with our delegates and sponsors.

Here's to a long and illustrious life, for both the Bridge and Scotch on the Rocks.

Fuzzy Orange @ Adobe MAX 2010

Adobe MAX, the annual showcase conference for all things Adobe takes place October 23-23 in Los Angeles, California.

Registration for the conference is already open, and this week the official Session Scheduler has been released.

I'm delighted to announce that Matt Gifford and myself will not only be there, but we'll also be delivering a BYOL (Bring Your Own Laptop) lab on "Search made Easy: Full-Text Document Search with ColdFusion".

In this lab, we'll be getting hands on and demonstrating ColdFusion and Solr; how to configure Solr, it's advantages over Verity, how to manage Collections, how to index files and query objects, and ultimate how to build a slick search interface.

You're going to love Solr once we're finished.

The Lab description says Windows, but we can guarantee it also works on the Mac as that's what we've built the code on. And there's no reason for it not to work on Linux as well, so not matter what operating system you're running, you'll be able to join in.

We <3 Scotch on the Rocks

Scotch on the Rocks is now less than 5 days away.

If you haven't confirmed your place or purchased your ticket for the event yet, don't hesitate and secure one now from the official SOTR site: www.scotch-on-the-rocks.co.uk

We <3 our sessions

Covering two days, with two tracks per day, there are currently a total of 22 sessions, bringing to you a wide range of content and topics covering ColdFusion, frameworks, working methodologies, Flex, AIR and HTML5.

We <3 our speakers

No conference would be complete without the experts and 'purveyors of knowledge' standing up and providing the content for the sessions. This year is no exception, and we are really excited about the 19 speakers we have lined up.

We <3 our badgers

moving on..

We <3 our Reachies

For the first time in SOTR history, we are holding what we hope to be an annual awards ceremony, 'The Reachies'.

The large number of EMEA developers work hard at what they do, and provide fantastic content, open source or not. The ColdFusion community across the globe is one of (if not) the best, open sharing communities, and we wanted to take the opportunity to highlight that fact and reward developers for their efforts.

There are five categories in this year's awards, and if you haven't voted, or are still unaware the awards even exist ( shame on you ), head over to the nominations page on the SOTR website to view the categories and place your nominations.

There ARE prizes for each category winner.

We <3 our sponsors

The Scotch on the Rocks events rely on the input and support from other companies and organisations in various formats.

It is with this important support that the conference has been able to grow and progress year after year, and attendees have been able to enjoy the wealth of knowledge and fun of the event. A massive thank you to the sponsors of the 2010 event.

We <3 the attendees

Most importantly, a conference simply would not be a conference without people turning up, and we're very lucky to have a fantastic group of developers and attendees who join us for each event.

Ultimately, SOTR has always been undertaken with the attendees in mind, and it will continue to cater for you/them at every turn, every year.

We <3 doing it again

I'm really excited about this years conference. A lot of work and planning has gone into the event this year ( whether the attendee's realise it or not :) ) and we've already started planning the event for SOTR2011. We must be mad, so why do it?

Simple. We love it.

Ever since SOTR was brought to life by Andy Allan and Fuzzy Orange in 2005, it's been a boost for the RIA and ColdFusion community in the UK and Europe. Bringing together like-minded individuals and developers is essentially what the conference is about.

Whether you are there for business reasons, development ideas, educational purposes, networking, or purely as a chance to catch up with old friends and colleagues and to enjoy a beer or five, Scotch on the Rocks has always been and will always be happy to have you.

We <3 choice

On a final note, yes, the bar at SOTR 2010 is open and drinks provided for you. There's nothing better than relaxing with a beer or two afterwards and networking, chatting, catching up with mates and having some fun. The only choice is what drink to order from the bar. :)

More Entries

Downloads

Downloadable PDFs, video case studies, podcasts and more.