Ubuntu – how to stop apache2, thesql from starting automatically as computer starts

11.04Apache2MySQLserverstartup

My os is 11.04.

I have apache2 & mysql installed.

How to stop apache2, mysql from starting automatically as computer starts?

Best Answer

MySQL is handled by upstart. In 11.04 you can use the new override feature to modify the starting behaviour:

echo "manual" >> /etc/init/mysql.override

See the section "Disabling a Job from Automatically Starting" in the Upstart Cookbook

Apache still uses traditional SysV init scripts so you use

 update-rc.d -f apache2 remove

to remove the links from /etc/rcX.d or, alternatively, use

 update-rc.d apache2 disable

which "disables" the script by changing it from a start script S91apache2 to a stop script K09apache2. This is reversible by update-rc.d apache2 enable.

Related Question