Apache Virtual Host ServerName

Posted November 2, 2020 1.1k views


I was trying to set up a (test) virtual host with Apache2 on Ubuntu but I get this error :

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

I do not understand since I already created this :

<VirtualHost *:80>
    ServerAdmin webmaster@localhost
    ServerName your_domain
    ServerAlias www.your_domain
    DocumentRoot /var/www/your_domain
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

Thanks for answering and sorry for (eventual) bad English!

edited by bobbyiliev

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
1 answer

Hi @Asmorgrym,

Can you please confirm how did you create this, is it a separate file, in which folder did you create it?

Additionally, for the following settings:

    ServerName your_domain
    ServerAlias www.your_domain
    DocumentRoot /var/www/your_domain

Did you use an actual domain or you used your_domain as a setup?


  • Hi,

    I created this file in etc/apache2/sites-available as a .conf file.

    Also, I used your_domain and tried to see if it works with this ServerName. I don’t know if it’s a valid one or not actually.

    • Hi @Asmorgrym,

      Okay, so you’ve done 50% right! You need to create a sym link for the /etc/apache2/sites-available/.conf file to etc/apache2/sites-enabled/ folder.

      The second thing is, you need to use a real domain or add a test domain like in the place of your_domain.