Articles of lighttpd

vBulletin 5 + lighttpd url重写

我试图让vBulletin 5在lighttpd下运行,但是我在使用url重写时遇到了一些问题。 这里是由vBulletin提供的apache .htaccess。 <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php?routestring=$1 [L,QSA] #needed because admincp is an actual directory. RewriteRule ^(admincp/)$ index.php?routestring=$1 [L,QSA] </IfModule> 如果这有帮助,这是由vBulletin提供的IISconfiguration <?xml version="1.0" encoding="UTF-8"?> <!– This file is to support redirection in IIS. It is harmless if you are running under Apache –> <configuration> <system.webServer> […]

使用lighttpd阻止HEAD,DELETE等

所以我安装了lighttpd,它运行的站点只需要响应GET请求。 我想知道如何可以返回405回应与Allow: GET头到GET请求使用lighttpd? 我有一个快速的谷歌,但即使lighttpd没有什么坚实的东西。 更新 限制$HTTP["request-method"]是一种享受。 不幸的是,当你使用url.access-deny lighttpd url.access-deny状态码和头部设置为一个固定的东西(403状态),而不pipe你是否在前面或后面添加头部。 最终结果: $HTTP["request-method"] =~ "^(PUT|HEAD|PATCH|DELETE)$" { url.access-deny = ( "" ) }

如何用lighttpd返回410

我有一个服务的子域,我要杀了。 我想用410来标记它。 有没有办法做到这一点与lighttpd没有解决mod_magnet和lua脚本?

Lighttpdredirect到SSL会导致301redirect循环

我正在运行lighttpd 1.4.31与SSL支持,并有强迫在特定的虚拟主机的HTTPS问题。 如果我从下面的configuration禁用redirect行,它的工作原理(http和https都工作,但没有redirect),但是当我启用它时,我发现浏览器得到原因在一个301的循环。 我不明白为什么这是发生在我身上的redirect应该只适用于http。 我在configuration的顶部加载了mod_redirect,另外一个虚拟主机用ssl强制启动了一些域名,我不认为这会有什么影响。 我在做什么错在下面的configuration片段? 请注意,我将site.example.comreplace为我的网域。 $HTTP["host"] == "site.example.com" { dir-listing.activate = "enable" accesslog.filename = "/home/lighttpd/site.example.com/logs/access.log" server.document-root = "/home/lighttpd/site.example.com/htdocs" server.upload-dirs = ("/tmp") server.errorlog = "/home/lighttpd/site.example.com/logs/error.log" $SERVER["socket"] == ":443" { ssl.engine = "enable" ssl.pemfile = "/home/lighttpd/site.example.com/cert.pem" $HTTP["url"] =~ "^/shell" { # shellinabox proxy.server = ( "" => (( "host" => "127.0.0.1", "port" => 4200, ),),) […]

(network.c.379)无法绑定到端口:80地址已经在使用中

我有一台服务器在两个独立的IP上运行apache和lighttpd。 重新启动服务器后,我无法访问lighttpd上的东西: /etc/init.d/lighttpd restart(network.c.379)无法绑定到端口:80地址已经在使用中

每个目录的lighttpd速率限制

我正在创build一个有大量小工具的网站。 一种是使用与自然语言工具包(nltk)进行交互的Python cgi脚本的工具,该工具是磁盘和CPU密集型的。 我有其他服务不那么密集。 在客户端,这些限制了JavaScript限制。 创buildbot的恶意或非智能用户可以直接build立连接。 我想阻止这个尽可能低的水平,但我需要它是每个目录(CGI脚本坐在旁边的index.html文件)。 我也将有一个防火墙阻止虐待IP地址发出请求。 我想这个返回一个简单的429响应与一个空的JSON对象作为正文。 我还想在其中包含其他规则,如30秒接收到发送时间,否则closures连接。 我如何在Debian的lighttpd服务器上实现这个function?

SELinux政策问题

由于qemu和KVM在SELinux开箱即用的情况下工作正常,我想启用SELinux来改善我的CentOS 6服务器上的客户隔离。 问题是我正在使用需要禁用SELinux的第三个奇偶校验虚拟化pipe理软件。 因为他们永远不会实现,我现在试图让我自己的工作… 虽然我能够修复所有libvirt / qemu相关的问题(更改默认图像/ lvm位置,并与audit2allow修复另一个问题),我卡住了他们用来处理各种pipe理任务的自定义lighttpd 。 我试图用audit2allow添加一个自定义规则,但是根本不起作用。 所以,我不是一个SELinux专家,我只是想找一个办法 只是把lighttpd放在宽松的模式(所以它可以做任何必要的) 仅对运行虚拟机的qemu / libvirt进程强制执行SELinux 我已经在semanage manpage中find了这个,我想这可能是一个解决schemesemanage permissive -a TYPE http_r命令,但是这只是返回: / usr / sbin / semanage:bad选项 我认为这是因为他们没有从CentOS仓库运行股票lighttpd,所以缺less了lighty的政策。 以下是audit.log中的一小段代码 type=SYSCALL msg=audit(1393761691.786:1259): arch=c000003e syscall=9 success=yes exit=140369999609856 a0=0 a1=1fa588 a2=5 a3=802 items=0 ppid=1 pid=8532 auid=4294967295 uid=500 gid=500 euid=500 suid=500 fsuid=500 egid=500 sgid=500 fsgid=500 tty=(none) ses=4294967295 comm="php" exe="/usr/bin/php" […]

使用lighttpd和regex将所有子域redirect到主域

是否有可能将所有*.domain.comredirect到我的domain.com ? 我一直在与正则expression式搞乱,但没有任何运气: $HTTP["host"] =~ ".*\.domain\.com" { url.redirect = ("^/(.*)" => "http://domain.com/$1") } $HTTP["host"] =~ “domain\.com" { server.document-root = "/var/www/servers/domain.com/awesomesite" accesslog.filename = "/var/www/logs/domain.com/access.log" server.errorlog = "/var/www/logs/domain.com/error.log" fastcgi.server = ( ".fcgi" => ( "main" => ( # Use host / port instead of socket for TCP fastcgi "bin-path" => "/var/www/servers/domain.com/awesomesite/domain.fcgi", "socket" => "/tmp/domain.sock", "check-local" => "disable", […]

lighttpd + PHP-fcgi响应速度慢

我们有一个关于lighttpd作为php5作为后端通过fast-cgi的networking服务器的问题。 有时,当请求调用phpinfo();的简单文件时,服务器的响应时间超过5秒(最多20秒phpinfo(); 。 服务器日志不显示任何错误,并且HTTP响应为200。 当我请求一个没有任何PHP内容的静态HTML文件时,没有问题,并且所有的请求都被快速地处理。 这是lighttpd-fcgiconfiguration: fastcgi.debug = 1 fastcgi.server += ( ".php" => (( "bin-path" => "/usr/bin/php-cgi", "socket" => "/tmp/php.socket", "max-procs" => 7, "bin-environment" => ( "PHP_FCGI_CHILDREN" => "5", "PHP_FCGI_MAX_REQUESTS" => "5000" ) )) ) 该服务器正在运行Debian 7 64位。

Lighttpdredirect非www到www

我想在我的域名上redirect所有非www到www。 但是,当我使用由一些网站提供的代码,并优雅地重新启动lighttpd服务器,我的网站不再工作 – 完全: $HTTP[”host”] =~ “^example\.com” { url.redirect = ( ”^/(.*)$” => “http://www.example.com/$1″ ) } 但是,当我使用lighttpd的维基百科页面提供的那个,它可以工作,但它将example.com/ANYTHINGHERE的所有内容redirect到www.example.com,即example.com/search.php?v=michael被redirect到www.example。 COM: $HTTP["host"] =~ "^([^.]+\.[^.]+)$" { url.redirect = ( ".*" => "http://www.%1" ) } 我记得在configuration文件中包含mod_redirect。 谁能帮我? 🙂