Star / Stop / Restart Apache 2 Web Server

by on April 6, 2008 · 15 comments· LAST UPDATED March 6, 2010

in , ,

How do I restart Apache 2 Web Server under Debian / Ubuntu Linux or UNIX operating systems?

Apache is primarily used to serve both static content and dynamic Web pages on the World Wide Web. Many web applications are designed expecting the environment and features that Apache provides.

First, login to server using ssh, if server is not in local data center:
ssh root@your.server.com
Once logged in type the following commands

Restart Apache 2 web server, enter:

# /etc/init.d/apache2 restart

If you are using Ubuntu use sudo:

$ sudo /etc/init.d/apache2 restart

To stop Apache 2 web server, enter:

# /etc/init.d/apache2 stop
OR
$ sudo /etc/init.d/apache2 stop

To start Apache 2 web server, enter:

# /etc/init.d/apache2 start
OR
$ sudo /etc/init.d/apache2 start

TwitterFacebookGoogle+PDF versionFound an error/typo on this page? Help us!

{ 15 comments… read them below or add one }

1 test November 5, 2009 at 7:45 pm

or try this: invoke-rc.d apache2 restart

Reply

2 sudhakara.alva January 1, 2010 at 6:11 am

reset apache.404 not found

Reply

3 Anonymous June 17, 2010 at 9:39 pm

Sorry, this doesn’t work on Red Hat:
/etc/init.d/apache2: command not found

Reply

4 nixCraft June 17, 2010 at 10:08 pm

For Redhat use:

/etc/init.d/httpd restart

Reply

5 tipster February 9, 2011 at 1:50 am

If you want to stop,start, restart apache2 in Debian give this a try after su’ing

/etc/init.d/apache2ctl stop
or start restart what ever

Reply

6 Hasnat April 11, 2011 at 9:09 am

Sorry, this doesn’t work on Debian:
/etc/init.d/apache2: command not found

Reply

7 alex September 28, 2011 at 4:54 pm

remove the leading $ sign

Reply

8 ob1 May 8, 2011 at 1:27 pm

service httpd start|stop|restart|status

Reply

9 pc-moon August 1, 2011 at 11:38 pm

okey what is mean when this message coming to u : No apache MPM package installed

Reply

10 Hemant Thorat January 3, 2012 at 6:04 am

sudo service apache2 restart

Reply

11 emmanuel March 22, 2012 at 3:45 am

hello there,

can someone help me out with how i can stop my apache from running.?

Reply

12 ivan March 25, 2012 at 11:52 am

run

/etc/init.d/apache2 stop

Reply

13 Fabio Tropia February 4, 2013 at 10:10 am

# service httpd restart
…is better!

Reply

14 Aziz August 19, 2013 at 6:31 am

Can some one help me..
When apache server restart then apache service will not working it shows…

Not Found
The requested URL / was not found on this server.
Apache/2.2.22 (Debian) Server at 192.168.1.39 Port 80

Reply

15 Miguel A. Acevedo November 15, 2013 at 7:22 pm

Not Found
The requested URL/ was not Found on
this server cool

Reply

Leave a Comment

Tagged as: , , , , , , , , ,

Previous Faq:

Next Faq: