-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Hi, I have a CentOS 6 box with a single IPv6 and a /64 IPv6
I would like to have on the same box a name-based virtual host of Apache with IPv4 and an IP-based virtual host with IPv6.
The only solution I have found so far is to run two instances of Apache, one on IPv4 and the other on IPv6.
In your opinion, are there other solutions to this problem?
Thanks.
Ciao, luigi
- -- / +--[Luigi Rosa]-- \
If you stick your head in the sand, one thing is for sure, you're gonna get your rear kicked.
On 10/14/2012 01:08 AM, Luigi Rosa wrote:
I would like to have on the same box a name-based virtual host of Apache with IPv4 and an IP-based virtual host with IPv6.
Does that not work? As far as I know, enabling named virtual hosts just allows you to have multiple virtual hosts with the same address and port specified, with the configuration chosen based on the request's Host: header. Additionally, it only affects the address and port given in the NameVirtualHost directive. Enabling it shouldn't stop you from defining multiple hosts with unique addresses and ports.
On 14/10/2012 10:08, Luigi Rosa wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Hi, I have a CentOS 6 box with a single IPv6 and a /64 IPv6
I would like to have on the same box a name-based virtual host of Apache with IPv4 and an IP-based virtual host with IPv6.
The only solution I have found so far is to run two instances of Apache, one on IPv4 and the other on IPv6.
In your opinion, are there other solutions to this problem?
Thanks.
Ciao, luigi
/ +--[Luigi Rosa]-- \
If you stick your head in the sand, one thing is for sure, you're gonna get your rear kicked. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://www.enigmail.net/
iEYEARECAAYFAlB6cvoACgkQ3kWu7Tfl6ZS57QCbBMVp2TELaOuinaXFQk9hlAxO lyoAnjy7+ztuXcG4kShXatuO16DsG7nS =FLer -----END PGP SIGNATURE----- _______________________________________________ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Luigi,
Try something like this:
NameVirtualHost *:80
<VirtualHost *:80> DocumentRoot /web/content/ipall.domain.com/html <Directory "/web/content/ipall.domain.com/html/"> </Directory> </VirtualHost>
<VirtualHost [2a00:1450:4013:c00::65]:80> DocumentRoot /web/content/ipv6.domain.com/html <Directory "/web/content/ipv6.domain.com/html/"> </Directory> </VirtualHost>
<VirtualHost 72.232.194.162:80> DocumentRoot /web/content/ipv4.domain.com/html <Directory "/web/content/ipv4.domain.com/html/"> </Directory> </VirtualHost>
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Maarten Elsen said the following on 15/10/12 22:10:
Try something like this:
NameVirtualHost *:80
<VirtualHost *:80> DocumentRoot /web/content/ipall.domain.com/html <Directory "/web/content/ipall.domain.com/html/"> </Directory>
</VirtualHost>
<VirtualHost [2a00:1450:4013:c00::65]:80> DocumentRoot /web/content/ipv6.domain.com/html <Directory "/web/content/ipv6.domain.com/html/"> </Directory> </VirtualHost>
It does not work that way because for mixed mode you cannot use '*' in NameVirtualHost directive
I found the solution on http://httpd.apache.org/docs/2.2/vhosts/examples.html#mixed
You should do this:
Listen 80 NameVirtualHost 1.2.3.4
Then every name-based virtual host should be declared like this:
<VirtualHost 1.2.3.4:80>
And every IPv6 IP-based virtual host should be declared like this:
<VirtualHost [2001:db8::beef]:80>
This solution is working 'live' right now on a CentOS 6 server.
Ciao, luigi
- -- / +--[Luigi Rosa]-- \
Mollari... understand... that I can never forgive your people for what they did to my world. My people can never forgive your people. But I... can forgive... you. --G'Kar, "The fall of Centauri Prime"