UbuntuThis forum is for the discussion of Ubuntu Linux.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
The quick and easy way to shutdown a running apache system:
In a terminal type:
sudo apachectl stop
This will not prevent Apache from starting again if the machine is rebooted. I'm more accustomed to controlling my services via slackware, where I would either edit or remove the proper rc file so take this advice for what it is, there may be a different way to do this in Ubuntu (I admit, I have to spend more time using Ubuntu the Ubuntu way).
Apache is started at boot via the init script in the default run level (default run level is set by the /etc/inittab file). On Ubuntu this is run level 2. If you look in /etc you will see different run level configuration directories:
/etc/rc1.d, /etc/rc2.d, and so on.
In each rc#.d directory you will find a list of files that start with either a "S" or a "K." "S" is for start and "K" is for kill. These files are links back to the control script for the service which resides in /etc/init.d.
From a terminal you can delete or move the startup link for apache from the desired run level (in this case 2). If you delete the link it is pretty easy to recreate.
As I am not on a Ubuntu system right now I can only provide a general example, alter per your system.