Web Servers General Talk - Content Negotiation Performance Issue in Apache

This is Interesting: Free IT Magazines  
Home > Archive > Web Servers General Talk > June 2004 > Content Negotiation Performance Issue in Apache





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Content Negotiation Performance Issue in Apache
Lachlan Hunt

2004-06-05, 7:48 am

Hi,
I've just tried to set up content negotiation for my website, however
there is now a very noticeable performance hit.

The server is Apache/1.3.26 (Unix) Debian GNU/Linux PHP/4.1.2.
Unfortunately, I have to use .htaccess to set the directives because I
don't have access to the httpd.conf file on the server; and I'm aware
that, according to the documentation, this can cause a performance
problem. However, if I just type in the URI:
http://www.lachy.id.au/
the it is processed much slower than if I type
http://www.lachy.id.au/index

The .htaccess file (which is in the root directory of my site:
public_html/.htaccess) I'm using contains the following:

AddDefaultCharset UTF-8
AddType application/xhtml+xml .xhtml
DefaultLanguage en-au
DirectoryIndex index
Options Multiviews

<Files ~ "^\.ht">
Order allow,deny
Deny from all
</Files>

There's two index files: index.html and index.xhtml. Is there
something I've done wrongly, or a better method that I could use that
doesn't suffer from this problem so much? I will try to get these
directives in httpd.conf, however I'm not yet sure whether my ISP will
allow that, so for now, they're stuck in .htaccess.

--
Lachlan Hunt
http://www.lachy.id.au/
lachlan.hunt@lachy.id.au.update.virus.scanners

Remove .update.virus.scanners to email me,
NO SPAM and NO VIRUSES!!!
Tim

2004-06-05, 4:48 pm

On Sat, 05 Jun 2004 10:50:46 GMT,
Lachlan Hunt <lachlan.hunt@lachy.id.au.update.virus.scanners> posted:

> I've just tried to set up content negotiation for my website, however
> there is now a very noticeable performance hit.
>
> The server is Apache/1.3.26 (Unix) Debian GNU/Linux PHP/4.1.2.
> Unfortunately, I have to use .htaccess to set the directives because I
> don't have access to the httpd.conf file on the server; and I'm aware
> that, according to the documentation, this can cause a performance
> problem.


Is it possible in that root .htaccess file to then set the no-override
options so that the server doesn't look for more .htaccess files in
subdirectories?

> However, if I just type in the URI:
> http://www.lachy.id.au/
> the it is processed much slower than if I type
> http://www.lachy.id.au/index
>
> The .htaccess file (which is in the root directory of my site:
> public_html/.htaccess) I'm using contains the following:
>
> AddDefaultCharset UTF-8
> AddType application/xhtml+xml .xhtml
> DefaultLanguage en-au
> DirectoryIndex index
> Options Multiviews
>
> <Files ~ "^\.ht">
> Order allow,deny
> Deny from all
> </Files>


I shouldn't have thought that for such a simple .htaccess file that you'd
see a significant slow down. The computer ought to be handling that faster
than you can blink, so to speak.

> There's two index files: index.html and index.xhtml. Is there
> something I've done wrongly, or a better method that I could use that
> doesn't suffer from this problem so much? I will try to get these
> directives in httpd.conf, however I'm not yet sure whether my ISP will
> allow that, so for now, they're stuck in .htaccess.


I can't see anything obviously wrong with that. Though there's plenty of
browsers which will have problems with XHTML, or have problems between
picking the right file if you're negotiating whether to give them HTML or
XHTML. I see that here with MSIE - it'll even prefer a plain text file
over HTML, given the chance. Idiots... (Microsoft).

--
If you insist on e-mailing me, use the reply-to address (it's real but
temporary). But please reply to the group, like you're supposed to.

This message was sent without a virus, please delete some files yourself.
Lachlan Hunt

2004-06-05, 11:48 pm

Tim wrote:
> Is it possible in that root .htaccess file to then set the no-override
> options so that the server doesn't look for more .htaccess files in
> subdirectories?


I set the "AllowOverride none" directive in .htaccess, and got an
HTTP 500 error. AFAICS, from the documentation, AllowOveride can only
go within a <Directory> directive, in httpd.conf. So, unless there's
another directive I could use, I don't think that will work.

Thanks for your help.

--
Lachlan Hunt
http://www.lachy.id.au/
lachlan.hunt@lachy.id.au.update.virus.scanners

Remove .update.virus.scanners to email me,
NO SPAM and NO VIRUSES!!!
D. Stussy

2004-06-06, 11:48 pm

On Sat, 5 Jun 2004, Lachlan Hunt wrote:
> I've just tried to set up content negotiation for my website, however there
> is now a very noticeable performance hit.
>
> The server is Apache/1.3.26 (Unix) Debian GNU/Linux PHP/4.1.2.


Both Apache and php need to be updated to avoid some security bugs and stuff.

> Unfortunately, I have to use .htaccess to set the directives because I don't
> have access to the httpd.conf file on the server; and I'm aware that,
> according to the documentation, this can cause a performance problem.


That is true. It may look for an .htaccess file in EACH directory of the path
that it's allowed to be in.

> However, if I just type in the URI:
> http://www.lachy.id.au/
> the it is processed much slower than if I type
> http://www.lachy.id.au/index


That's not so much "content negotiation" as the "DirectoryIndex" function,
although CN could be involved too.

> The .htaccess file (which is in the root directory of my site:
> public_html/.htaccess) I'm using contains the following:
>
> AddDefaultCharset UTF-8
> AddType application/xhtml+xml .xhtml
> DefaultLanguage en-au
> DirectoryIndex index
> Options Multiviews
>
> <Files ~ "^\.ht">
> Order allow,deny
> Deny from all
> </Files>
>
> There's two index files: index.html and index.xhtml. Is there something
> I've done wrongly, or a better method that I could use that doesn't suffer
> from this problem so much? I will try to get these directives in httpd.conf,
> however I'm not yet sure whether my ISP will allow that, so for now, they're
> stuck in .htaccess.


You're lucky you even have that. My ISP does not support any user
"modification" of the server - no .htaccess files, no server-side scripting,
etc. I had to run my own web server elsewhere.
Lachlan Hunt

2004-06-06, 11:48 pm

D. Stussy wrote:
>
> Both Apache and php need to be updated to avoid some security bugs and stuff.


Can you provide a link to some documentation on these security
issues? Unfortunately the server is set up and administered by my ISP,
so I can't do the upgrade myself, but if I let them know, and show them
the evidence, they may upgrade for me. The worst they can do is say no,
so there's no harm in trying.

> That's not so much "content negotiation" as the "DirectoryIndex" function,
> although CN could be involved too.


Is there another method I could use instead of DirectoryIndex, that
will give the same result, without resorting to browser sniffing? I
found some that seem to use a form of browser sniffing, by looking for
"Mozilla" in the user agent string, or something like that, but then any
UAs that support application/xhtml+xml that don't identify themselves as
Mozilla will still get text/html, so I don't really want to use that method.

--
Lachlan Hunt
http://www.lachy.id.au/
lachlan.hunt@lachy.id.au.update.virus.scanners

Remove .update.virus.scanners to email me,
NO SPAM and NO VIRUSES!!!
D. Stussy

2004-06-13, 11:48 pm

On Mon, 7 Jun 2004, Lachlan Hunt wrote:
> D. Stussy wrote:
>
> Can you provide a link to some documentation on these security issues?


New releases which are due to security bugs are documented as such at both
apache's and the php web sites. Go get it yourself - it's there.

The only thing I didn't see is why 1.3.30 was a skipped version number.

> Unfortunately the server is set up and administered by my ISP, so I can't do
> the upgrade myself, but if I let them know, and show them the evidence, they
> may upgrade for me. The worst they can do is say no, so there's no harm in
> trying.
>
>
> Is there another method I could use instead of DirectoryIndex, that will
> give the same result, without resorting to browser sniffing? I found some
> that seem to use a form of browser sniffing, by looking for "Mozilla" in the
> user agent string, or something like that, but then any UAs that support
> application/xhtml+xml that don't identify themselves as Mozilla will still get
> text/html, so I don't really want to use that method.


Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com