新浪博客

Lighttpd 访问m3u8文件显示403 -Forbidden错误页面

2013-02-19 14:17阅读:
问题:
Lighttpd访问http:/live***/bjwshd/workflow1.m3u8显示403 -Forbidden
但在lighttpd家目录下创建测试html文件,可以通过URL成功访问到。
原因:
(1)配置文件问题
lighttpd配置文件中需引用到mime type来设定某种扩展名的文件用一种应用程序来打开的方式类型),引用文件为include 'conf.d/mime.conf'
而实际配置的mime.conf文件缺失对m3u8和ts的类型说明
(2)lighttpd 主目录下/live***/bjwshd内容软连指向/dev/s**/ftp,ftp下的目录属性755,/dev/s**也为755,唯独/dev/s**/ftp属性为700,显然其它用户无法访问。注意如果有软连,则在lighttpd配置文件中需将symlink设为enable(server.follow-symlink = 'enable')
解决:
(1)在mime.conf文件中,加上以下内容
'.m3u8' => 'audio/x-mpegurl',
'.ts' => 'video/MP2T',

(2)/dev/s**/ftp属性改为755
********************他山之石********************
http://redmine.lighttpd.net/boards/2/topics/43
56
ASK:
I'm trying to serve static files, but in a directory on another volume. However, whenever I try to view a file in the directory, I get a 403 - Forbidden. What I've tried:
- Symbolic links on the same volume work fine, both inside and outside of the document root. So server.follow-symlink = 'enable' I think is set fine.
- I've checked permissions on the file and directory in question, and it's all world-readable
- I've tried server.network-backend = 'linux-sendfile' and server.network-backend = 'writev' to see if there is any difference. There isn't.
- I've enabled debug.log-request-handling, and it just says 'access denied' when it gets to the point where it accesses the file.
- I've check if SELinux active and disable that
Solved: I feel mildly foolish, but it was a permissions issue on the parent directories: they needed +x on them. The fact that the ones that didn't work were on a different filesystem was just a coincidence.

我的更多文章

下载客户端阅读体验更佳

APP专享