This shows you the differences between two versions of the page.
lightttpd [2010/04/08 02:33] k2patel |
lightttpd [2020/08/10 02:35] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== lighttpd ====== | ||
- | In order to make it work simply change following options. | ||
- | |||
- | Enable all needed modules, in this case i am configuring it for streaming. | ||
- | |||
- | <code lighttpd> | ||
- | "mod_flv_streaming", | ||
- | "mod_h264_streaming", | ||
- | </code> | ||
- | |||
- | Specify file extension | ||
- | |||
- | <code lighttpd> | ||
- | flv-streaming.extensions = ( ".flv" ) | ||
- | h264-streaming.extensions = ( ".mp4" ) | ||
- | </code> | ||
- | |||
- | Now enable document root from where you want to serve content. | ||
- | |||
- | <code lighttpd> | ||
- | server.document-root = "/srv/www/html/tube.xyz.com/video/" | ||
- | </code> | ||
- | |||
- | Setup Log / PID file | ||
- | |||
- | <code lighttpd> | ||
- | server.errorlog = "/var/log/lighttpd.error.log" | ||
- | accesslog.filename = "/var/log/lighttpd.access.log" | ||
- | server.pid-file = "/var/run/lighttpd.pid" | ||
- | </code> | ||
- | |||
- | Setup server port/IP | ||
- | |||
- | <code lighttpd> | ||
- | server.port = 81 | ||
- | server.bind = "127.0.0.1" | ||
- | </code> | ||
- | |||
- | Setup server user | ||
- | |||
- | <code lighttpd> | ||
- | server.username = "ketan" | ||
- | server.groupname = "ketan" | ||
- | </code> | ||
- | |||
- | Finally setup virtual host. | ||
- | |||
- | <code lighttpd> | ||
- | $HTTP["host"] =~ "tube.xyz\.com" { | ||
- | server.document-root = "/srv/www/html/tube.xyz.com/video" | ||
- | } | ||
- | </code> | ||
- | |||
- | Also you can add IP based Socket. | ||
- | |||
- | <code lighttpd> | ||
- | $SERVER["socket"] == "192.168.1.5:81" { | ||
- | server.document-root = "/srv/www/html/www.xyz.com/videos/" | ||
- | server.errorlog = "/var/logs/lighttpd-xyz.error.log" | ||
- | accesslog.filename = "/var/logs/lighttpd-xyz.com.access.log" | ||
- | } | ||
- | </code> |