apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for
2015-06-14 14:40
666 查看
his is just a friendly warning and not reallya problem (as in that something does not work).
If you insert a
ServerNamelocalhost
in either httpd.conf or apache2.conf in /etc/apache2 and
restart apache the notice will disappear.
If you have a nameinside /etc/hostname you can also use that name instead of localhost.
And it uses 127.0.1.1 if it is inside your /etc/hosts:
127.0.0.1localhost
127.0.1.1myhostname
Preferred method
Troubleshooting Apache
If you get this error:
apache2:Could not determine the server's fully qualified domain name,
using127.0.0.1 for ServerName
then use a text editor such as "sudonano" at the command line or "gksudo gedit" on the desktop tocreate a new file,
sudo nano/etc/apache2/conf.d/fqdn
or
gksu"gedit /etc/apache2/conf.d/fqdn"
then add
ServerNamelocalhost
to the file and save. This can all be done ina single command with the following:
echo "ServerName localhost" | sudotee /etc/apache2/conf.d/fqdn
But on Ubuntu 14.04:
echo "ServerName localhost" | sudotee /etc/apache2/conf-available/fqdn.conf
sudo a2enconf fqdn
Don't forget the ".conf" (withoutwill not work).
If you insert a
ServerNamelocalhost
in either httpd.conf or apache2.conf in /etc/apache2 and
restart apache the notice will disappear.
If you have a nameinside /etc/hostname you can also use that name instead of localhost.
And it uses 127.0.1.1 if it is inside your /etc/hosts:
127.0.0.1localhost
127.0.1.1myhostname
Preferred method
Troubleshooting Apache
If you get this error:
apache2:Could not determine the server's fully qualified domain name,
using127.0.0.1 for ServerName
then use a text editor such as "sudonano" at the command line or "gksudo gedit" on the desktop tocreate a new file,
sudo nano/etc/apache2/conf.d/fqdn
or
gksu"gedit /etc/apache2/conf.d/fqdn"
then add
ServerNamelocalhost
to the file and save. This can all be done ina single command with the following:
echo "ServerName localhost" | sudotee /etc/apache2/conf.d/fqdn
But on Ubuntu 14.04:
echo "ServerName localhost" | sudotee /etc/apache2/conf-available/fqdn.conf
sudo a2enconf fqdn
Don't forget the ".conf" (withoutwill not work).
相关文章推荐
- Apache部署Django环境
- windows下apache部署django项目个人总结(备查)
- Apache Drill学习笔记二:Dremel原理(上)
- Apache Drill学习笔记一:环境搭建和简单试用
- linux手动安装apache服务器
- Apache域名自动指向虚拟主机目录
- 使用Apache POI将ppt截屏成png格式(+背景和图片)
- Apache Benchmark修改,支持发送不同数据包
- Exception starting filter struts2 java.lang.NoClassDefFoundError: org/apache/commons/lang3/StringUti
- 用Apache的HTACCESS保护密码
- apache kafkac系列lient发展-java
- ubuntu 安装mysql+apache+php
- Apache Curator入门实战
- Apache Curator入门实战
- 使用Apache的ab工具进行压力测试
- apache2.4 以上的版本,cgi-bin中的文件不能运行。
- Apache Pig的前世今生
- 启用Mac(OS X Yosemite)自带的apache
- Apache Spark Resource Management and YARN App Models
- Web开发在Mac下配置Apache、php、MySQL应该注意的地方(Yosemite10.10.3)