Restart Apache server

An web server (Apache) is running on a Linux (RedHat9) server. I have root privilege to this server. The web server was running but now it seems not to be running. I cannot get to the web URL to the web server. How can I check from command prompt that the server is running/not running. If not running, how to restart it?
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

To check:
List running process with "ps ax"

To restart:
/etc/init.d/apache restart
/etc/init.d/apache2 restart

Mrielf's general approach is good; however, let me expand a bit.

There are several ways to check to see if the web server is running:

   ps ax | grep -i httpd                                                
   apachectl status

or the start-up script, which is probably located in:


although in some setups, it may be located in the /etc/init.d directory that mrielf has indicated.  The script may be called any of the following (the name is arbitrary and depends upon your setup):


I'm going to assume for this exercise that it is called httpd, but you can substitute your correct name.  

To check the status using the startup script, you can use:

   /etc/rc.d/init.d/httpd status

To restart the server if it is entirely down, you will want to have a slightly different command if you are running SSL or if you are not.

With SSL, you can use either:

   apachectl startssl                                            
   /etc/rc.d/init.d/httpd startssl

Without SSL, you can use either:

   apachectl start                                              
   /etc/rc.d/init.d/httpd start

If you cannot locate your apachectl command (i.e. it is not in your path), try issuing the following commands to locate it:

  cd /
  find . -name apachectl

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
tookiAuthor Commented:
apachectl start  
Above command worked for me.
Glad to assist, tooki!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Apache Web Server

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.