Warning: curl_exec() has been disabled for security reasons in /pub/host/sunboyu/sunboyu/www/wp-includes/http.php on line 1022
apache 一个程序猿 孙小一,孙小二,PHP,MYSQL,LINUX,APACHE,原创技术,扯淡

Apache开启Gzip压缩

作者 : admin 于 2008年10月28日, 13:57:00
2008
10-28

文档位置 http://lamp.linux.gov.cn/Apache/ApacheMenu/mod/mod_deflate.html

Apache2中的实时压缩解压的模块编译在mod_deflate模块中,替换了原来的mod_gzip模块。

编译apache的时候 –enable-deflate  这个参数是默认开启的,编译完会有mod_deflate模块。

配置站点:

如果我们想使一个文件传输的时候进行加密,我们在站点配置文件里增加这样的配置

<Location />
SetOutputFilter DEFLATE
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
SetEnvIfNoCase Request_URI \
\.(?:gif|jpe?g|png)$ no-gzip dont-vary
Header append Vary User-Agent env=!dont-vary
</Location>
这样,/opt/httpd-2.2.9/htdocs目录下的所有mime类型为text/html的文件就可以启用

未压缩的http头

Date Tue, 28 Oct 2008 13:04:15 GMT
Server Apache/2.2.9 (Unix) DAV/2 PHP/5.2.6
Last-Modified Tue, 28 Oct 2008 12:51:52 GMT
Etag “30623-55fda-45a4fb62a8a00″
Accept-Ranges bytes
Content-Length 352218
Content-Type text/html
Vary Accept-Encoding,User-Agent

压缩后的http头

Date Tue, 28 Oct 2008 13:07:39 GMT
Server Apache/2.2.9 (Unix) DAV/2 PHP/5.2.6
Last-Modified Tue, 28 Oct 2008 12:51:52 GMT
Etag “30623-55fda-45a4fb62a8a00″-gzip
Accept-Ranges bytes
Vary Accept-Encoding,User-Agent
Content-Encoding gzip
Content-Length 2778
Keep-Alive timeout=5, max=100
Connection Keep-Alive
Content-Type text/html

原来length为352218,压缩后为2778,效果还是很明显的。

不过对于length很小的文件,是不进行压缩的。

具体的一些调整的细节,可以看原apache手册。

打造全能优化的Linux+Apache+PHP+Mysql服务器(3)

作者 : admin 于 2008年07月15日, 14:30:24
2008
07-15

apache部分

先安装openssl

./configure –enable-authz-dbm –enable-log-config –enable-headers –enable-setenvif –with-ssl=/usr/local/ssl  –enable-static-ab –enable-http –enable-mime –enable-status –enable-suexec –enable-vhost-alias –enable-dir –enable-rewrite –with-mpm=worker

fastcgi

cp Makefile.AP2 Makefile
make make install

打造全能优化的Linux+Apache+PHP+Mysql服务器(1)

作者 : admin 于 2008年07月13日, 21:05:51
2008
07-13

fastcgi   http://www.fastcgi.com/dist/mod_fastcgi-2.4.6.tar.gz
apache2   http://apache.mirror.phpchina.com/httpd/httpd-2.2.9.tar.gz
mysql5    http://dev.mysql.com/get/Downloads/MySQL-5.0/mysql-5.0.51b.tar.gz/from/http://mysql.mirrors.arminco.com/
php5      http://cn2.php.net/distributions/php-5.2.6.tar.gz
libxml2
gd-jpeg   ftp://192.48.96.9/graphics/jpeg/jpegsrc.v6b.tar.gz
freetype  http://voxel.dl.sourceforge.net/sourceforge/freetype/freetype-2.3.7.tar.gz
libpng    http://voxel.dl.sourceforge.net/sourceforge/libpng/libpng-1.2.29.tar.gz
zend      http://www.zend.com/download/55

memcached  http://www.danga.com/memcached/dist/memcached-1.2.5.tar.gz
memcache   http://pecl.php.net/get/memcache-3.0.1.tgz
libevent   http://www.monkey.org/~provos/libevent-1.2a.tar.gz

目前想到的功能大概有这些,想到再加。

目前正在研究每一个组件的性能和参数。

centos5安装指南(简单篇)

作者 : admin 于 2008年06月13日, 21:50:17
2008
06-13

进入默认页面,直接回车即可

测试光盘文件的完整性,我一般都跳过

阅读全部 »

 Page 2 of 2 « 1  2