lighttpd

How to handle relative paths in node.js / express?

假装没事ソ 提交于 2019-12-04 03:22:52
问题 I've written a website in node.js and express. Now I configured lighttpd to use the node.js server with an subdirectory: $HTTP["url"] =~ "^/app/" { proxy.server = ( "" => ( ( "host" => "127.0.0.1", "port" => 3000 ) ) ) } When I open http://localhost/app/ I get error 404 because I wrote something like this: app.get('/', function (req, res){ res.render('index'); }); Is there a better way as modifying these lines like: var relPath = '/app'; app.get(relPath + '/', function (req, res){ res.render(

Apache - how to limit maximum download speed of files? (if not apache, i can run lighthttpd)

岁酱吖の 提交于 2019-12-04 01:28:38
问题 I have a bunch of videos but I only want to limit the maximum download speed for these files to be 1mbps. How can I set this up (ideally in Apache but lighthttpd is an option) thanks 回答1: If you only want to limit the download speed per connection, without any regard for managing the totals or performing more fine-grained controls, the best way to handle this is to use Apache's own mod_ratelimit . This example restricts everything under /files to 1Mbit/s ... <Location /files> SetOutputFilter

Rewriting with lighttpd - how to remove file extensions

[亡魂溺海] 提交于 2019-12-03 22:19:42
问题 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")? 回答1: Cassy and natbro got this very nearly right, but as user102008 commented, this erroneously rewrites any directory

How to improve PHP performance?

那年仲夏 提交于 2019-12-03 20:21:04
I've created PHP application for Facebook. It uses MySQL, Memcached and works on Lighttpd on Centos 2,6 Ghz and 2 GB RAM. it's basically one PHP file that after first run is cached and every next time it's served in 0,8 ms directly from Memcached. What more can I do to shorten this time? Once you get to 0.8 ms, I'm not sure you can go any lower. However, you can set up multiple servers to handle many concurrent requests (with a common memcached). You will then be able to scale very high by simply adding a new server when you reach limits. Run XDebug and run the profiler . There you can see if

nginx、apache和lighttpd比较

大城市里の小女人 提交于 2019-12-03 17:36:40
Apache介绍: Apache是基于模块化设计的,它的核心代码并不多,大多数的功能都被分散到各个模块中,各个模块在系统启动的时候按需载入。 MPM(Multi -Processing Modules,多重处理模块)是Apache的核心组件之一, Apache通过MPM来使用操作系统的资源,对进程和线程池进行管理 。Apache为了能够获得最好的运行性能,针对不同的平台 (Unix/Linux、Window)做了优化,为不同的平台提供了不同的MPM,用户可以根据实际情况进行选择, 其中最常使用的MPM有 prefork和worker两种 (两种模式介绍http://my.oschina.net/shyl/blog/523070)。至于您的服务器正以哪种方式运行,取决于安装Apache过程中指定的MPM编译参数,在X系统上默认的编译参数为 prefork。 Apache的CGI和Module: 区别在于一个进程池是web server的进程池,一个是php的进程池;FASTCGI这种模式下,可以比较好的分离动态和静态请求,php出了问题不会影响web server。 Nginx介绍: Nginx的模块从结构上分为核心模块、基础模块和第三方模块: 核心模块:HTTP模块、EVENT模块和MAIL模块 基础模块:HTTP Access模块、HTTP FastCGI模块、HTTP

ASP.NET / Web.config: customErrors redirect only on a 404

眉间皱痕 提交于 2019-12-03 12:23:01
I have this scenario: A user comes to my site and followes a link, wich doesnt exists anymore, he should be redirected to a custom errorpage. (that works) If a user does something, that throws an error, he should see the Stacktrace and the real Errorpage. This is my current Web.config: <?xml version="1.0" encoding="utf-8" ?> <configuration> <system.web> <customErrors> <error statusCode="404" redirect="/errors/404.htm" /> </customErrors> <compilation debug="true" strict="false" explicit="true" /> </system.web> </configuration> with this configuration, a 404 will be redirected to the right site,

Lighttpd and cgi python

匿名 (未验证) 提交于 2019-12-03 08:54:24
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm trying to execute some python scripts through lighttpd but when I try to run it, I only get a blank file which I'm asked to download. lighttpd.conf server.modules = ( "mod_access", "mod_alias", "mod_accesslog", "mod_compress", "mod_rewrite" ) server.port = 8080 server.bind = "127.0.0.1" server.document-root = "/var/www" server.upload-dirs = ( "/var/cache/lighttpd/uploads" ) server.errorlog = "/var/log/lighttpd/error.log" server.pid-file = "/var/run/lighttpd.pid" server.username = "www-data" server.groupname = "www-data" index-file.names

Lighttpd configuration, . (dots) in my query string cause 404

匿名 (未验证) 提交于 2019-12-03 08:28:06
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I have an address on my site like so: http://www.example.com/lookup?q=http%3A%2F%2Fgigaom.com%2F2010%2F10%2F10%2Fangry-birds-for-windows7-phone-dont-count-on-it%2F In this example, the dot in the 'gigaom.com' part of the query string is screwing with lighttpd and my rewrite rules. I get a 404 with the dot in, no 404 if I take the dot out. My rewrite rules are below. In case it makes a difference, I'm using symfony 1.4. If anyone could shed some light on this problem it would be much appreciated! url . rewrite - once = ( "^/(.*\..+)

Multipart Downloading in C#?

瘦欲@ 提交于 2019-12-03 04:42:20
Please excuse my ignorance on the subject. I would like to write an application in C# that can download files off a server the same way DownThemAll does. DownThemAll seems to open four connections to the HTTP server to download the same file. I was just wondering if there are any existing libraries that might do this. Here is a quote from their site about this feature: DownThemAll features a smart download technique called ‘multipart download’. It splits files into multiple sections, which are downloaded simultaneously. I would also like to be able to pause/resume the downloads. That's the

部署Lighttpd到252板子

匿名 (未验证) 提交于 2019-12-02 23:56:01
1. 先到lighttpd 官网 下载对应版本的软件包: 如: lighttpd-1.4.30.tar.gz 2. 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 ( 其中的交叉编译工具、安装目录根据项目要求更改) 编译lighttpd,执行命令: make (可能出现权限不够,加上sudo解决) 6. 安装完成后