Lighttpd 图片和视频等文件的防盗链处理

  用过Apache的朋友都知道mod_rewrite可以用来进行处理防盗链,Lighttpd也有同样的功能,而且总的来说,lighttpd.conf配置文件比httpd.conf更简单明了。 原来一直使用Apache来处理防盗链,今天修改了服务器上Lighttpd的配置,直接实现了防盗链,下面是防盗链部分的代码。

[coolcode]
$HTTP[“referer”] !~ “^($|http://.*\.(toplee\.com|8zone\.cn))” {
  $HTTP[“url”] =~ “\.(jpg|jpeg|png|gif|rar|zip|mp3)$” {
    url.redirect = (“.*” => “http://www.toplee.com/blog/”)
  }
}
[/coolcode]

  懂点编程的朋友一定惊叹lighttpd的配置如此简洁明了,我非常喜欢这种风格的东西!
Lighttpd

112 thoughts on “Lighttpd 图片和视频等文件的防盗链处理”

  1. Michael您好,打扰了.发您邮件可能跑垃圾邮件里去了,等了几天没见您回复.所以留言到您这里来了.:)
    故事是这样的:
    我是做点播服务的,说的通俗点就是像现在的电影网站,影片数据是放在自己的服务器上的.现在的情况是这样,眼看影片数据的一天一天增加,硬盘的容量也一点一点减少.该怎么规划新的存储结构噢?
    小弟才浅,1\认为在原来的做过Raid1上面在加两个相同容量的硬盘上去.
    2\在增加一台烂机器,采用现在的小弟认为比较热门的FreeNAS来做,存储服务器?(对FreeNas我不是很懂)
    请问michael指点指点?小弟不胜感激.(方案最好成本越低越好,因为现在访问量并不大)

  2. 的确没有收到邮件,如果你的邮件标题大多是英文的,估计都会被我的postfix邮件系统自动扔到垃圾箱了:)

    你说的情况不是很明确,首先你有没有分布式? 还是只是单机? 另外你提供的服务是直接在线播放吗?

    基于上述问题,你可能需要考虑如何保证不同电信运营商接入用户的速度问题,如果分布式的话要考虑同步问题。

    存储空间始终都是在不断增长的,如果说你想让自己的业务不断蒸蒸日上,那就必须面临存储的不断膨胀。

    我接触过的情况是大部分都是存储上10T级别的,这样的应用都需要用到专门的盘阵,有一些专门的公司做这个,有他们的服务很好,盘阵有基于光纤的也有磁盘柜的,我建议你一开始就选择一个盘阵比较好,盘阵都是可扩展的,随着业务增长只需要往上堆硬盘就行。

    如果你想低成本先用普通机器顶着,你就往机器上加硬盘即可,然后进行分区mount到系统上,如果不想改太多程序,做个符号连接到原来的存储目录里面即可。

    另外,也可以考虑新增加一台机器,使用NFS挂接到现有机器上。

    有更多问题,如果我知道的会尽力回复你,邮件lee@toplee.com

  3. 博主你好 我一直在网上找一些防止盗连的技术或者软件 看见了你的文章
    像看见了希望一样 我的网站上视频放在一个服务器上 页面放在一个服务器上
    应该如何处理盗连呢 我的服务器都是windows的 麻烦帮我想想办法可以么
    我在http://v.nmtv.cn/ 这个网站上 看见类似我想要的 他的视频文件都是wmv格式和我的一样 他的是写了什么程序处理了 应该这个程序怎么实现 没点思路 望指教

  4. 我vps的,路径如下
    /etc/lighttpd/lighttpd.conf
    /usr/local/lxlabs/kloxo/httpdocs/htmllib/filecore/lighttpd.conf
    /usr/local/lxlabs/kloxo/file/lighttpd.conf
    /usr/local/lxlabs/kloxo/file/lighttpd/lighttpd.conf
    /usr/share/doc/lighttpd-1.4.20/lighttpd.conf 具体都不晓得应该是那个了

  5. monface: 我vps的,路径如下
    /etc/lighttpd/lighttpd.conf
    /usr/local/lxlabs/kloxo/httpdocs/htmllib/filecore/lighttpd.conf
    /usr/local/lxlabs/kloxo/file/lighttpd.conf
    /usr/local/lxlabs/kloxo/file/lighttpd/lighttpd.conf
    /usr/share/doc/lighttpd-1.4.20/lighttpd.conf 具体都不晓得应该是那个了

    应该是 /etc/lighttpd/lighttpd.conf

  6. I have been exploring for a little for any high quality articles or
    blog posts on this sort of area . Exploring in Yahoo I ultimately stumbled upon this site.

    Reading this information So i’m glad to convey that I’ve a very excellent uncanny feeling I found out just what I needed.

    I most definitely will make certain to do not put out of your
    mind this web site and provides it a look on a relentless basis.

  7. Greetings! I know this is somewhat off topic but
    I was wondering which blog platform are you using for this website?

    I’m getting sick and tired of WordPress because I’ve had issues
    with hackers and I’m looking at alternatives for another platform.
    I would be fantastic if you could point me in the direction of a good
    platform.

  8. Hello there I am so grateful I found your site, I really found
    you by mistake, while I was looking on Google for something else, Anyhow
    I am here now and would just like to say thank
    you for a remarkable post and a all round interesting
    blog (I also love the theme/design), I don’t have time to read through it all at the moment but
    I have bookmarked it and also added your RSS feeds, so when I have time I will be back to read more, Please do keep
    up the awesome jo.

  9. What you published made a ton of sense. But, consider this, what if you were to write
    a awesome headline? I ain’t suggesting your content isn’t solid., but suppose you added a headline that grabbed people’s attention? I mean Lighttpd 图片和视频等文件的防盗链处理 | 李俊麟的平凡生活 is a
    little plain. You could peek at Yahoo’s home page and note how
    they create news headlines to get people to click. You might add a related
    video or a related pic or two to grab readers excited about
    everything’ve got to say. Just my opinion, it could
    bring your posts a little livelier.

  10. Hey there! Quick question that’s entirely off topic.
    Do you know how to make your site mobile friendly?
    My website looks weird when browsing from my iphone4.
    I’m trying to find a template or plugin that might be
    able to correct this issue. If you have any recommendations, please share.

    Appreciate it!

  11. I’ve been browsing online more than 3 hours as of late, but I never found
    any interesting article like yours. It’s
    beautiful value enough for me. In my view, if all webmasters and bloggers made excellent content as you
    probably did, the net will be much more useful than ever before.

  12. Pingback: xtream codes pdf
  13. Pingback: Reseller hosting
  14. With havin so much written content do you ever run into any problems
    of plagorism or copyright violation? My site has a lot of completely
    unique content I’ve either authored myself or outsourced but it appears a lot
    of it is popping it up all over the internet without my authorization. Do you know any methods to
    help protect against content from being stolen? I’d genuinely appreciate it.

  15. Hi my loved one! I wish to say that this post is awesome, great written and include approximately all significant infos.
    I’d like to peer extra posts like this .

  16. Simply want to say your article is as amazing. The clearness for your submit
    is simply excellent and i can assume you are knowledgeable in this
    subject. Well along with your permission let me to snatch your
    feed to stay up to date with impending post.
    Thank you one million and please keep up the enjoyable work.

  17. Have you ever thought about adding a little bit more than just your articles?
    I mean, what you say is fundamental and all. But just imagine if you added
    some great graphics or videos to give your posts more,
    “pop”! Your content is excellent but with images and clips, this site could certainly be one of the very best in its niche.
    Wonderful blog!

  18. After looking into a few of the articles on your blog, I
    seriously like your technique of writing a blog. I added
    it to my bookmark website list and will be checking back
    in the near future. Please check out my web site too and let me know how you
    feel.

  19. I know this if off topic but I’m looking into starting my own weblog and was curious what all is required to get set
    up? I’m assuming having a blog like yours would cost a
    pretty penny? I’m not very web savvy so I’m not 100% sure.

    Any tips or advice would be greatly appreciated. Many thanks

  20. I do not know whether it’s just me or if perhaps everybody else experiencing issues with your site.
    It looks like some of the written text on your posts are running off the screen. Can somebody else please provide feedback and
    let me know if this is happening to them too? This might be a problem with my browser because I’ve had this
    happen before. Kudos

  21. I am really loving the theme/design of your blog. Do you ever run into any internet browser compatibility issues?

    A couple of my blog audience have complained about my blog
    not working correctly in Explorer but looks great in Safari.
    Do you have any solutions to help fix this problem?

  22. I have been exploring for a little bit for any high quality articles or blog posts on this sort of space .
    Exploring in Yahoo I finally stumbled upon this site.

    Reading this info So i’m glad to show that I have an incredibly good uncanny
    feeling I discovered exactly what I needed. I so much indubitably will make
    sure to do not fail to remember this site and give it
    a glance regularly.

  23. Please let me know if you’re looking for a article writer for
    your blog. You have some really great posts and I believe I would be a
    good asset. If you ever want to take some of the load
    off, I’d absolutely love to write some articles for your blog in exchange
    for a link back to mine. Please blast me an email if interested.
    Thank you!

  24. It’s a pity you don’t have a donate button! I’d definitely donate
    to this excellent blog! I suppose for now i’ll settle
    for bookmarking and adding your RSS feed to my Google account.

    I look forward to new updates and will talk about this website with my Facebook group.
    Talk soon!

Leave a Reply

Your email address will not be published. Required fields are marked *

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Anti-spam image