Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 231 lines (151 sloc) 5.475 kb
e8c5616 @kfish Add doc/admin-guide.txt
authored
1
2 Sighttpd Administrator's Guide
3 ==============================
4
0f067a4 @kfish add a note about -f option to admin-guide
authored
5 By default, the configuration file is looked for in /etc/sighttpd/sighttpd.conf
6 You can override this with the -f commandline option to sighttpd:
7
8 $ sighttpd -f /path/to/configfile
e8c5616 @kfish Add doc/admin-guide.txt
authored
9
9f2ca99 @kfish admin-guide: add note about examples
authored
10 Various example config files are distributed in the examples/ directory of the
11 sighttpd source distribution.
388ff1b @kfish add syntax section to admin-guide
authored
12
13 1. Syntax
14 ---------
15
16 Comments are marked with a '#' character, and continue to the end of line.
17
18 Configuration directives are single keywords followed by whitespace and a
1373509 @kfish document that block and directive names are case insensitive
authored
19 value (to the end of the line, or comment character). The directive name
20 (ie. keyword) is case insensitive.
388ff1b @kfish add syntax section to admin-guide
authored
21
22 Configuration is grouped in blocks; the names of directives are scoped within
23 a configuration block. Any configuration directives outside of a block are
1373509 @kfish document that block and directive names are case insensitive
authored
24 global to the entire configuration. Block names are case insensitive.
388ff1b @kfish add syntax section to admin-guide
authored
25
26 For example, the configuration file:
27
28 -----
29 Listen 3000
30
31 <StaticText>
32 Path "/welcome.txt"
33 Text "Hello, world!"
34 </StaticText>
35 -----
36
37 specifies one global directive ("Listen 3000"), and one block ("StaticText").
38 Within that block, the directives "Path" and "Text" appear.
39
40
41 2. Stdin: Configuring streaming from standard input
42 ---------------------------------------------------
e8c5616 @kfish Add doc/admin-guide.txt
authored
43
44 This section explains how to configure streaming of data from stdin with
45 three examples:
46
47 1. plain text
48 2. H.264 video
49 3. Motion JPEG
50
18fb733 @kfish admin-guide.txt: add description of path and text directives
authored
51 The <stdin> configuration block takes two parameters, Path and Type.
52
53 Path specifies the local part of the URL path at which you would like the content
54 to appear. For example, when configuring the server http://example.com/, the
55 configuration directive:
56
57 Path /my/video.ogv
58
59 in a <stdin> block will make the content appear at http://example.com/my/video.ogv
60
61 The Type parameter specifies the Internet media type of the stream, which will
62 appear in the Content-Type HTTP response header. For example, the configuration:
63
64 Type video/ogg
65
66 will instruct sighttpd to serve this stream with Content-Type: video/ogg.
67
68
388ff1b @kfish add syntax section to admin-guide
authored
69 2.1. Streaming text updates
e8c5616 @kfish Add doc/admin-guide.txt
authored
70
71 This configuration prints a timestamp every second. The content appears at
72 the path /date.txt (eg. http://localhost/date.txt):
73
74 sighttpd.conf:
75
76 -----
496e6a0 @kfish remove = from example configs in admin-guide.txt
authored
77 Listen 3000
e8c5616 @kfish Add doc/admin-guide.txt
authored
78
e880262 @kfish simplify stdin streaming configuration
authored
79 <Stdin>
80 Path "/date.txt"
81 Type "text/plain"
82 </Stdin>
e8c5616 @kfish Add doc/admin-guide.txt
authored
83 -----
84
85 Then, run:
86
87 $ while `true`; do date; sleep 1; done | sighttpd
88
89 Then connect from another terminal:
90
91 $ curl -i http://localhost:3000/date.txt
92 HTTP/1.1 200 OK
93 Date: Wed, 07 Apr 2010 04:23:09 GMT
94 Server: Sighttpd/0.9.0
95 Content-Type: text/plain
96
97 Wed Apr 7 13:23:09 JST 2010
98 Wed Apr 7 13:23:10 JST 2010
99 Wed Apr 7 13:23:11 JST 2010
100 ...
101
102
103
388ff1b @kfish add syntax section to admin-guide
authored
104 2.2. Streaming H.264 video
e8c5616 @kfish Add doc/admin-guide.txt
authored
105
106 (This replicates the default configration for handling /stream.264 of
107 sighttpd-0.9.0).
108
109 sighttpd.conf:
110
111 -----
496e6a0 @kfish remove = from example configs in admin-guide.txt
authored
112 Listen 3000
e8c5616 @kfish Add doc/admin-guide.txt
authored
113
e880262 @kfish simplify stdin streaming configuration
authored
114 <Stdin>
115 Path "/stream.264"
116 Type "video/mp4"
117 </Stdin>
e8c5616 @kfish Add doc/admin-guide.txt
authored
118 -----
119
120 Then run your streaming video input, eg:
121
122 $ shcodecs-record k264-v4l2-stream.ctl | sighttpd
123
124 and connect with a video player:
125
126 $ mplayer http://localhost:3000/stream.264 -fps 30
127
388ff1b @kfish add syntax section to admin-guide
authored
128 2.3. Motion MJPEG
e8c5616 @kfish Add doc/admin-guide.txt
authored
129
130 (This replicates the default configration for handling /mjpeg of
131 sighttpd-0.9.0).
132
133 sighttpd.conf:
134
135 -----
496e6a0 @kfish remove = from example configs in admin-guide.txt
authored
136 Listen 3000
e8c5616 @kfish Add doc/admin-guide.txt
authored
137
e880262 @kfish simplify stdin streaming configuration
authored
138 <Stdin>
70d8a89 @kfish fix documentation for /mjpeg streaming
authored
139 Path "/mjpeg/"
e880262 @kfish simplify stdin streaming configuration
authored
140 Type "multipart/x-mixed-replace; boundary=++++++++"
141 </Stdin>
e8c5616 @kfish Add doc/admin-guide.txt
authored
142 -----
143
144 This configuration expects that a series of jpeg comes in from stdin. At
145 each boundary the following headers must be inserted:
146
147 --++++++++
148 Content-Type: image/jpeg
149 Content-length: <size of jpeg file>
150
b3a0abc @kfish move mjpeg_test.sh to examples/, add to dist
authored
151 examples/mjpeg_test.sh is provided for testing purpose. Execute the following:
e8c5616 @kfish Add doc/admin-guide.txt
authored
152
b3a0abc @kfish move mjpeg_test.sh to examples/, add to dist
authored
153 $ examples/mjpeg_test.sh file1 file2 file3 ...
e8c5616 @kfish Add doc/admin-guide.txt
authored
154
155 Then open 'http://localhost:3000/mjpeg/' with Firefox.
156
7c00d7e @kfish add Ogg Vorbis eg to admin-guide, sighttpd.conf(5)
authored
157
be04cf6 @kfish Add documentation for <OggStdin> module
authored
158 3. Streaming Ogg from standard input
159 ------------------------------------
a5a129a @kfish add SHRecord configuration docs to admin-guide.txt
authored
160
be04cf6 @kfish Add documentation for <OggStdin> module
authored
161 Raw Ogg data cannot be streamed from standard input using <Stdin>, as an Ogg
162 stream needs to have setup headers prepended for each codec stream. For this
163 purpose a special module called <OggStdin> is provided, which buffers these
164 headers and serves them first to each client that connects before continuing
165 with live Ogg pages.
166
167 The sighttpd.conf setup is similar to the normal <Stdin> configuration:
168
169 -----
170 Listen 3000
171
172 # Streaming Ogg Vorbis from stdin, using the special
173 # OggStdin module that caches Ogg Vorbis headers
174 <OggStdin>
175 Path "/stream.ogg"
176 Type "audio/ogg"
177 </OggStdin>
178 -----
179
7c00d7e @kfish add Ogg Vorbis eg to admin-guide, sighttpd.conf(5)
authored
180 You can run this with a shell pipeline like:
181
182 $ arecord -c 2 -r 44100 -f S16_LE -t wav | oggenc -o - - | sighttpd -f examples/sighttpd-oggstdin.conf
183
184 And you can connect to it as an Ogg stream, eg:
185
186 $ ogg123 http://localhost:3000/stream.ogg
187
be04cf6 @kfish Add documentation for <OggStdin> module
authored
188
189 4. Streaming video with SHRecord
a5a129a @kfish add SHRecord configuration docs to admin-guide.txt
authored
190 --------------------------------
191
192 sighttpd includes direct support for capture and encoding on SH-Mobile, using
193 libshcodecs, libshveu and libuiomux. The configuration:
194
195 -----
196 Listen 3000
197
198 <SHRecord>
199 Path "/video0/vga.264"
200 CtlFile "/usr/share/shcodecs-record/k264-v4l2-vga-stream.ctl"
201 </SHRecord>
202
203 <SHRecord>
204 Path "/video0/cif.264"
205 CtlFile "/usr/share/shcodecs-record/k264-v4l2-cif-stream.ctl"
206 </SHRecord>
207 -----
208
209 will make two H.264 streams appear at:
210
211 http://ecovec:3000/video0/vga.264
212 http://ecovec:3000/video0/cif.264
213
214 The same control files that are used for shcodecs-record can be used - the
215 output filename is simply ignored.
c623985 @kfish shrecord: add "Preview off" config file option
authored
216
217 To disable the on-screen preview, set "Preview off" in one of the SHRecord
218 stanzas, eg:
219
220 -----
221 Listen 3000
222
223 <SHRecord>
224 Path "/video0/cif.264"
225 CtlFile "/usr/share/shcodecs-record/k264-v4l2-cif-stream.ctl"
226 Preview off
227 </SHRecord>
228 -----
229
230
Something went wrong with that request. Please try again.