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:
DocumentRoot /var/www <Directory /> Options FollowSymLinks AllowOverride All </Directory> <Directory /var/www/> Options Indexes FollowSymLinks MultiViews AllowOverride All Order allow,deny allow from all </Directory> ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ <Directory "/usr/lib/cgi-bin"> AllowOverride None Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch Order allow,deny Allow from all </Directory>
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?