Wednesday, June 8, 2011

How to start, stop and restart Apache in Ubuntu

There are times when you will be forced to start, stop or restart your Apache web server, be it on your VPS or on your localhost. And like every other linux distribution, Ubuntu also comes with a shell script that lets you to do this.

All you need to do is to login as a root or make use of sudo. Open the terminal or login to your VPS and perform these commands:



To start apache web server:
sudo /etc/init.d/apache2 start

To stop apache web server:
sudo /etc/init.d/apache2 stop

To restart apache web server:
sudo /etc/init.d/apache2 restart