5+ Ways To Restart Your Apache Server On Ubuntu 18.04, 18.04.2 & 19.04 Disco Dingo

How Do You Restart Apache Server On Ubuntu Distros

Apache HTTP Project


pache Server Restart: Apache is a free and open source webs server. This Apache web server is developed and maintained by Apache Software Foundation. The Apache server is highly compatible with Linux based Server Operating Systems. Now they expand its support for Windows too. In this article, we are going to explain How To Restart Your Apache Server on Ubuntu 18.04, Ubuntu 18.04.2 & Ubuntu 19.04 edition.

Jump To:

3+ Ways To Restart Apache Server On Ubuntu 18.04:

Follow the below commands to restart your Apache server on Ubuntu 18.04. We added the below commands that currently working with the latest ubuntu based operating systems. The below “Apache Restart” commands are working well for Ubuntu 16.04, Ubuntu 18.04, Ubuntu 18.04.2 LTS & Ubuntu 19.04 Disco Dingo editions.

$sudo service apache2 restart

The above command is the most commonly using command for restarting your Apache Web Server on Ubuntu. The service is the best way and it works on most of the Linux Distros. Now, you can use this command to restart your Apache server on Debian based operating system too.

$sudo service apache2 reload

The above command is the second alternate command for restarting your Apache server. It is considerably faster method and has no downtime while restarting your apache server.

$sudo /etc/init.d/apache2 restart

You can swap restart for stop, start and Reload. This command can be used in recent versions of Ubuntu and Debian OS.

$sudo systemctl restart apache2

The above command will restart your apache server instantly.

Check this too  How To Install [LAMP] Linux, Apache, MySQL & PHP on Ubuntu 18.04.2 Digital Ocean Server
$sudo apache2ctl graceful-stop
These commands wait until all requests for web pages have been served before restarting/stopping the web server so that your user’s don’t get half a web page.

Apache Server Not Restarting Error:

$sudo restart apache2

The above command will work only up to Ubuntu 14.04 editions only. If you try to use the above command in latest versions of Ubuntu and it will throw you the error.

Restarting web server apache2
AH00558: apache2: Could not reliably determine the server’s fully qualified domain name, using Set the ‘ServerName’ directive globally to suppress this message

If you receiving the output when you try to restart your apache server and then you need to follow the below steps to resolve the apache restart error.

To solve this problem just set ServerName.

sudo nano /etc/apache2/conf.d/name
For example, set the name as localhost or any other name that you want:

ServerName localhost
Then just restart Apache 2

sudo /etc/init.d/apache2 restart

Commonly Used Command for Apache Restart:

$sudo service apache2 restart

Copy the command and paste in the terminal and hit “Enter” button, The Apache server will instantly restart without any downtime.


In this article, we provided 5+ ways to Restart your Apache Server on Ubuntu editions. If you know any other working method for restarting the Apache server and then feel free to comment us below.

Leave a Reply

Your email address will not be published. Required fields are marked *

Written by Jim Moriarty

Hello, Am Jim from Arizona, Big Fan of Holmes. Server-side handler, Network Engineer & currently working for Tec Robust. I write a server-based article.

Contact me:
tecrobust [@]
Sub: Message to Jim.

Nginx on Ubuntu 18.04.2 LTS

How to Install Nginx on Ubuntu 18.04.2 LTS[SERVER] & Manage it

Kodi 19 Matrix

Kodi 19 Code Name Revealed- Upcoming Kodi got its Codename !!