Take the 2-minute tour ×

I setup a LAMP server on my desktop Ubuntu install for testing web applications. How do I set it to only run when I tell it to rather than at startup? It is not used as a production web server but instead for testing PHP scripts I write before pushing them to my public web server.

share|improve this question

2 Answers 2

up vote 10 down vote accepted

Remove from start up:

sudo update-rc.d apache2 remove
sudo update-rc.d mysql remove

Start at will:

sudo service mysql start
sudo service apache2 start
share|improve this answer
in 11.10 I've used sudo update-rc.d apache2 disable :) –  Pitto Jan 7 '12 at 20:38

If that doesn't work, try removing them forcefully.

sudo update-rc.d -f apache2 remove
sudo update-rc.d -f mysql remove
share|improve this answer

Your Answer


