【问题标题】:Is it possible to deterministically trace how port 80 is forwarded and where the configuration is on a given system?是否可以确定性地跟踪端口 80 的转发方式以及给定系统上的配置位置?
【发布时间】:2015-06-28 01:59:13
【问题描述】:

有没有办法确定或跟踪如何在运行 Ubuntu 14.04 LTS 的系统上设置端口转发配置,在该系统上运行 NodeJS 服务并以某种方式通过端口 80 接受连接,尽管服务本身正在运行8080 端口,因为很明显 Apache 正在处理端口 80 连接(请参阅下面的详细信息)?

我试图在系统上lsof -i :80,根据lsof,端口80上没有运行任何进程。但有趣的是:

ubuntu@ip-***-**-**-***:~$ sudo netstat -anp | grep apache
tcp6       0      0 :::80                   :::*                    LISTEN      10197/apache2

在确定它位于/etc/apache2/apache2.conf 并且无法找到任何VirtualHost 记录、ProxyPass 或任何类似内容后,我已经深入研究了 apache 配置。

我还检查了iptables -L,以防万一。

httpry 或类似的东西是否有助于确定端口转发配置以及哪些正在运行的进程负责端口转发?

【问题讨论】:

  • iptables -L 不会回答这个问题;你想看看nat 表(iptables -t nat -L)。通常,Apache 读取的不仅仅是 /etc/apache2/apache2.conf,因此您应该检查 /etc/apache2 下的其他 Apache 配置文件。
  • 这是完美的,而且效果很好。请将此更改为答案,而不是评论,我会接受。
  • 已回答。干杯!

标签: node.js apache portforwarding netstat lsof


【解决方案1】:

iptables -L 不会回答问题(这列出了 iptables filter 表);您可能想通过运行iptables -t nat -L(或iptables -t nat -S,它产生iptables-save 格式的输出,我发现它更易于阅读)来查看nat 表。

通常 Apache 读取的不仅仅是 /etc/apache2/apache2.conf,因此您应该检查 /etc/apache2 下的其他 Apache 配置文件。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-12-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-04-05
    相关资源
    最近更新 更多