虚拟主机文件未重定向到正确的目录

时间:2014-07-06 10:37:46

标签: php apache zend-framework2 virtualhost virtual-hosts

我正在尝试将我的虚拟主机设置为在地址栏中输入//zf2-tutorial.localhost/时指向目录:

我的/etc/apache2/sites-available/zf2-tutorial.localhost文件

<VirtualHost *:80>
         ServerName zf2-tutorial.localhost
         DocumentRoot /var/www/zf2-tutorial/public
         SetEnv APPLICATION_ENV "development"
         <Directory /var/www/zf2-tutorial/public>
                 DirectoryIndex index.php
                 AllowOverride All 
                 Order allow,deny
                 Allow from all
         </Directory>
</VirtualHost>

我的/etc/hosts file

127.0.0.1       zf2-tutorial.localhost localhost
127.0.1.1       martyn-Lenovo-B590

# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

..但不起作用。仅显示根目录文件(/ var / www,因为我只输入// localhost /)。

当我去// localhost / zf2-tutorial / public /我可以看到我的网站时,我希望它成为//zf2-tutorial.localhost/的根源。

有什么建议吗?

0 个答案:

没有答案
相关问题