To restart the Apache HTTP server (httpd) on Ubuntu 22.04, you can use the systemctl
command. Here’s how:
- Open a Terminal:
Open a terminal window on your Ubuntu 22.04 system. You can do this by searching for “Terminal” in the applications menu or by pressingCtrl + Alt + T
as a shortcut. - Use systemctl to Restart Apache:
Type the following command and press Enter:
sudo systemctl restart apache2
You’ll need to enter your password when prompted since you’re using sudo
to execute the command with administrative privileges.
- Verify Apache Restart:
After running the command, Apache will attempt to restart. To ensure that it has restarted successfully, you can check its status by running:
sudo systemctl status apache2
If Apache has restarted successfully, you should see output indicating that it’s active and running.
That’s it! You’ve now restarted Apache HTTP server on Ubuntu 22.04 using systemctl.