【问题标题】:How do I configure apache2 to a port other than port 80?如何将 apache2 配置到端口 80 以外的端口?
【发布时间】:2013-03-07 04:30:12
【问题描述】:

我已经在 ubunto 上安装了 apache2,并且弄乱了 localhost 页面上的文本。现在我被要求显示它在 port 80 以外的端口上运行。我该怎么做?

【问题讨论】:

    标签: apache ubuntu port


    【解决方案1】:

    您应该更改httpd.conf 中的Listen x 行,其中x 是端口号。之后您需要重新启动 apache 服务器。

    【讨论】:

      【解决方案2】:

      在文件中:/etc/apache2/httpd.conf

      更改以下行:

      Listen 80
      

      到:

      Listen <NEWPORT>
      

      之后需要重启apache服务器:

      sudo service apache2 start
      

      更新: 与 Ubuntu 类似,默认 /etc/apache2/httpd.conf 为空,推荐的方法是在 /etc/apache2/conf.d 下创建一个新的 .conf 文件,这样即使有软件更新,用户变化是持久的。

      所以只需创建一个新文件,比如/etc/apache2/conf.d/mycustomizations.conf

      Listen <NEWPORT>
      

      【讨论】:

        猜你喜欢
        • 2016-09-30
        • 1970-01-01
        • 2011-04-25
        • 2012-02-12
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2013-05-31
        • 2016-03-10
        相关资源
        最近更新 更多