准备条件:
a,创建/usr/local/lighttpd目录,用于安装lighttpd
b,创建lighttpd用户密码为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的ip端口信息
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/