Restart Apache server

Posted on 2004-11-29
Last Modified: 2010-03-04
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?
Question by:tooki
    LVL 5

    Expert Comment

    To check:
    List running process with "ps ax"

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

    LVL 15

    Accepted Solution

    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

    Author Comment

    apachectl start  
    Above command worked for me.
    LVL 15

    Expert Comment

    Glad to assist, tooki!

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    PRTG Network Monitor: Intuitive Network Monitoring

    Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

    Introduction As you’re probably aware the HTTP protocol offers basic / weak authentication, which in combination with the relevant configuration on your web server, provides the ability to password protect all or part of your host.  If you were not…
    If you've heard about htaccess and it sounds like it does what you want, but you're not sure how it works... well, you're in the right place. Read on. Some Basics #1. It's a file and its filename is .htaccess (yes, with a dot in the front). #…
    Need more eyes on your posted question? Go ahead and follow the quick steps in this video to learn how to Request Attention to your question. *Log into your Experts Exchange account *Find the question you want to Request Attention for *Go to the e…
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    7 Experts available now in Live!

    Get 1:1 Help Now