lighttpd

Rewriting with lighttpd - how to remove file extensions

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-01 00:31:10
I would like to use lighttpd's mod_rewrite to allow requests without a specific file extension. For instance, I would like the following mappings to automatically work: Requesting for "/index" would serve "/index.php". "/dir/file" => "/dir/file.php" "/dir/file?args" => /dir/file.php?args" Can this be easily done with a single rewrite rule for a given extension (e.g. ".php")? Cassy and natbro got this very nearly right, but as user102008 commented, this erroneously rewrites any directory index. Adding a url.rewrite-once matching anything ending with a '/' seems to make it work. url.rewrite-once

Benchmarking Performance of node.js (cluster) with mysql pools : Lighttpd + PHP?

泄露秘密 提交于 2019-11-30 12:21:04
问题 Edit(2): Now using db-mysql with generic-pool module. The error rate has dropped significantly and hovers at 13% but the throughput is still around 100 req/sec. Edit(1): After someone suggesting that ORDER BY RAND() would cause MySQL to be slow, I had removed that clause from the query. Node.js now hovers around 100 req/sec but still the server reports 'CONNECTION error: Too many connections'. Node.js or Lighttpd with PHP? You probably saw many "Hello World" benchmarking of node.js... but

lighttpd as reverse-proxy

北慕城南 提交于 2019-11-30 11:48:43
问题 DeviceA serves as a reverse-proxy and is supposed to forward requests as follows: 192.168.1.10/DeviceB ==> 192.168.1.20/index.html 192.168.1.10/DeviceC ==> 192.168.1.30/index.html Both index files are located under /var/www and are static "Hello world!" pages. The problem is that I can't access those files through DeviceA, but if I call a test service also running on DeviceC (listening on port 12345) everything works fine. Am I wrong saying that the web server on DeviceB, DeviceC should

Server-side auto-minify?

烈酒焚心 提交于 2019-11-30 09:03:05
Is there any way to automatically minify static content and then serve it from a cache automatically? Similar to have mod_compress/mod_deflate work? Preferably something I could use in combination with compression (since compression has a more noticeable benefit). My preference is something that works with lighttpd but I haven't been able to find anything, so any web server that can do it would be interesting. You can try nginx's third party Strip module: http://wiki.nginx.org/NginxHttpStripModule Any module you use is just going to remove whitespace. You'll get a better result by using a

Failed requests by length in my ApacheBench load test result

爱⌒轻易说出口 提交于 2019-11-30 01:35:24
I have a website in PHP, Lighttpd. It uses also MySQL on Centos 5. I've tested my PHP with code below with Apache Bench (ab). It resulted in some errors (Failed Requests) indicating other length than normal. I'm absolutely sure that my PHP result should always have the same exact length. I've reviewed my Lighttpd and MySQL logs and error logs and don't have any errors there. Is there any way to check exactly what ab gets when result has other length or is there any other way to find out what is the cause or what is the "bad" result? I need to know that because I need to have 100% good results.

lighttpd as reverse-proxy

房东的猫 提交于 2019-11-30 00:26:45
DeviceA serves as a reverse-proxy and is supposed to forward requests as follows: 192.168.1.10/DeviceB ==> 192.168.1.20/index.html 192.168.1.10/DeviceC ==> 192.168.1.30/index.html Both index files are located under /var/www and are static "Hello world!" pages. The problem is that I can't access those files through DeviceA, but if I call a test service also running on DeviceC (listening on port 12345) everything works fine. Am I wrong saying that the web server on DeviceB, DeviceC should respond with index.html if a request comes in on port 80 ??? lighttpd.conf DeviceA @192.168.1.10 server

百度应用部署秘籍

纵然是瞬间 提交于 2019-11-29 18:29:52
【背景介绍】 传统PaaS采用sandbox实现app间的资源安全隔离,sandbox需要对运行环境和编程语言进行底层的功能限制,例如:禁止创建进程和线程,禁止部分系统调用,禁止对某些系统路径的读写,禁止加载C语言模块,禁止某些网络功能等,这大大增加了开发者的开发成本,也使得应用开发和跨平台迁移难度叫交接和学习成本变大,不利于平台的推广。另外困扰开发者的一个主要问题就是应用的云端运行环境与开发者的本地开发环境不一致,很多功能受到限制。开发者在本地开发调试好的应用,发布到云端就遇到沙盒限制问题无法运行,不得不针对云端环境进行修改。BAE采用轻量虚拟机技术进行资源隔离,在运行环境和编程语言层面,不做任何限制;应用在云端的运行环境与开发者本地的开发环境保持一致,从而使得学习成本、开发和迁移成本降到最低,开发者的生产力得到最大限度的解放。下图显示沙盒技术实现资源隔离(左)与轻量虚拟机技术实现资源隔离(右)的区别: 一、服务器部署评估 应用部署计算流量可能存在一个逐渐优化的过程,为了防止流量突增引起雪崩效益,针对php执行环境(代码为hello world),对单个执行单元并发20时候,qps达到530最高阈值,并发再次提高qps会下降,单个执行单元配置:单核,内存 512,带宽10M 。部分压测数据如下: 注:当前压测数据是对执行单元最简单的吞吐校验。是线上和线下的一个辅助校验

Server-side auto-minify?

◇◆丶佛笑我妖孽 提交于 2019-11-29 14:10:59
问题 Is there any way to automatically minify static content and then serve it from a cache automatically? Similar to have mod_compress/mod_deflate work? Preferably something I could use in combination with compression (since compression has a more noticeable benefit). My preference is something that works with lighttpd but I haven't been able to find anything, so any web server that can do it would be interesting. 回答1: You can try nginx's third party Strip module: http://wiki.nginx.org

Create HTML button to run Python Script

╄→尐↘猪︶ㄣ 提交于 2019-11-29 08:02:18
I am trying to create a button on a webpage quad_relay.html <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.o$ <html xmlns="http://www.w3.org/1999/xhtml"> </script> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> </head> <body> <h1>Quad Web Relay</h1> <div>Relay 1: <input type="button" value="Toggle" id="toggle1" /> </div> </body> </head> </html> When that button is clicked I want it to run a python script set_gpio.py def set_pins_high(): fp = open("/sys/class/gpio/gpio"+pin+"/value","w") fp.write(str(1)) fp.close() def set_pins_low():

部署Lighttpd到252板子

為{幸葍}努か 提交于 2019-11-29 01:04:01
1. 先到lighttpd 官网 下载对应版本的软件包: 如: lighttpd-1.4.30.tar.gz 2. 将压缩包解压到任意目录得到文件夹 lighttpd-1.4.30 3. 执行配置命令: bash ./configure CC=arm-hisiv600-linux-gcc AR=arm-hisiv600-linux-ar LD=arm-hisiv600-linux-ld RANLIB=arm-hisiv600-linux-ranlib STRIP=arm-hisiv600-linux-strip --prefix=/opt/web/lighttpd-1.4.30-arm --host=arm-hisiv600-linux --build=i686-pc-linux --disable-FEATURE --enable-shared --disable-static --disable-lfs --disable-ipv6 --without-PACKAGE --without-valgrind --without-openssl --without-kerberos5 --without-pcre --without-zlib --without-bzip2 --without-lua ( 其中的交叉编译工具、安装目录根据项目要求更改) 4. 编译lighttpd