# Syntax error after ap24-mod_rpaf2 update



## timypcr (Jun 1, 2018)

Anyone here use the Apache module mod_rpaf2 to pass the IP's from an nginx proxy so the back end apache server logs the correct IP of web site visitors? This has been working great for over two years; until I updated both Apache (apache 2.4.33 ) and ap24-mod_rpaf2 to version 0.8.4 After the update Apache no longer recognizes the RPAFenable directive causing the below error.

"AH00526: Syntax error on line 182 of /usr/local/etc/apache24/httpd.conf:
Invalid command 'RPAFenable', perhaps misspelled or defined by a module not included in the server configuration"

Here is the related configuration in httpd.conf I was using

```
#show real IP behind nginx
LoadModule rpaf_module        libexec/apache24/mod_rpaf.so
RPAFenable On
RPAFsethostname On
RPAFproxy_ips 192.168.14.210 192.168.14.211
RPAFheader X-Forwarded-For
```
Once I commented out the above lines and restart apache the error went away, but I would like to continue to use this module to log visitors IP's. 

Thanks,
Tim


----------



## ShelLuser (Jun 1, 2018)

I don't use the module but I might still be able to help find the cause of all this.

Does the module actually get loaded by Apache? By default Apache uses /var/log/httpd-error.log, if that's also used on your system; does it mention anything specific? That would be the first place to look into: the logfiles.

Also: how did you upgrade both software packages?  Using binary packages or through the ports collection?


----------



## timypcr (Jun 1, 2018)

ShelLuser,

Thanks for reaching out it's greatly appreciated! I used pkgng to update  all packages on the web servers in question (pkg update && pkg upgrade) These web servers run in jails, once  the site went down I restored it from archive and updated apache first, restarted, tested and it worked, once I applied the module update and restarted thats when the error occurred. The error I noted in my last post came from httpd-error.log.

"AH00526: Syntax error on line 182 of /usr/local/etc/apache24/httpd.conf:
Invalid command 'RPAFenable', perhaps misspelled or defined by a module not included in the server configuration"

This module is loaded by Apache and it seems that maybe the syntax has been deprecated or replaced with something else but I can't seem to find any documentation on this. Here is a link that covers the details for my configuration from start to finish which had been working for over two years until this update. https://goo.gl/eytYXq I'm all for using another method to log IP's as as a work around if it gets the job done.

Thanks again!
tim


----------



## anlashok (Jun 1, 2018)

Were you using 0.6.0 of mod_rpaf2 before? I don't use it personally, but looking at the example config in the commit they appear to have renamed RPAF[directive] to RPAF_[directive]

from freshports.org/www/mod_rpaf2/


> These upgrade notes are taken from /usr/ports/UPDATING
> 
> 2017-11-05 Affects: users of www/mod_rpaf2
> Author: brnrd@FreeBSD.org
> ...


----------



## timypcr (Jun 3, 2018)

anlashok,

Bingo! thanks so much I completely overlooked those changes. Based on the info you shared I changed my httpd.conf from this

```
#show real IP behind nginx
LoadModule rpaf_module        libexec/apache24/mod_rpaf.so
RPAFenable On
RPAFsethostname On
RPAFproxy_ips 192.168.14.210 192.168.14.211
RPAFheader X-Forwarded-For
```
to this

```
#show real IP behind nginx
LoadModule rpaf_module        libexec/apache24/mod_rpaf.so
RPAF_Enable On
RPAF_SetHostName On
RPAF_ProxyIPs 192.168.14.210 192.168.14.211
RPAF_Header X-Forwarded-For
```
restarted apache and  I'm happy to report no more errors and the module is working as expected. 
Thanks to everyone for the assistance
Tim


----------

