0

Apache cannot fully determine domain name when I tried restarting after install.

I get this error;

$ sudo /etc/init.d/apache2 restart
Restarting web server config apache2
apache2: Could not reliably determine the server's fully qualified domain
name, using 127.0.1.1 for ServerName.

Why am I seeing 127.0.1.1? I have tried saving ServerName localhost into my /etc/init.d/apache2 but it keeps redirecting me to Google search page every time I type phpmyadmin.

Will appreciate any expert help.

Zanna
  • 72,312
frqcuse
  • 69

4 Answers4

1

Unless there is a specific reason you need it to determine it there is no real reason to try and do so. I run 3 soon to be 5 sites on my server and at every restart it still says that. It seems to only be important in very specific cases.

0

Line:

ServerName localhost

should be added to /etc/apache2/httpd.conf or to some specific site in /etc/apache2/sites-available/. The configuration can vary on different versions but httpd.conf should be there always.

Aditya
  • 13,616
Kride
  • 101
0

As default the configurations of apache is blank. Try to set with this.

Open terminal, and edit /etc/apache2/httpd.conf ,

set Servername localhost

Besure u have changed httpd.conf with right.

Restart with this command :

sudo service apache2 stop

sudo service apache2 start

See image below.

enter image description here

enter image description here

enter image description here

Baim
  • 245
  • 1
  • 5
0

You need to specify ( Optional ) name of the site in apache configuration. Edit /etc/apache2/httpd.conf file.

Add following parameter

Servername <your-website-name> 

For example

 Servername ketan.in

Restart apache

/etc/init.d/apache2 restart 
KK Patel
  • 19,753