nixCraft Linux Forum

nixCraft

Linux / UNIX Tech Support Forum

Lighttpd Hotlink Prevention

This is a discussion on Lighttpd Hotlink Prevention within the Web servers forums, part of the Mastering Servers category; Hello , I had a problem when i tried to integrate hotlink protection to my conf. My current lighttpd.conf file ...


Go Back   nixCraft Linux Forum > Mastering Servers > Web servers

Linux answers from nixCraft.


Web servers Discussion on Apache, Nginx and Lighttpd HTTP/web server and configuration issues.

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-20-2008, 04:21 PM
Junior Member
User
 
Join Date: Jul 2007
OS: CentOs
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
Lizard King is on a distinguished road
Default Lighttpd Hotlink Prevention

Hello ,

I had a problem when i tried to integrate hotlink protection to my conf.

My current lighttpd.conf file is as follow. How shall i add the hotlink prevention code ? What ever i do i always get an error while restarting lighttpd. I tried using Lighttpd prevent image hotlinking or leeching or direct linking

Code:
$HTTP["host"] =~ "^www.ayyas\.com$" {
server.document-root = "/home/lighttpd/ayyas.com/html"
server.errorlog = "/var/log/lighttpd/error_ayyas.log"
accesslog.filename = "/var/log/lighttpd/access_ayyas.log"
url.rewrite-once = (
"^/(sitemap.*\.(xml|txt)(\.gz)?)$" => "/vbseo_sitemap/vbseo_getsitemap.php?sitemap=$1",
"^(/(attachments|orange|phpmyadmin|mina|highslide|xcache|geek|gars|stats|ajaxtabs|mert|blizzard|serenity|cey|arcade|mysmiliesvb|admincp|modcp|clientscript|cpstyles|images|sonstil|kirmizi|files|galeri|vampir|summer|avatars|attachments|custompics|customavatars|favicon)/.*)$" => "$1",
"^/(archive/.*)$" => "/vbseo.php?vbseourl=$1",
"^(.*(clear\.gif|favicon\.ico))$" => "$1",
"^/(.+)\?(.*)$" => "/vbseo.php?vbseourl=$1&$2",
"^/(.+)$" => "/vbseo.php?vbseourl=$1"
)
server.error-handler-404 = "/404.php"
}
$HTTP["host"] =~ "^ayyas\.com$" { url.redirect = ( "^/(.*)" => "http://www.ayyas.com/$1" ) }
Reply With Quote
  #2 (permalink)  
Old 05-02-2008, 02:44 AM
rockdalinux's Avatar
Is that all you got?
User
 
Join Date: May 2005
Location: Planet Vegeta
OS: Redhat
Posts: 703
Thanks: 15
Thanked 19 Times in 18 Posts
Rep Power: 10
rockdalinux is a glorious beacon of light rockdalinux is a glorious beacon of light rockdalinux is a glorious beacon of light rockdalinux is a glorious beacon of light rockdalinux is a glorious beacon of light rockdalinux is a glorious beacon of light
Default

Try this
Code:
#### stop image hijacking (anti-hotlinking)
$HTTP["referer"] =~ ".*BADDOMIN\.com.*" {
      url.access-deny = ( "jpg", "png", "js", "jpeg", "gif" )
}
Replace BADDOMIN with actual domain i.e. block hotlinking domain
__________________
Rocky Jr.
What's wrong? I hope I am not making you uncomfortable...

Never send a boy to do a mans job.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads

Thread Thread Starter Forum Replies Last Post
Can lighttpd access log be filtered? petu Web servers 5 10-21-2008 01:10 PM
lighttpd ProxyPass thunderbirdsei Web servers 0 04-30-2008 10:50 PM
Inactivity timer for lighttpd petu Web servers 0 03-11-2008 12:49 PM
Apache and lighttpd together anjanesh Web servers 4 08-29-2007 05:11 PM
redirect to www in lighttpd muks Web servers 11 06-02-2007 10:55 PM


All times are GMT +5.5. The time now is 12:05 PM.


Powered by vBulletin® Version 3.8.5 - Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2
©2005-2009 nixCraft. All rights reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38