lighttpd

Cherrypy : Do I really need to put it behind a frontend?

我与影子孤独终老i 提交于 2019-12-19 19:44:11
问题 I've been working on a python web app using cherrypy and read it'd be more "robust" to use it as a backend, so I gave it a try. Shortly put, running some benchmarks on a page doing some database operations and serving static & dynamic content has shown that plain cherrypy was twice as fast than nginx and memcached, and about half faster than lighttpd. I heard the latter had memory leak issues, so refrained from using it. And yes, both nginx and lighttpd were configured to serve the static

Linux的crond和crontab

那年仲夏 提交于 2019-12-18 23:09:38
一、crond cron是一个linux下的定时执行工具(相当于windows下的scheduled task),可以在无需人工干预的情况下定时地运行任务task。 由于cron 是Linux的service(deamon),可以用以下的方法启动、关闭这个服务: /sbin/service crond start //启动服务 /sbin/service crond stop //关闭服务 /sbin/service crond restart //重启服务 /sbin/service crond reload //重新载入配置 在系统启动的时候自动启动: 在/etc/rc.d/rc.local这个脚本的末尾加上: /sbin/service crond start 二、crontab cron服务提供crontab命令来设定cron服务的 crontab -u //设定某个用户的cron服务,一般root用户在执行这个命令的时候需要此参数 crontab -l //列出某个用户cron服务的详细内容 crontab -r //删除某个用户的cron服务 crontab -e //编辑某个用户的cron服务 例子 root查看自己的cron设置:crontab -u root -l root想删除fred的cron设置:crontab -u fred -r 在编辑cron服务时

Is glibc's implementation of fprintf() thread-safe?

六眼飞鱼酱① 提交于 2019-12-18 15:52:35
问题 Is fprintf thread-safe? The glibc manual seems to say it is, but my application, which writes to a file using single call to fprintf() seems to be intermingling partial writes from different processes. edit: To clarify, the program in question is a lighttpd plugin, and the server is running with multiple worker threads. Looking at the file, some of the writes are intermingled. edit 2: It seems the problem I'm seeing might be due to lighttpd's "worker threads" actually being separate processes

Redirecting websocket traffic on port 80 with lighttpd

天涯浪子 提交于 2019-12-17 18:44:39
问题 I have a website hosted on lighttpd, accessible at the "www" subdomain. I also have a chat server listening on port 8124 made with node.js and socket.io. I want all client traffic to happen on port 80, by redirecting all requests to the "chat" subdomain to port 8124. So I enabled mod_proxy and in lighttpd.conf I added: $HTTP["host"] == "chat.myserver.com" { proxy.server = ( "" => (( "host" => "78.128.79.192", "port" => "8124" )) ) } On the client, when I connect to the websocket, var socket =

Access X-Forwarded-Proto in lighttpd Configiuration

白昼怎懂夜的黑 提交于 2019-12-13 17:11:22
问题 I’ve got a lighttpd server behind an AWS load balancer. The ELB handles all the SSL stuff for me and forwards the requests to lighttpd over HTTP on port 80, setting the X-Forwarded-Proto header along the way. As I only want to have one specific page go via HTTPS and everything else over HTTP, I wanted to setup redirects in the lighttpd config file, like: $HTTP["scheme"] == "https" { $HTTP["host"] !~ ".*ttc/(index.html)?$" { $HTTP["host"] =~ "(.*)" { url.redirect = ( "^(.*)$" => "http://%1$1")

Can't figure out how to receive http requests using lighttpd

醉酒当歌 提交于 2019-12-13 06:52:48
问题 I have a simple lighttpd web server running off my router. In it's .conf file I know I need to set $HTTP["querystring"] =~ "cams=on" { telnet to turn on cams via managed poe switch } The issue I am having is trying to figure out how to actually get it to run a script that sends telnet commands to my poe switch. I've never done anything like this and I'm unable to find any help for anyone not angry familiar with web serving. 回答1: There are multiple ways to do this with lighttpd. One of the

Running system calls from webserver

和自甴很熟 提交于 2019-12-13 05:15:34
问题 I am trying to run a standard python os.system call from a cgi python script. This is part of a tutorial so the script is quite simple. I am trying to take a picture with the Raspberry Pi camera and display it in a webpage. import os, sys os.system('raspistill -o /var/www/images/image.jpg') print "Content-type:text/html\r\n\r\n" print '<html>' print '<head>' print '<title>Hello Word - First CGI Program</title>' print '</head>' print '<body>' print '<h2>Hello Word! This is my first CGI program

URL rewrite in lighttpd

南笙酒味 提交于 2019-12-13 02:18:36
问题 I have the following query: update234ae5.php?q=1&q=2.... must be rewritten to: update.php?cond=234ae5&q=1&q=2.... I use: "^/update(([a-zA-Z0-9]+))" => "/update.php?cond=$1" How can I add the rest of url string, because my url is rewritten to update.php?cond=234ae5& without the rest of params In Apache I use RewriteCond %{QUERY_STRING} (.*) RewriteRule ^/update([0-9a-z]+).php /update.php?cond=$1&%1 回答1: As the lighttpd documentation states: If you wanna pass the Query String (?foo=bar) to the

How to map URL to port and modified URL?

最后都变了- 提交于 2019-12-13 01:12:26
问题 How do I map www.somesite.com/api(.*) to www.somesite.com/$1:9000? (I need to map /api to Play framework application running @ port 9000) I did the following: $HTTP["url"] =~ "^/api" { proxy.server = ( "" => ( ( "host" => "127.0.0.1", "port" => 9000 ) ) ) } This gets me to somesite.com/api:9000 when I go to somesite.com/api, and I get "Action not found: For request 'GET /api'" 回答1: It is easily accomplished using Nginx: location /api/ { rewrite ^/api(/.*)$ $1 break; proxy_pass http:/

Lighttpd reverse proxy converts HTTP/1.1 requests to 1.0

为君一笑 提交于 2019-12-12 18:41:35
问题 I'm using lighttpd as a reverse proxy for a group of Play instances, which are on version 2.1.1 at the moment. The Play applications use chunked transfer encoding to do COMet (server push). Lighttpd version is 1.4.28 (latest supported version for Ubuntu 12.04). This setup is working nicely, but now I'm upgrading to Play Framework 2.2.1. The play framework now enforces that chunked responses must be in response to a HTTP/1.0 request (see https://github.com/playframework/playframework/commit