【问题标题】:Apache Listen configuration [closed]Apache Listen 配置 [关闭]
【发布时间】:2012-10-22 01:39:44
【问题描述】:

以下配置有什么区别

Listen *:80 //anything at port 80
Listen 192.168.0.34:80 //from an internal ip on port 80
Listen 173.194.35.23:80 //from an external ip on port 80

其中哪一个是最佳配置(如果它们之间有任何区别)。我希望我的服务器可以从 Internet 访问,而不仅仅是从 LAN。

【问题讨论】:

    标签: apache http configuration


    【解决方案1】:

    我总是使用*:80

    您只能侦听实际绑定到服务器网卡的 IP,但拥有一个跨越内部和外部网络的服务器是不好的做法,恕我直言,所以我不会定义内部和外部地址。

    我认为唯一需要具体说明您侦听的 IP 地址是如果您有特定的基于 IP 的虚拟主机。

    【讨论】:

      【解决方案2】:

      一个 Apache 服务器可以有多个域的多个 IP。

      Listen *:80 --> Apache listens no matter what ip request the web browser
      Listen 192.168.0.34:80 ---> Apache listens only if web browser requests http://192.168.0.34 . 192.x.x.x use to be internal IPs
      Listen 173.194.35.23:80 ---- Apache listens only if web browser requests http://Listen 173.194.35.23
      

      如果您只有一个站点域,请听 *:80 就足够了。其他配置是将多个站点/域服务到一个 apache 服务器中。

      一些文档示例http://httpd.apache.org/docs/2.2/vhosts/examples.html

      【讨论】:

        猜你喜欢
        • 2012-12-06
        • 2013-03-24
        • 1970-01-01
        • 2017-08-18
        • 1970-01-01
        • 1970-01-01
        • 2018-04-30
        • 2016-06-08
        • 1970-01-01
        相关资源
        最近更新 更多