Links

Get the right IP

Get the right IP

Was currently taking part in moving a WordPress site with a single webserver into a AWS Virtual Private cloud using an ELB to loadbalance multiple webservers.  Ran into an issue where IPs were not being grabbed properly and provided to the WordPress control panel for comment moderation.  I have already enabled the X-FORWARDED-FOR header in apache and wanted WordPress to capture this rather than the VPC IPs.

 

https://www.benjaminwiedmann.net/wordpress-behind-reverse-proxy-fix-wrong-ip-insert-x-forwarded-for-ip.html

Placing the following in my wp-config.php made it possible to get the real IP via this header so we can better moderate without requiring registration.  It’s a hack, but it’s a useful one.

// ** bw 2012-08-12 wordpress reverse proxy x-forwarded-for ip fix ** //
if(isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
  $xffaddrs = explode(',',$_SERVER['HTTP_X_FORWARDED_FOR']);
  $_SERVER['REMOTE_ADDR'] = $xffaddrs[0];
 }
Advertisements
Tagged , ,

MOAR SCREEN!

MOAR SCREEN!

Gotta keep this for later, a neat wrapper to expand on my love for gnu screen.

looks like byobu expands on screen’s functionality by adding toggles and notification.

credit to @jeffreykaplan for the tip.

Tagged , , ,
Advertisements