two project directory in ssame server, apache. how can i differentiate
now the situation is like am trying to view the www开发者_如何学Go.b.com
it is going to document root of a.com
how can i change it as both a and b should work.? can i use alias.?
like checking id there is bb in request go to document root of bb or else go to document root of aa.
What can i do to achieve this?
You need to run Apache with 2 VirtualHost
elements - one for a.com and one for b.com.
Each can point to it's own DocumentRoot
The config will be something like
<VirtualHost 127.0.0.1>
DocumentRoot "C:\My Sites\Site1"
ServerName a.com
</VirtualHost>
<VirtualHost 127.0.0.1>
DocumentRoot "C:\My Sites\Site2"
ServerName b.com
</VirtualHost>
Read more at http://apptools.com/phptools/virtualhost.php and http://httpd.apache.org/docs/2.0/mod/core.html#virtualhost
精彩评论