问题
I have a VPS that's barely being used. I would love to point several domains I have (through a registrar somewhere else) to different folders of this VPS. Is there any way to do this?
For example:
helloomgwtf.com -> 111.111.111.111/hello
hitherehowareyou.com -> 111.111.111.111/hithere
thirdrandomdomain.com -> 111.111.111.111/random
I'm entirely new to setting stuff up, so detailed explanations would really be appreciated.
Thanks!
回答1:
You are looking for Virtual Hosts.
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 has pretty good info on this here.
来源:https://stackoverflow.com/questions/20228872/how-can-i-point-multiple-domains-to-one-server