define('DISALLOW_FILE_EDIT', true);{"id":86,"date":"2009-03-17T23:14:29","date_gmt":"2009-03-18T04:14:29","guid":{"rendered":"http:\/\/www.unfocus.com\/?p=86"},"modified":"2009-08-28T12:11:43","modified_gmt":"2009-08-28T17:11:43","slug":"correct-user-ip-for-wordpress-comments-on-mosso","status":"publish","type":"post","link":"http:\/\/www.unfocus.com\/2009\/03\/17\/correct-user-ip-for-wordpress-comments-on-mosso\/","title":{"rendered":"Correct User IP for WordPress comments on Mosso"},"content":{"rendered":"

Update #2<\/strong>: It looks like a couple of days after I posted this, the Mosso guys sent word on fresh clicks<\/a> that the issue has been fixed on their end<\/a>, rendering this plugin completely useless, days after I put it up. \ud83d\ude42<\/p>\n

I stumbled across a problem running WordPress on Mosso (Rackspace Clould) servers<\/a> (which I’m now quite happily running unFocus.com on \ud83d\ude42 ) in the Mosso Knowledge Base, where the ip address of the user is not properly recorded in comments when running in the Mosso cluster. The knowledge based linked to a fresh clicks article<\/a>, but I wanted something a little easier to maintain than an inline hack. So I rolled a quick and dirty plugin, which seems to do the trick. Here is what it does: <\/p>\n

[cc lang=’php’]
\n< ?php\n\/*\nPlugin Name: unFocus.Mosso-User-IP\nPlugin URI: http:\/\/www.unfocus.com\/projects\/\nDescription: A plugin to set REMOTE_ADDR on Mosso clusters to \nHTTP_X_CLUSTER_CLIENT_IP to fix tracking and comment posts, etc.\nVersion: 1.0a\nAuthor: Kevin Newman\nAuthor URI: http:\/\/www.unfocus.com\/projects\/\n*\/\nfunction unFocus_MossoUserIP() {\n\t$_SERVER['REMOTE_ADDR'] = $_SERVER['HTTP_X_CLUSTER_CLIENT_IP'];\n}\nadd_action('init', 'unFocus_MossoUserIP');\n?>
\n[\/cc]<\/p>\n

That’s it! It just sets the regular REMOTE_ADDR value to the Mosso Server var HTTP_X_CLUSTER_CLIENT_IP. Pretty simple. \ud83d\ude42 Update<\/strong>: I forgot to upload a zip archive. unFocus.Mosso-User-IP.zip<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"

Update #2: It looks like a couple of days after I posted this, the Mosso guys sent word on fresh clicks that the issue has been fixed on their end, rendering this plugin completely useless, days after I put it up. \ud83d\ude42 I stumbled across a problem running WordPress on Mosso (Rackspace Clould) servers (which … Continue reading “Correct User IP for WordPress comments on Mosso”<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[14],"tags":[19,21,20],"_links":{"self":[{"href":"http:\/\/www.unfocus.com\/wp-json\/wp\/v2\/posts\/86"}],"collection":[{"href":"http:\/\/www.unfocus.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.unfocus.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.unfocus.com\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/www.unfocus.com\/wp-json\/wp\/v2\/comments?post=86"}],"version-history":[{"count":19,"href":"http:\/\/www.unfocus.com\/wp-json\/wp\/v2\/posts\/86\/revisions"}],"predecessor-version":[{"id":99,"href":"http:\/\/www.unfocus.com\/wp-json\/wp\/v2\/posts\/86\/revisions\/99"}],"wp:attachment":[{"href":"http:\/\/www.unfocus.com\/wp-json\/wp\/v2\/media?parent=86"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.unfocus.com\/wp-json\/wp\/v2\/categories?post=86"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.unfocus.com\/wp-json\/wp\/v2\/tags?post=86"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}