在 lighttpd.conf 中,通常用 # 注释 1 行
想知道如何评论多行而不在每行前面添加#。
谢谢
我正在尝试验证对 webroot (/ ) 中所有内容的访问权限,除了驻留在特定目录 (/directory/ ) 中的任何内容,我尝试了这两个选项均无济于事:
$HTTP["url"] =~ "^(?!(/directory))" {
auth.require = ( "" =>
(
"method" => "basic",
"realm" => "auth to this area",
"require" => "user=username"
)
)
}
$HTTP["url"] != "/directory" {
auth.require = ( "" =>
(
"method" => "basic",
"realm" => "auth to this area",
"require" => "user=username"
)
)
}
Run Code Online (Sandbox Code Playgroud) 我想要一个 apache 的替代品,lighthttpd 有内存泄漏问题所以我不能去,我一直在读 nginx 适合静态内容,但它适合 php-mysql 动态视频共享内容吗?
我也读过,一个不错的选择是将 apache 和 nginx 一起运行以获取动态内容,但我根本不想使用 apache - apache 使用了太多内存,这就是我想首先使用 nginx 的原因!
我的最后一个问题,是 lighthttpd 仍然存在内存泄漏问题还是他们修复了它,因为我很想使用它,我在某处读到 youtube 使用它,我的网站与 youtube 非常相似(虽然不一样,但是如果它对 youtube 来说足够好,那对我来说就足够了)
目标是能够执行存储在 WWW 目录中的任意脚本文件,例如http://www.example.com/*.py.
我不想为每个请求生成一个新的 Python 实例(解释器)(就像在常规 CGI 中所做的那样,如果我没记错的话),这就是我使用 FastCGI 的原因。
根据Lighttpd 的文档,以下是我的配置文件的 FastCGI 部分。问题是它总是/usr/local/bin/python-fcgi为每个 *.py 文件运行脚本,而不管该文件的内容如何:
http://www.example.com/script.py [output=>] "python-fcgi: test"
(无论内容如何script.py)
我对使用任何框架不感兴趣,而只是执行单独的 [web] 脚本。
我怎样才能让它像 PHP 一样运行,通过请求它的路径来执行 WWW 目录中的任何脚本?
/etc/lighttpd/conf.d/fastcgi.conf:
server.modules += ( "mod_fastcgi" )
index-file.names += ( "index.php" )
fastcgi.server = (
".php" => (
"localhost" => (
"bin-path" => "/usr/bin/php-cgi",
"socket" => "/var/run/lighttpd/php-fastcgi.sock",
"max-procs" => 4, # default value
"bin-environment" => ( …Run Code Online (Sandbox Code Playgroud) 我lighttpd/1.4.28 (ssl)在 Debian Squeeze 上运行。我刚刚创建了一个http://startssl.com证书,我在所有浏览器(Firefox、Chrome、Opera)上运行良好,但我的用户在 Firefox 中报告证书错误。我已经将其归结为证书链加载失败:
在证书我的Firefox:http://i.stack.imgur.com/moR5x.png
证书在其他火狐:http://i.stack.imgur.com/ZVoIu.png(注意失踪StartCOM-证书这里)
我按照本教程将证书嵌入到我的 lighttpd 中:https ://forum.startcom.org/viewtopic.php ? t = 719
我的 lighttpd.conf 的相关部分如下所示:
$SERVER["socket"] == ":443" {
ssl.engine = "enable"
ssl.ca-file = "/etc/lighttpd/certs/ca-bundle.pem"
ssl.pemfile = "/etc/lighttpd/certs/www.bisaboard.crt"
}
Run Code Online (Sandbox Code Playgroud)
ca-bundle.pem 是这样创建的:cat ca.pem sub.class1.server.ca.pem > ca-bundle.pem
我从这里获取了相关文件:http : //www.startssl.com/certs/
www.bisaboard.crt 是这样创建的:cat certificate.pem ssl.key > www.bisaboard.crt
其中,certificate.pem 是我的 StartSSL-Class1 证书,ssl.key 是我的 SSL-Root-Key。
你知道为什么第二个 Firefox 没有正确加载证书链吗?
我已经使用 yum 安装了 FastCGI,并编辑了我的 lighttpd.conf,但是在重新启动服务器时我收到了这个错误。
2009-06-24 12:44:43: (log.c.97) server started
2009-06-24 12:44:43: (mod_fastcgi.c.924) bind failed for: unix:/var/run/lighttpd/php-fastcgi.socket-0 No such file or directory
2009-06-24 12:44:43: (mod_fastcgi.c.1365) [ERROR]: spawning fcgi failed.
2009-06-24 12:44:43: (server.c.902) Configuration of plugins failed. Going down.
Run Code Online (Sandbox Code Playgroud)
我的 lighttpd.conf 的相关部分是:
fastcgi.server = ( ".php" =>
( "localhost" =>
(
#"socket" => "/var/run/lighttpd/php-fastcgi.socket",
#"bin-path" => "/usr/bin/php-cgi"
"socket" => "/tmp/php-fastcgi.socket",
"bin-path" => "/usr/bin/php-cgi"
)
)
)
Run Code Online (Sandbox Code Playgroud)
非常感谢。
H264 不适用于 lighttpd 1.5,但可以使用 1.4 有什么建议吗?
我正在尝试在 lighttpd 中设置一个反向代理,以便 /mobile/video 下的所有请求(并且只有那些请求)被重定向到辅助 Web 服务器的 / 目录。这在 apache 中很容易,但我一生都无法弄清楚如何在 lighttpd 中做到这一点。
$HTTP["url"] =~ "^/wsmobile/video/" {
url.rewrite-once = ( "^/wsmobile/video/(.+)" => "/$1" )
proxy.server = ( "" => ( ( "host" => "210.200.144.26", "port" => 9091 ) ) )
}
Run Code Online (Sandbox Code Playgroud)
我试过使用 http["url"] 指令,但是 lighttpd 只是忽略这些请求并继续将完整的 url 传递给辅助服务器,这当然会导致 404 阻塞和抛出。但是,如果我进行全局重写,那么所有内容都会转发到辅助服务器,这也不是我想要的。
我该如何完成这项任务?
我在带有 Fcgi 和 Memcached 的 Centos 5 上安装了 Lighttpd。每隔一两周,我会收到一次内部服务器错误 500,我必须手动重新启动 lighttpd 以使其再次工作。
在我的 lighttpd 配置中,我定义了错误日志文件:
server.errorlog = "/home/lxadmin/httpd/lighttpd/error.log"
Run Code Online (Sandbox Code Playgroud)
但是当我打开它时,它只有一个月前的最后几天没有行。
所以我的问题是如何诊断问题所在以及如何为我的配置启用错误日志?
我在使用 Lighttpd 的 Ubuntu 服务器上设置了一些域。我有通配符域,我希望未使用的子域返回 404 而不是 200 并显示常规域。这个问题引起了我的注意,因为一些经验不足的搜索引擎(Bing、百度、mail.ru)正在用奇怪的子域索引我的网站。
我在这里发现了对 Apache 提出的同样的问题:Wildcard DNS, VirtualHosts on apache2, 404 forused subdomains
但是我还没有找到任何有关 Lighttpd 的信息。
我想www.example.com/*重定向301到example.com/*(已设置)
我想allUnsetSubdomains.example.com/*返回,404以便搜索引擎和人们了解它不存在。
这是我的文件中的相关数据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 #
Run Code Online (Sandbox Code Playgroud)
理想情况下,我希望能够有一个通用规则,即服务器上所有域的所有未使用的子域都返回404 …