If you don’t use managed hosting solutions for your forums, you might have to install everything yourself.
By default the directive for AllowOverride is set to None, meaning even if you enable the friendly urls in XenForo, it will show you 404 not found pages.
If you already have a .htaccess file, get the appropriate content from htaccess.txt provided by XenForo and apply it properly to your existing .htaccess file.
Otherwise, rename htaccess.txt to .htaccess.
Make sure your .htaccess file for XenForo is in the public html directory from where you run XenForo.
Edit the .htaccess file, and find the commented #RewriteBase /xenforo line and change it to:
Make sure your Apache2 web server has mod_rewrite installed. Ssh to the server with a user that can sudo up, and type:
sudo a2enmod rewrite
Find your apache.conf in /etc/apache2/ and edit it with nano, finding the directive for /var/www, and change None to All.
<Directory /var/www/> Options Indexes FollowSymLinks MultiViews AllowOverride All Require all granted </Directory>
And finally, restart apache:
sudo service apache2 restart