0

I'm trying to only allow the localhost on a certain folder, it works perfect with ipv4 (Allow from 127.0.0.1) but as soon as I add ipv6 (Allow from [::1]) my Apache won't start anymore.

I checked the error.log and it says:

The specified IP address is invalid.

I already typed the ipv6 address without the compressed format, didn't work either.

I'm using Apache 2.2.25, Windows 8.1. IPv6 is enabled on my computer.

  • 1
    Which OS (and Linux distribution), is Apache compiled from source or installed with a package manager, does your machine have ipv6 fully configured, etc. Unless you add more detail, I suspect this question will be at risk of being closed. – EightBitTony May 19 '15 at 09:31

2 Answers2

2

The notation where you surround the IPv6 address with brackets is only used in cases where there might be confusion between the address and an optional port number.

One example is in the Listen directive. Because it can specify both an address and a port the brackets have to be added to avoid confusion: Listen 2001:db8::1:8080 is invalid because it could both mean Listen [2001:db8::1]:8080 and Listen [2001:db8::1:8080]. The brackets make it explicit.

For the Allow from directive this is not the case. When specifying an address it is always an address without a port number. Therefore Allow from 2001:db8::1:8080 is never ambiguous. It is always IPv6 address 2001:db8::1:8080.

If you leave out the brackets (Allow from ::1) it should work.

Sander Steffann
  • 7,572
  • 18
  • 29
  • Hmm I didn't know that about the brackets. But I tried it again and it still won't work. let me just give you the code i'm trying to get to work Options FollowSymLinks Includes DirectoryIndex index.html AllowOverride None Order Deny,Allow Allow from 127.0.0.1 Allow from ::1 – ahsokatano May 19 '15 at 10:27
0

Your virtualhost hev to be defined like this <VirtualHost *:80>which is allowing access for both ipv4 and ipv6.

Also, Apache documentation uses this format for ipv6 restriction : Allow from 2001:db8::a00:20ff:fea7:ccea Apache doc

lazzio
  • 306
  • 1
  • 2
  • 11