2014-02-20 192 views
0

目前我正在Windows機器上使用wamp,併爲一個站點啓動並運行khana。我想部署另一個完全獨立的站點,並使用kohana的不同副本。要做到這一點,我添加的文件結構和部署的Kohana如下在一臺服務器上配置多個Kohana應用程序

+wamp 
++www 
+++site1 
++++kohana 
+++site2 
++++kohana 

目前我的Apache的httpd.conf監聽器是如下

Listen 0.0.0.0:80 

而我的主人在目錄設置爲

Windows文件
127.0.0.1  localhost 
127.0.0.1 site1.localhost 
127.0.0.1 site2.localhost 

當我到本地主機時,它會去site1.localhost。或者,如果我去site1.localhost它將轉到站點1.如果我去site2.localhost應用程序將重定向到site1.localhost

我對LAMP很新,所以這可能是一個非常基本的問題,對於我道歉。

回答

0

創建一個虛擬主機就是答案

<VirtualHost site1.localhost> 
    ServerAdmin [email protected] 
    ServerName site1 

    DocumentRoot "C:/wamp/www/site1" 

    <Directory "C:/wamp/www/site1"> 
    Options Indexes FollowSymLinks 
    AllowOverride All 
    Require all granted 
    </Directory> 


    ErrorLog "logs/site1-error.log" 
    CustomLog "logs/site1-access.log" common 
</VirtualHost> 

<VirtualHost site2.localhost> 
    ServerAdmin [email protected] 
    ServerName site2 

    DocumentRoot "C:/wamp/www/site2" 

    <Directory "C:/wamp/www/site2"> 
    Options Indexes FollowSymLinks 
    AllowOverride All 
    Require all granted 
    </Directory> 


    ErrorLog "logs/site2-error.log" 
    CustomLog "logs/site2-access.log" common 
</VirtualHost> 
相關問題