April 17, 2010

[SOLVED] “Could not reliably determine the server’s fully qualified domain name, using ... for ServerName”

 

You might probably faced the same following error while you were restarting the Apache server on Ubuntu.




$ sudo /etc/init.d/apache2 restart
Restarting web server apache2                                                apache2: 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



To fix that problem, you need to edit the httpd.conf file. Open the terminal and type,




$ sudo gedit /etc/apache2/httpd.conf


By default httpd.conf file will be blank. Now, simply add the following line to the file.




ServerName localhost


Save the file and exit from gEdit.


Finally restart the server.




$ sudo /etc/init.d/apache2 restart


Source: How to fix Apache – “Could not reliably determine the server’s fully qualified domain name, using 127.0.1.1 for ServerName” Error on Ubuntu.

65 comments:

  1. Please don't copy and duplicate my original blog post.

    Without asking any permission doing this is illegal.

    Please remove the post.

    ReplyDelete
  2. You don't need any traffic? You don't need better Google PageRank?

    ReplyDelete
  3. thanks a lot. more power...

    ReplyDelete
  4. it works boy..ty

    ReplyDelete
  5. Worked for me - thanks!

    ReplyDelete
  6. Worked for me thank u so much !

    ReplyDelete
  7. works for me too

    ReplyDelete
  8. Thank, that's right!

    ReplyDelete
  9. awesome help..
    turns out the problem very easy

    ReplyDelete
  10. It worked for me.Thanks a lot

    ReplyDelete
  11. Works like a charm, thanks!

    I'd suggest these 3 lines:

    $ sudo su
    # echo "ServerName localhost" >> /etc/apache2/httpd.conf
    # /etc/init.d/apache2 restart

    ReplyDelete
  12. Thanks!!! It's works!!!

    ReplyDelete
  13. working like a charm, thank you!

    ReplyDelete
  14. Cheers for that. I had been ignoring that error for ages!!

    ReplyDelete
  15. thanks, worked for me as well.

    ReplyDelete
  16. My http.conf file is not blank. where to add the line?

    ReplyDelete
  17. this is work thanks
    i add "ServerName " line

    ReplyDelete
  18. Me too - simple yet effective! :-)

    ReplyDelete
  19. wah~!

    I for one am grateful for the post.

    Thank you for spreading the good advice (supposedly the only man on the planet came up with the idea....Aslam)....everyone bow down.

    ReplyDelete
  20. Doesn't work if you have 2 virtual server's running in the htttp.conf thru port 80. If all you have in the http.conf is ServerName then it will work, otherwise if you are set up like this.........


    ServerAdmin webmaster@localhost
    DocumentRoot /var/www/somesite1
    ServerName localhost


    DirectoryIndex index.htm
    AllowOverride None
    Order allow,deny
    Allow from all

    ErrorLog /var/log/apache2/error.log
    LogLevel warn

    CustomLog /var/log/apache2/access.log combined




    ServerAdmin webmaster@localhost
    DocumentRoot /var/www/somesite2
    ServerName localhost


    DirectoryIndex index.htm
    AllowOverride None
    Order allow,deny
    Allow from all

    ErrorLog /var/log/apache2/error.log
    LogLevel warn

    CustomLog /var/log/apache2/access.log combined



    (IT WON'T WORK!)

    Please help! :(

    ReplyDelete
  21. [...] [SOLVED] “Could not reliably determine the server’s fully qualified domain name, using … for S.... Share this:ShareFacebookTwitterEmailLike this:LikeBe the first to like this post. Programming [...]

    ReplyDelete
  22. Awesome, worked like a charm!

    ReplyDelete
  23. [...] You may get an error from Apache: “apache2: Could not reliably determine the server’s fully qualified domain name, using 127.0.0.1 for ServerName”. To fix this problem, do the following (as described here): [...]

    ReplyDelete
  24. [...] to russenreaktor and aslamnajeebdeen for the fix. This entry was posted in Ubuntu. Bookmark the [...]

    ReplyDelete
  25. Thanks a lot!

    ReplyDelete
  26. spread the knowledge how ever you can. this is a virtue.

    ReplyDelete
  27. david glivar25 April, 2012

    you should remove this post. its a blatant copy/paste.

    ReplyDelete
  28. Tom Street27 April, 2012

    It didn't work for me. I have Ubuntu 11.10 recently installed.

    ReplyDelete
  29. wonderful it works for me...

    ReplyDelete
  30. thank you..

    ReplyDelete
  31. its works...gr8 job

    ReplyDelete
  32. [...] konfigurasi dapat dilihat di sini. Share this:TwitterFacebookLike this:LikeBe the first to like this [...]

    ReplyDelete
  33. thank's for solution :D

    ReplyDelete
  34. thanks a lot for your support to all of us ...

    way to go !!

    regards

    ReplyDelete
  35. gopalakrishnan07 June, 2012

    thanks...............................

    ReplyDelete
  36. If running Ubuntu DO NOT edit httpd.conf!

    echo "ServerName localhost" | sudo tee /etc/apache2/conf.d/fqdn

    ReplyDelete
  37. Apache Chief27 June, 2012

    Thank you for copying this info. Mohamed Aslam's website has expired, and the info would have been lost otherwise. I for one am grateful.

    ReplyDelete
  38. You sure you went to /etc/apache2/httpd.conf not /opt/lampp/etc/httpd.conf?

    ReplyDelete
  39. Ogungbe Abayomi04 November, 2012

    it works.thanks

    ReplyDelete
  40. thank you man for your support

    ReplyDelete
  41. If he had not duplicated your post, maybe some people wouldn't have found a solution so fast, which is in no way a gain for society...
    So please leave your "copyright infringement" claims at home, the internet is a free place...

    ReplyDelete
  42. It is working.. Thanks a ton!!

    ReplyDelete
  43. Malik Haider29 December, 2012

    No Such file in my syste :(
    /etc/apache2/httpd.conf

    ReplyDelete
  44. Malik Haider30 December, 2012

    #if you dont find httpd.conf edit the hosts
    # restart apache services All Good for me .

    /etc$ sudo vim hosts
    127.0.0.1 localhost
    192.168.168.122 WebServer-Linux.webpalm.ie WebServer-Linux

    ReplyDelete
  45. Really, a bit narcissistic are we? Do you really think that editing httpd.conf was so brilliant that only you would possible have come up with it and you should therefore be acknowledged every time that it is done?

    ReplyDelete
  46. The original for this is no longer present, I'm glad it was duplicated here

    ReplyDelete
  47. Thanks for my first apache answer that wasnt over complicated (by the answer) and actually worked first time.

    ReplyDelete
  48. it did not work for me - it keeps saying the same

    ReplyDelete
  49. This makes a bug --- DO NOT ATTEMPT THIS

    ReplyDelete
  50. in order for this to work, then edit the file fqdn and remove the " characters
    then it works

    ReplyDelete
  51. [...] http://russenreaktor.wordpress.com/2010/04/17/solved-%E2%80%9Ccould-not-reliably-determine-the-serve... [...]

    ReplyDelete
  52. HI, tried it but it did not work for me.
    so i checked my hosts and i have something like this:
    127.0.0.1 localhost
    127.0.1.1 voice

    what do i do?

    ReplyDelete
  53. don't remove this post.

    ReplyDelete
  54. imaginemyfistgoingstraighttoyourface09 July, 2013

    stop being a jerk you numbskull :P

    ReplyDelete
  55. Restarting web server apache2 /usr/sbin/apache2ctl: 87: ulimit: error setting limit (Operation not permitted)
    apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName

    ReplyDelete
  56. when restart apache server..
    /usr/sbin/apache2ctl: 87: ulimit: error setting limit (Operation not permitted)
    apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
    (13)Permission denied: make_sock: could not bind to address 0.0.0.0:80
    no listening sockets available, shutting down Unable to open logs Action 'start' failed.
    The Apache error log may have more information.

    ReplyDelete
  57. how to solve it could you please help..

    ReplyDelete
  58. how uninstall lamp server completly

    ReplyDelete