Posted on

Install H264 Streaming Module for Apache & PHP on CentOS Server

Installing the streaming module can be a problem sometimes. This is a simple ins;tall guide which worked fine in a standard CentOS7/cpanel server:

For Cpanel:

yum install ea-apache24-devel

otherwise:

yum install httpd-devel

wget http://h264.code-shop.com/download/apache_mod_h264_streaming-2.2.7.tar.gz
tar -zxvf apache_mod_h264_streaming-2.2.7.tar.gz
cd mod_h264_streaming-2.2.7
./configure
make
make install

Edit /usr/local/apache/conf/httpd.conf
Add the following lines:
LoadModule h264_streaming_module /usr/lib64/httpd/modules/mod_h264_streaming.so
AddHandler h264-streaming.extensions .mp4

Then restart your apache:
service httpd restart

Make sure the module is loaded, you can check using command:
/usr/local/apache/bin/apachectl -t -D DUMP_MODULES | grep h264_streaming_module

then, cd to a public_html which is resolving correctly and run
cd /home/user/public_html
wget -O test.mp4 "http://h264-demo.code-shop.com/demo/apache/trailer2.mp4"

http://your-servers-ip/test.mp4?start=55.5

You will see the opening preview credits in the first link and in the second, it should have the first 55.5 seconds removed from the original video file.