-1

I'm trying to reset the DeflateBufferSize directive like so in my .htaccess file:

DeflateBufferSize 1024
SetOutputFilter DEFLATE

But the result of each page is then 500 internal server error (this happens even if I set it to its default value of 8096). If I remove that line everything's fine. Why is this happening, do I need to set it differently?

Andrew Schulman
  • 8,561
  • 21
  • 31
  • 47
Core_dumped
  • 103
  • 1

1 Answers1

1

The manual will show you that that particular directive is only valid in the context of the server config and the virtual host and it is not valid in a .htaccess file.

So add those directives to /etc/httpd/conf/httpd.conf or any of the Include files that make up the server configuration.

Additionally: my pet peeve, quoted from from the manual on .htaccess files:

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 in the main Apache configuration file(s), as it will have the same effect with better performance.

Assuming you read the manual and the Directives you were trying to use are valid in .htaccess files in the first place...

HBruijn
  • 72,524
  • 21
  • 127
  • 192
  • But if I try to put it inside httpd.conf when I type in the terminal to restart the server it just gets stuck. If I remove again that line it restarts successfully – Core_dumped Feb 03 '15 at 20:53
  • `apachectl configtest` and confirm that the module is actually loaded... – HBruijn Feb 03 '15 at 20:53
  • It outputs Syntax OK. There seems to be no error but it doesn't want to restart – Core_dumped Feb 03 '15 at 20:59
  • and do the log files show anything? – HBruijn Feb 03 '15 at 21:00
  • Actually everything works, the files get compressed since I set SetOutputFilter DEFLATE. The reason why I'm trying to change the DeflateBufferSize is to allow compression on smaller chunks of data(since im using flush and thus I send data in chunks) but the problem persists even if I make the compressed chunk be greater than 8K. Do you know what the problem may be? I've trying to solve this 4 hours with no success – Core_dumped Feb 03 '15 at 21:02
  • If I put the line in the It restarts successfully but the chunks don't want to be compressed – Core_dumped Feb 03 '15 at 21:08