Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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
add comment

1 Answer

up vote 2 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.

screenshoot


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

MySQL

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

  • Start service: sudo start mysql

  • Restart service: sudo restart mysql

  • Stop service: sudo stop mysql

Apache

  • 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
add comment

Your Answer

 
discard

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.