Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using .htaccess file in Apache

There is any performance issue using .htaccess with the 'deny from all' instruction in all main directories in an web aplication? Tks.

like image 585
miguelbgouveia Avatar asked Jul 04 '13 09:07

miguelbgouveia


People also ask

How do I enable htaccess in httpd conf?

Open a global Apache configuration ( /etc/apache2/apache2. conf ) or site-specific configuration ( /etc/apache2/sites-available/mywebsite. conf ) with a text editor. Look for <Directory></Directory> directives.


Video Answer


1 Answers

Using .htaccess files slows down Apache. If you can, modify the main server config file (usually called httpd.conf)

From the manual:

You should avoid using .htaccess files completely if you have access to httpd main server config file. Using .htaccess files slows down your Apache http server. Any directive that you can include in a .htaccess file is better set in a Directory block, as it will have the same effect with better performance.

http://httpd.apache.org/docs/current/howto/htaccess.html.

On the other hand if you want to discuss or argue the performance loss versus the loss of ease of maintenance see this post by Simon Greenhill and his benchmarking results.

like image 142
Anthony Hatzopoulos Avatar answered Oct 06 '22 01:10

Anthony Hatzopoulos