Fixing Apache 2 “Could not reliably determine the server’s fully qualified domain name, using 127.0.1.1 for ServerName” Error on Raspberry Pi Wheezy

You might probably find this error while starting/restarting Apache web server on Raspberry Pi Wheezy:

root@raspi:# /etc/init.d/apache2 restart
[....] Restarting web server: apache2apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
 ... waiting apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
. ok

This error caused by Apache’s ServerName confguration is missing in apache2.conf file. So, as a quick fix to this error is creating or editing a httpd.conf file in directory /etc/apache2/conf.d using nano:

root@raspi:# cd /etc/apache2/conf.d
root@raspi:/etc/apache2/conf.d# nano httpd.conf

Put the following line on httpd.conf file:

ServerName localhost

Save the file using Ctrl+O command, and exit nano using Ctrl+X.

Restart Apache 2 using the following command

root@raspi:/etc/apache2/conf.d# /etc/init.d/apache2 restart
root@raspi:/etc/apache2/conf.d# /etc/init.d/apache2 restart
[ ok ] Restarting web server: apache2 ... waiting .
root@raspi:/etc/apache2/conf.d#

That’s it! The FQDN error has gone, and you are good to go to your awesome Raspberry Pi project. Hope this helps!

Note:
Raspberry Pi Raspbian “Wheezy” is Debian-based Linux OS, so this tutorial might be applicable to other Debian-based OS, such as Ubuntu.

4 thoughts on “Fixing Apache 2 “Could not reliably determine the server’s fully qualified domain name, using 127.0.1.1 for ServerName” Error on Raspberry Pi Wheezy

  1. Actualy, I’d suggest not to edit apache2.conf or httpd.conf directly but put the directive inside /etc/apache2/conf.d/servername

    That’s better for updates.

Leave a Reply

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

*

CAPTCHA Image

*

You may use these HTML tags and attributes: <a href="" title="" rel=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>