在ubuntu8.10上设置虚拟主机时候,把配置文件/etc/apache2/aspache2.conf删除掉几行,原文件没有备份,重起apache服务一直报错:
root@ubuntu8110:/etc/apache2# service apache2 restart
* Stopping web server apache2
apache2: Could not reliably determine the server’s fully qualified domain name, using 203.86.2.51 for ServerName
…done.
apache2: Could not reliably determine the server’s fully qualified domain name,using xxx.xxx.xxx.xx for ServerName
由於網站還能正常運作,所以就不管它了,
剛剛又在我的email當中發現系統發出的警告信…很煩耶,每次出現錯誤訊息就發一次,實在是煩死人了,
於是就打開了/etc/apache2/apache2.conf,
在裡面加入了一行:
ServerName www.OOXX.edu.tw
再重新apache2ctl restart 看看,果然沒有再出現錯誤訊息囉^^
按ESC键 跳到命令模式,然后:
:w 保存文件但不退出vi
:w file 将修改另外保存到file中,不退出vi
:w! 强制保存,不推出vi
:wq 保存文件并退出vi…
如修改/etc/x11/... 这个文件 可打开终端在超级用户下 # vi /etc/x11/... 打开后按a就可输入要修改的内容和windows的记事本差不多 输入完毕后 输入Q退出输入 wq存盘退出 输入q!放弃存盘后退出

在Ubuntu环境中安装Apache2时遇到'apache2: Could not reliably determine the server's fully qualified domain name'的错误。解决方法是在default配置文件中添加ServerName 127.0.0.1,或者在httpd.conf文件中设置ServerName localhost,然后重启服务。如果配置文件丢失,可能导致启动报错,可以尝试使用vi编辑器进行修复并保存。

2472

被折叠的 条评论
为什么被折叠?



