[SOLVED] apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName on Xubuntu
Symptom
You get this error message when starting apache:
* Starting web server apache2
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
Fix
Open a terminal window and run:
sudo sh -c 'echo "ServerName localhost" >> /etc/apache2/conf.d/name' && sudo service apache2 restart
thanks a lot very usefull
ReplyDeleteYou're welcome.
Deletehttp://linuxconfig.net/manual-howto/error-solution-could-not-reliably-determine-the-servers-fully-qualified-domain-name.html
ReplyDeleteTo solve this problem You need set ServerName.
1
$ vim /etc/apache2/conf.d/name
For example set add ServerName localhost or any other name:
1
ServerName localhost
Restart Apache 2
1
$ service apache restart
thanks!!!
ReplyDeleteYou're welcome!
DeleteDoesn't work for me. And I'm even using Xubuntu (12.10) not a variant. In fact, I haven't got this little trick for the last 2 months or so, on Ubuntu, Mint or CrunchBang
ReplyDeleteI just tried this on Xubuntu 12.10 and it worked:
Deletesudo sh -c 'echo "ServerName localhost" >> /etc/apache2/conf.d/name' && sudo service apache2 restart
You could try this as well.
awesome ! this works with my xubuntu THANK YOU !
Delete@Anonymous
DeleteYou're welcome!
"sudo sh -c 'echo "ServerName localhost" >> /etc/apache2/conf.d/name' && sudo service apache2 restart"
ReplyDeleteTried all the trick on Linux Mint 13 64bit,none work. Please help.
And what does the name in '/conf.d/name' mean, when I execute the command with this,I get an error that the directory doesn't exist.
I tried on Linux Mint 14 and it worked.
Deleteconf.d holds Apache's configuration files, there should a line inside you httpd.conf including it (Include conf.d/).
Did you install Apache from the repositories? Please check that you typed it right.
Thanks man! Simple and Work!
ReplyDeleteYou're welcome!
DeleteThank you, work for me in Ubuntu 12.10, i used to edit httpd.conf manually but somehow manually editing didn't work last time!!!! .. thanks again
ReplyDeleteYou're welcome.
DeleteThanks for the suggestion. it worked. Can you also explain what was the problem and explain the command which fixes it?
ReplyDeleteThe error message says that ServerName is not set, so what the command does is to append the line "ServerName localhost" to the file /etc/apache2/conf.d/name.
DeleteThe echo command writes text to standard output. This text is appended using the bash redirection (>>).
After the configuration is updated the Apache server is restarted using the "service" command.
thanks ! work for me in Ubuntu 12.10
ReplyDeleteYou're welcome.
DeleteThanks a bunch. Worked for me.
ReplyDeleteYou're welcome.
DeleteYou are a *. Worked like a charm
ReplyDeleteThanks :)
DeleteThanks, it worked like...well it worked :)
ReplyDeleteMmm saturday night and I'm configuring a web server. We all have our priorities
I'm glad that worked for you.
DeleteI am using Ubuntu 12.04 and when i use the above given command the message on terminal is '* Restarting web server apache2' but when i check the browser for http://localhost:8080 i dont get the Apache server page. Please guide
ReplyDeleteApache uses port 80, so try http://localhost
DeleteYou can also configure Apache to make it listen to other ports.
You're welcome!
ReplyDeleteI started getting thisk error after moving my Document Root from /var/www/ to my Dropbox folder. Here is my new entry in /etc/apache2/sites-available folder. File name is mysite:
ReplyDelete------------------
ServerAdmin webmaster@localhost
DocumentRoot /var/www
Options FollowSymLinks
AllowOverride None
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
ErrorLog ${APACHE_LOG_DIR}/mysite_error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined
------------------
I have given 777 permission to the Dropbox tree ~/Dropbox/mysite/
I put the entry ServerName localhost in a new /etc/apache2/name file and that is the only entry in that file.
I've restarted the server countless times. I'm confused by all the misinformation on the web where Xubuntu installations of Apache2 are confused with other installations of Apache on .rpm servers. Where should I go next?
Nevermind. Saw my error in my mysite file. Corrected that and it is working find now, apparently.
ReplyDeleteSorry for the bother.
I'm glad that the problem is solved :)
DeleteWorked on a Raspberry Pi "wheezy"......thank you!
ReplyDeleteYou're welcome!
DeleteI messed up with my apache2.conf,ports.conf,000-default files. And,then I reset them back (atleast that is what I thought). It led to the problem refereed in the post,which I fixed using your solution.I had edited /var/www/index.html before messing up with those files and customized it to my needs. Now ,when I type in http://localhost/ ,I get the default "It works" page. I couldn't find where this page is ,and I couldn't understand why my customized index.html is not being displayed.(although the customized index.html still lives in the /var/www/ directory ) All the other pages work fine. Any help?
ReplyDeletePlease, open the file: /etc/apache2/sites-available/default
DeleteThen check the value of the "DocumentRoot" directive; it should be "var/www".
After changing the value restart apache: sudo service apache2 restart
thanks man..
ReplyDeleteit's worked like charm :)
You're welcome.
DeleteHi, I've a Ubuntu 11.10 version running on my personal computer. I had entered the above mentioned command on a "Terminal" as you instructed on this site but there's no luck I'm still running the errors with the Apache2 on my computer. Kindly help me out in fixing this error ASAP.
ReplyDeletesudo sh -c 'echo "ServerName localhost" >> /etc/apache2/conf.d/name' && sudo service apache2 restart
Regards,
Kelam Praveen Kumar
Could you try the solution below?
Deletesudo sh -c 'echo "ServerName localhost" >> /etc/apache2/httpd.conf' && sudo service apache2 restart
No, it didn't worked and I ended up with the new error right now.....
DeleteError message:
sh: cannot create /etc/apache2/httpd.conf: Directory nonexistent
Hi, I had entered the command provided by you and after I entered the command I'm getting a new error message.
DeleteError message:
* Restarting web server apache2
Action 'start' failed.
The Apache error log may have more information.
I had opened the error logs but I couldn't understand as I'm a beginner and I had posted it below....
Error.log.2.gz
[Wed Mar 06 20:28:28 2013] [notice] Apache/2.2.17 (Ubuntu) mod_perl/2.0.4 Perl/v5.10.1 configured -- resuming normal operations
[Thu Mar 07 00:22:22 2013] [notice] caught SIGTERM, shutting down
[Thu Mar 07 18:20:21 2013] [notice] Apache/2.2.17 (Ubuntu) mod_perl/2.0.4 Perl/v5.10.1 configured -- resuming normal operations
[Thu Mar 07 20:03:26 2013] [notice] caught SIGTERM, shutting down
[Fri Mar 08 23:07:52 2013] [notice] Apache/2.2.17 (Ubuntu) mod_perl/2.0.4 Perl/v5.10.1 configured -- resuming normal operations
[Fri Mar 08 23:32:01 2013] [notice] caught SIGTERM, shutting down
[Fri Mar 08 23:32:42 2013] [notice] Apache/2.2.17 (Ubuntu) mod_perl/2.0.4 Perl/v5.10.1 configured -- resuming normal operations
[Sat Mar 09 00:26:28 2013] [notice] caught SIGTERM, shutting down
[Sun Mar 10 10:15:38 2013] [notice] Apache/2.2.17 (Ubuntu) mod_perl/2.0.4 Perl/v5.10.1 configured -- resuming normal operations
[Sun Mar 10 10:18:02 2013] [notice] SIGUSR1 received. Doing graceful restart
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
erro.log.3.gz
[Tue Jan 31 08:52:09 2012] [notice] Apache/2.2.17 (Ubuntu) configured -- resuming normal operations
[Tue Jan 31 09:59:58 2012] [notice] caught SIGTERM, shutting down
[Thu Feb 02 19:07:51 2012] [notice] Apache/2.2.17 (Ubuntu) mod_perl/2.0.4 Perl/v5.10.1 configured -- resuming normal operations
[Thu Feb 02 23:07:33 2012] [notice] caught SIGTERM, shutting down
[Fri Feb 03 12:33:14 2012] [notice] Apache/2.2.17 (Ubuntu) mod_perl/2.0.4 Perl/v5.10.1 configured -- resuming normal operations
[Fri Feb 03 13:51:25 2012] [notice] caught SIGTERM, shutting down
[Wed Mar 06 20:06:20 2013] [notice] Apache/2.2.17 (Ubuntu) mod_perl/2.0.4 Perl/v5.10.1 configured -- resuming normal operations
[Wed Mar 06 20:28:28 2013] [notice] SIGUSR1 received. Doing graceful restart
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
Hi, I've a Ubuntu 11.10 version running on my private computer. I had installed the Apache2 recently on my computer and I ended with the error while restarting the Apache2. I had entered the command provided by you on this site but nothing changed I'm still running the error while restarting the Apache2.....
ReplyDeleteError message:
* Restarting web server apache2
Action 'start' failed.
The Apache error log may have more information..
Kindly help me in fixing this error.....
Thanks in advance..
-Kelam Praveen Kumar-
That error message isn't related with the problem exposed in this post. Please check the Apache error log for more information (/var/log/apache2/error.log)
DeleteSorry, I had received the same error at the first place which is exposed in the post and later I ended up with the following error.
DeleteError message:
* Restarting web server apache2
Action 'start' failed.
The Apache error log may have more information..
As you instructed, I had checked the error log and I've entered it below....
Error.log.2.gz
[Wed Mar 06 20:28:28 2013] [notice] Apache/2.2.17 (Ubuntu) mod_perl/2.0.4 Perl/v5.10.1 configured -- resuming normal operations
[Thu Mar 07 00:22:22 2013] [notice] caught SIGTERM, shutting down
[Thu Mar 07 18:20:21 2013] [notice] Apache/2.2.17 (Ubuntu) mod_perl/2.0.4 Perl/v5.10.1 configured -- resuming normal operations
[Thu Mar 07 20:03:26 2013] [notice] caught SIGTERM, shutting down
[Fri Mar 08 23:07:52 2013] [notice] Apache/2.2.17 (Ubuntu) mod_perl/2.0.4 Perl/v5.10.1 configured -- resuming normal operations
[Fri Mar 08 23:32:01 2013] [notice] caught SIGTERM, shutting down
[Fri Mar 08 23:32:42 2013] [notice] Apache/2.2.17 (Ubuntu) mod_perl/2.0.4 Perl/v5.10.1 configured -- resuming normal operations
[Sat Mar 09 00:26:28 2013] [notice] caught SIGTERM, shutting down
[Sun Mar 10 10:15:38 2013] [notice] Apache/2.2.17 (Ubuntu) mod_perl/2.0.4 Perl/v5.10.1 configured -- resuming normal operations
[Sun Mar 10 10:18:02 2013] [notice] SIGUSR1 received. Doing graceful restart
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
erro.log.3.gz
[Tue Jan 31 08:52:09 2012] [notice] Apache/2.2.17 (Ubuntu) configured -- resuming normal operations
[Tue Jan 31 09:59:58 2012] [notice] caught SIGTERM, shutting down
[Thu Feb 02 19:07:51 2012] [notice] Apache/2.2.17 (Ubuntu) mod_perl/2.0.4 Perl/v5.10.1 configured -- resuming normal operations
[Thu Feb 02 23:07:33 2012] [notice] caught SIGTERM, shutting down
[Fri Feb 03 12:33:14 2012] [notice] Apache/2.2.17 (Ubuntu) mod_perl/2.0.4 Perl/v5.10.1 configured -- resuming normal operations
[Fri Feb 03 13:51:25 2012] [notice] caught SIGTERM, shutting down
[Wed Mar 06 20:06:20 2013] [notice] Apache/2.2.17 (Ubuntu) mod_perl/2.0.4 Perl/v5.10.1 configured -- resuming normal operations
[Wed Mar 06 20:28:28 2013] [notice] SIGUSR1 received. Doing graceful restart
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
It seams that Apache isn't properly installed...
Deleteiloveu.
ReplyDeleteThanks!
ReplyDeleteYou're welcome!
DeleteThanks a lot it works!!!
ReplyDeleteWorking in Ubuntu 13.04. Thank you very much from Mexico.
ReplyDeleteThanks.
ReplyDeleteI think there's possibility to change localhost for real host name.
Thanks for this, much appreciated!
ReplyDeleteThank you !!! From Paris :D
ReplyDeletei have some probleme but on kali linux
ReplyDeleteStarting web server: apache2apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
Thanks a lot. it's working good. but i got another error. i posted in below
ReplyDeleteplease help
$ sudo sh -c 'echo "ServerName localhost" >> /etc/apache2/conf.d/name' && sudo service apache2 restart
* Restarting web server apache2 (98)Address already in use: 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. [fail]
It seems that you have another service using the HTTP port (80).
Delete