LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Enterprise Linux Forums > Linux - Enterprise
User Name
Password
Linux - Enterprise This forum is for all items relating to using Linux in the Enterprise.

Notices


Reply
  Search this Thread
Old 02-12-2008, 07:07 AM   #1
htabesh
LQ Newbie
 
Registered: May 2006
Location: Iran-Tehran
Distribution: Enterprise RedHat
Posts: 25

Rep: Reputation: 16
HTTP Services


Hello,
I want to know, how can I start and stop 'httpd' service in Enterprise Linux Red Hat 5, with the command line?

Last edited by htabesh; 02-13-2008 at 09:55 AM.
 
Old 02-12-2008, 07:10 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
service httpd stop
service httpd start
 
Old 02-12-2008, 01:40 PM   #3
custangro
Senior Member
 
Registered: Nov 2006
Location: California
Distribution: Fedora , CentOS , RHEL
Posts: 1,979
Blog Entries: 1

Rep: Reputation: 209Reputation: 209Reputation: 209
Quote:
Originally Posted by acid_kewpie View Post
service httpd stop
service httpd start
Don't forget:

service httpd restart

 
Old 02-14-2008, 06:34 AM   #4
doublejoon
Member
 
Registered: Oct 2003
Location: King George, VA
Distribution: RHEL/CentOS/Scientific/Fedora, LinuxMint
Posts: 370

Rep: Reputation: 44
If you don't want interruptions to your users

While httpd is running

service httpd graceful
 
Old 02-14-2008, 11:59 AM   #5
custangro
Senior Member
 
Registered: Nov 2006
Location: California
Distribution: Fedora , CentOS , RHEL
Posts: 1,979
Blog Entries: 1

Rep: Reputation: 209Reputation: 209Reputation: 209
Quote:
Originally Posted by doublejoon View Post
If you don't want interruptions to your users

While httpd is running

service httpd graceful
or apachectl graceful
 
Old 02-14-2008, 12:29 PM   #6
htabesh
LQ Newbie
 
Registered: May 2006
Location: Iran-Tehran
Distribution: Enterprise RedHat
Posts: 25

Original Poster
Rep: Reputation: 16
What is a different between "apachectl [start]" and "service httpd [start]"?

Last edited by htabesh; 02-14-2008 at 12:33 PM.
 
Old 02-14-2008, 12:44 PM   #7
custangro
Senior Member
 
Registered: Nov 2006
Location: California
Distribution: Fedora , CentOS , RHEL
Posts: 1,979
Blog Entries: 1

Rep: Reputation: 209Reputation: 209Reputation: 209
Quote:
Originally Posted by htabesh View Post
What is a different between "apachectl [start]" and "service httpd [start]"?
Not 100% sure; but apachectl uses the httpd script. With the service command uses the /etc/init.d/httpd startup script. Essentialy service httpd start and /etc/init.d/httpd start is the same thing. When you use apachectl you are using the script that came with apache. I think that the startup scripts uses apachectl...I'm not sure though...

In Any event I would use the "service" method or the /etc/init.d method becuase it will start the service as the user "www" (I belive). And apachectl starts it as the user starting it (bad).

-C
 
Old 02-14-2008, 04:50 PM   #8
frndrfoe
Member
 
Registered: Jan 2008
Distribution: RHEL, CentOS, Ubuntu
Posts: 379

Rep: Reputation: 38
Ya, use the service httpd ..., or the /etc/init.d/httpd ... command (same thing). They put the lock and pid files in the appropriate places.
Don't forget "service httpd configtest" which is the same as "apachectl configtest". It can save you from downtime when you typo in the conf files.
 
Old 02-14-2008, 05:08 PM   #9
custangro
Senior Member
 
Registered: Nov 2006
Location: California
Distribution: Fedora , CentOS , RHEL
Posts: 1,979
Blog Entries: 1

Rep: Reputation: 209Reputation: 209Reputation: 209
Quote:
Originally Posted by frndrfoe View Post
Ya, use the service httpd ..., or the /etc/init.d/httpd ... command (same thing). They put the lock and pid files in the appropriate places.
Don't forget "service httpd configtest" which is the same as "apachectl configtest". It can save you from downtime when you typo in the conf files.
I didn't know about 'configtest'! I would always do 'apachectl -t'


I ALWAYS do a a 'apachectl -t' (i.e. a config test) before I do a graceful...even when the change was small change...it has saved me plenty of times


-C
 
  


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
apache: http://localhost (work) http://ipaddress (not working) sarmad Linux - Newbie 7 02-05-2013 07:47 AM
monodoc-http gives a http 500 internal server error ernesto_cgf Linux - Software 0 05-10-2007 03:48 PM
Media Services on Linux platform similar to Windows Media Services happyok Linux - Software 3 05-27-2006 04:36 PM
TightVNC Ver terminal Services.. also looking for terminal Services for linux 2782d4 Linux - Security 3 05-20-2004 02:30 AM
http & ftp services jmono Linux - Newbie 5 05-08-2003 10:30 AM

LinuxQuestions.org > Forums > Enterprise Linux Forums > Linux - Enterprise

All times are GMT -5. The time now is 04:30 AM.

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