Pengen Punya WebSite instan kualitas intan ?

Thursday, July 15, 2010

h264 dan flv streaming pada Lighttpd

install dependency
zypper in fam fam-devel libgio-fam pkg-config pcre-devel

cd /root

wget http://download.lighttpd.net/lighttpd/releases-1.4.x/lighttpd-1.4.23.tar.gz
tar -xzf lighttpd-1.4.23.tar.gz

mendapatkan h264 dari Lighttp 1.4.18 svn
svn export http://h264.code-shop.com/svn/h264/tags/mod_h264_streaming-2.0/lighttpd-1.4.18 lighttpd-1.4.18
svn export --force http://h264.code-shop.com/svn/h264/tags/mod_h264_streaming-2.0/mp4split lighttpd-1.4.18/src

cp lighttpd-1.4.18/src/moov.* lighttpd-1.4.23/src/
cp lighttpd-1.4.18/src/mod_h264_streaming.c lighttpd-1.4.23/src/

edit Makefile.am
vi lighttpd-1.4.23/src/Makefile.am

#
# add this line after mod_flv_streaming portion:
lib_LTLIBRARIES += mod_h264_streaming.la
mod_h264_streaming_la_SOURCES = mod_h264_streaming.c moov.c
mod_h264_streaming_la_LDFLAGS = -module -export-dynamic -avoid-version -no-undefined
mod_h264_streaming_la_LIBADD = $(common_libadd)

Compile dan install lighttpd with h264
cd lighttpd-1.4.23/
./autogen.sh
./configure
make && make install

jika ingin enable pcre pada lighttpd bisa seperti berikut - centos - (thanks to rob moen):
./autogen.sh
./configure --with-pcre
make && make install

konfigurasi mod_h264_streaming pada lighttpd.conf 1.4.23
mkdir /etc/lighttpd
cp ./doc/lighttpd.conf /etc/lighttpd/
mkdir /var/log/lighttpd
touch /var/log/lighttpd/error.log
vi /etc/lighttpd/lighttpd.conf

# on server.modules add mod_h264_streaming,
# and actived mod_expire and mod_secdownload, and other modules
server.modules              = (
etc...
"mod_expire",
"mod_secdownload",
"mod_flv_streaming",
"mod_h264_streaming" )

# add this flv streaming extensions
flv-streaming.extensions = ( ".flv" )
# add this h264 streaming extensions
h264-streaming.extensions = ( ".mp4" )

contoh buat index pada srver root

sebelumnya lihat setingan pada /etc/lighttpd/lighttpd.conf









## mod_simple_vhost module.



server.document-root        = "/srv/www/htdocs/"





lalu kita buat file index.html
vi index.html

isi dengan : hallo i'm lighttpd

dan simpan.

Starting Lighttpd 1.4.23
/usr/local/sbin/lighttpd -f /etc/lighttpd/lighttpd.conf &

atau
/usr/local/sbin/lighttpd-angel -D -f /etc/lighttpd/lighttpd.conf &

tes akses dari browser http://commands.org.uk:81/

untuk stop
killall lighttpd

*catatan :

jika pada server ada apache, sebelum start lighttpd kita harus mengkonfigurasi port agar beda dengan port yang digunakan pada apache. Letak konfigurasinya ada pada lighttpd.conf

thanks for toxpenguen

0 comments:

Post a Comment