大多數人可能就知道 Apache 的基于名字的,不知道 Apache 還可以有基于 IP 的。前者的道理不言自明,多個域名(服務器)對應一個 IP 地址,配置方法為:
NameVirtualHost 111.22.33.44
ServerName
DocumentRoot /www/sample
ServerName
DocumentRoot /www/sample2
但是在有些 IP 地址充裕,但是機器資源緊張的環境下,我們可能要把多個域名解析到同一臺機器上,其配置方法為:
ServerName
DocumentRoot /groups/smallco/www
ServerName
DocumentRoot /groups/baygroup/www
這種方法下,要求機器配置多個 IP 地址。
(作者:徐永久)
延伸閱讀
文章來源于領測軟件測試網 http://www.kjueaiud.com/