I'm running a website with Joomla on a dedicated server (Debian), and i've read that moving .htaccess rules to apache2 configuration files may result in a good performance improvement (Apache HTTP Server Tutorial: .htaccess files).
Main configuration file in /etc/apache2: apache2.conf
In apache2.conf there are, among other directives that i'am able to understand:
The server hosts just one website. In sites-enabled there is another file including additional directives, 000-default:
Options Indexes FollowSymLinks MultiViews
allow from all
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Allow from all
Running a "locate .htaccess" through shell returns some results: 2 files under /usr/share/phpmyadmin/ and other results under the directories for the website: /var/www.
I've read how to use Directory block to include htaccess rules into an apache configuration file, but i've mainly three doubts:
1) Where should i insert htaccess rules, in apache2.conf or in 000-default?
2) As the performance improvements are due to apache lookups reduction for htaccess files in the main directory and in subdirectories, which directive should i modify?
or both? And about AllowOverride All, in which Directory block in 000-default?
3) After disabling AllowOverride All, shall i include the directives of htaccess for /usr/share/phpmyadmin too, even with DocumentRoot /var/www instruction?