ColdFusion Batch Scripts – For Linux

I always set ColdFusion to NOT run at startup – why have it eating resources when you aren’t using it? On Windows I had a few batch scripts to easily kick off ColdFusion. I dug around looking for something similar for Linux… I found a few things which I’ve added to my wiki in the ColdFusion section.

I basically came up with a very simple bash script:

#!/bin/bash
read -p "Press ENTER to start ColdFusion and Apache (must be root!)"
/etc/init.d/apache2 start
/opt/coldfusion8/bin/coldfusion start
read -p "Services started. Press ENTER to continue..."

Save this to a cfstart.sh file or something. Give it executable rights. Then it’s just ‘sudo ./cfstart.sh’. And of course you can make the same thing to stop the services. I’m running Ubuntu 7.10 so if you are on something different (RedHat) you’ll have to change your paths, etc…

Recent Related Posts

7 thoughts on “ColdFusion Batch Scripts – For Linux

  1. Thanks Jim. I am not much on unix commands but I was was using gksudo -d -k -S -u [username] command to start my cf server. I took your script and changed it around a little, now it doesn’t prompt me for a password and I can close the term session when finished running. Running it is just ./cfstart.sh

    #!/bin/bash
    gksudo -d -k -S /etc/init.d/apache2 start
    gksudo -d -k -S -u [username] /opt/jrun4/bin/jrun start cfusion

  2. You could make use of the actual Adobe scripts stored in /etc/init.d/ which would save the typing.
    I’m not sure these get installed unless you choose the ‘start CF at start up’ option in the installer, in which case you can choose that then
    rm /etc/rc.d/rc*/*coldfusion_*
    or use chkconfig (or your Linux’s varient) to set it not to start itself.

  3. Actually, the bash script above only allows the services to be started and you have to be logged on as root in order to start the services. Then Apache and CF8 run with their own users. Apache runs with the ‘apache’ user and CF8 runs with ‘nobody’ by default.

    To stop them from starting at boot, you would use the commands:
    >chkconfig httpd off
    >chkconfig coldfusion_8 off

    … and then run the bash to manually start them.

    *The above commands are for Red Hat and their variants, not sure about Ubuntu.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>