Perry Clarke | 29 Jun 02:57
Favicon

Conditional Config Ordering

I don't understand some of the ordering dependencies in the  
conditional configuration stuff.  I'm using lighttpd 1.4.19.

For example, this first method doesn't work ("server.error- 
handler-404" is never set):

> $HTTP["url"] =~ "^/foobar/" {
>    $HTTP["useragent"] != "my-ua-str" {
>        server.error-handler-404 = "/foobar/req_error_handler.php"
>    }
> }

while merely swapping the order of the clauses makes it work  
correctly depending on the incoming request:

> $HTTP["useragent"] != "my-ua-str" {
>    $HTTP["url"] =~ "^/foobar/" {
>        server.error-handler-404 = "/foobar/req_error_handler.php"
>    }
> }

There are times when one order is much more convenient than another  
so it would be better if ordering wasn't such an issue (this is just  
one example, I've tripped over similar ordering issues several times).

Is there logic behind this that isn't obvious?

Perry

(Continue reading)

Darren Garvey | 17 Jun 20:40
Picon

[fastcgi] Using FastCGI with C/C++

Hi all,

I've tried to get some FastCGI code of mine working with lighttpd several times in the past, but always without luck. I've been trying again recently and I'm really stuck, having exhausted as much of google as I have time to wade through.

The aim is to be able to get lighty to start up the relevant process given a name in a special directory.
ie.
a request for /fcgi/echo    -> starts up the 'echo' app in /usr/lib/fcgi-bin
a request for /fcgi/whatever -> starts up /usr/lib/fcgi-bin/whatever
etc...

As it stands I'm struggling to figure out how lighty actually deals with fastcgi stuff in general - I've briefly looked at the source, but not for long enough. ;-) The above use-case seems to be moot in the face of things like FastCGI-PHP, but hopefully it's not impossible.

I've attached the relevant part of my config that is as close to working as possible. With that, lighty starts up the processes as expected, but doesn't forward anything to them. Directing my browser to /fcgi/linux_fcgi just gives an error 404.

I'm working on both linux and windows (with the latest stable lighty, sometimes with SVN lighty) , although linux is my focus for now since I hear windows fastcgi support is very fickle (is this true?). I'm implementing a FastCGI library, so it should work with unix sockets/named pipes and tcp, both locally and remotely. AFAICT, the library works fine once it's connected to the server (it works with Apache), but connecting is proving to be a pain. Any pointers here would be very much appreciated.

Apologies for the lack of concrete details, I can provide any extra information that would be helpful.

Cheers,

Darren

Attachment (10-fastcgi.conf): application/octet-stream, 1106 bytes
Jack L | 14 Jun 20:03
Picon

Start up script for lighttpd?

Hi all,

I'm so not good at Unix stuff - a while ago I got a copy of the
/etc/init.d/lighttpd from someone on this list but I lost it.

I tried modifying from another file myself. Somehow it doesn't
start the back end process (Python FCGI) properly. The Python
back-end somehow can not find some modules. But if I run the
same command /usr/local/sbin/lighttpd -f /etc/lighttpd.conf,
it works just fine.

Can anyone help point out what I'm doing wrong? Below is the file.

-- 
Best regards,
Jack

#!/bin/sh
#
# chkconfig: - 85 15
# description: Startup script for the lighttpd server
#
# processname: lighttpd
# config: /etc/lighttpd.conf
# pidfile: /var/run/lighttpd.pid

# Source function library
.. /etc/rc.d/init.d/functions

appname="lighttpd"
pid="/var/run/$appname.pid"
socket="/tmp/$appname.socket"
RETVAL=0

start() {
        echo -n $"Starting $prog: "
        $appname -f /etc/lighttpd.conf
        RETVAL=$?
        echo
        [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$prog
        return $RETVAL
}

stop() {
        echo -n $"Stopping $prog: "
        #killproc -p $pid
        pkill lighttpd
        RETVAL=$?
        echo
        [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$prog
        return $RETVAL
}

reload() {
        echo -n $"Reloading $prog: "
        killproc -p $pid -HUP
        RETVAL=$?
        echo
        return $RETVAL
}

case "$1" in
        start)
                start
                ;;
        stop)
                stop
                ;;
        restart)
                stop
                start
                ;;
        condrestart)
                if [ -f /var/lock/subsys/$prog ]; then
                        stop
                        start
                fi
                ;;
        reload)
                reload
                ;;
        status)
                status -p $pid
                RETVAL=$?
                ;;
        *)
                echo $"Usage: $0 {start|stop|restart|condrestart|reload|status}"
                RETVAL=1
esac

exit $RETVAL

Jan Kneschke | 8 Jun 17:04
Picon
Gravatar

Mailinglists are moved

Dear lighties,

thanks to darix the mailing-lists have a new home now and all previous 
subscribers are added to the new mailing-lists:

* lighttpd <at> lists.lighttpd.net
* lighttpd-announce <at> lists.lighttpd.net
* lighttpd-dev <at> lists.lighttpd.net

The prefixes are the same, just the domain is now @lists.lighttpd.net 
instead of @lists.kneschke.de.

Sorry, that it took so long to bring up the mailing lists again.

cheers,
   Jan
--

-- 
  jan: "Gee, Brain^WEric, what'd you wanna do tonight?"
eric: Same thing we do everynight: Take over the HelloWorld!

Andy Wright | 22 Feb 20:22
Picon

libpre3 stack overflow

Their is a security update for libpre3 and devel packages for Ubuntu
Server 6.06:

Version 7.4-0ubuntu0.7.04.2: 

  * SECURITY UPDATE: stack overflow when handling long UTF8 strings.
  * pcre_compile.c, testdata/test{in,out}put4: upstream changes from 7.6
    backported, thanks to Tomas Hoger and Florian Weimer.
  * References
    CVE-2008-0674

I compile lighttpd from source, should I be overly concerned with the
previous build without this fix?
--

-- 
                                   ___________________________________
Andy Wright                                  andy.wright <at> extracted.org
IT/IS Professional                         For public and private use.
IT/IS Forum # (608)554-0030 VM                         KEY ID 7CECF855 
Open Forum Skype: extracted              http://7cecf855.extracted.org    
Thanks BB, "water is wet"
                                    ALTERNATIVE: andy.wright <at> yahoo.com
                                   ___________________________________

Martin Honermeyer | 22 Feb 02:57
Picon

Problems with 503 page returned by mod_magnet

Hello guys,

first of all, thanks for this wonderful piece of software! Running Lighttpd 
1.5 for about half a year now, updating to HEAD now and then. A few stability 
issues at the beginning have been resolved after a while.

We have one problem though. We try to show a custom 503 page when our 
application is down for maintainance, like described over here: 
http://johnleach.co.uk/words/archives/2007/01/10/251/

From lighttpd.conf:

magnet.attract-raw-url-to = ( "/etc/lighttpd-1.5/magnet.lua" )

magnet.lua

if (lighty.stat("/u/apps/ss2-rails/shared/system/maintenance.html")) then
	lighty.status["maintenance.hits"] = lighty.status["maintenance.hits"] + 1
	lighty.content = { { filename 
= "/u/apps/ss2-rails/shared/system/maintenance.html" } }
	lighty.header["Content-Type"] = "text/html"
	return 503
end

When using curl or or a text browser (links), the page is correctly displayed 
(although the default error message is appended, see 
http://trac.lighttpd.net/trac/ticket/1420). In "real" browsers like Firefox 
and Konqueror, the page just loads forever, waiting for data to arrive (?). 

Furthermore,  I tried using "server.errorfile-prefix" with a custom 503 page 
in that directory. I modified my magnet script like this, so as to return the 
error code only:

if (lighty.stat("/u/apps/ss2-rails/shared/system/maintenance.html")) then
	lighty.status["maintenance.hits"] = lighty.status["maintenance.hits"] + 1
--	lighty.content = { { filename 
= "/u/apps/ss2-rails/shared/system/maintenance.html" } }
--	lighty.header["Content-Type"] = "text/html"
	return 503

Same problem then!

I don't know what's happening here. Maybe this is about problems 
with "Keep-Alive"? Sorry for guessing so badly, I am not a HTTP expert..

Any help would be greatly appreciated!

Greetings
Martin

Senthil | 15 Feb 15:21
Picon

response not received, request sent: 997 on socket: unix:/tmp/php-fastcgi.socket-5

Hi All,

I'm not receiving response, when i call a function from a php script.

The function is from a shared library, basically a php extension .

I am able to send a request to that function and receive the response with cgi enabled in my lighttpd web server.

But with fast-cgi,i am not getting any response from the server.

I am getting 500 error instead.


Following is the lighttpd error log.
======================================================
response not received, request sent: 997 on socket: unix:/tmp/php-fastcgi.socket-5 for /symbrowser/player_control.php , closing connection
======================================================

I version of  lighttpd  is 1.4.13  and php version is PHP 5.2.1 (cgi-fcgi) (built: Nov 28 2007 23:09:10).

Please suggest a solution asap.

Thanks,
Senthil.


sir buce | 8 Feb 12:07
Picon

Save sessions in memcached

Hello,

When I try to save the sessions on memcached with Lighttpd 1.5 doesn't
run correctly, doesn't do anything in the log of memcached, and save the
session files in the default folder of php5.

I have configured /etc/php5/cgi/php.ini

session.save_handler = Memcache
session.save_path = "tcp://192.168.100.243:11211?persistent=1"

When I execute "php5-cgi -m" we can see that the module of memcache
loaded.

My pecl's version is 2.1.2

Memcached service: I try in 1.1.13 and 1.2.2

With apache2 the same parameters in /etc/php5/apache2/php.ini run ok.

Somebody know what is the solution?

Thanks
Stefan Scholl | 5 Feb 09:53
Picon
Favicon

Debian Backports for etch?

Are there any plans on a backport of a current Lighttpd for
Debian Etch?

Etch's Lighttpd is missing mode_extforward. I'm currently
battling with myself if I should install Lighttpd from source or
hope for a backport.

--

-- 
Web (en): http://www.no-spoon.de/ -*- Web (de): http://www.frell.de/

Jan Kneschke | 22 Dec 10:50
Picon
Gravatar

mailinglist will be moved to new host

Dear Readers,

I hope you all enjoy your seasonal holidays, may they be cold like here
in Germany or warm like in Buenos Aires.

Over the next days we have to leave the old mailing-list server and move
to a new one. lists.kneschke.de has served us for quite some time now
and the mailing-list is the last service that's not located at
lighttpd.net yet.

All the mail-addresses will be moved over to lists.lighttpd.net, you
don't have to re-subscribe.

  lighttpd <at> lists.kneschke.de

will become

  lighttpd <at> lists.lighttpd.net

You will get a mail from the new mailing-list when the transition is over.

cheers,
  Jan
--

-- 
 jan: "Gee, Brain^WEric, what'd you wanna do tonight?"
eric: Same thing we do everynight: Take over the HelloWorld!

Steve Greenland | 13 Dec 22:24

mod_alias vs. conditinal configuration

This is regarding to http://trac.lighttpd.net/trac/ticket/1427

The problem is that this config snippet:

        alias.url += ( "/a/" => "/home/olaf/a/" )

        $HTTP["remoteip"] == "127.0.0.1" {
	        alias.url += ( "/doc/" => "/usr/share/doc/" )
        }

        alias.url += ( "/b/" => "/home/olaf/b/" )

Does not do what anyone not familiar with lighttpd internals would
expect: the alias for "/b/" doesn't work. Moving it before the
conditional works. (When accessing via localhost).

The first reply to the ticket, from "moo", claims that this is
intentional. If so, it's a really strange decision, and undocumented.
Anyone want to comment? Jan?

Regards,
Steve
--

-- 
Steve Greenland
    The irony is that Bill Gates claims to be making a stable operating
    system and Linus Torvalds claims to be trying to take over the
    world.       -- seen on the net


Gmane