2 0

Block XML-RPC for all Wordpress sites

Create files:
cd /usr/local/directadmin/data/templates/custom/
touch virtual_host2.conf.CUSTOM.4.post virtual_host2_secure.conf.CUSTOM.4.post 
touch virtual_host2_secure_sub.conf.CUSTOM.4.post virtual_host2_sub.conf.CUSTOM.4.post
chmod 644 virtual_host2.conf.CUSTOM.4.post virtual_host2_secure.conf.CUSTOM.4.post 
chmod 644 virtual_host2_secure_sub.conf.CUSTOM.4.post virtual_host2_sub.conf.CUSTOM.4.post
Edit:
vi virtual_host2.conf.CUSTOM.4.post
Add:

    Order allow,deny
    Deny from all
    ErrorDocument 403 "Sorry, you are not allowed to view this page!"
Copy to the other files:
cp -p virtual_host2.conf.CUSTOM.4.post virtual_host2_secure.conf.CUSTOM.4.post
cp -p virtual_host2.conf.CUSTOM.4.post virtual_host2_secure_sub.conf.CUSTOM.4.post
cp -p virtual_host2.conf.CUSTOM.4.post virtual_host2_sub.conf.CUSTOM.4.post
Apply changes and re-generate configs:
cd /usr/local/directadmin/custombuild/
./build rewrite_confs
Result: https://kbhost.nl/xmlrpc.php Sorry, you are not allowed to view this page!