Windows使用apxs独立编译 Apache 模块
http://blog.sina.com.cn/s/blog_43b83d340100mdhl.html
安装 apxs
1.解压apxs.zip,如C:\apxs
2.打开命令提示符,切换当前目录到解压的路径C:\apxs
3.输入
perl Configure.pl --with-apache2=\Path\to\Apache2 --with-apache-prog=httpd.exe
其中\Path\to\Apache2需要替换为Apache的安装路径
如果提示perl为不可执行程序的话,需要安装Perl,如Strawberry Perl
4.切换到Apache安装目录下的bin文件夹中,输入apxs,如有解释apxs用法的文本出现,则表明安装完成。
 
使用apxs在windows下编译模块
1.修改在apache下的build目录中config_vars.mk文件
将CC = gcc 的gcc改为cl.exe ,LD = g++的g++改为link.exe,CPP = gcc-E的gcc-E删掉
2.打开VS2005命令提示符(或者进入命令提示符,输入 %comspec% /k ""编译器变量初始化脚本路径"" x86
编译器变量初始化脚本路径:在vc6下是"C:\Program Files\Microsoft Visual Studio\VC98\Bin\VCVARS32.BAT",vs2005下是"C:\Program Files\Microsoft Visual Studio 8\VC\vcvarsall.bat")
3.将apxs 所在路径设置为系统环境变量的系统路径。
4.运行apxs -n helloworld -g(其中helloworld为模块名)
5.将路径切换到helloworld文件夹,输入
apxs -c -i -a mod_helloworld.c libapr-1.lib libaprutil-1.lib libapriconv-1.lib libhttpd.lib
(将helloworld文件夹替换为你的模块所在路径,mod_helloworld.c替换为你的模块文件名)
 

http://www.server110.com/apache/201403/6943.html

apache下配置flv拖动

环境:debian apache2 ckplayer

1、安装apxs工具。

apxs 是Apache的扩展工具,用于编译一个或多个源程序或目标代码文件为动态共享对象,使之可以用LoadModule指令在运行时加载到Apache 服器中。

作为apache模块的编译工具,用它来编译mod_flvx.c文件。

debian和ubuntu下,apxs被放在apache2-threaded-dev和apache2-prefork-dev里,安装任一个即可。

apt-get install  apache2-prefork-dev

whereis apxs2 查看安装路径

man apxs 如果你想看看这东西怎么用的话

2、下载mod_flvx.c并进行编译

wget https://github.com/osantana/mod_flvx/blob/master/mod_flvx.c 或者

wget http://people.apache.org/~pquerna/modules/mod_flvx.c

使用apxs进行编译,编译前,请检查apxs的版本,如果新安装的基本没啥问题吧

apxs -c -i -a ./mod_flvx.c

3、在apache的配置文件中增加mod_flvx.so模块,并添加对.flv的处理

在apache的conf.d目录下创建mod_flvx.conf文件,并写入以下内容

LoadModule flvx_module /usr/lib/apache2/modules/mod_flvx.so

AddHandler flv-stream .flv

4、重启apache

5、如果还不能拖动,则

1)FLV没有metadata关键帧数据

可以使用yamdi或flvtool2为你的flv视频添加关键帧

yamdi -i source.flv -o dest.flv或

flvtool2 -U source.flv

如果没有yamdi或者flvtool2可apt-get先安装。

这里我用flvtool2报错,于是用了yamdi,没报错。据说yamdi效率更高。

2)如果还不能拖动,则尝试配置播放器。

我这里用的是ckplayer。

搜了一下ckplayer的配置:http://www.ckplayer.com/view.php?id=82

ckplayer.js里

  (1)ck.setup = '1,1,1,1,1,1,0,0,1,2,5';的第6个参数,是否使用http流式控制1是/0不是

  (2)h的值,h:'1',//播放http视频流时采用何种拖动方法,0是按关键帧,1是按关键时间点

  (3)q:'',//视频流拖动时参考函数,默认是start。

关于选择关键帧还是关键时间点的区别,默认的是flv是按关键时间点,而mp4是按关键帧来随意拖动的,但很多网站是把这二个设置成统一的,要么都按关键帧,要么都按关键时间点。

这里我执行了(1)。

然后,就好了。。。可以拖动了。。。

转载请注明原文地址:http://www.server110.com/apache/201403/6943.html

mp4-----------

http://h264.code-shop.com/trac/wiki/Mod-H264-Streaming-Apache-Version2

Dependencies

We will be using ​apxs2, the APache eXtenSion tool, to build and install the module for the Apache server.

Make sure you have apxs2 installed:

  1. sudo apt-get install apache2-threaded-dev

Download

Download the source of the H264 Streaming Module for Apache.

  1. cd ~
  2. wget http://h264.code-shop.com/download/apache_mod_h264_streaming-2.2.7.tar.gz
  3. tar -zxvf apache_mod_h264_streaming-2.2.7.tar.gz

Build

  1. cd ~/mod_h264_streaming-2.2.7
  2. ./configure --with-apxs=`which apxs2`
  3. make
  4. sudo make install

Configuration

Edit the configuration file (in /etc/apache/httpd.conf) so that file requests ending in ".mp4" are handled by the h264_streaming_module.

  1. LoadModule h264_streaming_module /usr/lib/apache2/modules/mod_h264_streaming.so
  2. AddHandler h264-streaming.extensions .mp4

Start Apache.

  1. sudo /etc/init.d/apache start

Build & Configuration (CentOS 5.2)

CentOS users can follow these intructions for building the module instead. It uses apxs (instead of apxs2) and httpd (instead of apache).

  1. sudo yum install httpd-devel
  2. sudo yum install httpd mod_ssl
  3.  
  4. cd ~/mod_h264_streaming-2.2.5
  5. ./configure
  6. make
  7. sudo make install
  8.  
  9. sudo vi /etc/httpd/conf/httpd.conf
  10. Add the line
  11. 'AddHandler h264-streaming.extensions .mp4'
  12. after the line
  13. 'LoadModule h264_streaming_module /usr/lib/httpd/modules/mod_h264_streaming.so'
  14. sudo /etc/init.d/httpd start

License

This version is free if you agree to the ​noncommercial license. Please mention its use on your website, in the lines of 'This website uses H264 pseudo video streaming technology by​CodeShop'.

Our commercial license is very inexpensive, see the following page to check if you need a commercial license.

Testing

Continue to the testing page to verify your setup.

Demo

See ​http://h264-demo.code-shop.com/demo/apache/testlist.html for a demo running Apache.

Apache Module 开发后记

由 qyb 在 周二, 2007-02-13 12:14 提交

上一篇文章

开发出 apache 2.0 的模块以后,又面对着要将其移植到 apache 其他版本的需求,经过这段时间一点点的修补,现在我的模块已经可以同时在 1.3/2.0/2.2 下编译。甚至在 2.0/Win32 环境下也编译出了 dll,供在个人PC上做开发的同事使用。

我感觉如果项目不复杂的话,可以学习我这样把所有的内容放在一个文件里面的做法。

最重要的就是利用 MODULE_MAGIC_COOKIE 的定义,把 1.3 和 2.0/2.2 的不同之处融合在一起。例子:

  1. #if MODULE_MAGIC_COOKIE == 0x41503230UL || MODULE_MAGIC_COOKIE == 0x41503232UL
  2.  
  3. #include "util_filter.h"
  4. #include "apr_strings.h"
  5. module AP_MODULE_DECLARE_DATA foobar_module;
  6. #define APLOG_FOOBAR APLOG_ERR,0
  7.  
  8. #else
  9.  
  10. module MODULE_VAR_EXPORT foobar_module;
  11. #define apr_pool_t pool
  12. #define apr_table_t table
  13. #define apr_pcalloc ap_pcalloc
  14. #define apr_table_unset ap_table_unset
  15. #define apr_table_set ap_table_set
  16. #define apr_table_get ap_table_get
  17. #define apr_table_make ap_make_table
  18. #define apr_pstrdup ap_pstrdup
  19. #define apr_snprintf ap_snprintf
  20. #define apr_pstrndup ap_pstrndup
  21. #define APLOG_FOOBAR APLOG_ERR
  22.  
  23. #endif /* MODULE_MAGIC_COOKIE == 0x41503230UL */

同样,模块初始化的部分也这样针对不同版本定义一下。

这样主要的功能函数就可以使用同样的代码模块,并使用 apr_* 系列函数族了。

之所以要对 APLOG_ERR 做定义,是因为在 1.3 和 2.x 版本中,ap_log_error 和 ap_log_rerror 所使用的参数数目不一致,2.x 的参数要多一个,因此针对 2.x自动增加一个参数——",0"

2.0 和 2.2 有些地方也有小差别,我的代码里面就碰到了 apr_socket_create 的参数不一样。同样简单 #if 就可以处理了。

在 1.3 里面 module initializer 如果 2.x 里面的 post_config 会运行两次,而且2.x 上的这个小技巧无法直接使用了。本来是不影响程序运行的,但还是想出了一个变态的办法来解决它。module initializer 两次执行之间的一个重要事件就是 apache 的 daemonize。那样怎么来判断当前进程是否在 daemon 状态下呢?我的方案是:

  1. /* 小技巧,用于帮助 init_module 只执行一次检查 */
  2. #define MAX_FDS 1024
  3. int daemon_flag(int fds[MAX_FDS])
  4. {
  5. int fd;
  6. int newfd;
  7. int i;
  8. int opt;
  9. socklen_t optlen = sizeof(int);
  10. int ret = 0;
  11.  
  12. memset(fds, 0, sizeof(int) * MAX_FDS);
  13. newfd = fd = socket(AF_INET,SOCK_STREAM,0);
  14. while (newfd < MAX_FDS && newfd > 0) {
  15. fds[newfd] = 1;
  16. newfd = dup(fd);
  17. }
  18. for (i = 0; i < MAX_FDS; i++) {
  19. if (fds[i] == 1) {
  20. close(i);
  21. } else {
  22. if (0 == getsockopt(i, SOL_SOCKET, SO_REUSEADDR, &opt, &optlen)) {
  23. fds[i] = -1; //这样返回以后也知道哪些 fd 被监听
  24. ret = 1;
  25. }
  26. }
  27. }
  28. return ret;
  29. }

因为我知道 apache 必然会对监听套接字设置 SO_REUSEADDR,所以可如此判断。

由于 apache2 有了 apr 的支持,几乎不用修改任何代码模块就可以在 win32 下编译。而且只需要 MS 的免费工具就可以了,包括 MSVC C++ Toolkit 2003 和 Platform SDK。设置好 INCLUDE/LIB 路径后,只需要执行
cl /MD /D "WIN32" /c mod_foobar.c
link /DLL mod_foobar.obj libhttpd.lib libapr.lib

这样就得到了可被 LoadModule 的 mod_foobar.dll

win32 下我碰到的问题稍微麻烦一些。启动 apache 无法成功,报告什么 OPENSSL_Applink 错误。看了 openssl 的 FAQ,说什么要 include 一个 applink.c,但仍然无济于事。不过查看 applink.c 后发现,它似乎和 IO 库相关;最后我把以前使用的 stdio 替换成了 openssl 自己的 bio 函数族,该问题就消失了。

openssl 的 win32 库从这里下载并安装

 
http://httpd.apache.org/docs/current/platform/windows.html#down

Apache 流媒体 拖动模块编译的更多相关文章

  1. centos 6.4 Apache 配置 flv mp4.h264 流媒体拖动

    http://blog.csdn.net/xst686/article/details/9763995 加入流媒体扩展后要重启 httpd flv 流媒体 <textarea style=&qu ...

  2. 给已经编译运行的Apache增加mod_proxy模块的配置方法

    在Linux系统下,需要给已经编译运行的Apache增加mod_proxy模块,可以按照如下方法配置. 具体配置步骤如下: 1. 首先定位到Apache源码的 proxy目录 # cd /root/s ...

  3. 为Apache动态增加模块

    Apache已经安装完毕并投入运行,但是后来却发现部分模块没有加载,当然有两个方法: 1. 一是完全重新编译Apache, 再安装 2. 编译模块为SO文件,使用LoadModule指令加载扩展模块. ...

  4. Nginx SPDY Pagespeed模块编译——加速网站载入

    在看<Web性能权威指南>的时候,看到了SPDY这货,于是便开始折腾起了这个了,也顺便把pagespeed加了进去. Nginx SPDY 引自百科~~ SPDY(读作“SPeeDY”)是 ...

  5. apache动态添加模块

    Apache已经安装完毕并投入运行,但是后来却发现部分模块没有加载,当然有两个方法: 1. 一是完全重新编译Apache, 再安装 2. 编译模块为SO文件,使用LoadModule指令加载扩展模块. ...

  6. Apache 的mod_auth_cas模块的介绍和使用

    apache的mod_auth_cas模块是一个集成到apache中的cas客户端,一般是配合Apache的反向代理来使用,对某个url的请求先经过apache,apache会判断是否经过cas认证, ...

  7. SNMP 原理及配置简述 net-snmp-utils net-snmp 第2版基于SNMP 群体名(community name) 第3版引入了安全性更高的访问控制方法 SNMP协议操作只有4种 Apache的php_snmp 模块

    SNMP 原理及配置简述  net-snmp-utils  net-snmp 第2版基于SNMP 群体名(community name) 第3版引入了安全性更高的访问控制方法 SNMP协议操作只有4种 ...

  8. 使用Apache TVM将机器学习编译为WASM和WebGPU

    使用Apache TVM将机器学习编译为WASM和WebGPU TLDR 在Apache TVM深度学习编译器中引入了对WASM和WebGPU的支持.实验表明,在将模型部署到Web时,TVM的WebG ...

  9. Android之源码之模块编译和调试

    Android之源码之模块编译调试 (一) 进行源码模块修改进行编译的调试 1.首先是从git或者svn上拉一套完整的工程下来,然后全编一下,一般这个时间比较长,大概会得2,3个小时左右, 2,编译成 ...

随机推荐

  1. how to learn device driver

    making a linux usb driver http://www.kroah.com/linux/ http://matthias.vallentin.net/blog/2007/04/wri ...

  2. Hadoop HDFS概念学习系列之hdfs里的文件下载闲谈(二十六)

    hdfs里的文件下载 可以,通过hadoop distributed system来下载,而且速度非常之快.涨知识!!! 或者,通过命令行的方式,也可以! ********************** ...

  3. android事件分发笔记

    1.SimpleOnGestureListener 遇到的问题: 自己定义一个按钮继承自Button,一开始改变按钮颜色的操作放在onTouchEvent的ATION_DOWN里触发. 这时问题来了, ...

  4. hdoj 2023 求平均成绩

    求平均成绩 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submi ...

  5. hdoj 1162 Eddy's picture

    并查集+最小生成树 Eddy's picture Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java ...

  6. 如何使用Keil仿真环境查看CPU类型字长?【worldsing笔记】

    笔者上次写了如何用IAR查CPU的字长和数据类长度的方法:点击这里查看 今天试着在Keil MDK 5.0 里查看CPU的字长和数据类长度,打开一个已有的工程,编译并进入Debug,如图1.1所示: ...

  7. 两个简单方法加速DataGridView

    两个简单方法加速DataGridView (2009-03-24 16:57:13) 转载▼ 标签: 杂谈 分类: .NET DataGridView虽然好用,但是如果数据量比较大的话就会出现性能的问 ...

  8. ECSHOP在线手册布局参考图--商品分类页 category.dwt

        A.购物车 1,设置方法 程序自动读取购物车的商品数量 2,代码相关 cart.lbi 中 {insert_scripts files='transport.js'} <div clas ...

  9. MySQL内存表的特性与使用介绍

    国内私募机构九鼎控股打造APP,来就送 20元现金领取地址:http://jdb.jiudingcapital.com/phone.html内部邀请码:C8E245J (不写邀请码,没有现金送)国内私 ...

  10. Codeforces Round #324 (Div. 2) E. Anton and Ira 贪心

    E. Anton and Ira Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/584/probl ...