Setting the Global ServerName Directive on Ubuntu Apache

Published: 2024-03-02 | Updated: 2024-07-03


Apache reports an error AH00558 after setting up a server configuration when issuing the restart, reload, or configtest commands

sudo /etc/init.d/apache2 restart


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


Open apache’s main config file with your favorite editor (vim, nano, gedit…)

sudo vim /etc/apache2/apache2.conf

And add at end of the file:

# Global ServerName directive

Save and exit and test config

sudo apachectl configtest
# Syntax OK
sudo /etc/init.d/apache2 restart

The error is no more.