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'd like to install a LAMP stack on my laptop in order to be able to locally develop PHP websites. However, since my computer is a laptop, and since I don't always need having apache and MySQL server running, I'd like to setup a simple way to start and stop the LAMP stack when I need it. What method do you suggest to achieve that?

  • Disable apache and mysql daemons and start / stop them when needed?
  • Install LAMP stack on a virtual machine and share the network with the host to access the developed websites?
  • Other suggestions?
share|improve this question
up vote 3 down vote accepted

A useful tool (answering your first question) is localhost-indicator. With this application you have this functions from a window with buttons:

  • open http://localhost/ and phpMyAdmin in your Web browser,
  • open your Public http documents directory,
  • start/stop the Apache and MySQL services,
  • edit the apache and php configuration.


Also, the must used commands in LAMP are the followings: (always useful)


  • Login: mysql -u <user> -p <db_to_use>

  • Start service: sudo start mysql

  • Restart service: sudo restart mysql

  • Stop service: sudo stop mysql


  • Start service: sudo /usr/sbin/apache2ctl start

  • Restart service: sudo /usr/sbin/apache2ctl restart

  • Stop service: sudo /usr/sbin/apache2ctl stop

  • To test configuration changes: sudo /usr/sbin/apache2ctl configtest

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.