Thursday, October 21, 2010

An Easy Bash Shell Script to Start and Stop ColdFusion, mySQL and Apache

Well I normally do my development on my mac with code on a mounted Volume from a windows server, which is where my CF or PHP servers are running. From time to time though, I develop directly on my mac and since I don't keep my CF, Apache and mySQL running by default, I created 2 simple scripts I thought I would share with everyone here.

I called my 2 scripts cfstart.sh and cfstop.sh, when creating these files make sure to either do it on pico, vi or an editor that lets you save in unix style line breaks not windows(dos) style. Also, once you save them make sure to run chmod +x on the files to mark them as executable.

cfstart.sh

cfstop.sh

Once you are done you simply run them by typing the following in a terminal window on the folder where the files are located:
./cfstart.sh

Before it executes, it will ask for your password and this is because I added the sudo call which allows the applications to start under root, which is what you want.

No comments:

Post a Comment