Up until version 2.7.1, running WordPress on an intranet was a real pain in the ass. It connects to the outside world to look for updates, to check comments for spam (using Akismet) or to fetch RSS-feeds for widgets if you configured those on your blog, … But as you typically don’t have direct internet-access on an intranet and as there was no way of letting WordPress know about a proxy, your blog timed out while it was trying to fsockopen those external sites.
Here’s what you’ll have to add (values are examples which you’ll have to replace with settings for your environment off course):
define('WP_PROXY_HOST', '192.168.22.1');
define('WP_PROXY_PORT', '9099');
If you need to authenticate to access the proxy you can add your credentials this way:
define('WP_PROXY_USERNAME', 'frank');
define('WP_PROXY_PASSWORD', 's3cr3t');
You can also exclude requests for specific hosts from going through the proxy:
define('WP_PROXY_BYPASS_HOSTS', 'localhost, blog2.corpintranet');
And finally you can block all outgoing requests by default and add domains to a whitelist to only allow those to connect:
define ('WP_HTTP_BLOCK_EXTERNAL', 'true');
define ('WP_ACCESSIBLE_HOSTS', 'api.wordpress.org, akismet.com');
Off course some WordPress-plugins do not use the HTTP API yet (e.g. Lifestream and wp-security-scan rely on Simplepie, which does not use the proxy-aware wp_remote_get-function), so you might have to be careful when installing plugins that need internet-access.
I don’t this Akismet takes care of these settings.
Looking at the code you can see a “raw” fsockopen to the domain rest.akismet.com
But tell me if I’m wrong.
if that is the case, that’s a bug (or feature request) in the akismet plugin? does it work from behind a proxy?
posted about this on the wordpress.org support forum; see http://wordpress.org/support/topic/368089
frank
I’ve rewritten the function in the akismet plugin which deals with http requests to use the HTTP Api, so it now works behind a proxy.
http://tall-paul.co.uk/wp-akismet-plugin-behind-proxy/
great stuff paul, thanks!!
Thanks PaulB. is good !
Brilliant! I’ve been struggling with this as a newbie hiding behind a big organisation’s proxy server. SOLVED and DONE! Thanks