{"id":4899,"date":"2012-12-20T08:01:32","date_gmt":"2012-12-20T13:01:32","guid":{"rendered":"http:\/\/g33kinfo.com\/info\/?p=4899"},"modified":"2012-12-20T08:01:32","modified_gmt":"2012-12-20T13:01:32","slug":"mod_cloudflare-and-mod_cloudflare-cpan","status":"publish","type":"post","link":"https:\/\/g33kinfo.com\/info\/mod_cloudflare-and-mod_cloudflare-cpan\/","title":{"rendered":"mod_cloudflare and mod_cloudflare cpan"},"content":{"rendered":"<p><strong>mod_cloudflare<\/strong><\/p>\n<p>When using Cloudflare, in order to retrieve the actual visitors IP that connect to your server, you must install mod_cloudflare. Normally when using Cloudflare, all of the IP&#8217;s that connect to your web server will come from a Cloudflare IP address. mod_cloudflare is an Apache module that forces Apache to log actual visitor IP addresses instead of cloudflare server IP&#8217;s. It can be installed on servers running cPanel, using the following commands:<\/p>\n<p><code>cd \/usr\/local\/src<br \/>\nwget --no-check-certificate http:\/\/github.com\/cloudflare\/CloudFlare-Tools\/raw\/master\/mod_cloudflare.c<br \/>\napxs -a -i -c mod_cloudflare.c<br \/>\nservice httpd restart<br \/>\n\/usr\/local\/cpanel\/bin\/apache_conf_distiller --update<\/code><\/p>\n<p><!--more--><\/p>\n<p>More info can be found here for this particular issue of showing real IP&#8217;s instead of Cloudflare IP&#8217;s<br \/>\n<a href=\"http:\/\/www.cloudflare.com\/wiki\/Log_Files\" title=\"http:\/\/www.cloudflare.com\/wiki\/Log_Files\" target=\"_blank\" rel=\"noopener noreferrer\">http:\/\/www.cloudflare.com\/wiki\/Log_Files<\/a><\/p>\n<p>Also the following information link may be of assistance when addressing this issue when using Nginx and Varnish:<br \/>\n<a href=\"http:\/\/danielmiessler.com\/blog\/getting-real-ip-addresses-using-cloudflare-nginx-and-varnish\" title=\"http:\/\/danielmiessler.com\/blog\/getting-real-ip-addresses-using-cloudflare-nginx-and-varnish\" target=\"_blank\" rel=\"noopener noreferrer\">http:\/\/danielmiessler.com\/blog\/getting-real-ip-addresses-using-cloudflare-nginx-and-varnish<\/a><\/p>\n<p><strong>mod_cloudflare cpan<\/strong><\/p>\n<p>There is also a mod_cloudflare cpanel plugin now. It requires that the user have a valid cloudflare API key, but it works well for cpanel, and multi domain deployment.<\/p>\n<p>Install as follows:<br \/>\n<code>ssh root@SERVER IP ADDRESS or SERVER NAME<br \/>\ncd \/usr\/local\/cpanel<br \/>\ncurl -k -L https:\/\/github.com\/cloudflare\/CloudFlare-CPanel\/tarball\/master > cloudflare.tar.gz<br \/>\ntar -zxvf cloudflare.tar.gz<\/code><br \/>\n&nbsp;<\/p>\n<p><code>cd cloudflare-CloudFlare-CPanel-UNIQUE ID\/cloudflare\/ <\/code><br \/>\n***Note, the UNIQUE ID is the name of the extracted folder. eg below:<br \/>\nThis extracts a directory that includes a UNIQUE ID. For example, the directory will be in this format:<br \/>\n<code>cloudflare-CloudFlare-CPanel-d03f3b8<br \/>\nThe UNIQUE ID is only: d03f3b8<br \/>\nThe UNIQUE ID is not cloudflare-CloudFlare-CPanel-d03f3b8<\/code><br \/>\n&nbsp;<\/p>\n<p>Here is where the API and the user come in handy<br \/>\n<code>.\/install_cf API HOST KEY mod_cf \u201cYOUR COMPANY NAME\u201d<br \/>\n(example for Awesome Hosting Company: .\/install_cf 56yt8x9s987dfy4324bnv mod_cf \u201cAwesome Hosting\u201d)<\/code><br \/>\n&nbsp;<br \/>\nTest with: cat etc\/cloudflare.json<br \/>\nYou should see output like:<br \/>\n<code>root@server1 [\/usr\/local\/cpanel]# cat etc\/cloudflare.json<br \/>\n{<br \/>\n\u201chost_key\u201d:\u201d32yt5a7b436tuy8974tre -\u201d, (For security purposes, this will not be your host key.)<br \/>\n\u201chost_formal_name\u201d:\u201dAwesome Hosting\u201d,<br \/>\n\u201chost_name\u201d:\u201dapi.cloudflare.com\u201d,<br \/>\n\u201chost_uri\u201d:\u201d\/host-\u00adgw.html\u201d,<br \/>\n\u201cuser_name\u201d:\u201dwww.cloudflare.com\u201d,<br \/>\n\u201cuser_uri\u201d:\u201d\/api_json.html\u201d,<br \/>\n\u201chost_port\u201d:\u201d443\u201d,<br \/>\n\u201chost_prefix\u201d:\u201dcloudflare-\u00adresolve-\u00adto\u201d,<br \/>\n\u201ccp_version\u201d:\u201d1.3.0\u201d<br \/>\n}<\/code><br \/>\n&nbsp;<br \/>\nAlso, be sure to  add into apf or csf allow the proper IP ranges for Cloudflare, which can be found here: <a href=\"https:\/\/www.cloudflare.com\/ips\" title=\"https:\/\/www.cloudflare.com\/ips\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/www.cloudflare.com\/ips<\/a><\/p>\n<p>Enjoy!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>mod_cloudflare When using Cloudflare, in order to retrieve the actual visitors IP that connect to your server, you must install mod_cloudflare. Normally when using Cloudflare, all of the IP&#8217;s that connect to your web server will come from a Cloudflare IP address. mod_cloudflare is an Apache module that forces Apache to log actual visitor IP&#8230; <\/p>\n<div class=\"read-more navbutton\"><a href=\"https:\/\/g33kinfo.com\/info\/mod_cloudflare-and-mod_cloudflare-cpan\/\">Read More<i class=\"fa fa-angle-double-right\"><\/i><\/a><\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-4899","post","type-post","status-publish","format-standard","hentry","category-apache"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.0 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>mod_cloudflare and mod_cloudflare cpan - Linux Shtuff<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/g33kinfo.com\/info\/mod_cloudflare-and-mod_cloudflare-cpan\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"mod_cloudflare and mod_cloudflare cpan - Linux Shtuff\" \/>\n<meta property=\"og:description\" content=\"mod_cloudflare When using Cloudflare, in order to retrieve the actual visitors IP that connect to your server, you must install mod_cloudflare. Normally when using Cloudflare, all of the IP&#8217;s that connect to your web server will come from a Cloudflare IP address. mod_cloudflare is an Apache module that forces Apache to log actual visitor IP... Read More\" \/>\n<meta property=\"og:url\" content=\"https:\/\/g33kinfo.com\/info\/mod_cloudflare-and-mod_cloudflare-cpan\/\" \/>\n<meta property=\"og:site_name\" content=\"Linux Shtuff\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/fb.me\/g33kinf0\" \/>\n<meta property=\"article:author\" content=\"https:\/\/fb.me\/g33kinf0\" \/>\n<meta property=\"article:published_time\" content=\"2012-12-20T13:01:32+00:00\" \/>\n<meta name=\"author\" content=\"g33kadmin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@https:\/\/twitter.com\/drsinger1111\" \/>\n<meta name=\"twitter:site\" content=\"@drsinger1111\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/mod_cloudflare-and-mod_cloudflare-cpan\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/mod_cloudflare-and-mod_cloudflare-cpan\\\/\"},\"author\":{\"name\":\"g33kadmin\",\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/#\\\/schema\\\/person\\\/c022e4c40b13ea1b678e6f020756f547\"},\"headline\":\"mod_cloudflare and mod_cloudflare cpan\",\"datePublished\":\"2012-12-20T13:01:32+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/mod_cloudflare-and-mod_cloudflare-cpan\\\/\"},\"wordCount\":254,\"publisher\":{\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/#\\\/schema\\\/person\\\/c022e4c40b13ea1b678e6f020756f547\"},\"articleSection\":[\"Apache\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/mod_cloudflare-and-mod_cloudflare-cpan\\\/\",\"url\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/mod_cloudflare-and-mod_cloudflare-cpan\\\/\",\"name\":\"mod_cloudflare and mod_cloudflare cpan - Linux Shtuff\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/#website\"},\"datePublished\":\"2012-12-20T13:01:32+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/mod_cloudflare-and-mod_cloudflare-cpan\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/g33kinfo.com\\\/info\\\/mod_cloudflare-and-mod_cloudflare-cpan\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/mod_cloudflare-and-mod_cloudflare-cpan\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"mod_cloudflare and mod_cloudflare cpan\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/#website\",\"url\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/\",\"name\":\"Linux Shtuff\",\"description\":\"Because I have CRS Syndrome...\",\"publisher\":{\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/#\\\/schema\\\/person\\\/c022e4c40b13ea1b678e6f020756f547\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/#\\\/schema\\\/person\\\/c022e4c40b13ea1b678e6f020756f547\",\"name\":\"g33kadmin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/wp-content\\\/uploads\\\/2022\\\/07\\\/minion-researchA.gif\",\"url\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/wp-content\\\/uploads\\\/2022\\\/07\\\/minion-researchA.gif\",\"contentUrl\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/wp-content\\\/uploads\\\/2022\\\/07\\\/minion-researchA.gif\",\"width\":512,\"height\":512,\"caption\":\"g33kadmin\"},\"logo\":{\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/wp-content\\\/uploads\\\/2022\\\/07\\\/minion-researchA.gif\"},\"description\":\"I am a g33k, Linux blogger, developer, student and Tech Writer for Liquidweb.com\\\/kb. My passion for all things tech drives my hunt for all the coolz. I often need a vacation after I get back from vacation....\",\"sameAs\":[\"https:\\\/\\\/thelinuxreport.com\",\"https:\\\/\\\/fb.me\\\/g33kinf0\",\"https:\\\/\\\/x.com\\\/https:\\\/\\\/twitter.com\\\/drsinger1111\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"mod_cloudflare and mod_cloudflare cpan - Linux Shtuff","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/g33kinfo.com\/info\/mod_cloudflare-and-mod_cloudflare-cpan\/","og_locale":"en_US","og_type":"article","og_title":"mod_cloudflare and mod_cloudflare cpan - Linux Shtuff","og_description":"mod_cloudflare When using Cloudflare, in order to retrieve the actual visitors IP that connect to your server, you must install mod_cloudflare. Normally when using Cloudflare, all of the IP&#8217;s that connect to your web server will come from a Cloudflare IP address. mod_cloudflare is an Apache module that forces Apache to log actual visitor IP... Read More","og_url":"https:\/\/g33kinfo.com\/info\/mod_cloudflare-and-mod_cloudflare-cpan\/","og_site_name":"Linux Shtuff","article_publisher":"https:\/\/fb.me\/g33kinf0","article_author":"https:\/\/fb.me\/g33kinf0","article_published_time":"2012-12-20T13:01:32+00:00","author":"g33kadmin","twitter_card":"summary_large_image","twitter_creator":"@https:\/\/twitter.com\/drsinger1111","twitter_site":"@drsinger1111","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/g33kinfo.com\/info\/mod_cloudflare-and-mod_cloudflare-cpan\/#article","isPartOf":{"@id":"https:\/\/g33kinfo.com\/info\/mod_cloudflare-and-mod_cloudflare-cpan\/"},"author":{"name":"g33kadmin","@id":"https:\/\/g33kinfo.com\/info\/#\/schema\/person\/c022e4c40b13ea1b678e6f020756f547"},"headline":"mod_cloudflare and mod_cloudflare cpan","datePublished":"2012-12-20T13:01:32+00:00","mainEntityOfPage":{"@id":"https:\/\/g33kinfo.com\/info\/mod_cloudflare-and-mod_cloudflare-cpan\/"},"wordCount":254,"publisher":{"@id":"https:\/\/g33kinfo.com\/info\/#\/schema\/person\/c022e4c40b13ea1b678e6f020756f547"},"articleSection":["Apache"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/g33kinfo.com\/info\/mod_cloudflare-and-mod_cloudflare-cpan\/","url":"https:\/\/g33kinfo.com\/info\/mod_cloudflare-and-mod_cloudflare-cpan\/","name":"mod_cloudflare and mod_cloudflare cpan - Linux Shtuff","isPartOf":{"@id":"https:\/\/g33kinfo.com\/info\/#website"},"datePublished":"2012-12-20T13:01:32+00:00","breadcrumb":{"@id":"https:\/\/g33kinfo.com\/info\/mod_cloudflare-and-mod_cloudflare-cpan\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/g33kinfo.com\/info\/mod_cloudflare-and-mod_cloudflare-cpan\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/g33kinfo.com\/info\/mod_cloudflare-and-mod_cloudflare-cpan\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/g33kinfo.com\/info\/"},{"@type":"ListItem","position":2,"name":"mod_cloudflare and mod_cloudflare cpan"}]},{"@type":"WebSite","@id":"https:\/\/g33kinfo.com\/info\/#website","url":"https:\/\/g33kinfo.com\/info\/","name":"Linux Shtuff","description":"Because I have CRS Syndrome...","publisher":{"@id":"https:\/\/g33kinfo.com\/info\/#\/schema\/person\/c022e4c40b13ea1b678e6f020756f547"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/g33kinfo.com\/info\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/g33kinfo.com\/info\/#\/schema\/person\/c022e4c40b13ea1b678e6f020756f547","name":"g33kadmin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/g33kinfo.com\/info\/wp-content\/uploads\/2022\/07\/minion-researchA.gif","url":"https:\/\/g33kinfo.com\/info\/wp-content\/uploads\/2022\/07\/minion-researchA.gif","contentUrl":"https:\/\/g33kinfo.com\/info\/wp-content\/uploads\/2022\/07\/minion-researchA.gif","width":512,"height":512,"caption":"g33kadmin"},"logo":{"@id":"https:\/\/g33kinfo.com\/info\/wp-content\/uploads\/2022\/07\/minion-researchA.gif"},"description":"I am a g33k, Linux blogger, developer, student and Tech Writer for Liquidweb.com\/kb. My passion for all things tech drives my hunt for all the coolz. I often need a vacation after I get back from vacation....","sameAs":["https:\/\/thelinuxreport.com","https:\/\/fb.me\/g33kinf0","https:\/\/x.com\/https:\/\/twitter.com\/drsinger1111"]}]}},"_links":{"self":[{"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/posts\/4899","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/comments?post=4899"}],"version-history":[{"count":0,"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/posts\/4899\/revisions"}],"wp:attachment":[{"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/media?parent=4899"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/categories?post=4899"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/tags?post=4899"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}