Page 1 of 1

How to enable remoteip Apache module in MAMP Pro

Posted: Tue Aug 01, 2023 11:01 am
by mampsupportmod
For services like Cloudflare, you may want to see actual IP addresses of clients hitting your sites in your Apache access logs (not cloudflare proxy IP's.) To do this, you need to enable remoteip Apache module and confgiure the trusted proxy addresses.


Per Apache:
This module is used to treat the useragent which initiated the request as the originating useragent as identified by httpd for the purposes of authorization and logging, even where that useragent is behind a load balancer, front end server, or proxy server.


1. In MAMP Pro, enable remoteip_module in Apache.

Mamp Pro Remote Ip Apache
Mamp Pro Remote Ip Apache (89.9 KiB) Viewed 28940 times

2. Open httpd.conf template.

Mamp Pro Apache Httpd Conf
Mamp Pro Apache Httpd Conf (101.77 KiB) Viewed 28940 times

3. Update your LogFormat log replacing %h with %a. (this will show client IP address of the request in log files) Example:

Code: Select all

LogFormat "%a %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined


4. Configure your trust proxy addresses accordingly.

Code: Select all

RemoteIPHeader CF-Connecting-IP
RemoteIPTrustedProxy 192.0.2.1 (example IP address)
RemoteIPTrustedProxy 192.0.2.2 (example IP address)

Mamp Pro Apache Trusted Ip Proxy Address
Mamp Pro Apache Trusted Ip Proxy Address (133.05 KiB) Viewed 28940 times

5. Restart MAMP Pro (Apache).