AFP548 Changing the world one server at a time.

Allowing ipranges in .htaccess file

Home › Forums › OS X Server and Client Discussion › Web › Allowing ipranges in .htaccess file

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #362827
    beleth
    Participant

    First what I´m trying to do …

    OS: OS X Server 10.3.9 and 10.4.1

    Allow the IP-Ranges 192.168.XXX.XXX to access some intranet pages without the need to auth as user

    &

    Force all other visitors (ips) to auth with user / pwd

    —
    htaccess file is set up correctly ..(functional under linux / freebsd) – Allow override is set to all

    Auth with pwd is working too,
    but there seems to be no way to allow / deny ip ranges …

    found this

    http://defindit.com/readme_files/apple_osx_apache.html

    could someone confirm this bug or give me a hint /workaround ?

    #365801
    Anonymous
    Guest

    I’ve been pulling my hair out with this same problem.
    I seemed to have solved it though. After searching a few boards for answers, here’s what I’ve found:

    1. Normal Apache Allow directives don’t work. Due to the port swap REMOTE_ADDR always has the ip address of the server instead of the ip address of the user. The server returning the ip is the proxy server.

    2. Turn off the performance cache in Server Admin -> Web -> Settings -> Sites -> Options

    This acts as a proxy server in front of Apache to improve performance of certain files. However, one side effect is that Apache sees the IP address of the proxy server not the IP address of the user.

    Performance cache or remote IP addresses. Pick one. You can’t have both 🙂

    In most cases, turning off the performance cache is what most people opt for. The performance gains are usually modest.

    3. If you are hosting multiple sites, go to Server Admin and turn off performance caching on ALL of them. Turns out that if any sites are set to use it, then they all will!

    Solved for me. Now I restrict access to a couple of directories to only on campus clients (UCSC). No one off campus can access.

    Hope this helps

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.