简体   繁体   中英

IP and Domain Based Virtual Hosts

My VPS is giving me 16 IP v6 addresses, and I want to host 16 domains and I want them in such a way that each domain has its own unique ipv6 address.

If I wanted to do this, how would I proceed ? A lot of research tells me that I should use Virtual Hosts, is this how it is to be done ? Should I use a simple panel like webmin instead ?

If you're using Apache, it's pretty straightforward. Follow the instructions at http://httpd.apache.org/docs/2.2/vhosts/ip-based.html using ipv6 notation (ipv6 address in square brackets) instead of naked ipv4 addresses. Make sure to have a Listen directive for each of the 16 addresses, and a VirtualHost section for each as well.

eg:

Listen [2001:0db8:100::1]:80

<VirtualHost [2001:0db8:100::1]:80>
    ServerName www.example.com
    ...more config here...
</VirtualHost>

Or you could map your IPV6 addresses to domain names in DNS

[2001:0db8:100::1 -> Domain1 [2001:0db8:100::2 -> Domain2

And use Name Based Virtual Hosts in Apache which makes accessing the application via browsers more readable: http://httpd.apache.org/docs/2.2/vhosts/name-based.html

<VirtualHost *:80>
ServerName www.domain1.com
DocumentRoot /www/domain1
</VirtualHost>

<VirtualHost *:80>
 ServerName www.domain2.com
 DocumentRoot /www/domain2
</VirtualHost>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM