Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
up vote 12 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


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.