I've installed lamp through the welcome script. It works fine, but when I was using lampp on my last computer, I had to switch it on/off every time I wanted to use it/stop using it. How can I do this with this system installed lamp, is there something like start and stop scripts?
Thank you for you help.
From the terminal:
sudo /etc/init.d/apache2 stop && sudo /etc/init.d/mysql stop
You can use start and restart instead of stop to start or restart LAMP.
You can also add these commands to you menu Settings > Openbox > GUI Menu Editor. In my experience I couldn't get the && to work so I had to split up the commands.
Thanks. This is what I was thinking about, but I wasn't sure, thanks.
You can also use
sudo update-rc.d -f servicename remove
to stop the service automatically running at boot time. Then you can use
sudo service start servicename
sudo service stop servicename
to start and stop the service according to your wishes.
Thank you, this worked for me:
sudo service <servicename> stop
For further visitors of this post I wrote with your help above short bash script to ease the work.
#!/bin/sh if [ "$1" = "start" ]; then sudo service apache2 start sudo service mysql start elif [ "$1" = "stop" ]; then sudo service apache2 stop sudo service mysql stop else echo "start or stop?" fi