<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>access.log Archives - Tech Antidote</title>
	<atom:link href="https://techantidote.com/tag/access-log/feed/" rel="self" type="application/rss+xml" />
	<link></link>
	<description>‎ &#124; LINUX &#124; Tech &#124; Security &#124;</description>
	<lastBuildDate>Wed, 10 Jul 2024 23:01:09 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.1.3</generator>

<image>
	<url>https://techantidote.com/wp-content/uploads/2016/02/cropped-google-plus-profile-picture-32x32.png</url>
	<title>access.log Archives - Tech Antidote</title>
	<link></link>
	<width>32</width>
	<height>32</height>
</image> 
<site xmlns="com-wordpress:feed-additions:1">106369530</site>	<item>
		<title>Configure apache to log the real client IP instead of cloudflare IP in http access logs (WordPress)</title>
		<link>https://techantidote.com/configure-apache-to-log-the-real-client-ip-instead-of-cloudflare-ip-in-http-access-logs-wordpress/</link>
					<comments>https://techantidote.com/configure-apache-to-log-the-real-client-ip-instead-of-cloudflare-ip-in-http-access-logs-wordpress/#respond</comments>
		
		<dc:creator><![CDATA[]]></dc:creator>
		<pubDate>Wed, 10 Jul 2024 23:01:07 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Random]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[access.log]]></category>
		<category><![CDATA[apache2]]></category>
		<category><![CDATA[cloudflare]]></category>
		<category><![CDATA[mod_cloudflare]]></category>
		<category><![CDATA[real client ip]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[X-Forwarded-For]]></category>
		<guid isPermaLink="false">https://techantidote.com/?p=3798</guid>

					<description><![CDATA[<p>If you are running a WordPress site and you have cloudflare setup, you may have noticed that the http access logs log the IP of cloudflare instead of the actual client IP. This is a guide to enable logging of the real client IP instead of the cloudflare IP in the apache2 logs. This was &#8230; <a href="https://techantidote.com/configure-apache-to-log-the-real-client-ip-instead-of-cloudflare-ip-in-http-access-logs-wordpress/" class="more-link">Continue reading <span class="screen-reader-text">Configure apache to log the real client IP instead of cloudflare IP in http access logs (WordPress)</span> <span class="meta-nav">&#8594;</span></a></p>
<p>The post <a href="https://techantidote.com/configure-apache-to-log-the-real-client-ip-instead-of-cloudflare-ip-in-http-access-logs-wordpress/">Configure apache to log the real client IP instead of cloudflare IP in http access logs (WordPress)</a> appeared first on <a href="https://techantidote.com">Tech Antidote</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">If you are running a WordPress site and you have cloudflare setup, you may have noticed that the http access logs log the IP of cloudflare instead of the actual client IP. This is a guide to enable logging of the real client IP instead of the cloudflare IP in the apache2 logs. This was tested on a Ubuntu 20.04 machine + apache2  and traffic is proxied from cloudflare. </p>



<p class="wp-block-paragraph">&#8211; <strong>Install Prerequisites:</strong></p>



<pre class="wp-block-preformatted">sudo apt-get install apache2-dev libtool git</pre>



<p class="wp-block-paragraph">Git clone the <strong>mod_clouflare</strong> repo from cloulflare:</p>



<pre class="wp-block-preformatted">cd ~/<br>git clone https://github.com/cloudflare/mod_cloudflare.git<br>cd mod_cloudflare</pre>



<p class="wp-block-paragraph">Use the Apache extension tool to convert the .c file into a module:</p>



<pre class="wp-block-preformatted">apxs -a -i -c mod_cloudflare.c</pre>



<p class="wp-block-paragraph"><strong>Restart Apache:</strong></p>



<pre class="wp-block-preformatted">sudo apachectl restart</pre>



<p class="wp-block-paragraph">Verify that the module is active:</p>



<pre class="wp-block-preformatted">apache2ctl -M|grep cloudflare</pre>



<p class="wp-block-paragraph">The output should show &#8220;<span style="color: #0000ff;"><strong>cloudflare_module (shared)</strong></span>&#8220;</p>



<p class="wp-block-paragraph">Now your apache logs should show the real client IP instead of the cloudflare IPs.</p>



<pre class="wp-block-preformatted">tail -f /var/log/apache2/access.log</pre>



<p class="wp-block-paragraph">-Below is screenshot of access log that shows the real client IP(right click and open image in new lab for high res image):</p>



<figure class="wp-block-image"><img fetchpriority="high" decoding="async" width="1892" height="80" data-attachment-id="3802" data-permalink="https://techantidote.com/configure-apache-to-log-the-real-client-ip-instead-of-cloudflare-ip-in-http-access-logs-wordpress/access-logs/" data-orig-file="https://techantidote.com/wp-content/uploads/2024/07/access-logs.png" data-orig-size="1892,80" data-comments-opened="1" data-image-title="access-logs" data-image-description="" data-image-caption="" data-large-file="https://techantidote.com/wp-content/uploads/2024/07/access-logs-1024x43.png" src="https://techantidote.com/wp-content/uploads/2024/07/access-logs.png" alt="access.log screenshot" class="wp-image-3802" srcset="https://techantidote.com/wp-content/uploads/2024/07/access-logs.png 1892w, https://techantidote.com/wp-content/uploads/2024/07/access-logs-300x13.png 300w, https://techantidote.com/wp-content/uploads/2024/07/access-logs-1024x43.png 1024w, https://techantidote.com/wp-content/uploads/2024/07/access-logs-768x32.png 768w, https://techantidote.com/wp-content/uploads/2024/07/access-logs-1536x65.png 1536w" sizes="(max-width: 1892px) 100vw, 1892px" /></figure>



<p class="wp-block-paragraph"><strong>Sources/Credits/References:</strong></p>



<p class="wp-block-paragraph"><a href="https://developers.cloudflare.com/support/troubleshooting/restoring-visitor-ips/restoring-original-visitor-ips/">Cloudflare</a><br><a href="https://www.youtube.com/watch?v=70v8zfQpu_I">Noirth Security</a></p>
<p>The post <a href="https://techantidote.com/configure-apache-to-log-the-real-client-ip-instead-of-cloudflare-ip-in-http-access-logs-wordpress/">Configure apache to log the real client IP instead of cloudflare IP in http access logs (WordPress)</a> appeared first on <a href="https://techantidote.com">Tech Antidote</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://techantidote.com/configure-apache-to-log-the-real-client-ip-instead-of-cloudflare-ip-in-http-access-logs-wordpress/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">3798</post-id>	</item>
	</channel>
</rss>

<!--
Performance optimized by W3 Total Cache. Learn more: https://www.boldgrid.com/w3-total-cache/?utm_source=w3tc&utm_medium=footer_comment&utm_campaign=free_plugin

Page Caching using Disk: Enhanced 
Minified using Disk

Served from: techantidote.com @ 2026-10-25 07:27:05 by W3 Total Cache
-->