How to Restart Apache in Ubuntu Server 18.04
After applying updates or configurations to Apache2, you will need to reload or restart the daemon. In this tutorial you are going to learn how to Restart Apache Web Server in Ubuntu Server 18.04.
To Restart Ubuntu Apache2 Web Server we can use systemctl command or apache2ctl command.
Restart Apache2 in Ubuntu using systemctl command
To restart Apache Server in Ubuntu, restart the apache2 service using systemctl command.
sudo systemctl restart apache2.service
The reload option of the systemctl command will reload the apache configuration file, without restarting the entire HTTP Process.
sudo systemctl reload apache2.service
Restart Apache Web Server using apache2ctl command
The apache2ctl command is a very simple command use to manage the Apache2 server on Ubuntu 18.04.
sudo apache2ctl restart
This will restart apache web server on Ubuntu Server 18.04.
Apache Graceful Restart in Ubuntu Server 18.04.
Graceful Restart option will only reload the apache configuration file. If you make changes to the apache configuration file, then you can use the graceful option to reread the configuration file, without having to restart entire apache2 process.
sudo apache2ctl graceful
You could still use service Command or init.d script restart Apache in Ubuntu , but both commands will redirect to the systemctl command.