Mod_remoteip on Debian with ISPConfig

Anyone any experience getting this working with ISPConfig installed?
I have fowlled this (I only have apache 2.4 installed, no NGINX) https://support.cloudflare.com/hc/en-us/articles/360029696071-Restoring-original-visitor-IPs-Option-2-Installing-mod-remoteip-with-Apache

I can’t get this working, etc/apache2/sites-available/000-default.conf looks ike this
<VirtualHost *:80>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request’s Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
#ServerName www.example.com

ServerAdmin [email protected]
DocumentRoot /var/www/html
RemoteIPHeader CF-Connecting-IP
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel info ssl:warn

ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined

# For most configuration files from conf-available/, which are
# enabled or disabled at a global level, it is possible to
# include a line for only one particular virtual host. For example the
# following line enables the CGI configuration for this host only
# after it has been globally disabled with "a2disconf".
#Include conf-available/serve-cgi-bin.conf

vim: syntax=apache ts=4 sw=4 sts=4 sr noet

According to the guys at howtoforge the /etc/apache2/apache2.conf for ISPConfig is etc/apache2/sites-available/ispconfig.conf and it the top few lines look like this,

################################################

ISPConfig Logfile configuration for vlogger

################################################

SetEnvIf Request_URI “^/datalogstatus.php$” dontlog

LogFormat “%v %a %l %u %t “%r” %>s %O “%{Referer}i” “%{User-Agent}i”” combined_ispconfig
CustomLog “| /usr/local/ispconfig/server/scripts/vlogger -s access.log -t “%Y%m%d-access.log” /var/log/ispconfig/httpd” combined_ispconfig env=!dontlog

I changed the %h to %a, I have added the file /etc/apache2/conf-available/remoteip.conf
Rebooted the server and purged the Cloudflare cache, not working :slight_smile:
Any ideas?
Thanks

Edit as post closed,

Got it working :slight_smile:

The Cloudflare guide said add this /etc/apache2/conf-available/remoteip.conf

it shoud be /etc/apache2/conf-enabled/remoteip.conf

This is rather a question for StackExchange I am afraid.

If the Cloudflare addresses still show up you it is most likely not an issue with the logging but mod_remoteip won’t work properly. Check out https://httpd.apache.org/docs/2.4/mod/mod_remoteip.html

1 Like