1 2<erl> 3 4box(Str) -> 5 {'div',[{class,"box"}], 6 {pre,[], yaws_api:htmlize(Str)}}. 7 8 9out(A) -> 10 [{ssi, "TAB.inc", "%%",[{"configuration", "choosen"}]}]. 11 12</erl> 13 14 15<div id="entry"> 16 <h1>Build and install Yaws</h1> 17 <p> 18 Yaws is hosted at <a 19 href="http://github.com/klacke/yaws">http://github.com/klacke/yaws</a>. (Prior 20 to release 1.81 Yaws was hosted at Sourceforge.) 21 </p> 22 <p> 23 Tested releases are downloadable from the Yaws download directory 24 at <a href="http://yaws.hyber.org/download" >http://yaws.hyber.org/download 25 </a> 26 </p> 27 28 <p> 29 To check out the latest release and build a number of prerequisites 30 are required. (All code example below on Ubuntu) 31 </p> 32 <p> 33 <strong>NOTE: Erlang/OTP R16B01 or higher is required.</strong> 34 </p> 35 <ul> 36 <li> 37 <p> 38 Installed erlang + development 39 </p> 40 <div class="box"> 41 <pre> 42# sudo apt-get build-dep erlang yaws 43# sudo apt-get install erlang-nox erlang-src erlang-manpages erlang-mode erlang-dev libtool 44 </pre> 45 </div> 46 </li> 47 <li> 48 <p> 49 Installed git 50 </p> 51 <div class="box"> 52 <pre> 53# sudo apt-get install git-core 54 </pre> 55 </div> 56 </li> 57 58 <li> 59 <p> 60 To build the docs, all kinds of verious tools are required. 61 latex, man2pdf ... etc. 62 63 </p> 64 </li> 65 66 <li> 67 <p> 68 To build win32 releases - the following is required. 69 </p> 70 <ul> 71 <li> 72 <p> 73 Mingw. 74 <div class="box"> 75 <pre> 76# apt-get install mingw32 mingw32-binutils 77 </pre> 78 </div> 79 </p> 80 </li> 81 <li> 82 Installbuilder. To build win32 installers we're using 83 an install builder that is free to use free of charge 84 for opensource projects. 85 Get the linux installer at 86 <a href="http://www.bitrock.com/download_installbuilder_download.html"> 87 bitrock 88 </a> 89 </li> 90 <p> 91 Further instructions are found in the win32 directory 92 in the source tree. 93 </p> 94 </ul> 95 </li> 96 </ul> 97 98 <p> 99 To check out the sources do 100 </p> 101 <div class="box"> 102 <pre> 103# git clone git://github.com/klacke/yaws.git 104 </pre> 105 </div> 106 <p>To build and to what is knows as a <em>local</em> install, e.g. 107 a developer install do: 108 </p> 109 <div class="box"> 110 <pre> 111# cd yaws 112# autoreconf -fi 113# ./configure --prefix=/path/to/yaws 114# make install 115 </pre> 116 </div> 117 <p> 118 Alternatively, to make a <em>standard</em> install 119 </p> 120 <div class="box"> 121 <pre> 122# cd yaws 123# autoreconf -fi 124# ./configure --help 125# ./configure --localstatedir=/var --sysconfdir=/etc 126# make 127# sudo make install 128 </pre> 129 </div> 130 131 <p> 132 The above commands will checkout the HEAD source, 133 build it and install it at 134 127.0.0.1:80 with the docroot set to the local documentation. 135 </p> 136 <p> 137 A <em>local</em> install does install yaws at http://127.0.0.1:8000 138 </p> 139 <p> 140 This is the typical mode of operation while either just trying out yaws, or 141 hacking yaws. This will install a template configuration file 142 <em>yaws.conf</em> in <em>${prefix}/etc/yaws</em> (<em>${prefix}</em> is the 143 value of the <em>--prefix</em> option passed during the execution of the 144 configure script). If this file exists, the old file will not be 145 overwritten. 146 </p> 147 <p> 148 To run a locally installed system, we run the installed yaws script 149 <em>${prefix}/bin/yaws</em>. 150 </p> 151 152 <p> 153 A <em>standard</em> install will install yaws in <em>/usr/local</em>. A 154 configuration file <em>/etc/yaws/yaws.conf</em> will also be installed 155 unless the file already exists. The default config file will set up the 156 system to listen on http://127.0.0.1:80 157 </p> 158 159 <h2>Building with Rebar</h2> 160 <p> 161 Yaws can alternatively be built using <a 162 href="https://github.com/rebar/rebar">rebar</a>. Assuming you already 163 have <code>rebar</code> installed, simply type 164 </p> 165 <div class="box"> 166 <pre> 167$ rebar get-deps compile 168 </pre> 169 </div> 170 <p> 171 This fetches all dependencies and builds Yaws. 172 </p> 173 <p> 174 The <a href="rebar_release.yaws">rebar_release page</a> explains how to 175 use <code>rebar</code> to create an Erlang release for an application 176 that depends on Yaws. 177 </p> 178 179 <h2>Running yaws</h2> 180 <p> 181 The yaws executable is a shell script which invokes the 182 erlang system and instructs it to start yaws. 183 The command line flags for yaws are documented in 184 <a href="yman.yaws?page=yaws"> 185 man page for yaws(1) 186 </a> 187 188 <p> 189 When developing yaws code, the interactive mode is ideal. Typically, yaws 190 is then started as: 191 </p> 192 <div class="box"> 193 <pre> 194# yaws -i 195 </pre> 196 </div> 197 <p> 198 Run yaws as a daemon as 199 </p> 200 <div class="box"> 201 <pre> 202# yaws --daemon 203 </pre> 204 </div> 205 <p> 206 All command line flags to yaws are described in the 207 man page for yaws. 208 </p> 209 210 <h2>Configuring Yaws</h2> 211 <p> 212 Web server configuration can be supplied to yaws in either of two ways 213 depending on whether we run yaws as a standalone daemon or if we run yaws 214 as an embedded application inside another Erlang program. 215 </p> 216 <p> 217 The yaws configuration is described in 218 <a href="yman.yaws?page=yaws.conf"> 219 man page for yaws.conf (5) 220 </a> 221 </p> 222 223 <h3>Embedded mode</h3> 224 <p> 225 It is possible to run yaws in embedded mode where yaws is part of a 226 larger application. When running yaws in embedded mode, it is often not 227 possible to let yaws read its configuration data from 228 <em>/etc/yaws/yaws.conf</em>. 229 </p> 230 231 <p> 232 The function 233 <tt>yaws_api:setconf(Gconf, Groups)</tt> 234 can be used by an other erlang process to explicitly set a yaws 235 configuration at runtime. 236 To execute Yaws in embedded mode, it must be started with 237 the environment 238 <tt>{embedded, true}</tt> 239 </p> 240 <p> 241 The embedded mode is fully described at 242 <a href="embed.yaws">embed.yaws</a> 243 </p> 244 </p> 245</div> 246 247 248<erl> 249 250out(_) -> 251 {ssi, "END2",[],[]}. 252 253</erl> 254 255 256