Hello!
I think the solution is referenced in Flarum install guide (see http://flarum.org/docs/installation/).
I suggest you to check whether you have enable mod_rewrite on apache2 (if not, enable it), and whether you have then tried to add:
<Directory "/path/to/your/forum">
AllowOverride All
</Directory>
to your apache2 website configuration file.
After everything is done please remember to restart apache2 service.
That should do the trick...