T086ѧϰ�� | վ��ѧԺ | �����ĵ� | ���� | Ъ���� | IP��ַ��ѯ | �������� | ���ջ��� | �����ֵ� | ���ù��� | ������Ϣ��ѯ

Apache deflateģ������˵��

�� �������ߣ�Jackylau ����ʱ�䣺2007-07-24 | ���壺�� �� С��
[����]Apache deflateģ������˵�� ǰ����һֱ����apache2.0��dso��ʽ����������deflateģ���İ취 ����apxs -ica mod_deflate.cN�Σ�ʼ���DZ� Cannot load /opt/apache/modules/mod_deflate.so into server: /opt/apache/...

Apache deflateģ������˵��
  ǰ����һֱ����apache2.0��dso��ʽ����������deflateģ���İ취
����apxs -ica mod_deflate.cN�Σ�ʼ���DZ�
Cannot load /opt/apache/modules/mod_deflate.so into server: /opt/apache/modules/mod_deflate.so: undefined symbol: deflate
�쳣��ʹ�࣬ʲôldd mod_deflate.so����export LIB_LIBRARY_PATHѽ��������N�Σ�googleҲgo��N�졣������google��go����һƪ���£����ڽ������������£�
vi /usr/local/apache2/bin/apr-config
�޸�LDFLAGS=" " Ϊ LDFLAGS="-lz"
Ȼ����apxs -ica mod_deflate.c
��OK��

����������deflate����ʱ
apache2.0�Ƽ���������
Header append Vary User-Agent env=!dont-vary
�Ա�ȷ������������ѹ�������г������ݷ�����error
��һ�������£��ڲ���apache���﷨�����л��ֳ�
Invalid command 'Header', perhaps mis-spelled or defined by a module not included in the server configuration
�����취���Ǽ���һ��headersģ����OK��

�������û����ڱ���apacheģ��ʱֱ�Ӽ���--enable-deflate --enable-headers��ʡ�¶��ˡ�

һ�� ����
ѹ��apache���������ݣ�������վ����
���� ����Apache��deflate�
1�� �޸�apr-config
vi /usr/local/apache2/bin/apr-config
�޸�LDFLAGS=" " Ϊ LDFLAGS="-lz"
2�� ��apacheԴ��װĿ¼��,����
cd /root/httpd-2.0.55/modules/filters
3������mod_deflate�
/usr/local/apache2/bin/apxs -i -a -c mod_deflate.c
����û�а�װheadersģ�飬����headersģ��
cd /root/httpd-2.0.55/modules/metadata
����mod_headers�
/usr/local/apache2/bin/apxs -i -a �Cc mod_headers.c
��������Apache�������ļ�
1. ��httpd.conf�������������������
#������������byte����
DeflateFilterNote Input instream
#������������byte����
DeflateFilterNote Output outstream
#����ѹ���İٷֱ�
DeflateFilterNote Ratio ratio
#������־����
LogFormat '"%r" %{outstream}n/%{instream}n (%{ratio}n%%)' deflate
CustomLog logs/deflate_log deflate


#ָ��ѹ������
<Location />
# Insert filter
SetOutputFilter DEFLATE

# Netscape 4.x has some problems...
BrowserMatch ^Mozilla/4 gzip-only-text/html

# Netscape 4.06-4.08 have some more problems
BrowserMatch ^Mozilla/4.0[678] no-gzip

# MSIE masquerades as Netscape, but it is fine
# BrowserMatch MSIE !no-gzip !gzip-only-text/html

# NOTE: Due to a bug in mod_setenvif up to Apache 2.0.48
# the above regex won't work. You can use the following
# workaround to get the desired effect:
BrowserMatch MSI[E] !no-gzip !gzip-only-text/html

# Don't compress images
SetEnvIfNoCase Request_URI .(?:gif|jpg|cab|jpe?g|exe|bmp|mp3|rar|zip|swf|png)$ no-gzip dont-vary


# Make sure proxies don't deliver the wrong content
Header append Vary User-Agent env=!dont-vary
</Location>
������־������ʽ����
[root@trffic2 logs]# tail -f access_log
"GET /apache_pb.gif HTTP/1.1" -/- (-%)
"GET /manual/ HTTP/1.1" 2163/7434 (29%)
"GET /manual/style/css/manual.css HTTP/1.1" 3973/18335 (21%)
"GET /manual/style/css/manual-loose-100pc.css HTTP/1.1" 1006/2882 (34%)
"GET /manual/style/css/manual-print.css HTTP/1.1" 2994/13017 (23%)

ԭ�ģ�http://www.ceass.com/index.php?play=reply&id=90

  • ת����ע����Դ��ITѧϰ�� ��ַ��http://www.t086.com/ �����������Ƽ�������
  • �ر������� ��վ�������ر�������ֹת�ص�ר�������������¿�������ת�أ���������ע��������ԭʼ���ߡ����°�Ȩ������ԭʼ�������С����ڱ���վת�����µĸ��˺���վ�����DZ�ʾ������л�⡣������վת�ص������а�Ȩ��������ϵ���ǣ����ǻᾡ�����Ը�����
  • ��
  • ��
  • ��
  • ��
  • ��
  • ��
  • ��
  • ��
  • ��
������ѯ Health Check Gulangyu
© 2017 T086ѧϰ�� - T086.com(ԭitlearner.com)
RunTime:8.39ms QueryTime:7