apache 模块的编写

step to step:

 

安装好apache之后。

 

[1] apxs -g -n aaa
                    Creating [DIR]  aaa
                    Creating [FILE] aaa/Makefile
                    Creating [FILE] aaa/modules.mk
                    Creating [FILE] aaa/mod_aaa.c
                    Creating [FILE] aaa/.deps
[2] cd aaa
[3] apxs -c mod_aaa.c
                    //编译
[4] apxs -i mod_aaa.la
[5] vi /etc/httpd/conf/httpd.conf
                   add bellow words to the file:
    LoadModule aaa_module modules/mod_aaa.so
    <Location /aaa>
    setHandler aaa
    </Location>
[6] apachctl restart
[7] ie browser,   http://localhost/aaa

 

 

 

在mod_aaa.c中,aaa_register_hooks(apr_pool_t *p)注册apache模块。

                                static int aaa_handler(request_rec *r)中添加你要实现的代码。

 

 

可以参考:

http://yangzb.javaeye.com/blog/561357
http://andrew913.javaeye.com/blog/398648
apache图片操作
http://www.itqun.net/content-detail/105257.html

 

 

 

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值