
主机换到hostens以后,发现Wordpress for android APP无法连接到网站,显示服务器所需的XML-RPC方法不存在。把这个错误信息提供给了hostens的客服,客服还是比较负责的,1个小时后回复了我,提供了解决的思路:首先是排除wordpress的插件限制了xml-rpc使用,然后再检查是不是有什么文件禁止了xml-rpc功能,最后实在不行就禁用Modsecurity。最后经过证实,的确是Modsecurity限制了wordpress的访问。
Hostens客服的答复:
Our server does block some malicious requests to XML-RPC files as it is often used as a brute force attack source for websites. However, not all requests are being blocked, only those that exceed the threshold limit on our servers. After doing some research online, I have found a couple of solutions, for example: - Disable any WordPress plugin that might be blocking the XML-RPC service (E.g., Wordfence, Sucuri, iThemes Security); - Check that the no theme/plugins are disabling the XML-RPC service. Search for add_filter(“xmlrpc_enabled”, “__return_false”). If that will not help, you can try to disable ModSecurity for your domain: https://www.hostens.com/knowledgebase/how-to-disable-modsecurity-for-the-domain/ Take note that in such a case, your site's security becomes compromised. So it should be a final option. If you have more questions, contact us again. Have a good day. You can always leave a review on https://uk.trustpilot.com/evaluate/www.hostens.com Also, I would really appreciate it if in the review you could mention my name, Justina.
按照客服的提示,我自己认真研究了一下Modsecurity是个神东东。在虚拟主机的后台,安全设置中,就有这个盾牌的东西,这个就是Modsecurity(hostus的主机是没有这个组建的,hostens主机有,是不是说明hostens主机更安全一些?)

ModSecurity是一个开源的、跨平台的Web应用防火墙(WAF),被称为WAF界的“瑞士军刀”。它可以通过检查Web服务接收到的数据,以及发送出去的数据来对网站进行安全防护。
我关闭了域名的Modsecurity安全保护,再用APP进行测试,完美链接,功能正常。但是鉴于Modsecurity的重要性,似乎也不能完全关闭保护。这个问题暂时无解。解决的一个思路,是可以找到禁止wordpress app远程登陆的规则,在Modsecurity的规则中关闭这个规则,但后果貌似不可预测。
看来这个问题只能暂时无解。