-
Notifications
You must be signed in to change notification settings - Fork 0
/
configuration.html
324 lines (280 loc) · 9.01 KB
/
configuration.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta name="keywords" content="Yaws"/>
<title>Yaws</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<link rel="stylesheet" type="text/css" href="stil.css"/>
<link rel="shortcut icon" href="/icons/yaws_y.gif" type="image/x-icon"/>
</head>
<body>
<div class="logo">
<img src="icons/yaws_head.gif" width="600" alt="YAWS"/>
</div>
<div id="sidebar">
<h4> Yaws </h4>
<div class=""> <a href="index.html" id="index" >Top Page</a> </div>
<div class="choosen"> <a href="configuration.html" id="configuration">Build Config and Run</a></div>
<div class=""> <a href="dynamic.html" id="dynamic" >Dynamic Content</a> </div>
<div class=""> <a href="https://github.com/erlyaws/yaws/releases/" id="download">Download </a> </div>
<div class=""> <a href="contact.html" id="contact">Contact </a> </div>
<div class=""> <a href="doc.html" id="doc">Documentation</a> </div>
<div class=""> <a href="articles.html" id="resources">Articles</a> </div>
<h4> Examples </h4>
<div class=""> <a href="/json_intro.html">AJAX/JSON RPC</a></div>
<div class=""> <a href="/appmods.html">Appmods</a> </div>
<div class=""> <a href="/arg.html">Arg</a> </div>
<div class=""> <a href="/privbind.html">Binding to Privileged Ports</a></div>
<div class=""> <a href="/bindings.html">Bindings</a> </div>
<div class=""> <a href="/cgi.html">CGI</a></div>
<div class=""> <a href="/session.html">Cookie Sessions</a> </div>
<div class=""> <a href="/cookies.html">Cookies</a> </div>
<div class=""> <a href="/dynamic.html">Dynamic Content</a> </div>
<div class=""> <a href="/embed.html">Embedding Yaws</a></div>
<div class=""> <a href="/upload0.html">File Upload</a> </div>
<div class=""> <a href="/form.html">Forms</a> </div>
<div class=""> <a href="/haxe_intro.html">haXe Remoting</a></div>
<div class=""> <a href="/pcookie.html">Persistent Cookies</a> </div>
<div class=""> <a href="/query.html">Query Part of URL</a></div>
<div class=""> <a href="/rebar_release.html">Rebar Releases</a></div>
<div class=""> <a href="/redirect.html">Redirect</a> </div>
<div class=""> <a href="/server_sent_events.html">Server-Sent Events</a> </div>
<div class=""> <a href="/ssi.html">Server Side Includes</a> </div>
<div class=""> <a href="/simple.html">Simple</a> </div>
<div class=""> <a href="/soap_intro.html">SOAP with Yaws</a></div>
<div class=""> <a href="/stream.html">Streaming Data</a> </div>
<div class=""> <a href="/websockets.html">Web Sockets</a> </div>
<a href="/shoppingcart/index.html">Tiny Shopping Cart</a>
<div class=""> <a href="/yapp_intro.html">Yaws Applications (yapps)</a></div>
<div class=""> <a href="/logger_mod.html">Write Your Own Logger</a></div>
<h4> Misc </h4>
<div class=""> <a href="/internals.html">Internals</a> </div>
</div>
<div id="entry">
<h1>Build and install Yaws</h1>
<p>
Yaws is hosted at <a
href="https://github.com/erlyaws/yaws">https://github.com/erlyaws/yaws</a>.
</p>
<p>
Tested releases are downloadable from the Yaws download directory
at <a href="https://github.com/erlyaws/yaws/releases" >https://github.com/erlyaws/yaws/releases</a>.
</p>
<p>
To check out the latest release and build a number of prerequisites
are required. (All code example below on Ubuntu)
</p>
<p>
<strong>NOTE: Erlang/OTP 18.0 or higher is required.</strong>
</p>
<ul>
<li>
<p>
Installed erlang + development
</p>
<div class="box">
<pre>
# sudo apt-get build-dep erlang yaws
# sudo apt-get install erlang-nox erlang-src erlang-manpages erlang-mode erlang-dev libtool
</pre>
</div>
</li>
<li>
<p>
Installed git
</p>
<div class="box">
<pre>
# sudo apt-get install git-core
</pre>
</div>
</li>
<li>
<p>
To build the docs, all kinds of verious tools are required.
latex, man2pdf ... etc.
</p>
</li>
<li>
<p>
To build win32 releases - the following is required.
</p>
<ul>
<li>
<p>
Mingw.
<div class="box">
<pre>
# apt-get install mingw32 mingw32-binutils
</pre>
</div>
</p>
</li>
<li>
Installbuilder. To build win32 installers we're using
an install builder that is free to use free of charge
for opensource projects.
Get the linux installer at
<a href="https://www.bitrock.com/download_installbuilder_download.html">
bitrock
</a>
</li>
<p>
Further instructions are found in the win32 directory
in the source tree.
</p>
</ul>
</li>
</ul>
<p>
To check out the sources do
</p>
<div class="box">
<pre>
# git clone git://github.com/erlyaws/yaws.git
</pre>
</div>
<p>To build and to what is knows as a <em>local</em> install, e.g.
a developer install do:
</p>
<div class="box">
<pre>
# cd yaws
# autoreconf -fi
# ./configure --prefix=/path/to/yaws
# make install
</pre>
</div>
<p>
Alternatively, to make a <em>standard</em> install
</p>
<div class="box">
<pre>
# cd yaws
# autoreconf -fi
# ./configure --help
# ./configure --localstatedir=/var --sysconfdir=/etc
# make
# sudo make install
</pre>
</div>
<p>
The above commands will checkout the HEAD source,
build it and install it at
127.0.0.1:80 with the docroot set to the local documentation.
</p>
<p>
A <em>local</em> install does install yaws at http://127.0.0.1:8000
</p>
<p>
This is the typical mode of operation while either just trying out yaws, or
hacking yaws. This will install a template configuration file
<em>yaws.conf</em> in <em>${prefix}/etc/yaws</em> (<em>${prefix}</em> is the
value of the <em>--prefix</em> option passed during the execution of the
configure script). If this file exists, the old file will not be
overwritten.
</p>
<p>
To run a locally installed system, we run the installed yaws script
<em>${prefix}/bin/yaws</em>.
</p>
<p>
A <em>standard</em> install will install yaws in <em>/usr/local</em>. A
configuration file <em>/etc/yaws/yaws.conf</em> will also be installed
unless the file already exists. The default config file will set up the
system to listen on http://127.0.0.1:80
</p>
<h2>Building with Rebar</h2>
<p>
Yaws can alternatively be built using <a
href="https://github.com/rebar/rebar">rebar</a>. Assuming you already
have <code>rebar</code> installed, simply type
</p>
<div class="box">
<pre>
$ rebar get-deps compile
</pre>
</div>
<p>
This fetches all dependencies and builds Yaws.
</p>
<p>
The <a href="rebar_release.html">rebar_release page</a> explains how to
use <code>rebar</code> to create an Erlang release for an application
that depends on Yaws.
</p>
<h2>Running yaws</h2>
<p>
The yaws executable is a shell script which invokes the
erlang system and instructs it to start yaws.
The command line flags for yaws are documented in
<a href="yman.yaws?page=yaws">
man page for yaws(1)
</a>
<p>
When developing yaws code, the interactive mode is ideal. Typically, yaws
is then started as:
</p>
<div class="box">
<pre>
# yaws -i
</pre>
</div>
<p>
Run yaws as a daemon as
</p>
<div class="box">
<pre>
# yaws --daemon
</pre>
</div>
<p>
All command line flags to yaws are described in the
man page for yaws.
</p>
<h2>Configuring Yaws</h2>
<p>
Web server configuration can be supplied to yaws in either of two ways
depending on whether we run yaws as a standalone daemon or if we run yaws
as an embedded application inside another Erlang program.
</p>
<p>
The yaws configuration is described in
<a href="yman.yaws?page=yaws.conf">
man page for yaws.conf (5)
</a>
</p>
<h3>Embedded mode</h3>
<p>
It is possible to run yaws in embedded mode where yaws is part of a
larger application. When running yaws in embedded mode, it is often not
possible to let yaws read its configuration data from
<em>/etc/yaws/yaws.conf</em>.
</p>
<p>
The function
<tt>yaws_api:setconf(Gconf, Groups)</tt>
can be used by an other erlang process to explicitly set a yaws
configuration at runtime.
To execute Yaws in embedded mode, it must be started with
the environment
<tt>{embedded, true}</tt>
</p>
<p>
The embedded mode is fully described at
<a href="embed.html">embed.yaws</a>
</p>
</p>
</div>
<div class="logo">
<img src="/icons/yaws_pb.gif" alt="pbyaws" />
</div>
<p>
<a href="https://validator.w3.org/check?uri=referer"><img
src="https://www.w3.org/Icons/valid-xhtml10"
alt="Valid XHTML 1.0!" height="31" width="88" /></a>
</p>
</body>
</html>