turdukulov the .htaccess should stay under the public directory, you can rename public to public_html after installing if your server serves web files from public_html, make sure to install Flarum one directory up.
The AllowOverride usually isn't necessary, if it doesn't exist you an add it in the apache configuration under /etc/apache/apache.conf or something similar relating to your operating system.