Bandwith and lighttpd
Added by GodHunter almost 16 years ago
Hi,
i had searched for an option to get dynamic change of download bandwith with lighttpd.
The reason is that i wanna build a fair option for users they registered and guests so that registered members will get a faster download than guests.
So i had found this option:
header("X-LIGHTTPD-KBytes-per-second: 50");
header("X-Sendfile: path/to/download");
But it didnt worked for me, nothing happend, the download dosnt started.
Normaly im doing that this way:
header("LOCATION: path/to/download");
That version works but than i cant limit bandwith dynamcly...i dunno whats the prob, so if there is an mising mod or something else...
Here is my mod config:
server.modules = ("mod_access",
"mod_alias",
"mod_accesslog",
"mod_fastcgi",
"mod_compress",
- "mod_rewrite",
- "mod_redirect",
- "mod_evhost",
- "mod_usertrack",
- "mod_rrdtool",
- "mod_webdav",
- "mod_expire",
- "mod_flv_streaming",
- "mod_evasive"
)
Replies (7)
RE: Bandwith and lighttpd - Added by GodHunter over 15 years ago
Hi, im using Version 1.4.19
I had searched a lil bit more and found out that i have to set the feature enabled in fastcgi settings, so ive done that but nothing changed.
Here are the settings i had made to activate this feature:
fastcgi.server = ( ".php" => ((
"bin-path" => "/usr/bin/php5-cgi",
"socket" => "/tmp/php.socket",
"allow-x-send-file" => "enable"
)))
But how i sad, the download wouldnt start when i call the file.
header("X-LIGHTTPD-KBytes-per-second: 50");
header("X-Sendfile: http://93.186.192.150/otr/platte1/test.rar");
?>
Ive only get a blank page.
RE: Bandwith and lighttpd - Added by nitrox over 15 years ago
i´m not quite sure about the X-LIGHTTPD-KBytes-per-second working at all, but iirc the X-Sendfile (isn´t it called X-LIGHTTPD-send-file for 1.4?) needs a full path to a file not an url.
http://redmine.lighttpd.net/projects/1/wiki/X-LIGHTTPD-send-file
RE: Bandwith and lighttpd - Added by tx over 15 years ago
For X-LIGHTTPD-KBytes-per-second and lighttpd 1.5 use attached patch
RE: Bandwith and lighttpd - Added by GodHunter over 15 years ago
@tx: As im using lighttpd v.1.4.19 i dont need the patch? Or did i? And how can i install the patch?
@nitrox: Thanks for your help, it doesnt work now but i almost got something shown. He didnt download it but he shows me the file in Browser
Please have a look, i dunno why that happens: http://93.186.192.150/otr/xsend.php
But you are right, he needs the full path to file. The only thing he has to do now is sending the file.
RE: Bandwith and lighttpd - Added by nitrox over 15 years ago
Have you read even a single bit of docs/howto about x-sendfile? You also need to set the Content-Type ofcourse.
Please stop bothering us until you´ve read the docs!