Articles of lighttpd

lighttpd fastcgi unix绑定错误

我试图configurationLighttpd使用FastCGI运行Redmine。 我已经将下面的代码添加到我的标准lighttpd.conf : $HTTP["host"] =~ "^foo.bar.com$" { server.document-root = "/usr/share/redmine/public/" index-file.names += ( "dispatch.fcgi" ) #dispatch.fcgi if rails specified server.error-handler-404 = "/dispatch.fcgi" #too fastcgi.server = ( ".fcgi" => ( "localhost" => ( "socket" => "/var/run/lighttpd/rails-fastcgi.sock", "bin-path" => "/usr/share/redmine/public/dispatch.fcgi" ) ) ) } 当我尝试启动lighttpd服务器时,我在错误日志中得到以下内容: May 11 10:24:05 ohio lighttpd[5527]: (log.c.166) server started May 11 10:24:05 ohio […]

从mod_rewrite和lighttpd中重写排除目录

即时将一个Apache2服务器迁移到Lighttpd,但即时通讯与Mod_Rewrite有一些问题。 我有一个目录/ api /,我需要从重写规则中排除如下: url.rewrite-once = ( ".*\?(.*)$" => "/index.php?$1", ".*\.(js|ico|gif|jpg|png|css)$" => "$0", "" => "/index.php" ) 我试图围绕着块 $HTTP["url"] !~ "^/api/" { } 然而,这不起作用,只是从重写中排除每一个URL。 有没有人知道的方法 a)从重写中排除/ api / b)排除服务器上存在的每个实际目录重写 我已经看到了Drupal的Lua脚本,可以做后者,但是我不熟练Lua,不知道如何configuration这个Zend Framework应用程序。 整个configuration: http : //pastebin.com/ggjiTFLk 干杯

Lighttpd域redirect

我想在HTTP / HTTPS上redirect域: http://old.com -> https://new.com https://old.com -> https://new.com 我必须为旧域名指定SSL密钥/证书,但是我不确定在哪里放置这些指令: $SERVER["socket"] == ":443" { ssl.engine = "enable" ssl.pemfile = "/etc/pki/tls/private/new.com.pem" ssl.ca-file = "/etc/pki/tls/certs/new.com.crt" } $SERVER["socket"] == ":80" { $HTTP["host"] =~ "old.com|new.com" { url.redirect = ( "^/(.*)" => "https://new.com:443/$1" ) } } 我试图添加下面的代码,但Lighttpd报告configuration错误: $SERVER["socket"] == ":443" { $HTTP["host"] =~ "old.com" { url.redirect = ( "^/(.*)" => […]

lighttpd:为什么使用端口> = 9000不能正常工作

我有一个正常工作的lighttpd服务器。 我可以通过http://vm.aaa.com:8080从外部(非本地主机)访问这个网站。 让我们假设这是一个简单的静态网站,没有PHP或MySQL。 现在我想复制这个网站作为一个testing(使用另一个端口)在同一台机器。 而我不想使用虚拟主机。 所以我只是复制原始服务器的全部文件,包括lighttpd的bin / conf / htdocs / lib /等文件夹。 我做了一些必要的更改,包括更改lighttpd.conf。 现在我感到困惑的是,如果将端口更改为小于9000的数字,则完美无缺。 但是,如果端口号变成9000或更大的数字,lighttpd可以启动,但是我不能从外部访问新的网站,而我可以从INSIDE访问新的网站(我的意思是在同一个局域网本地主机)。 INSIDE的访问日志如下所示: vm.aaa.com:9876 10.46.175.117 – – [08/Oct/2012:13:18:47 +0800] "GET / HTTP/1.1" 200 15 "-" " curl/7.12.1 (x86_64-redhat-linux-gnu) libcurl/7.12.1 OpenSSL/0.9.7a zlib/1.2.1.2 libidn/0.5.6" 我用来启动lighttpd的命令是: bin/lighttpd -f conf/lighttpd.conf -m lib/ -D 我的lighttpd.conf是这样的: server.modules = ( "mod_access", "mod_accesslog", ) var.rundir = "/home/work/lighttpd_9876" server.port = […]

为什么lighttpd或Apache2代理在访问index.html时更改我的URL?

我有一个尴尬的设置与Apache 2的networking服务器是守门人和代理stream量基于传入的域名: <VirtualHost *:80> ServerName example.org RewriteEngine On RewriteRule ^/(.*) http://localhost:3000/$1 [P] </VirtualHost> 在localhost:3000下运行我有一个lighttpd运行,它提供静态内容,并作为其他两个服务的反向代理,在端口3001和3002上运行。configuration如下所示: # lighttpd will also be used to forward requests to node.js server.modules = ( "mod_proxy" ) # This config is meant to work relative to certain directories, # it is not meant to be used somewhere globally in /etc/ var.projectRoot = […]

lighttpdredirect/重写

我正在尝试设置redirect/重写,以便以/(尾随斜线)结尾(为了使search引擎友好)。 但是还有其他的内部重写,它们在浏览器地址栏中没有显示。 我希望能够首先在地址栏上拖尾/然后执行这些内部重写。 当我尝试把这个规则在开始,所有的内部重写得到显示在地址栏中: 目前我有重写规则: `url.rewrite-once = ( ^/([0-9_-]+)(?:\?(.*))?" => "/path/www/index.php?cmd=alias&target=$1&$2", <second condition> => <relative uri> <third condition> => <relative uri> )` 这是我想要添加的规则。 使用的规则: url.redirect = ("^(.*[^/])$" => "$1/") 但是这也显示了我的url的内部path。 例如: www.tikejhya.com/path/www/index.php?cmd=alias&target=hellow/world&/ 我只是想添加一个结尾的斜杠(在地址栏中可见),而其他所有东西都不变。 仅供参考:我的模块也是正确的顺序,我尝试guglling(mod_rewrite / fastcgi和别名与redirect)任何指针在正确的方向将不胜感激。

无法激活Lighttpd中的用户目录

我正在使用基于Debian 7的主机,并在此主机上configurationPHP-FPM和lighttpd以及rutorrent。 我想使用用户目录而不是默认的/ var / wwwpath。 我已经运行以下命令激活用户目录,但无法使用它们。 root@xxxx# lighty-enable-mod userdir 还有一件事应该写在/etc/lighttpd/conf-available/10-userdir.conf文件的以下行中; 这样www:// xxxx / project应该指向/ home / user / www / project? 我也在这里使用身份validation,所以user1将看到他的主目录和user2将看到他的主目录。 userdir.path = "public_html" /etc/lighttpd/lighttpd.conf在这里: server.modules = ( "mod_access", "mod_alias", "mod_compress", "mod_redirect", "mod_rewrite", "mod_scgi", ) 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 […]

当使用fastcgi.debug指令时,Lighttpd不会启动

我在Ubuntu 12.04 LTS上运行lighttpd / 1.4.28(ssl)。 一切正常,我正在尝试做一些性能调整。 我想为fastcgi模块启用debugging模式,但是当我将fastcgi.debug指令添加到我的conf文件时,lighttpd扼杀了“parsing器失败”错误: 2013-10-08 10:56:23: (configfile.c.912) source: /etc/lighttpd/conf-enabled/15-fastcgi-php.conf line: 1 pos: 15 parser failed somehow near here: (EOL) configuration文件是:/etc/lighttpd/conf-enabled/15-fastcgi-php.conf fastcgi.debug=1 fastcgi.server += ( ".php" => (( "bin-path" => "/usr/bin/php-cgi", "socket" => "/tmp/php.socket", "max-procs" => 1, # runs max-procs bin-path controllers plus (max-procs * PHP_FCGI_CHILDREN) workers "idle-timeout" => 20, "bin-environment" => ( […]

在lighttpd中重写位置响应头

我有一个lighttpd 1.4.35的实例监听httpsstream量,并将其反向代理到后端服务器。 也就是说, .———-. .———-. client —https–> | lighttpd | —http–> | back-end | <–https— | | <–http— | server | `———-' `———-' 当我通过https(通过https)对代理页面进行HTTP发布时,后端服务器正在使用http而不是https返回Location标头。 Location: http://lighttpd_url/some_page.htm 有没有办法lighttpd可以重写位置标题中的url? 我在lighttpd 1.5.x中看到,proxy-core有一个rewrite-response指令,我想这就是它的样子: proxy-core.rewrite-response = ( "Location" => ( "^http://xyz/(.*)" => "https://xyz/$1" ), ) 但是,我如何重写lighttpd 1.4.x中的Location标题?

错误500/503

我得到一个错误500 / 503.我的理论是,php5-fpm被杀死,每秒钟重新生成,由于这样的消息在php5-fpm.log [27-Jan-2015 08:21:34] NOTICE: fpm is running, pid 30045 [27-Jan-2015 08:21:34] NOTICE: ready to handle connections [27-Jan-2015 08:21:44] NOTICE: Finishing … [27-Jan-2015 08:21:44] NOTICE: exiting, bye-bye! [27-Jan-2015 08:21:44] NOTICE: configuration file /etc/php5/fpm/php-fpm.conf test is successful [27-Jan-2015 08:21:44] NOTICE: fpm is running, pid 30066 [27-Jan-2015 08:21:44] NOTICE: ready to handle connections [27-Jan-2015 08:21:54] NOTICE: […]