LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 07-25-2005, 07:59 AM   #1
howarddevore
Member
 
Registered: Apr 2005
Distribution: not sure yet
Posts: 117

Rep: Reputation: 15
pretty green apache question


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.


Thanks for any help offered...
howard
 
Old 07-25-2005, 08:38 AM   #2
cdhgee
Member
 
Registered: Oct 2003
Location: St Paul, MN
Distribution: Fedora 8, Fedora 9
Posts: 513

Rep: Reputation: 30
If you're running fedora, as root do

Code:
chkconfig httpd off
service httpd stop
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.
 
Old 07-25-2005, 08:39 AM   #3
danns
Member
 
Registered: Nov 2003
Posts: 40

Rep: Reputation: 15
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.

To delete:

sudo rm /etc/rc2.d/S##apache

To move:

sudo mv /etc/rc2.d/S##apache some_backup_location

To recreate:

sudo ln -s /etc/init.d/apache /etc/rc2.d/S##apache
 
Old 07-25-2005, 08:45 AM   #4
jpcaza
LQ Newbie
 
Registered: Jul 2005
Distribution: Slackware 10.0
Posts: 6

Rep: Reputation: 0
Hi,

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!

J-P
 
Old 07-25-2005, 08:59 AM   #5
overlord73
Member
 
Registered: Apr 2004
Location: ..where no life dwells..
Posts: 541

Rep: Reputation: 30
you donīt need to stop httpd for replacing the index.htm(l)!!!
just overwrite the files, the next webaccess will show the new site.

BUT nevertheless its always good to know how to start/stop your apache! ;-)
 
Old 07-27-2005, 08:47 AM   #6
howarddevore
Member
 
Registered: Apr 2005
Distribution: not sure yet
Posts: 117

Original Poster
Rep: Reputation: 15
o delete:

sudo rm /etc/rc2.d/S##apache

To move:

sudo mv /etc/rc2.d/S##apache some_backup_location

To recreate:

sudo ln -s /etc/init.d/apache /etc/rc2.d/S##apache
~danns

thanks danns, I've done it.

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
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Very green question about installing software on Linux Delmarc Linux - Newbie 3 01-10-2004 01:07 PM
Green Text Under Konqueror Question JC404 Linux - Newbie 3 08-10-2003 08:14 AM
pretty icons chrismiceli Linux - General 1 06-27-2003 10:20 PM
Got pretty far, but just short of goal...Apache/FTP Question(s) -G- Linux - Newbie 3 03-19-2003 09:56 AM
Question for a Green Guy eckenroed Linux - General 1 02-01-2001 03:28 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu

All times are GMT -5. The time now is 03:32 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration