Listening for both IPv6 and IPv4 in apache 2.2

apache-2.2ipv6

I'm using apache2.2

How to listen both Ipv6 and Ipv4?

or

only Ipv6 / only Ipv4

Best Answer

Apache supports multiple Listen options:

Listen 192.170.2.1:80
Listen 192.170.2.5:8000

IPv6 addresses must be surrounded in square brackets, as in the following example:

Listen [2001:db8::a00:20ff:fea7:ccea]:80