11

My apache service is giving me error, I just used a snapshop on my AWS cloud instance and everything seemed to be fine and my website was working until I restarted my apache and now it gives me the below error:

ubuntu@ip-10-0-0-217:/var/www$ sudo service apache2 restart
sudo: unable to resolve host ip-10-0-0-217
 * Restarting web server apache2 
apache2: apr_sockaddr_info_get() failed for ip-10-0-0-217
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
 ... waiting apache2: apr_sockaddr_info_get() failed for ip-10-0-0-217
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName

On the user end they are getting This website is temporarily unavailable, please try again later. when they try to access the website.

How can I fix this?

1
  • 2
    Show us the configuration of Apache.
    – Braiam
    Sep 14, 2014 at 12:43

2 Answers 2

14

I too had this problem aster a good install of Apache 2.4 on Ubuntu 14.04.

I eventually fixed when I realised I had entered a wrong name in /etc/hosts file my server name set in /etc/hostname was thissrv2

i.e. hosts was (after I changed it) ...
127.0.0.1       localhost
::1             localhost ip6-localhost ip6-loopback
fe00::0         ip6-localnet
ff00::0         ip6-mcastprefix
ff02::1         ip6-allnodes
ff02::2         ip6-allrouters
127.0.1.1       thissvr1
91.189.88.140   ports.ubuntu.com
91.189.95.83    ppa.launchpad.net
54.224.40.137   repo.linaro.org

Once I corrected the entry to that below (now in line with /etc/hostname) the err went

127.0.0.1       localhost
::1             localhost ip6-localhost ip6-loopback
fe00::0         ip6-localnet
ff00::0         ip6-mcastprefix
ff02::1         ip6-allnodes
ff02::2         ip6-allrouters
127.0.1.1       thissvr2
91.189.88.140   ports.ubuntu.com
91.189.95.83    ppa.launchpad.net
54.224.40.137   repo.linaro.org

Hope this leads others to fixing this type of error.

10

This happens when apache is just installed and no setup has been done. Anyway, a quick search[1] first result provides the following reciepe:

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

sudo nano /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 . Finally restart the server.

sudo /etc/init.d/apache2 restart

[1] https://www.google.es/search?client=ubuntu&channel=fs&q=apache+fully+name&ie=utf-8&oe=utf-8&gfe_rd=cr&ei=hYmVU-ulHI7D8gedu4EY

3
  • I tried this one but it didn't solved the issue.
    – user291679
    Jun 9, 2014 at 10:32
  • Is still showing same error? Is showing more details in the logs?
    – XiR_
    Jun 9, 2014 at 11:08
  • also when activating vhosts pointing to 8080, you need to set the setup in /extra/httpd for the servername
    – woninana
    Dec 29, 2022 at 4:56

Not the answer you're looking for? Browse other questions tagged .