【问题标题】:How to Configure multiple sites locally?如何在本地配置多个站点?
【发布时间】:2014-01-01 21:34:37
【问题描述】:

我已经在我的机器上本地设置了 wamp,但我想在需要时在本地查看多个站点。

到目前为止,我已经在hosts文件中输入了以下代码

# localhost name resolution is handled within DNS itself.
#   127.0.0.1       localhost
#   ::1             localhost


127.0.0.1   mysitesname

如何同时拥有多个网站?这可能吗?

【问题讨论】:

    标签: localhost wamp local


    【解决方案1】:

    例如配置name based virtual hosting

    # Only needed once.
    NameVirtualHost *:80
    
    # One section for each virtual host. Must
    # match the "NameVirtualHost" directive.
    <VirtualHost *:80>
        # The FQDN of the host.
        ServerName mysitesname
    
        # The file system path to the directory with
        # the files to serve by this virtual host.
        DocumentRoot /www/mysitesname
    </VirtualHost>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-03-17
      • 2021-12-03
      • 1970-01-01
      • 1970-01-01
      • 2013-10-23
      • 1970-01-01
      • 2022-10-24
      • 2014-12-27
      相关资源
      最近更新 更多