Coldfusion auto start on Ubuntu

Posted At : August 22, 2008 6:42 AM | Posted By : Dave
Related Categories: ColdFusion 8,Ubuntu

Lately I have been playing around a little with Ubuntu. The server version of the OS is very similar to the desktop version. The main difference is that there is no GUI. This can be solved by installing the Ubuntu UI. However, you can do what I did and install Webmin. It is a browser based UI that allows you to do just about everything. This is because I am CLI illiterate.

Once I got CF running I wanted to set it up so that it would auto start with the OS. Since I had Webmin this was very easy. Well, kinda, I had to figure out what the start up command would be. So after digging and then trial and error here are the steps I came up with.

With Webmin:

  • Go to: System --> Boot up and Shutdown --> Create new
  • Fill out form:
    • Name: coldfusion
    • Description: [optional]
    • Boot up commands: /opt/coldfusion8/bin/coldfusion start (alter path based on your install)
    • Shutdown commands: [leave blank]
    • Start at boot time?: yes
    • click Create

  • Go to: Others --> File Manager
  • Set permissions:
    • Browse to /etc/init.d
    • Select file "coldfusion"
    • Set permissions to read, write, execute, for all.
    • Click Save

With CLI:

  • CD to /etc/init.d
  • Create file "coldfusion"
  • Open file with VI or other text editor
  • Paste following into file and save file. (change path to reflect your install path):
    #!/bin/sh

    case "$1" in
    'start')
       /opt/coldfusion8/bin/coldfusion start
       ;;
    'stop')
       ;;
    *)
       echo "Usage: $0 { start | stop }"
       ;;
    esac
    exit 0
  • Change permissions on file to "777"

You are now done. You can reboot the server if you want to make sure that ColdFusion starts on boot. Hopefully this will save you from some of the frustration I had trying to figure this out.

BTW... there is a script that comes with CF to do this very easily. However, the script will not run on Ubuntu.

Till next time...

--Dave

Comments
Interesting... so if you're using the Ubuntu server edition are you running Webmin from the Ubuntu server or from another computer with a web browser?
# Posted By Christian Ready | 8/22/08 11:21 AM
I installed Webmin onto the Umbutu server but browsing to it from a different computer.
# Posted By Dave Ferguson | 8/22/08 5:20 PM
Hi. I posted a detailed guide for setting up CF8 multi-server (JRun4) on Ubuntu 7.10 using Amazon EC2, which includes similar details about the auto-boot thing, along with a lot of other stuff like how to use remote desktop, setup MySQL, etc.

http://awsconsole.riaforge.org/blog/index.cfm/2008...

Adobe was supposed to fix the auto-boot issue in 8.1 but they did NOT, at least not for Ubuntu 7.10 (shouldn't matter that it's running on EC2).

There is a set-up screen asking about auto-boot, but when I select "yes" it still does not work. Maybe it is Ubuntu, maybe it's the multi-server version, but the work-around is very handy.
# Posted By David | 8/26/08 8:25 AM