Hi,

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 127.0.1.1. 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
</VirtualHost>

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.

×
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?

Regards,
KFSys

  • 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 exampledomain.com in the place of your_domain.

Submit an Answer