Create the configuration file:
touch /etc/apache2/conf-available/block-wp-xmlrpc.conf
Fill it with the following contents:
<Directory /home/*/public_html/*/> <files xmlrpc.php> order allow,deny deny from all </files> </Directory>
And then enable it:
a2enconf block-wp-xmlrpc.conf service apache2 reload