-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfiguration.yaws
236 lines (209 loc) · 5.54 KB
/
configuration.yaws
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
<erl>
box(Str) ->
{'div',[{class,"box"}],
{pre,[], yaws_api:htmlize(Str)}}.
out(A) ->
[{ssi, "TAB.inc", "%%",[{"configuration", "choosen"}]}].
</erl>
<div id="entry">
<h1>Build and install Yaws</h1>
<p>
Yaws used to be hosted at Sourceforge, but as of release 1.81 yaws is
hosted at github.
</p>
<p>
The github page is <a href="http://github.com/klacke/yaws">
http://github.com/klacke/yaws</a>
</p>
<p>
Tested releases are downloadable from the Yaws download directory
at <a href="http://yaws.hyber.org/download" >http://yaws.hyber.org/download
</a>
</p>
<p>
To check out the latest release and build a number of prerequisites
are required. (All code example below on Ubuntu)
</p>
<ul>
<li>
<p>
Installed erlang + development
</p>
<div class="box">
<pre>
# apt-get build-dep erlang yaws
# apt-get install erlang-nox erlang-src erlang-manpages erlang-mode
# apt-get install erlang-mode erlang-dev
</pre>
</div>
</li>
<li>
<p>
Installed git
</p>
<div class="box">
<pre>
# 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="http://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/klacke/yaws.git
</pre>
</div>
<p>To build and to what is knows as a local install, e.g.
a developer install do:
</p>
<div class="box">
<pre>
# cd yaws
# autoconf; ./configure; make; make local_install
</pre>
</div>
<p>
Alternatively, to make a proper install
</p>
<div class="box">
<pre>
# cd yaws
# ./configure --help
# ./configure --localstatedir=/var --sysconfdir=/etc
# make
# 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>
<em>make</em> (without install) will build the yaws system and
make local_install
does a local install 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 yaws.conf in $HOME.
If $HOME/yaws.conf exists, the old file will not be overwritten.
</p>
<p>
To run a locally installed system, we run the yaws script found in the
bin directory in the source code tree or $HOME/bin/yaws.
</p>
<p>
<tt>make install</tt>
will also build the yaws system and also
install it in /usr/local. A configuration file /etc/yaws/yaws.conf 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>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 /etc/yaws/yaws.conf.
</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.yaws">embed.yaws</a>
</p>
</p>
</div>
<erl>
out(_) ->
{ssi, "END2",[],[]}.
</erl>