点击打开链接
下面是使用apxs工具给apache添加模块
添加的模块:
LoadModule proxy_module libexec/mod_proxy.so
LoadModule rewrite_module libexec/mod_rewrite.so
LoadModule headers_module libexec/mod_headers.so
添加方法:
1. 进入apache 源文件modules目录
cd apache/src/modules/
2. 安装 proxy_module
> cd proxy
> /user/local/apache/bin/apxs -i -a -c *.c
3. 安装 rewrite_module
> cd standard
> /user/local/apache/bin/apxs -i -a -c mod_rewrite.c
4. 安装 headers_module
> cd standard
> /user/local/apache/bin/apxs -i -a -c mod_headers.c
但是,用这种方法添加的proxy不可用,提示错误:
/apache/httpd/bin/apachectl configtest
httpd: Syntax error on line 58 of /apache/httpd-2.2.3/conf/httpd.conf: Cannot load /apache/httpd-2.2.3/modules/mod_proxy.so into server: /apache/httpd-2.2.3/modules/mod_proxy.so: undefined symbol: proxy_lb_workers
所以,应该这样:
在Linux系统下,需要给已经运行的Apache增加mod_proxy模块,编译的时候应该这样:
apxs -c -i mod_proxy.c proxy_util.c
否则你可能会收到这样的错误信息
[root@server1 proxy]# /apache/httpd/bin/apachectl configtest
httpd: Syntax error on line 58 of /apache/httpd-2.2.3/conf/httpd.conf: Cannot load /apache/httpd-2.2.3/modules/mod_proxy.so into server: /apache/httpd-2.2.3/modules/mod_proxy.so: undefined symbol: proxy_lb_workers