xxxxxxxxxx
## Start apache2 if not running
status=`service apache2 status`
if [[ $status == *"apache2 is not running" ]]
then
sudo service apache2 start
fi
## Start MySQL if is stopped
status=`service mysql status`
if [[ $status == *"MySQL is stopped." ]]
then
sudo service mysql start
fi