httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Boyle Owen" <Owen.Bo...@swx.com>
Subject RE: htaccess question
Date Tue, 20 Aug 2002 09:44:06 GMT
>From the point-of-view of server efficiency, I would say that the order of preference for
where to process user requests would be:

(1) httpd.conf
(2) .htaccess
(3) external PHP scripts

My reasoning behind this is:

(1) httpd.conf directives are loaded into memory at startup and processed by httpd which is
a compiled program written in C. This has got to be fastest.
(2) .htaccess files are read anew every time the server goes into the directory. Although
this is done by httpd (therefore fast) it still has the overhead of opening a file and reading
it (i.e. disk access, assigning filehandles etc.) so is slower than the same directives in
httpd.conf.
(3) External PHP scripts are parsed by an interpreter which has to be fired up, read in the
script (file access as above) and then processed by the interpreter (on average, a perl program
is 20 times slower than the equivalent code written in C). This is slowest of all.

However, from the point-of-view of user efficiency, the order is exactly the reverse:

(1) Changes to httpd.conf require at least a graceful restart to take effect - risky (if you
screw up), time-consuming and manual.
(2) .htaccess changes don't need a restart but the directives, although powerful, may not
achieve exactly what you want (also applies to (1)).
(3) External scripting languages allow the full power of perl to be applied which enables
you to do whatever you want - limited only by your imagination.

The moral: It all depends on your point-of-view.

Rgds,

Owen Boyle
 



>-----Original Message-----
>From: Andy Kriger [mailto:andy.kriger@verizon.net]
>Sent: Dienstag, 20. August 2002 07:04
>To: Apache Users
>Subject: htaccess question
>
>
>I am using Apache on a shared host, so all of my configuration
>customizations are in .htaccess. It seems like there are 
>things that can be
>done at the server htaccess level or in a PHP file (or JSP or Perl or
>whatever your scripting lang of choice). For example, mod_rewrite can
>redirect to the root and then you can do your processing from 
>there in PHP
>or you can do it all in htaccess.
>
>What I'm wondering is this (being relatively new to the 
>under-the-hood stuff
>of webservers) - in your experience, which is better for performance,
>security, and ease of maintanance?
>
>thx
>andy
>
>
>---------------------------------------------------------------------
>The official User-To-User support forum of the Apache HTTP 
>Server Project.
>See <URL:http://httpd.apache.org/userslist.html> for more info.
>To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>   "   from the digest: users-digest-unsubscribe@httpd.apache.org
>For additional commands, e-mail: users-help@httpd.apache.org
>
>

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message