2014-05-15 258 views
1

我有以下的虛擬主機設置:虛擬主機不工作

<VirtualHost *:80> 
    ServerAdmin [email protected] 
    DocumentRoot "C:\Apache24\htdocs" 
    ServerName localhost 
</VirtualHost> 

<VirtualHost cake-photos.com:80> 
    ServerAdmin [email protected] 
    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 [email protected] 
    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 [email protected] 
    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虛擬主機。

我需要能夠去其他的東西,如localhost/phpmyadmin但這不適用於此配置。

我哪裏錯了?

回答

1

您是否設置了主機文件?在Unix系統/ etc/hosts上?你有沒有重新啓動你的服務器?

+0

是:127.0.0.1本地主機 127.0.0.1 \t fangwear.co.uk 127.0.0.1 \t cake-photos.com 127.0.0.1 \t es.cake-photos.com 127.0.0.1 \t fr.cake- photos.com 127.0.0.1 \t de.cake-photos.com 127.0.0.1 \t pt.cake-photos.com 127.0.0.1 \t zh.cake-photos.com 127.0.0.1 \t ru.cake的照片。 com 127.0.0.1 \t my.cake-photos.com 127.0.0.1 \t bd.cake-photos.com 127.0.0.1 \t in.cake-photos.com 127.0.0.1 \t ae.cake-photos.com 127.0.0.1 \t manager.com – imperium2335

+0

我睜開的httpd-vhosts.conf文件和我的條目是這樣的:< VirtualHost 127.0.0.1>只有我的IP,並在ServerName是實際名稱 – iCaramba

+0

感謝,似乎已經修復它! – imperium2335