【问题标题】:Run 2 different apache servers on the same machine with different ports?在具有不同端口的同一台机器上运行 2 个不同的 apache 服务器?
【发布时间】:2022-01-02 21:51:16
【问题描述】:

我想知道是否可以有两个 apache 服务器并能够将其设置为两个不同的端口,例如:192.168.0.1:80 和 192.168.0.1:81。 如果可能,该怎么做? 有关信息,我在 ubuntu 服务器机器上。

【问题讨论】:

    标签: apache ubuntu-server


    【解决方案1】:

    是的,可以通过在 apache 中配置虚拟主机,类似这样...

        Listen 80
        Listen 81
        
    <VirtualHost *:80>
        DocumentRoot "/www/app1"
    
        # Other directives here
    </VirtualHost>
    
    <VirtualHost *:81>
        DocumentRoot "/www/app2"
    
        # Other directives here
    </VirtualHost>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2018-12-28
      • 1970-01-01
      • 2019-01-21
      • 1970-01-01
      • 1970-01-01
      • 2020-08-23
      • 2013-10-06
      相关资源
      最近更新 更多