Skip to content

WordPress Sitemap not notifying Search Engines because of SELinux

If you use an SELinux-based distro, you may have encountered problems with your XML-Sitemap plugin not updating Google or any of the other search engines (Ask.com, Yahoo) properly. Obviously, since you’re familiar with file security contexts and SELinux, generally-speaking, you learn quickly that you need to indicate a security context type of httpd_cache_t, but the errors notifying the search engines of your sitemap updates persist. The problem is because you have a boolean value marked false and it needs to be true.

That boolean is httpd_can_network_connect. You can see what yours is, with the following command:

getsebool -a | grep httpd_can

If this returns “Off,” you can type setsebool httpd_can_network_connect 1 at the command prompt. After you press enter, it should within moments simply return you to another prompt. Enter your WordPress administrative area and click Options->XML Sitemap again to verify that Google (and the other search engines) are able to connect to your http server, enabling them to successfully update your sitemap in their servers. Your PageRank should skyrocket in no time*!

If this solves your problem and takes away your XML Sitemap plugin errors, go ahead back to that CLI and type “setsebool -P httpd_can_network_connect 1” to write the SELinux boolean value to disk so it sticks after a reboot. If you don’t use -P, the change only lasts until the machine is rebooted.

* Speculative statement not to be held accountable for any of anyone’s success or failure, you should just be happy someone’s taking the time to explain to you wtf is wrong with your WordPress. PS, secure that puppy; if you need help, contact the helpful folks at intarcorp.com.