UbuntuThis forum is for the discussion of Ubuntu Linux.
Notices
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.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
hi there,
I just installed apache, and intend to learn a bit about it before i go putting up any web pages. Well, that and secure up my system.
On the default index.html page it says that you should replace this with your web pages asap, but I'm not ready to do that..
How can i just turn apache off? In the windows version there is a system tray icon that lets you do this...I basically want to make it secure while i learn about it.
The first command stops apache from starting at boot-time; the second stops apache immediately. These commands may work in other distros, but I'm not certain.
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.
You have to found where it's start. In slackware it start from /etc/rc.d/rc.httpd.
So in my case, I will just have to set this file unexecutable.
Have fun!
I've got a couple of secondary questions for you or anyone else though:
where can i read about the command/arguement: sudo In -s?
scratch that, its creating a symblic link right? Can i ask why to do this, I would have
copied the file back to the rc2.d dir ?
also - it appears that i had two rc2.d/S##apache files: one 'apache' and one 'apache2'
Does this indicate that i have two versions of apache installed?
thanks for the advice, this is helping me learn.
howard
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.