Vhosts无法正常工作

时间:2014-05-15 19:50:56

标签: apache .htaccess vhosts

我有以下vhosts设置:

<VirtualHost *:80>
    ServerAdmin admin@localhost.com
    DocumentRoot "C:\Apache24\htdocs"
    ServerName localhost
</VirtualHost>

<VirtualHost cake-photos.com:80>
    ServerAdmin admin@localhost.com
    DocumentRoot "C:\Apache24\htdocs\cake-photos"
    ServerName cake-photos.com
    ServerAlias *.cake-photos.com
    <Directory "C:\Apache24\htdocs\cake-photos">
    Options Indexes FollowSymLinks
    AllowOverride all
Require ip 127.0.0.1
    </Directory>
</VirtualHost>

<VirtualHost fangwear.co.uk:80>
    ServerAdmin admin@localhost.com
    DocumentRoot "C:\Apache24\htdocs\Fangwear 2014"
    ServerName fangwear.co.uk
    ServerAlias www.fangwear.co.uk
    <Directory "C:\Apache24\htdocs\Fangwear 2014">
    Options Indexes FollowSymLinks
    AllowOverride all
     #   Require all granted
Require ip 127.0.0.1
    </Directory>
</VirtualHost>

<VirtualHost manager.com:80>
    ServerAdmin admin@localhost.com
    DocumentRoot "C:\Apache24\htdocs\Manager 2014"
    ServerName manager.com
    ServerAlias www.manager.com
    <Directory "C:\Apache24\htdocs\Manager 2014">
    Options Indexes FollowSymLinks
    AllowOverride all
    #    Require all granted
Require ip 127.0.0.1
    </Directory>
</VirtualHost>

似乎没有任何工作,如果我尝试去其中任何一个,我最终被重定向到cake-photos.com vhost。

我需要能够处理其他事情,例如localhost/phpmyadmin,但不能使用此配置。

我哪里错了?

1 个答案:

答案 0 :(得分:1)

您是否设置了主机文件?在Unix系统/ etc / hosts上?你重启了服务器吗?