sighttpd.conf

Section: (5)
Updated: 26 Apr 2010
Index Return to Main Contents
 

NAME

sighttpd.conf --- configuration file for sighttpd  

SYNOPSIS

sighttpd.conf

 

DESCRIPTION

The sighttpd.conf file is the runtime configuration file for sighttpd. By default, the configuration file is looked for in /etc/sighttpd/sighttpd.conf You can override this with the -f commandline option to sighttpd:

        $ sighttpd -f /path/to/configfile

Various example config files are distributed in the examples/ directory of the sighttpd source distribution.

 

FILE FORMAT

Comments are marked with a '#' character, and continue to the end of line.

Configuration directives are single keywords followed by whitespace and a value (to the end of the line, or comment character). The directive name (ie. keyword) is case insensitive.

Configuration is grouped in blocks; the names of directives are scoped within a configuration block. Any configuration directives outside of a block are global to the entire configuration. Block names are case insensitive.

For example, the configuration file:

        Listen 3000

        <StaticText>
                Path "/welcome.txt"
                Text "Hello, world!"
        </StaticText>

specifies one global directive ("Listen 3000"), and one block ("StaticText"). Within that block, the directives "Path" and "Text" appear.

 

GLOBAL PARAMETERS

Parameters outside of a <block> are global.

Listen
This parameter specifies the TCP port to listen on. This may be specified as a service name listed in /etc/services.

 

MODULE PARAMETERS

 

StaticText

The StaticText module allows you to specify that a text string should appear at a given URL. This is useful for identifying server instances at your installation.

Path
This parameter specifies the local part of the URL path.
Text
This parameter specifies the verbatim text that should appear at the URL path. This text is served with Content-Type text/plain.

 

Stdin

The Stdin module allows streaming of data from stdin.

Path
Path specifies the local part of the URL path at which you would like the content to appear. For example, when configuring the server http://example.com/, the configuration directive:

        Path /my/video.m4v

in a <stdin> block will make the content appear at http://example.com/my/video.ogv

Type
The Type parameter specifies the Internet media type of the stream, which will appear in the Content-Type HTTP response header. For example, the configuration:

        Type video/mpeg4

will instruct sighttpd to serve this stream with Content-Type: video/mpeg4.

 

OggStdin

Raw Ogg data cannot be streamed from standard input using <Stdin>, as an Ogg stream needs to have setup headers prepended for each codec stream. For this purpose a special module called <OggStdin> is provided, which buffers these headers and serves them first to each client that connects before continuing with live Ogg pages.

Path
Path specifies the local part of the URL path at which you would like the content to appear. For example, when configuring the server http://example.com/, the configuration directive:

        Path /my/stream.ogg

in a <oggstdin> block will make the content appear at http://example.com/my/stream.ogg

Type
The Type parameter specifies the Internet media type of the stream, which will appear in the Content-Type HTTP response header. For example, the configuration:

        Type audio/ogg

will instruct sighttpd to serve this stream with Content-Type: audio/ogg.

 

SHRecord

sighttpd includes direct support for integrated capture, video encoding and streaming on Renesas SH-Mobile processors. This module supports the following configuration directives:

Path
Path specifies the local part of the URL path at which you would like the content to appear. For example, when configuring the server http://example.com/, the configuration directive:

        Path /my/video.264

in an <SHRecord> block will make the content appear at http://example.com/my/video.264

CtlFile
This parameter specifies the control file with encoding parameters. The same control files that are used for shcodecs-record can be used - the output filename is simply ignored.
Preview
This parameter specifies if a preview of the captured video should be displayed on the framebuffer. Valid values are on and off; the default value is on.

 

EXAMPLES

Streaming text
This configuration prints a timestamp every second. The content appears at the path /date.txt (eg. http://localhost:3000/date.txt):

        Listen 3000

        <Stdin>
                Path "/date.txt"
                Type "text/plain"
        </Stdin>

Then, run:


    $ while `true`; do date; sleep 1; done | sighttpd

Then connect from another terminal:


    $ curl -i http://localhost:3000/date.txt
    HTTP/1.1 200 OK
    Date: Wed, 07 Apr 2010 04:23:09 GMT
    Server: Sighttpd/0.9.0
    Content-Type: text/plain


    Wed Apr  7 13:23:09 JST 2010
    Wed Apr  7 13:23:10 JST 2010
    Wed Apr  7 13:23:11 JST 2010
    ...

Streaming H.264 video

        Listen 3000

        <Stdin>
                Path "/stream.264"
                Type "video/mp4"
        </Stdin>

Then run your streaming video input, eg:

        $ shcodecs-record k264-v4l2-stream.ctl | sighttpd

and connect with a video player:

        $ mplayer http://localhost:3000/stream.264 -fps 30

Streaming Motion MJPEG

        Listen 3000

        <Stdin>
                Path "/mjpeg/"
                Type "multipart/x-mixed-replace; boundary=++++++++"
        </Stdin>

This configuration expects that a series of jpeg comes in from stdin. At each boundary the following headers must be inserted:


   --++++++++
   Content-Type: image/jpeg
   Content-length: <size of jpeg file>

examples/mjpeg_test.sh is provided for testing purpose. Execute the following:


    $ examples/mjpeg_test.sh file1 file2 file3 ...

Then open 'http://localhost:3000/mjpeg/' with a web browser that supports Motion JPEG, such as firefox(1).

Streaming Ogg from standard input

        Listen 3000

        # Streaming Ogg Vorbis from stdin, using the special
        # OggStdin module that caches Ogg Vorbis headers
        <OggStdin>
                Path "/stream.ogg"
                Type "audio/ogg"
        </OggStdin>

You can run this with a shell pipeline like:


    $ arecord -c 2 -r 44100 -f S16_LE -t wav | oggenc -o - - | sighttpd -f examples/sighttpd-oggstdin.conf

And you can connect to it as an Ogg stream, eg:


    $ ogg123 http://localhost:3000/stream.ogg

Streaming video with SHRecord

        Listen 3000

        <SHRecord>
                Path "/video0/vga.264"
                CtlFile "/usr/share/shcodecs-record/k264-v4l2-vga-stream.ctl"
        </SHRecord>

        <SHRecord>
                Path "/video0/cif.264"
                CtlFile "/usr/share/shcodecs-record/k264-v4l2-cif-stream.ctl"
        </SHRecord>

will make two H.264 streams appear at:

        http://ecovec:3000/video0/vga.264
        http://ecovec:3000/video0/cif.264

 

FILES

/etc/sighttpd/sighttpd.conf or sighttpd.conf

 

SEE ALSO

sighttpd(1)

 

DIAGNOSTICS

 

BUGS

Please report bugs to the author, conrad@metadecks.org

 

VERSION

This man page is current for version 1.0.0 of sighttpd.

 

CREDITS

sighttpd is distributed under the GNU General Public License. See the file COPYING for details.

A web site is available at http://www.kfish.org/software/sighttpd/

We would be delighted to hear from you if you like this program.

 

AUTHOR

sighttpd was written by Conrad Parker.


 

Index

NAME
SYNOPSIS
DESCRIPTION
FILE FORMAT
GLOBAL PARAMETERS
MODULE PARAMETERS
StaticText
Stdin
OggStdin
SHRecord
EXAMPLES
FILES
SEE ALSO
DIAGNOSTICS
BUGS
VERSION
CREDITS
AUTHOR

This document was created by man2html, using the manual pages.
Time: 02:16:09 GMT, May 11, 2010