Paper Lantern for cPanel accounts is being retired this year. Find out more »
cPanel & WHM Version 102 has been released, and brings a slew of great updates. Take a look at what is included, and then upgrade today!
This object is in archive! 

Add mod_remoteip as an EasyApache option when installing Apache 2.4

JamesOakley shared this idea 9 years ago
Open Discussion

It's not uncommon for someone to install a proxy, often a caching proxy such as Varnish or nginx, in front of Apache on a cPanel server. For the IP addresses to log correctly, a reverse proxy module is needed in Apache.

For Apache 2.2, mod_rpaf could be installed, and then enabled in the global include file.

With Apache 2.4, the recommended way to do this is instead to use mod_remoteip. This, however, is part of Apache itself, so needs to be compiled with Apache rather than added later.

For this reason, it would be really useful is mod_remoteip could be one of the optional modules available when Apache 2.4 is being installed.

Best Answer
photo

Hey James,


Thanks for submitting this request. Have you had any success running mod_remoteip as a custom opt mod in Apache 2.4? Here's our custom module documentation in case you'd like to try this in a test environment. If you already have it up and running please let us know how it's going.


Hearing your results would be fantastic.

Replies (4)

photo
1

Sounds wise, it is appreciated...

What do you think cPanel? When can we get it there?

photo
1

Hey James,


Thanks for submitting this request. Have you had any success running mod_remoteip as a custom opt mod in Apache 2.4? Here's our custom module documentation in case you'd like to try this in a test environment. If you already have it up and running please let us know how it's going.


Hearing your results would be fantastic.

photo
1

Hi Scott


Thanks for stepping in.


I'd forgotten I'd got this as a Feature Request, tbh. I think it was Laurence helped by turning the mod_remoteip module into a custom module for Easy Apache.


It all works exactly as it should, and I've used it on quite a few servers since then.


The only thing that doesn't quite work out of the box, and that I've had to document in my server-build notes, is that the default Log Format in the generated httpd.conf still logs the server's IP rather than the true remote IP. I've documented that I need to find 5 instances of the LogFormat directive in httpd.conf, and replace the %h with %a, then run the distiller.


It has always seemed to me that, given EasyApache generates httpd.conf based on the options and settings, this is a change that could be made by EasyApache whenever mod_remoteip is included in the build.

photo
1

Hey James,


That's fantastic information. Exactly the kind of thing we need to be aware of if this is turned into an EasyApache module. Thanks as well for providing your solution to the IP issue in the log.


We'll keep our eye on this Feature Request to see where it goes. Thanks again!

Leave a Comment
 
Attach a file