apache2 无法重新启动

系统:ubuntu server 14.04 LTS

服务:apache2

重启服务时报

* 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

解决方案:

cd /etc/apache2/sites-enabled

sudo vi 000-default.conf

打开default文件后,在default文件顶端加入:

ServerName 127.0.0.1

重启apache2 (sudo /etc/init.d/apache2 restart)就不会提示上述错误了。