Since my recent move to Linux I have been slowly but surely getting my development environment set up. In Ubuntu 8.10 it is fairly painless to get an ACME server up and running quickly. Apache, MySQL, and Eclipse are easily installed through package managers or using CLI tools in the shell. ColdFusion is easy enough to install as well, the main issue I had during my installation was the fact that ColdFusion did not start when the system booted using the install scripts installed by Adobe. Apparently the installer only likes RedHat and SuSE Linux so I had to do a little poking around to get it starting up automatically.
I will be the first to admit I currently know just enough about Linux to be dangerous. At any rate, here is how I got it working in case it may help someone else. If any gurus out there see me doing someone that is obviously wrong, please let me know!
First I created the scripts in /etc/init.d/ that will be used to start and stop the ColdFusion server. Using vi (running as root of course) I created coldfusion_start.sh and coldfusion_stop.sh to start and stop the ColdFusion server, respectively. The files short and to the point. As an example, here is my coldfusion_start.sh script:
#!/bin/sh -e
/opt/coldfusion8/bin/coldfusion start
The coldfusion_stop.sh file is almost identical except we send the stop parameter instead of start.
#!/bin/sh -e
/opt/coldfusion8/bin/coldfusion stop
After getting the scripts setup, we need to be able to execute them which is easy enough to do with a "sudo chmod +x /etc/init.d/coldfusion_start.sh" and "sudo chmod +x /etc/init.d/coldfusion_stop.sh" without the quotes, of course.
Now here is where my process gets a little less than scientific. Starting with /etc/rc0.d/ and working my way to /etc/rc5.d/ I looked for any symbolic links that had the Apache daemon starting or stopping. If Apache was starting I created a new symbolic link to my coldfusion_start.sh script and if Apache was stopping I created a symbolic link to the coldfusion_stop.sh script. I always made sure that ColdFusion was started or stopped after the Apache service.
For example, the link to kill ColdFusion in /etc/rc0.d/:
sudo ln -s /etc/init.d/coldfusion_stop.sh /etc/rc0.d/K90coldfusion
The link to start ColdFusion in /etc/rc3.d/:
sudo ln -s /etc/init.d/coldfusion_start.sh /etc/rc3.d/S95coldfusion
In retrospect, it may make more sense to stop the ColdFusion server before the Apache server is stopped but currently I have it starting and stopping after Apache. However, everything appears to be running smoothly.