2009年4月18日 星期六

Apache , virtualhost

Host websites on your local machine using Apache websever
配置 Apache 支援多個網域
VirtualHost Directive
Using Name-based Virtual Hosts
NameVirtualHost Directive
這邊設定主要是針對apache2

Configuration details
Let us assume for the sake of this tutorial that I have decided to host two websites on my local machine. All the files related to the two websites have already been created and saved in two separate directories by name websiteA and websiteB . The default location for serving the files in apache is usually in the /var/www location. So I move the two directories websiteA and websiteB to this location.

然後把原本/etc/apache2/sites-available/ 下的default 複製一份改名叫 websiteA
然後把NameVirtualHost, ServerName, DocumentRoot 等改成想要的名字


然後在site-enabled建立softlink


重起server 就行了

沒有留言: