我已经安装在Ubuntu的Apache 2,但是当我尝试重新启动它给了我这个错误
vmware@ubuntu:~$ sudo /etc/init.d/apache2 restart * Restarting web server apache2 apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName [Mon Apr 12 17:37:43 2010] [warn] NameVirtualHost *:80 has no VirtualHosts apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName [Mon Apr 12 17:37:43 2010] [warn] NameVirtualHost *:80 has no VirtualHosts
当我尝试http://localhost
现在我得到这个错误
sudo /etc/init.d/apache2 restart sudo: unable to resolve host ubuntu * Restarting web server apache2 apache2: apr_sockaddr_info_get() failed for ubuntu apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName apache2: apr_sockaddr_info_get() failed for ubuntu apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName (98)Address already in use: make_sock: could not bind to address [::]:80 (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 log
小号
什么都没有来
This is the netstat output Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 localhost:postgresql *:* LISTEN - tcp 0 0 *:3389 *:* LISTEN - tcp 0 0 localhost:3350 *:* LISTEN - tcp 0 0 *:ssh *:* LISTEN - tcp 0 0 localhost:ipp *:* LISTEN - tcp6 0 0 localhost:postgresql [::]:* LISTEN - tcp6 0 0 [::]:microsoft-ds [::]:* LISTEN - tcp6 0 0 [::]:netbios-ssn [::]:* LISTEN - tcp6 0 0 [::]:5900 [::]:* LISTEN 1338/vino-server
并重新启动Apache现在给
sudo /etc/init.d/apache2 restart sudo: unable to resolve host ubuntu * Restarting web server apache2 apache2: apr_sockaddr_info_get() failed for ubuntu apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName ... waiting .apache2: apr_sockaddr_info_get() failed for ubuntu apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
即使在configuration中有一个NameVirtualHost声明,您似乎仍然缺less一个VirtualHost节。
您需要删除NameVirtualHost行或修复您的虚拟主机configuration。
编辑:关于你的最新更新 – 这意味着别的东西在端口80上运行,所以Apache无法侦听该端口上的连接。 你可能有一些其他的守护进程(或者一个stream氓Apache进程)正在运行。
您可以运行netstat --tcp --listening --programs来显示所有侦听套接字以及侦听每个端口的应用程序。 您将在“本地地址”列中查找*:www或*:80 。 一旦您知道在端口80上侦听应用程序,就可以确定解决问题的最佳方法。
apache2:无法可靠地确定服务器的完全限定的域名,使用ServerName的127.0.0.1
编辑/etc/hostname或使用ServerName指令,如果你不需要在一台机器上提供多个网站来解决这个错误。
要查找其余的错误,请查看/etc/apache2/sites-enabled以/etc/apache2/sites-enabled您的configuration。 应该有一个默认网站刚刚服务/var/www 。
在这里检查: 设置基于名称的虚拟主机 。
要找出还有什么是绑在80端口,运行这个:
netstat -lnp | grep :80
然后,你可以做一些像killall -9 [process-name]然后再次尝试重新启动。