Installation and Configuration On Multisite Linux and Windows

I'm new to Yii and have downloaded the distribution. There are two blurbs in the docs that say that one should install Yii in a web directory, then a tip that says Yii can be installed in a non-web directory.

Now doing this would be poor decision for obvious reasons:

apache

apache/htdocs

apache/htdocs/domain1.com

apache/htdocs/domain1.com/yii

apache/htdocs/domain2.com

apache/htdocs/domain2.com/yii

apache/htdocs/domain3.com

apache/htdocs/domain3.com/yii

Since most of yii developers will be using Windows or Linux it would be nice if we had configuration examples considering the following:

  1. Install in a web directory under Linux

  2. Install in a web directory under Windows

  3. Install in a non-web directory under Linux

  4. Install in a non-web directory under Windows

I develop on Windows boxes but host on Linux boxes.

Ideally I want to know how to install Yii outside the webserver to protect my yii files on both Windows and Linux. I host multi sites on the same server so if this can be done with using only one copy of Yii to be used by all multisites that would also be ideal.

If anyone can show me how to do on both Linux and Windows this that would be great.

/yii

/apache/htdocs

/apache/htdocs/domain1.com

/apache/htdocs/domainI.com

/apache/htdocs/domainN.com

This is simple, you just nedd to put the yii framework wherever you want (an web directory OR a non-web directory), then, in each application you have change the index.php: