在 ubuntu 14.04 中运行 apache 服务器时我得到"This webpage is not available"
在浏览器中或"curl: (7) Failed to connect to localhost port 80: Connection refused"
using $ curl localhost
。此外我可以连接到 127.* 。 *。 *(例如 127.0.0.2)- 仅 127.0.0.1 不起作用
/etc/主机
127.0.0.1 localhost
127.0.1.1 al-ubuntu
# 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
端口配置文件
Listen 80
<IfModule ssl_module>
Listen 443
</IfModule>
<IfModule mod_gnutls.c>
Listen 443
</IfModule>
当我更改端口时,例如Listen 82
然后我可以连接到 localhost:82 或 127.0.0.1:82
除了 apache2 之外,没有任何进程使用端口 80:
$sudo netstat -tulpn | grep 80
=> tcp6 0 0 :::80 :::* LISTEN 7127/apache2
/var/log/apache2/ 中有三个文件:
access.log, error.log and other_vhosts_access.log
When 重新启动apache2: $ tail -f error.log
[Thu Feb 19 16:03:19.570066 2015] [mpm_prefork:notice] [pid 1285] AH00169:
caught SIGTERM, shutting down
[Thu Feb 19 16:03:20.673519 2015] [mpm_prefork:notice] [pid 3454] AH00163:
Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4.6 configured -- resuming normal
operations
[Thu Feb 19 16:03:20.674355 2015] [core:notice] [pid 3454] AH00094: Command line: '/usr/sbin/apache2'
When 连接到本地主机在所有日志文件中 - 什么也没有。
我在其他 ubuntu14.04 系统上安装了 apache 并且一切正常。
80端口被阻塞的原因是什么,你知道问题出在哪里吗?