Start / Stop and Restart Apache 2 Web Server Command

h‮t‬tps://www.lautturi.com
Start / Stop and Restart Apache 2 Web Server Command

To start, stop, or restart the Apache 2 web server on a Linux or Unix system, you can use the following steps:

  1. Connect to the system using SSH. You will need to use a tool such as ssh or putty to connect to the system using the appropriate credentials.

  2. Once you are logged in, use the sudo command to gain root privileges. You will need to enter the password for the root user or provide your own user's password if you have been granted sudo privileges.

  3. To start the Apache 2 web server, enter the following command:

sudo systemctl start apache2
  1. To stop the Apache 2 web server, enter the following command:
sudo systemctl stop apache2
  1. To restart the Apache 2 web server, enter the following command:
sudo systemctl restart apache2

It's important to note that the Apache 2 web server will not start automatically after a system reboot, so you will need to start it manually using one of the above methods if you want to use Apache on your system. Additionally, restarting the Apache 2 web server can cause disruption to any active connections or transactions, so it should be done with caution.

Created Time:2017-10-30 14:27:20  Author:lautturi