linux - debian中如何打开指定端口
黄舟
黄舟 2017-04-17 11:56:45
0
2
563

以前一直用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以为的地方设置吗?

黄舟
黄舟

人生最曼妙的风景,竟是内心的淡定与从容!

reply all(2)
迷茫

From the information you provided, port 8000 is not being monitored.

Apache adds a new VirtualHost and needs to be configured like this on port 8000:

  1. Add Listen 8000
  2. Add VirtualHost basic configuration:

    <VirtualHost *:8000>
    
    ServerName ooxx.com
    
    DocumentRoot "/var/www/html"
    
    </VirtualHost>
    
  3. Apache 2.2 and below requires placing a <VirtualHost *:8000> before NameVirtualHost *:8000.
Peter_Zhu

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

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template