754   Apache RedHat

重启apache时要注意使用sudo即root权限,不然会报以下错误

ubuntu@VM-138-137-ubuntu:/etc/apache2/sites-enabled$ service apache2 start
*Starting web server apache2
Permission denied: make_sock: could not bind to address 0.0.0.0:80

ubuntu@VM-138-137-ubuntu:/etc/apache2/sites-enabled$ sudo /etc/init.d/apache2 restart
* Restarting web server apache2
... waiting
[ OK ]

之前重启apache还会报另一个错
在Ubuntu上安装Apache,每次重启,都会出现以下错误提示:

Could not reliably determine the server’s fully qualified domain name, using 127.0.1.1 for ServerName

解决办法
修改 httpd.conf 文件
打开终端,输入以下命令:
sudo vim /etc/apache2/httpd.conf
默认情况下,这个是一个空文件,在文件中加入以下内容:

ServerName localhost

保存文件退出,再次重启apache,错误提示没有了。




Leave a Reply

Your email address will not be published. Required fields are marked *