Articles of lighttpd

在lighttpd中将HTTPS请求redirect到http

我有一个安装了SSL证书的lighttpd服务器。 我会,由于某些原因,喜欢转发所有的https:// www。 请求http:// www。 我的lighttpd代码如下所示: $SERVER["socket"] == ":443" { ssl.engine = "enable" ssl.pemfile = "/path/to/pem/file" ssl.ca-file = "/path/to/ca/file" HTTP["host"] =~ "^www\.(.*)$" { url.redirect = ("^/(.*)" => "http://www.%1$1") } } 你能指出这里的问题吗? 另一件事,%1和$ 1有什么区别?

让Lighttpd为未使用的子域返回404?

我在使用Lighttpd的Ubuntu服务器上设置了一些域。 我有通配符域,我希望未使用的子域返回404而不是200,并显示常规域。 这个问题引起了我的注意,因为一些不太经验的search引擎(Bing,百度,mail.ru)索引我的网站与奇怪的子域名。 我在这里发现了同样的问题: apache2上的通配符DNS,VirtualHosts,未使用的子域404 但是我还没有find任何Lighttpd。 我希望www.example.com/*能够301redirect到example.com/* (已经设置) 我希望allUnsetSubdomains.example.com/*返回404以便search引擎和人们了解它不存在。 以下是我的vhost.conf文件中的相关数据: $HTTP["host"] =~ "^www\.(.*)$" { url.redirect = ( "^/(.*)" => "http://%1/$1" ) } # lots of other domains # $HTTP["host"] =~ "example.com$" { server.document-root = "/var/www/example.com" server.errorlog = "/var/log/lighttpd/example.com-error.log" accesslog.filename = "/var/log/lighttpd/example.com-access.log" server.error-handler-404 = "/index.php" } # lots more domains # 理想情况下,我希望能够有一个通用的规则,即服务器上所有域的所有未使用的子域返回404 ,就像wwwredirect一样。 我真的不明白Lighttpdconfiguration文件或正则expression式很好。

404尝试使用Lighttpd缩短MediaWiki的URL

我对此绝对陌生,所以请耐心等待。 我在Lighttpd上安装了MediaWiki,没有任何问题,除了当我尝试跟踪redwerks关于如何缩短Lighttpd上MediaWiki的url时,我总是感到非常沮丧。这就是我所做的: 在lighttpd.conf : ## MediaWiki url.rewrite-once = ( "^/wiki(/|$)" => "/w/index.php", "^/$" => "/w/index.php", ) url.rewrite-if-not-file = ( "^/w/images/thumb/[0-9a-f]/[0-9a-f][0-9a-f]/([^/]+)/([0-9]+)px-.*$" => "/w/thumb.php?f=$1&width=$2", "^/w/images/thumb/archive/[0-9a-f]/[0-9a-f][0-9a-f]/([^/]+)/([0-9]+)px-.*$" => "/w/thumb.php?f=$1&width=$2&archived=1", ) 在LocalSettings.php上: $wgScriptPath = "/w"; $wgScriptExtension = ".php"; $wgArticlePath = "/wiki/$1"; $wgUsePathInfo = true; 帮助是如此赞赏,我可能会很快开始哭泣。

我如何设置letsencrypt与多个域在Ubuntu的16.04 lighttpd服务器?

我试图从lighttpd从头开始设置letsencrypt。 我目前在16.10 xenial上运行lighttpd,并希望将现有网站移到https的http。 我知道有一个Apache和ngnix的自动设置过程,但我不想移动的东西。 我有六个主机名,通过使用虚拟主机托pipe的一对域以及每个主机的单个块。 我将如何做到这一点?

Lighttpd子域名

$HTTP["host"] == "example.com" { server.document-root = "/var/www/vhosts/example.com/httpdocs/development/api" server.errorlog = "/var/log/lighttpd/error.log" accesslog.filename = "/var/log/lighttpd/access.log" } $HTTP["host"] == "api.example.com" { server.document-root = "/var/www/vhosts/example.com/httpdocs/development/api" server.errorlog = "/var/log/lighttpd/error.log" accesslog.filename = "/var/log/lighttpd/access.log" } $HTTP["host"] == "example.org" { server.document-root = "/var/www/vhosts/example.com/httpdocs/development/services" server.errorlog = "/var/log/lighttpd/error.log" accesslog.filename = "/var/log/lighttpd/access.log" } 以上是我的lighttpd.conf的摘录。 example.com和example.org工作正常。 任何想法为什么api.example.com拒绝工作? 谢谢!

Lighttpd在Apache之前的另一个好处

我在一个网站上读到,在Apache前面安装Lighttpd的另一个好处是subprocess的数量更less。 Lighttpd将处理保持活动和客户端请求,同时由于Lighttpd和Apache之间的低延迟通信,Apache的subprocess可以更快地为dynamic页面提供服务。 我试图find链接,但我很难。 鉴于我已经有我的静态内容(img,vid,css,js,html等)的专用Lighttpd服务器和另一个专用于我的dynamic页面(Apache)的Apache服务器,我想实现这个技术,如果它真的有一些性能增益。 1)有没有人为了与上面解释的相同的目的把Lighttpd放在Apache前面? 2)在这方面是否真的有性能提升? 多less? 3)Lighttpd处理请求到Apache的开销是多less,这真的值得吗? 谢谢!

如何设置用于x.509客户端证书authentication的lighttpd

到目前为止,我已经有很长时间的HTTPS工作,所以我不认为有任何服务器证书的问题。 现在我试图把它添加到lighttpd.conf: ssl.engine = "enable" ssl.cipher-list = "ECDHE-RSA-AES256-SHA384:AES256-SHA256:RC4-SHA:RC4:HIGH:!MD5:!aNULL:!EDH:!AESGCM" ssl.pemfile = "/etc/ssl/private/steinbitglis.domain.pem" ssl.ca-file = "/etc/ssl/private/GandiStandardSSLCA.pem" ssl.verifyclient.activate = "enable" ssl.verifyclient.enforce = "enable" lighttpd错误日志说: (connections.c.299) SSL: 1 error:140890C7:SSL routines:SSL3_GET_CLIENT_CERTIFICATE:peer did not return a certificate Firefox声称如下: ssl_error_handshake_failure_alert 我的目标是用浏览器证书replace用户名+密码,但是我甚至还没有能够从浏览器请求任何证书。 如果有人知道一个很好的资源来学习所有的细节,我需要使用这个技术,那真是太棒了。 这是我从远程机器上做的testing。 $ openssl s_client -CAfile GandiStandardSSLCA.pem -showcerts -connect steinbitglis.domain:443 CONNECTED(00000003) depth=2 C = US, ST = UT, L = Salt […]

lighttpd日志堵塞高清

我有一个PHP网站上运行lighttpd。 我每天有大约15到30K次访问。 现在,在我的PHP代码中,我有很多由未声明的$ _GET或$ _POSTvariables产生的警告。 显然,这些不会显示给用户,所有都login到lighttpd日志磁贴。 问题是:每三天或四天,这些日志变得如此之大,基本上占用了系统中的所有空间,而且什么也做不了,会话停止工作等等。 我怎样才能防止lighttpd写出所有这些警告信息?

缺lesslighttpd的mod_ssl.so

我正在尝试为运行Debian 8(Jessie)的lighttpd web服务器设置ssl(即https)。 lighttpd.conf中的相关行是: server.modules = ( "mod_access", "mod_alias", "mod_compress", "mod_redirect", "mod_ssi", "mod_fastcgi", "mod_auth", "mod_rewrite", "mod_proxy", "mod_ssl", ) $SERVER["socket"] =~ "111.11.22.33:443" { server.document-root = "/var/www/html" ssl.engine = "enable" ssl.pemfile = "/etc/lighttpd/ssl/mydomain.com/mydomain.com.pem" } 文件mydomain.com.pem是自行发布的。 然后我开始服务,并检查是否一切正常: # /etc/init.d/lighttpd restart [ ok ] Restarting lighttpd (via systemctl): lighttpd.service. # systemctl status lighttpd.service ● lighttpd.service – Lighttpd Daemon Loaded: […]

我可以使用Lighttpd为虚拟主机设置多个SSL证书吗?

我可以为使用Lighttpd Web服务器的虚拟主机设置多个SSL证书吗? 我在我的服务器上有几个网上商店(每个网上商店都有自己的域名),我需要为他们每个人设置一个SSL证书。 感谢Patrick