LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Enterprise (https://www.linuxquestions.org/questions/linux-enterprise-47/)
-   -   HTTP Services (https://www.linuxquestions.org/questions/linux-enterprise-47/http-services-620548/)

htabesh 02-12-2008 07:07 AM

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?

acid_kewpie 02-12-2008 07:10 AM

service httpd stop
service httpd start

custangro 02-12-2008 01:40 PM

Quote:

Originally Posted by acid_kewpie (Post 3054444)
service httpd stop
service httpd start

Don't forget:

service httpd restart

:)

doublejoon 02-14-2008 06:34 AM

If you don't want interruptions to your users

While httpd is running

service httpd graceful

custangro 02-14-2008 11:59 AM

Quote:

Originally Posted by doublejoon (Post 3056730)
If you don't want interruptions to your users

While httpd is running

service httpd graceful

or apachectl graceful :)

htabesh 02-14-2008 12:29 PM

What is a different between "apachectl [start]" and "service httpd [start]"?

custangro 02-14-2008 12:44 PM

Quote:

Originally Posted by htabesh (Post 3057086)
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

frndrfoe 02-14-2008 04:50 PM

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.

custangro 02-14-2008 05:08 PM

Quote:

Originally Posted by frndrfoe (Post 3057304)
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


All times are GMT -5. The time now is 07:57 AM.