如何在Zend Server上创建VirtualHost?

| 我正在使用zend服务器,并将一个VirtualHost添加到了extra / httpd-vhosts.conf文件中,并从httpd.conf文件中删除了#。 这是我添加到extra / httpd-vhosts.conf文件中的内容:
NameVirtualHost *:80

<VirtualHost *:80>
    ServerName quickstart.local
    DocumentRoot D:/quickstart/Code


    <Directory D:/quickstart/Code>
        DirectoryIndex index.php
        AllowOverride All
        Order allow,deny
        Allow from all
    </Directory>
</VirtualHost>
当我访问quickstart.local时,它可以正常工作,但是也会影响localhost(即当我尝试加载http:// localhost /时,我看到的是与http://quickstart.local/相同的站点。 我该如何解决这个问题?我希望localhost(我将其用于另一个项目)和quickstart.local都分开。     
已邀请:
        我也有同样的问题。尝试将主机添加到zend.conf或 加
Include conf/extra/httpd-vhosts.conf                   
到htppd.conf     
        您可以通过将指令添加到新文件中来添加新的虚拟主机:
/path/to/zend/etc/sites.d/vhost_[my-site].conf
将ѭ3替换为所需的任意字符(无空格)。 然后,请确保您重新启动apache:
sudo /path/to/zend/bin/apachectl restart
    
        尝试添加自己的网站时,我遇到了类似的问题。我的解决方案是在vhosts文件中评论两个vhost示例,还取消注释或添加
127.0.0.1 localhost 
进入%windir%/ system32 / drivers / etc文件夹中的主机文件 ...当然,如果您需要取消注释vhost_alias模块并包括httpd-vhosts文件。     
           [文件路径] \\ xampp \\ apache \\ conf \\ extra \\ httpd-vhosts.conf或(如果您是   使用Apache 2.4或更高版本:
<VirtualHost *:80>
     ServerName dev.zendapp
     DocumentRoot \"G:/xampp/htdocs/io2018/zend2018/zendApps\"
     SetEnv APPLICATION_ENV \"development\"
     <Directory \"G:/xampp/htdocs/io2018/zend2018/zendApps\">
         DirectoryIndex index.php
         AllowOverride All
         Require all granted
     </Directory>
 </VirtualHost>
  更改后。 C:\\ Windows \\ System32 \\ drivers \\ etc \\ hosts
127.0.0.1       dev.zendapp
  重新启动您的xampp服务器     

要回复问题请先登录注册