How to Start, Stop, and Restart the Apache Web Server in Linux



Linux


In this article, we show how to start, stop, and restart the apache web server in linux.

Though there are times when you will stop and start the apache web server, the most common of these you probably will be doing is restarting the apache web server.

Why would you need to restart the server?

You may need to restart the server if you've made any changes to any apache-specific files, such as the apache2.conf file (configuration file). In order to make sure all changes have been made, restarting the server is what you would do.

To restart the apache server, you would specify the following line below.



This command kills the server process and then restarts it.

To stop the apache server, you would specify the following line below.



This command kills the server process.

To start the apache server, you would specify the following line below.



This commands starts the apache server.

This is shown below.

Restarting, stopping, and starting the apache server in Linux

If you're running the following commands through the root user, then you won't need to use sudo.

So if you ever want to restart, stop, or start the apache server, these are the commands to use on the linux machine.


Related Resources

How to Randomly Select From or Shuffle a List in Python



HTML Comment Box is loading comments...