Saturday, 28 January 2012

Install lighttpd

1. yum install lighttpd lighttpd-fastcgi
2. open the configuration file /etc/lighttpd/lighttpd.conf and add the line at the end

include "conf.d/vhost.conf"

3. open /etc/lighttpd/conf.d/vhost.conf and add the following line


$HTTP["host"] =~ "domain\.net" {
        server.document-root = "/home/lighttpd/domain.net/http"
        accesslog.filename     = "/home/lighttpd/domain.net/logs/access.log"
}

4. open /etc/lighttpd/modules.conf and uncomment the modules


server.modules           = (
                            "mod_rewrite",
                            "mod_redirect",
                            "mod_access",
                            "mod_fastcgi",
                            "mod_accesslog" )


##
## FastCGI (mod_fastcgi)
##
include "conf.d/fastcgi.conf" ## uncomment this line

5(a). whereis php-cgi
php-cgi: /usr/bin/php-cgi #Might be different on your system.

or 

5(b). /etc/lighttpd/conf.d/fastcgi.conf and add the following:

fastcgi.server = ( ".php" => ((
                  "bin-path" => "/usr/bin/php-cgi",
                  "socket" => "/tmp/php.socket"
              )))

For installing H264 Streaming Module,
------------------------------------------------------

1. wget http://h264.code-shop.com/download/lighttpd-1.4.18_mod_h264_streaming-2.2.9.tar.gz
2. tar -zxvf lighttpd-1.4.18_mod_h264_streaming-2.2.9.tar.gz
3. cd ~/lighttpd-1.4.18
4. ./configure

Make and install Lighttpd.

5. make
6. sudo make install

Configuration

7. Edit the configuration file (in /etc/lighttpd/lighttpd.conf) so that file requests ending in ".mp4" are handled by the mod_h264_streaming module.

server.modules = ( 
  ...,
  "mod_h264_streaming",
  ...
)
h264-streaming.extensions = ( ".mp4" )

8. sudo /etc/init.d/lighttpd start




No comments:

Post a Comment