Forums Joomla!

Running a Linux script

Subscribe to Running a Linux script 3 post(s), 2 voice(s)

 
Avatar Gewitty 2 post(s)

I’m fairly new to Linux and have never yet used scripts. Having successfully installed the Joomla! stack and had it running for the first time, I was completely stumped when I next tried to run the Joomla! application. I read the notes regarding ctlscript.sh, but have no idea how to run this. I’m using Ubuntu Feisty at present. If anyone can give me the Dummies Guide To Running A Script, I’d be very grateful.

 
Avatar antonio Administrator 487 post(s)

Hi,

Let’s start with the basics. You can think of a script just the same way you think of a program. The difference between them is that the program is compiled (translated from “human” language to computer language) prior to execution, while a script isn’t.

The script we created to control the servers, works in this way:

./ctlscript.sh (start|stop|restart) [server]

Let me explain this a little bit more:

./ctlscript.sh

This is the name of the script. You’ll need to start it from the terminal.

(start|stop|restart)

The first parameter is passed to the script. This is a mandatory function, you’ll have to type one of the three options: start, stop or restart, with no parenthesis

[server]

This is an optional parameter. You enter it (with no brackets) if you want your first parameter to act only for one of the servers (e.g. if you only want Apache restarted).

Some examples:

Start all the servers: ./ctlscript.sh start
Stop all the servers: ./ctlscript.sh stop
Restart Apache: ./ctlscript.sh restart apache
Stop mysql: ./ctlscript.sh stop mysql

I hope this little explanation will help you :). If you have any other trouble, feel free to post to the forums, we will be glad to help.

Cheers!

 
Avatar Gewitty 2 post(s)

Thanks Antonio. I actually managed to figure it out through a process of trial and error, but your explanation makes things clear.

It’s a learning curve!

Forums Joomla!