David Narvaez | 10 Jan 2013 18:08
Picon
Favicon
Gravatar

Code Coverage Mode

Hi,

Is there any way to make Lighttpd run in "Code Coverage Mode" for PHP?
What I'm trying to achieve is a way to run, e.g., XDebug's Code
Coverage functionality in a non-intrusive way (without modifying the
PHP code to include code coverage  statements) once the server starts
and have a log of all lines and counts once the server shuts down (and
while the server is running, with a refresh interval).

I've read around and it looks like WebSphere + Rational Application
Developer provides such functionality, is there anything similar for
Lighttpd?

Thanks in advance.

David E. Narváez

Anthony L. Awtrey | 3 Aug 2012 19:39
Favicon
Gravatar

Lighttpd plugins and debian packaging


Hello,

Short version:

Can someone more-or-less officially provide guidance to distro
maintainers on how to build lighttpd plugins outside of the source tree?

Longer version:

I am migrating from Apache to Lighttpd and want to port some of the
custom plugins I've written. I found the official way to develop
plugins for lighttpd is by working in the source tree, copying the
mod_skeleton.c and hacking up the build to compile it together with
the lighttpd daemon.

http://redmine.lighttpd.net/projects/lighttpd/wiki/HowToWriteALighttpdPlugin

This has some obvious drawbacks from my point of view. I run Debian
and if I maintain a custom lighttpd package version with my plugins,
then I have to update my lighttpd package manually every time a new
lighttpd release comes out that fixes bugs or provides security fixes.

The Debian maintainers don't want to provide a lighttpd-dev package
because they are convinced it deviates too much from upstream. When I
asked about it, I was told that:

"well, upstream would need to provide a set of headers, libraries and
tools which are explicitly meant to develop. This isn't the case for
Lighttpd. We only could pick some random headers and maybe the skeleton
(Continue reading)

Picon

lighttpd + php_cgi = 100% cpu usage

Hi,

I just installed a lighttpd server with fast cgi running media wiki on an AWS EC2 Instance.
The wiki is running fine while only one person is connected, if 3 simultaneous access occurs it's
impossible to use the Wiki.
2 instances of php_cgi consuming a total of 100% of cpu.
Using alone the application, each page access raises the cpu usage of the server to 35%.

I would like to know what could I do to have the server working properly.

Follow some information about my configuration:

Linux: 2.6.35.14-107.1.36.amzn1.i686

php_cgi:

php-cgi -v
PHP 5.3.10 (cgi-fcgi) (built: Feb  2 2012 23:45:39)
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2012 Zend Technologies

lighttpd:

ighttpd -v
lighttpd/1.4.29 (ssl) - a light and fast webserver
Build-Date: Jul 16 2011 04:55:02

lighttpd.conf

$SERVER["socket"] == ":80" {
(Continue reading)

Davide Baldini | 28 Feb 2012 05:52
Picon
Gravatar

CGI - carriage-return for new lines?

I'm writing Bash script to process a stdin caming from lighttpd's CGI. I
noticed that the caming lines carry a trailing carriage-return for
breaking lines, instead of the expected line-feed, and obviously bash
fails to recognize new lines.

The MIME type is "multipart/form-data";
lighttpd -v
lighttpd/1.4.28 (ssl) - a light and fast webserver
Build-Date: Dec 20 2011 22:59:43

Christian Kujau | 15 Dec 2011 12:12
Picon

ssl.ciphers vs. ssl.cipher-list

Hi,

the config example added in r2814 (for the lighttpd-1.4.x branch) 
mentioned that "ssl.ciphers" could be used to specify allowed ciphers. But 
when configured, error.log says:

 2011-12-15 10:03:32: (server.c.968) WARNING: unknown config-key: 
 ssl.ciphers (ignored)

The documented[0] "ssl.cipher-list" works though. Is "ssl.ciphers" the 
new "ssl.cipher-list", even in lighttpd-1.4 and soon to be supported? Or 
is the config example wrong?

Thanks,
Christian.

[0] http://redmine.lighttpd.net/wiki/1/Docs:SSL
--

-- 
BOFH excuse #317:

Internet exceeded Luser level, please wait until a luser logs off before attempting to log back on.

Kaiwang Chen | 18 Oct 2011 15:02
Picon

How to log specifed cookie value in access log?

Hello list members,

I read accesslog.txt and verified that lightty yet supports %C for
logging specified cookie. I chance read the lua module mod_magnet,
http://redmine.lighttpd.net/wiki/lighttpd/Docs:ModMagnet, and tried to
extract specified cookie and append to uri:

-- magnet.attract-raw-url-to = ( conf_dir + "/test.lua" )
c = (string.match(lighty.request["Cookie"], "c=([^;,%s]+)") or "-")
uri = lighty.env["request.uri"]
if (string.match(uri, '?', 1, true)) then uri = string(uri, s, e) end
if (string.match(uri, '/$')) then uri = uri .. c else uri = uri .. "/" .. c end
lighty.env["request.uri"] = uri

However, the access log still represents orginal uri. I tried
returning lighty.RESTART_REQUEST, unfortunately the server was caught
in a dead loop.. looks like no custom variable suvives a
RESTART_REQUEST. I guess logging is handled before lua gets in
control. Any advice?

Thanks,
Kaiwang

Simon Loewenthal | 17 Oct 2011 16:09
Picon

[Q] Comparative Apache directives in Lighttpd

Hi there,

	I am migrating a server from Apache to Lighttpd.  I have an SSL question.

What it the comparative Lighttpd line for each of  these in Apache?

   SSLEngine on
   SSLProtocol all -SSLv2
   SSLCipherSuite HIGH:MEDIUM
   SSLCertificateFile /etc/ssl/private/example.ssl.crt
   SSLCertificateKeyFile /etc/ssl/private/example.ssl.key
   SSLCertificateChainFile /etc/ssl/certs/startcomIntermediateCA.pem
   SSLCACertificateFile /etc/ssl/certs/startcomCA.pem

Best regards, Simon.

--

-- 
	Email  simon AT klunky DOT co DOT uk
	PGP is optional: 4BA78604
	I won't accept your confidentiality
	agreement, and your Emails are kept.
      		       ~Ö¿Ö~

Emil Obermayr | 8 Aug 2011 15:28

DOS boxes in Windows 7

Hello list,

I have a project with a web based application, distributed
on a USB-stick. The basic configuration I got from light2go.

It works nicely from Windows 2000 through Vista.

But on Windows 7 I get a console-window ("DOS box") with 
every request. It appears and vanishes quickly, but it is
annoying nevertheless.

I tried some tricks with "start as administrator" and "start
in compatibility mode", but nothing helps.

Do you have any hint for me?

Thanks in advance

Emil

Picon
Favicon

how to show hostname in browser's address b

What can I do to make browser to show the hostname (not IP number) in address bar? ar

liu shawn | 11 Dec 2010 04:42
Picon
Favicon

lighttpd-announce <at> lists.lighttpd.net

Hello,

I would like to install lighttpd on MIPS64 via a cross-compile environment. When configure (--build=i686-linux-gnu --host=mips64-octeon-linux-gnu), it is OK. But when compile (make), it failed.
So how can do it? thanks a lot

shawn
mb | 25 Nov 2010 11:48
Picon
Favicon

cannot get rewrite rule to function properly

A customer is replacing their old perl based site with a newly written php based (using codeigniter framework). They would very much like the old page accessible for google indexing/rank/seo. The old sites index.cgi redirect to /se/index.cgi, so this means that all request for the old site will have /se/*.cgi (plus additionally /cmn/ for static content).

 

I have setup both sites in lighttpd, and they do work individually. In the config of the new site, I have created aliases for index.cgi|/se/|/cmn. The new site requires rewriting of: * to index.php?\*, this can be done with

"^(\.*)$" => "/index.php?/$1".

 

Using the first version of test.example.com, the new page behaves as expected.

The request against /search works (which rewrites to /index.php?search).

However, accessing .cgi|/cmn|/se does not work - instead I get a codeIgniter generated 404.

 

Using the second version of test.example.com, the old site is accessible through test.example.com/se/index.cgi, and the new page's /index.php - BUT /search is not rewritten to /index.php?search. In fact, the 404 is the standard lighttpd 404 so this leads me to believe that it's old.example.com's 404..

 

Seems very simple to solve if one knows his regexp, which I obviously do not. Can anyone spot the problem?

 

$HTTP["host"] =~ "old\.example\.com$" {

        server.document-root = "/home/example/perl/web"

        server.errorlog = "/var/log/lighttpd/lgold_error.log"

        accesslog.filename = "/var/log/lighttpd/lgold_access.log"

}

 

 

 

# new page works, old page through rewrite does not.

$HTTP["host"] =~ "(^www|^test)\.example\.com$" {

        server.document-root = "/home/example/php"

        server.errorlog = "/var/log/example/example_error.log"

        accesslog.filename = "/var/log/lighttpd/example_access.log"

        alias.url += (

         "/index.cgi" => "/home/example/perl/web/index.cgi",

         "/se" => "/home/example/perl/web/se",

         "/cmn/" => "/home/example/perl/web/cmn/",

        )

        url.rewrite-once = (

                                ".*\.(js|ico|gif|jpg|png|swf|css|html)$" => "$0",

                                "^(.*)$" => "/index.php?/$1",

                        )

}

 

# Old page works through test.somehost.com/se/index.cgi, only /index.php works on new page, and not /some-url-here

# (which really is /index.php?some-url-here)

$HTTP["host"] =~ "(^www|^test)\.example\.com$" {

        server.document-root = "/home/example/php"

        server.errorlog = "/var/log/example/example_error.log"

        accesslog.filename = "/var/log/lighttpd/example_access.log"

        alias.url += (

         "/index.cgi" => "/home/example/perl/web/index.cgi",

         "/se" => "/home/example/perl/web/se",

         "/cmn/" => "/home/example/perl/web/cmn/",

        )

        url.rewrite-once = (

                                ".*\.(js|ico|gif|jpg|png|swf|css|html)$" => "$0",

                                # rewrite all requests BUT ^/cmn/, ^/se/ and ^\*.cgi to index.php?$1

                               "!(^/cmn|^/se|*\.cgi)"  => "/index.php/$1",

                        )

}

 


Gmane