Apache2 Error AH00558 Could not reliably determine the server’s fully qualified domain name

Table of Contents

AH00558 Server Name missing

The first task you must complete immediately after the installation of Apache web server is to configure the Server Name, in our example we’re going to put www.example.com but you must use your own domain name here.

systemctl status apache2

Feel free to use the command above, hover your cursor over the up right corner of the box to see the COPY option that allows You to quickly copy the code with a simple click.

Add Server Name automatically

Adding a new line to a text file is a task that the “sed” command can quickly do, use the following command to add the Server Name automatically, change the line number (79) to whatever you prefer, and do not forget to use your own domain name.

sed -i -e '79iServerName www.example.com' '/etc/apache2/apache2.conf'

Feel free to use the command above, hover your cursor over the up right corner of the box to see the COPY option that allows You to quickly copy the code with a simple click.

Open file apache2.conf to confirm

Use your preferred text editor to open the file “apache2.conf” to verify that now line number 79 has the text you added via the command line interface using the “sed” command above.

Restart Apache2

As always, every time you make changes in the Apache’s configuration file “apache2.conf“, please do not forget to restart Apache, use the command below.

systemctl restart apache2

					
				

Feel free to use the command above, hover your cursor over the up right corner of the box to see the COPY option that allows You to quickly copy the code with a simple click.

Verify the error has gone

Feel free to verify running the Apache’s status command once again, the error must have been disappeared.

systemctl status apache2

Feel free to use the command above, hover your cursor over the up right corner of the box to see the COPY option that allows You to quickly copy the code with a simple click.

Where to go next?

Now that your web server is up and running and after allowing both HTTP and HTTPS traffic through the Ubuntu’s firewall, you can use the public IP address of your web server on a web  browser to see the Apache’s default web page.