我需要在我的Debian 7服务器上运行Apache2。但是它仅在tcpv6端口上运行,而不在tcpv4端口上运行。我用apt-get install安装了它。如果我转到localhost或127.0.0.1或我的服务器IPv4地址,它将不显示任何网站。
我的/etc/apache2/ports.conf
:
# If you just change the port or add more ports here, you will likely also
# have to change the VirtualHost statement in
# /etc/apache2/sites-enabled/000-default
# This is also true if you have upgraded from before 2.2.9-3 (i.e. from
# Debian etch). See /usr/share/doc/apache2.2-common/NEWS.Debian.gz and
# README.Debian.gz
NameVirtualHost *:80
Listen 80
<IfModule mod_ssl.c>
# If you add NameVirtualHost *:443 here, you will also have to change
# the VirtualHost statement in /etc/apache2/sites-available/default-ssl
# to <VirtualHost *:443>
# Server Name Indication for SSL named virtual hosts is currently not
# supported by MSIE on Windows XP.
Listen 443
</IfModule>
<IfModule mod_gnutls.c>
Listen 443
</IfModule>
netstat -plntu
:
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 3558/sshd
tcp 0 0 0.0.0.0:3466 0.0.0.0:* LISTEN 2820/mysqld
tcp6 0 0 :::80 :::* LISTEN 2097/apache2
tcp6 0 0 :::22 :::* LISTEN 3558/sshd
sudo iptables -nvL
和sudo sestatus
?我认为您有一些本地防火墙正在阻止您。
a2enmod php5
应该为您做。
::
。
Listen 80
改为Listen 0.0.0.0:80
。您可以参考文档httpd.apache.org/docs/2.2/bind.html了解更多信息。