How to install Lighttpd for FLV streaming

Lighttpd is a free web server designed for speed, with all the essential functions of a web server.  The low memory footprint (compared to other web servers) small CPU load and speed optimizations make lighttpd suitable for servers that are suffering load problems, or for serving static media separately from dynamic content. You can install lighttpd as reverse proxy with apache web server.

 

We can now setup lighttpd as reverse-proxy for apache.

How to install Lighttpd for FLV streaming

find lighttpd rpm repository

http://pkgs.repoforge.org/lighttpd/

or

yum install lighttpd

vi /etc/lighttpd/lighttpd.conf

change lighttpd port to 81
 server.port = 81
 server.use-ipv6 = "disable"

server.username  = "nobody"
 server.groupname = "nobody"

touch /var/log/lighttpd/error.log
touch /var/log/lighttpd/access.log

chown -R nobody.nobody /var/log/lighttpd

/etc/init.d/lighttpd restart

When you get restart error like this errors then check with log file permissions.

Starting lighttpd: (log.c.118) opening errorlog ‘/var/log/lighttpd/error.log’ failed: Permission denied
vi /etc/lighttpd/modules.conf

make sure modules and including these for flv steaming…

include “conf.d/simple_vhost.conf”
include “conf.d/flv_streaming.conf”

include ” conf.d/secdownload.conf”

vi conf.d/simple_vhost.conf

example entry

$HTTP[“host”] =~ “(^|\.)www.lighttpdexample\.com:81$” {
server.document-root = “/home/cpanel/public_html/”
secdownload.secret          = “vAfddsv4$%4”
secdownload.document-root   = “/home/cpanel/public_html/media/videos”
secdownload.uri-prefix      = “/flv/”
secdownload.timeout         = 36000
flv-streaming.extensions = ( “.flv” )
h264-streaming.extensions = ( “.mp4” )
}

or

$HTTP[“host”] != “^(fotoblow.tamilcomedy\.info)$” {
simple-vhost.server-root = “/home/username/public_html/”
simple-vhost.default-host = “fotoblow.tamilcomedy.info”
simple-vhost.document-root = “fotoblow”
}

$HTTP[“host”] =~ “(^|\.)fotoblow.tamilcomedy\.info:81$” {
server.document-root = “/home/username/public_html/fotoblow/”
}
$HTTP[“host”] =~ “(^|\.)www.cpanelkb\.net:81$” {
server.document-root = “/home/username/public_html/fotoblow/”
}
$HTTP[“host”] =~ “(^|\.)tamilcomedy\.info:81$” {
server.document-root = “/home/username/public_html/fotoblow/”
}

 

Then enable steaming modules.

vi conf.d/flv_streaming.conf

server.modules += ( “mod_flv_streaming”)
flv-streaming.extensions = ( “.flv” )

Normally apache will running on port 80, these entries will redirect .flv extension to port 81. Add the following code in your apache configuration.

vi /etc/httpd/conf/httpd.conf

Add the following entries blow domain config

ProxyPassReverse / http://%{HTTP_HOST}:81/
RewriteEngine on
RewriteCond   %{REQUEST_URI} .*\.(gif|png|jpg|flv|mp4|mp3)$
RewriteRule ^/(.*) http://%{HTTP_HOST}:81/$1 [P]

That’s all !!!

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

cPHulk Brute Force Protection

WHM/cPanel has a service, protected from Brute Force attack, which is called “cPHulk Brute Force...

Enable SSH key authorized login without root password

You need to generate SSH Key ( the private key )on your cpanel server and then update remote...

How can I Redirect URLs in cPanel

Login your cpanel 1. Click the Redirects button on the front page under the “domains” 2. Enter...

Enable Custom php.ini for Fast CGI

With fast-cgi, custom php.ini needs to be in the cgi-bin folder. 1) Move php.ini to cgi-bin...

ConfigServer Firewall CSF installation

ConfigServer firewall is a popular linux firewall security suite. It is easy to install, flexible...

Powered by WHMCompleteSolution