当前位置: 维客笔记>> apache >> 正文
-
apache
-
#wget http://apache.mirror.phpchina.com/httpd/httpd-2.2.6.tar.gz
#tar zxvf httpd-2.2.6.tar.gz
#./configure --prefix=/application/apache --enable-modules=so --enable-so --enable-deflate --with-rewrite --with-mpm=worker --enable-threads
#make
#make install
#cp apachectl /etc/init.d/httpd
#vi /etc/init.d/httpd
加入:
# chkconfig: - 85 15
# description: Apache is a good stuff.
description is necessary
#chkconfig httpd on# ./configure --enable-deflate --enable-headers
这样在编译完 Apache 后就可以直接在 httpd.conf 中启用并配置 deflate 模块了,配置的方法跟 Windows 平台下是相同的。如果说您的 Apache 已经在运行了,不想再重新编译一次,那也可以选择只编译 deflate 模块所需的文件 mod_deflate.c 和 mod_headers.c。这两个文件位于 {apache-src}/modules/filters/ 目录下(其中 {apache-src} 为 apache 源文件所在的目录)。使用如下命令来单独编译这两个源文件。
# {apache-bin}/apxs -i -a -c {apache-src}/modules/filters/mod_deflate.c
# {apache-bin}/apxs –i –a –c {apache-src}/modules/filters/mod_headers.c
其中 {apache-bin} 为 Apache 安装目录下的 bin 目录,接下来在 httpd.conf 直接配置该模块即可。很多时候你在单独编译 deflate 模块的时候可能会碰到编译错误,提示是:
Cannot load /opt/apache/modules/mod_deflate.so into server: /opt/apache/modules/mod_deflate.so: undefined symbol: deflate
解决的方法如下:
编辑 /usr/local/apache2/bin/apr-config 文件修改其中的 LDFLAGS 值为 "-lz",然后再重新编译 mod_deflate 模块,apxs -ica mod_deflate.c 即可。
#wget http://www.caucho.com/download/resin-3.1.4.tar.gz
#tar zxvf resin-3.1.4.tar.gz
#./configure --with-apxs=/application/apache2.2.6/bin/apxs --with-apache=/application/apache2.2.6
#cd /application/resin-3.1.4/modules/c/src/apache2
#vi Makefile
-fpic改为-fPic
CFLAGS增加-m64
#make
#make install
copy mod_caucho到apache的modules里#cp contrib/init.resin /etc/init.d/resin
#chmod a+x /etc/init.d/resin
#chkconfig --add resin
#chkconfig resin on
#service resin restart
出现log_daemon_msg和log_end_msg这两个commond not found
可以修改/etc/init.d/resin中的相关的if段,用shell里自己的函数,或者改用其他的log方法。 -
评论: apache当前尚无网友评论!发表我的评论
提示
- 1.遵守国家有关法律、法规,尊重网上道德
- 2.承担一切因您的行为而直接或间接导致的民事或刑事法律责任
- 3.互动百科留言板管理人员有权保留或删除其管辖留言中的任意内容



