以前一直用centOS,最近刚接触debian,不是很熟。
我在apache中在8000端口配了个VirtualHost,却发现无法访问。
于是我使用iptables -L
查看防火墙,却发现防火墙并没有配置任何规则。
然而我使用nmap
查看网络信息,却得到如下信息:
root@AY131109155544150a08Z:/etc/network# nmap 127.0.0.1
Starting Nmap 5.00 ( http://nmap.org ) at 2014-10-17 00:01 CST
Interesting ports on localhost (127.0.0.1):
Not shown: 992 closed ports
PORT STATE SERVICE
21/tcp open ftp
22/tcp open ssh
25/tcp open smtp
80/tcp open http
111/tcp open rpcbind
443/tcp open https
3306/tcp open mysql
8080/tcp open http-proxy
于是我就很不解了,请问如果我想打开某个端口,还需要在iptables以为的地方设置吗?
Apache adds a new
VirtualHost
and needs to be configured like this on port 8000:Listen 8000
Add VirtualHost basic configuration:
<VirtualHost *:8000>
beforeNameVirtualHost *:8000
.iptables -F can clear all firewall policies. Doesn’t it have anything to do with the firewall if the port is not open?
Use netstat -antple | grep 8000 to see if there is any. If not, it may be a problem with your apache configuration