2013-11-26 101 views
2

我有幾乎沒有使用的VPS。我很樂意將我擁有的幾個域(通過別處的註冊服務商)指向此VPS的不同文件夾。有沒有辦法做到這一點?如何將多個域指向一臺服務器?

For example: 

helloomgwtf.com -> 111.111.111.111/hello 
hitherehowareyou.com -> 111.111.111.111/hithere 
thirdrandomdomain.com -> 111.111.111.111/random 

我完全新的東西設置了,所以詳細的說明會真的理解。

謝謝!

回答

4

您正在尋找虛擬主機。

NameVirtualHost *:80 
<VirtualHost *:80> 
    ServerName helloomgwtf.com 
    DocumentRoot /var/www/vhosts/hello 
</VirtualHost> 

<VirtualHost *:80> 
    ServerName hitherehowareyou.com 
    DocumentRoot /var/www/vhosts/hithere 
</VirtualHost> 

<VirtualHost *:80> 
    ServerName thirdrandomdomain.com 
    DocumentRoot /var/www/vhosts/random 
</VirtualHost> 

Rackspace在這個here上有相當不錯的信息。

+0

謝謝!我會研究這個。 – FinalJon

相關問題