LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 11-20-2016, 02:53 AM   #1
StuartK24
Member
 
Registered: Jan 2010
Location: Melbourne, Australia
Distribution: MX 18.3
Posts: 32

Rep: Reputation: 2
Error message when I restart Apache


When I restart Apache, I get the following message.

* Restarting web server apache2
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 am new to apache and using servers so excuse my ignorance. I have looked for the 'ServerName' directive in apache2.conf and cannot see anything of relevance. I also did, at one stage, change my '/etc/hosts' file without backing up the original. So I suspect this may be causing the problem, but I don't know how to fix it.
Like I said, I'm a beginner and at a bit of a loss. Any help would be greatly appreciated.
 
Old 11-20-2016, 03:32 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,165
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Quote:
When I restart Apache, I get the following message.

* Restarting web server apache2
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 am new to apache and using servers so excuse my ignorance. I have looked for the 'ServerName' directive in apache2.conf and cannot see anything of relevance. I also did, at one stage, change my '/etc/hosts' file without backing up the original. So I suspect this may be causing the problem, but I don't know how to fix it.
You didn't mention your distro, but I guess you're running Mint as in your profile, even though the following applies to all.

Apache complains because it can't find a ServerName.
That happened because you messed with /etc/hosts. Have a look here to see how it should look like (of course use your own IP(s) and hostnames).

You can also edit apache2.conf and add:
Code:
ServerName www.mydomain.com
The hostname used in the ServerName directive it's better to match the one in /etc/hosts (but not necessarily)

Regards
 
1 members found this post helpful.
Old 11-21-2016, 10:02 AM   #3
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
terminal >
Code:
sudo echo "ServerName localhost" >> /etc/apache2/apache2.conf
sudo apache2ctl graceful
done.

or add
Code:
127.0.1.1 domain.com
to /etc/hosts

Last edited by Habitual; 11-21-2016 at 10:04 AM.
 
1 members found this post helpful.
Old 11-28-2016, 05:07 AM   #4
StuartK24
Member
 
Registered: Jan 2010
Location: Melbourne, Australia
Distribution: MX 18.3
Posts: 32

Original Poster
Rep: Reputation: 2
Thanks to you both. I changed the line 127.0.1.1 to my domain, and set the ServerName in apache2.conf to the same domain name. This has gotten rid of the error message.
 
Old 11-28-2016, 06:24 AM   #5
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Glad it worked out.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
while i try to restart ssh i get an error message below auteta Linux - Server 4 12-20-2017 04:46 AM
Apache restart error anilkumar.kathi Ubuntu 3 01-12-2016 05:57 AM
Apache restart error gobinath1989 Linux - Newbie 3 10-02-2012 04:48 AM
Ubuntu Karmic fails to restart - only logo shows briefly, then error message UserName108 Ubuntu 2 07-21-2010 08:58 PM
Apache2 error message won't restart slvfx Linux - Server 5 12-14-2009 04:29 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 02:55 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration