在一台服务器上配置多个Kohana应用程序
问题描述:
目前我正在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很新,所以这可能是一个非常基本的问题,对于我道歉。
答
创建一个虚拟主机就是答案
<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>