当我尝试启动服务器时,我收到来自 Apache 的奇怪错误消息
.
* Restarting web server apache2 apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
[Thu Jan 10 17:49:32 2013] [warn] NameVirtualHost 122.174.238.1XX:0 has no VirtualHosts
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
[Thu Jan 10 17:49:32 2013] [warn] NameVirtualHost **122.174.238.1XX:0** has no VirtualHosts
(99)Cannot assign requested address: make_sock: could not bind to address 122.174.238.1XX:80
no listening sockets available, shutting down
Unable to open logs
Action 'start' failed.
The Apache error log may have more information.
[fail]
奇怪的是,我不知道它从哪里获得 22.174.238.1XX IP
我在 sites-enabled 中有一个文件:
<VirtualHost 192.168.1.90:80>
DocumentRoot "/home/webmaster/www/thefaXXXX"
ServerName thefaXXXXX.cu.cc
<Directory "/home/webmaster/www/thefaXXXXX">
allow from all
Options +Indexes
</Directory>
</VirtualHost>
/etc/ 中的 hosts 文件内容如下
127.0.0.1 localhost
127.0.1.1 NightHwack
192.168.1.90 thefaXXXX.cu.cc
192.168.1.90 www.thefaXXXX.cu.cc
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
我希望我的服务器在端口 80 上监听 192.168.1.90。我尝试使用 webmin 删除虚拟服务器并创建一个在 192.168.1.90 上监听的新服务器(没有服务器名称等),但仍然出现完全相同的错误。
我不明白 Apache 从哪里获取了 122。。.* IP 来自
答案1
您在 中定义了静态 IP /etc/apache2/ports.conf
。重新配置文件即可修复该问题。