准备条件:
a,创建/usr/local/lighttpd文件夹,用于安装lighttpd
b,创建lighttpd用户password为lighttpd账号,用于lighttpd的启动用户
c,安装prce软件包,Perl兼容的规则表达式库.下载地址 http://sourceforge.net/projects/pcre/files/pcre/7.7/pcre-7.7.tar.gz/download
1,首先去官网http://www.lighttpd.net/下载相应的安装文件(眼下最新1.4.35)。
wget http://download.lighttpd.net/lighttpd/releases-1.4.x/lighttpd-1.4.35.tar.gz
2,解压安装包 lighttpd-1.4.35.tar.gz
[[email protected] lighttpd]# tar -zxvf lighttpd-1.4.35
3,编译lighttpd安装文件
[[email protected] lighttpd-1.4.35]# cd lighttpd-1.4.35 [[email protected] lighttpd-1.4.35]# ./configure --prefix=/usr/local/lighttpd [[email protected] lighttpd-1.4.35]# make [[email protected] lighttpd-1.4.35]# make install
4,创建www文件夹,用于存放html等文件
[[email protected] lighttpd-1.4.35]# mkdir -p /srv/www/htdocs/
5,复制配置文件到etc文件夹命令例如以下
[[email protected] lighttpd]# cp - p /data/lighttpd/lighttpd-1.4.35/doc/config/conf.d /usr/local/lighttpd/etc
6,创建日志输出文件夹
[[email protected] lighttpd]# mkdir - p /var/log/lighttpd
7,改动启动关闭重新启动配置
cp doc/initscripts/rc.lighttpd.redhat /etc/init.d/lighttpd
8,然后改动/etc/init.d/lighttpd,把
lighttpd="/usr/sbin/lighttpd"
改为
lighttpd="/usr/local/lighttpd/sbin/lighttpd"
9,进入文件夹/usr/local/lighttpd/etc。改动lighttpd.conf的var.log_root的值为"/var/log/lighttpd"
10,改动lighttpd的ipport信息
server.port = 8080 ## ## Use IPv6? ## server.use-ipv6 = "disable" ## ## bind to a specific IP ## server.bind = "192.168.10.1"
11,改动 modules.conf文件,用来支持flv伪流模,改后例如以下
server.modules = ( "mod_access", # "mod_alias", # "mod_auth", # "mod_evasive", "mod_redirect", "mod_rewrite", "mod_secdownload", "mod_flv_streaming", # "mod_setenv", # "mod_usertrack", ) flv-streaming.extensions = ( ".flv" )
12,改动属主为:lighttpd:lighttpd
chrown -R lighttpd:lighttpd /usr/local/lighttpd chrown -R lighttpd:lighttpd //srv/www/htdocs chrown -R lighttpd:lighttpd //var/log/lighttpd
13,启动lighttpd,看到以下的输出即成功
[[email protected] etc]# service lighttpd start Starting lighttpd:
转载:http://blog.csdn.net/joeyon1985/article/details/39961887
參考:http://blog.lighttpd.net/articles/2006/03/09/flv-streaming-with-lighttpd/