ManyCodes.com – codes & scripts Get free programming codes and tutorials!

8Aug/090

Star / Stop / Restart Apache 2 Web Server

Q. How do I restart Apache 2 Web Server under Debian / Ubuntu Linux?


A. 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. To ssh to your server, you will need to a ssh client like putty (download putty fromĀ http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html).

The ssh client will need you to enter the IP, username and password of your server. Choose port as 22.
Once logged in type the following commands as need be.

How To start Apache 2 web server, enter:

# /etc/init.d/apache2 start

OR

$ sudo /etc/init.d/apache2 start

Linux Command to restart Apache 2 web server, enter:

# /etc/init.d/apache2 restart

If you are using Ubuntu use sudo:

$ sudo /etc/init.d/apache2 restart

How To stop Apache 2 web server, enter:

# /etc/init.d/apache2 stop

OR

$ sudo /etc/init.d/apache2 stop



Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Webnews
  • Digg
  • del.icio.us
  • StumbleUpon
  • Reddit
  • Ask
  • Facebook
  • Technorati
  • YahooBuzz