1)、Nginx服务器的安装
#安装zlib
tar xzvf zlib-1.2.3.tar.gz
cd zlib-1.2.3
./configure
make && make install
#安装pcre
tar zxvf pcre-7.9.tar.gz
cd pcre-7.9
./configure --prefix=/usr/local/pcre
make && make install
#安装nginx
groupadd www
useradd -g www www
tar xzvf nginx-0.8.34.tar.gz
cd nginx-0.8.34
./configure --with-http_ssl_module --with-pcre=/root/zhang/nginx/pcre-7.9 --with-zlib=/root/zhang/nginx/zlib-1.2.3 --user=www --group=www --prefix=/usr/local/webserver/nginx --with-http_flv_module
make && make install
2)、安装yamdi
yadmi的作用是为flv文件添加关键帧,才能实现拖动播放
#下载yadmi
wget
#安装yadmi
tar xzvf yamdi-1.4.tar.gz
cd yamdi-1.4
make && make install
使用方法:yamdi -i input.flv -o out.flv
给input.flv文件 添加关键帧,输出为out.flv文件
3)、配置nginx
vi /usr/local/nginx/conf/nginx.conf 添加以下内容(根据自身情况修改):
user
worker_processes 30;
error_log
pid
events {
use epoll;
worker_connections
}
http {
include
default_type
log_format main
'"$request" $status $bytes_sent '
'"$http_referer" "$http_user_agent" '
'"$gzip_ratio"';
keepalive_timeout
server_names_hash_bucket_size
client_header_buffer_size
large_client_header_buffers
access_log off;
gzip on;
gzip_min_length
gzip_buffers
gzip_types
output_buffers
postpone_output
client_header_timeout
client_body_timeout
send_timeout
sendfile
tcp_nopush
tcp_nodelay
######################################################################
server {
listen
server_name
root
limit_rate_after 5m;
limit_rate 512k;
index
charset utf-8;
location ~ \.flv {
flv;
}
error_page
location = /50x.html {
root
}
}
}
4)、基本上已经设置完毕,但是此时我们测试的时候还需要一个支持拖拽播放的flash播放器,开源的JW Player就可以实现这样的功能.

















