Project

General

Profile

Lighttpd on a raspberry Pi, using motion and web cam

Added by AdrianH over 12 years ago

I am trying to serve a simple web page from a Raspberry Pi
The operating system is called Raspbian and is a Debian derivative for the Arm
processor

I have installed Lighttpd on the RasPi via a package called apt-get install
lighttpd. As soon as it was installed the RasPi is serving a default web page.

Using the provided index.html, I modified it and tried to get the mjpeg output
of a webcam from a package called motion on the page.

Browsing from from an internal LAN with an IE Windows machine I could not see
the mjpeg caption on the page. This was mentioned in motion FAQ so it says use
Cambozola.jar
which I have. I included within the index.html by adding this:
<applet code=com.charliemouse.cambozola.Viewer
archive=cambozola.jar width="352" height="288" style="border-width:1;
border-color:gray; border-style:solid;"> <param name=url
value="http://192.168.1.79:8081"> </applet>

From a local computer, I can see the image now using IE in Windows, Firefox in
Windows and Firefox in Linux.

So all well and good I thought, but when someone remote i.e. via the WWW tries
to view the page the image is missing, same if I go via my Android phone and
gprs.
I was able to confirm this myself today from work.

Wondering if I need to add a mime type or something? This is where I am now
stuck. The lighttpd.conf is as installed it consists of the following
---------------------------------------------------------------------------
server.modules = (
"mod_access",
"mod_alias",
"mod_compress",
"mod_redirect",
  1. "mod_rewrite",
    )

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 = "www-data"
server.port = 80

index-file.names = ( "index.php", "index.html", "index.lighttpd.html" )
url.access-deny = ( "~", ".inc" )
static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" )

compress.cache-dir = "/var/cache/lighttpd/compress/"
compress.filetype = ( "application/javascript", "text/css", "text/html",
"text/plain" )

  1. default listening port for IPv6 falls back to the IPv4 port
    include_shell "/usr/share/lighttpd/use-ipv6.pl " + server.port
    include_shell "/usr/share/lighttpd/create-mime.assign.pl"
    include_shell "/usr/share/lighttpd/include-conf-enabled.pl"
    -------------------------------------------------------------------------------
    Do I need something else in there?

I have checked /var/logs/lighttpd/ and the error log is showing nothing aprt
from me stopping and starting the server etc.

-------------------------------------------------------------------------------
2012-10-22 22:53:16: (log.c.166) server started
2012-10-22 23:17:17: (server.c.1546) server stopped by UID = 0 PID = 2816
2012-10-22 23:17:33: (log.c.166) server started
2012-10-22 23:27:07: (server.c.1546) server stopped by UID = 0 PID = 2122
2012-10-22 23:27:25: (log.c.166) server started
2012-10-22 23:28:10: (server.c.1546) server stopped by UID = 0 PID = 2190
2012-10-22 23:30:05: (log.c.166) server started
2012-10-22 23:32:06: (server.c.1546) server stopped by UID = 0 PID = 2113
2012-10-22 23:34:48: (log.c.166) server started
2012-10-22 23:45:13: (server.c.1546) server stopped by UID = 0 PID = 2330
2012-10-23 17:33:19: (log.c.166) server started
2012-10-23 17:35:05: (server.c.1546) server stopped by UID = 0 PID = 2823
2012-10-23 18:55:53: (log.c.166) server started
2012-10-23 18:58:13: (server.c.1546) server stopped by UID = 0 PID = 3089
2012-10-23 18:58:57: (log.c.166) server started
2012-10-23 18:59:42: (server.c.1546) server stopped by UID = 0 PID = 3163
2012-10-23 19:00:37: (log.c.166) server started
2012-10-23 19:17:27: (server.c.1546) server stopped by UID = 0 PID = 3316
2012-10-23 19:17:44: (log.c.166) server started
2012-10-23 19:20:05: (server.c.1546) server stopped by UID = 0 PID = 2140
2012-10-23 19:21:45: (log.c.166) server started
2012-10-23 19:22:12: (server.c.1546) server stopped by UID = 0 PID = 2317
2012-10-23 19:24:06: (log.c.166) server started
2012-10-23 19:24:31: (server.c.1546) server stopped by UID = 0 PID = 2489
2012-10-23 19:24:47: (log.c.166) server started
2012-10-23 20:06:51: (server.c.1546) server stopped by UID = 0 PID = 2155
2012-10-23 20:58:02: (log.c.166) server started
2012-10-23 22:21:47: (server.c.1546) server stopped by UID = 0 PID = 3057
2012-10-23 22:22:04: (log.c.166) server started
2012-10-24 07:10:11: (server.c.1546) server stopped by UID = 0 PID = 2581
2012-10-24 07:10:27: (log.c.166) server started
2012-10-24 07:17:17: (log.c.166) server started
2012-10-24 12:33:01: (server.c.1546) server stopped by UID = 0 PID = 2706
2012-10-24 12:33:18: (log.c.166) server started
2012-10-24 19:57:15: (server.c.1546) server stopped by UID = 0 PID = 2258
2012-10-24 19:57:32: (log.c.166) server started
2012-10-24 20:55:28: (server.c.1546) server stopped by UID = 0 PID = 2595
------------------------------------------------------------------------------

I run both motion and lighttpd using sudo

If anyone can help it would be appreciated, being a novice at this I am finding
it difficult.

I do loose the motion package at times, it stops?

I am also using a Thompson router at home and have added web server access to
the Raspberry Pi board only with a simple rule that redirects port 80 to port 80
on the Raspi
I also added a rule to Nat external ip:8081 across to the Raspi and this could
be seen externally if running Firefox, so from this I can surmise the images are
getting out.

Lighttpd is version 1.4.31

Cheers
Adrian


Replies (1)

Lighttpd on a raspberry Pi, using motion and web cam - II - Added by Ireng over 12 years ago

Hi,

di get anybody back to you witha solution or proposal ?

i suffer from the same problem! :-)

Regards, Ireng

    (1-1/1)