Bug 14674: [QA Follow-up] Typos and textual adjustment
[koha.git] / debian / docs / koha-create.xml
1 <article xmlns='http://docbook.org/ns/docbook'>
2 <title>koha-create</title>
3 <info>
4 <productname>Koha</productname> is the first free software library automation package.
5 <author>
6   <orgname>The Koha Community</orgname>
7   <uri>http://koha-community.org/</uri>
8 </author>
9 </info>
10
11 <refentry xml:id="koha-create">
12
13   <refmeta>
14     <refentrytitle>koha-create</refentrytitle>
15     <manvolnum>8</manvolnum>
16   </refmeta>
17
18   <refnamediv>
19     <refname>koha-create</refname>
20     <refpurpose>Create a new Koha instance.</refpurpose>
21     <refclass>UNIX/Linux</refclass>
22   </refnamediv>
23
24   <refsynopsisdiv>
25     <cmdsynopsis>
26       <command>koha-create</command>
27       <arg choice="req"><option>--create-db</option>|<option>--request-db</option>|<option>--populate-db</option>|<option>--use-db</option></arg>
28       <arg><option>--marcflavor</option> marc21|normarc|unimarc</arg>
29       <arg><option>--zebralang</option> en|es|fr|gr|nb|ru|uk</arg>
30       <arg><option>--auth-idx</option> dom|grs1</arg>
31       <arg><option>--biblio-idx</option> dom|grs1</arg>
32       <arg><option>--use-memcached</option></arg>
33       <arg><option>--memcached-servers</option> server:port</arg>
34       <arg><option>--memcached-prefix</option> namespace_prefix</arg>
35       <arg><option>--defaultsql</option> /path/to/some.sql</arg>
36       <arg><option>--configfile</option> /path/to/config</arg>
37       <arg><option>--passwdfile</option> /path/to/passwd</arg>
38       <arg><option>--database</option> database</arg>
39       <arg><option>--adminuser</option> n</arg>
40       <arg><option>--enable-sru</option></arg>
41       <arg><option>--sru-port</option> port</arg>
42       <arg><option>--upload-path</option> directory</arg>
43       <arg><option>--help</option>|<option>-h</option></arg>
44
45       <arg choice="req" rep="norepeat"><replaceable>instancename</replaceable></arg>
46     </cmdsynopsis>
47   </refsynopsisdiv>
48   
49   <refsect1><title>Options</title>
50   <variablelist>
51     
52     <varlistentry>
53       <term><option>--create-db</option></term>
54       <listitem>
55         <para>Create a new database on localhost. If the database you want to use does not reside on localhost, you can use <option>--request-db</option> and <option>--populate-db</option>, see below. If the database already exists, you can use <option>--use-db</option>, see below.</para>
56       </listitem>
57     </varlistentry>
58     
59     <varlistentry>
60       <term><option>--request-db</option></term>
61       <listitem>
62         <para>This  option will create a file called <filename>instancename-db-request.txt</filename> in your current directory that contains information about how the database needs to be set up.</para>
63       </listitem>
64     </varlistentry>
65     
66     <varlistentry>
67       <term><option>--populate-db</option></term>
68       <listitem>
69         <para>When you have run koha-create with the <option>--request-db</option> option, and a database has been set up, you can finish your installation by running <command>koha-create</command> with this option.</para>
70       </listitem>
71     </varlistentry>
72
73     <varlistentry>
74       <term><option>--use-db</option></term>
75       <listitem>
76         <para>When the database you want to use has already been populated, you can run <command>koha-create</command> with this option to take care of all the other set-up configuration.</para>
77       </listitem>
78     </varlistentry>
79
80     <varlistentry>
81       <term><option>--configfile</option></term>
82       <listitem>
83         <para>Path to an alternative config file. This file can hold the same variables as the default config file, see below for details.</para>
84       </listitem>
85     </varlistentry>
86
87     <varlistentry>
88       <term><option>--database</option></term>
89       <listitem>
90         <para>MySQL database to use.</para>
91       </listitem>
92     </varlistentry>
93
94     <varlistentry>
95       <term><option>--defaultsql</option></term>
96       <listitem>
97         <para>Path to an SQL-file other than the one pointed to in the default or alternative config file. Corresponds to the DEFAULTSQL config file variable.</para>
98       </listitem>
99     </varlistentry>
100
101     <varlistentry>
102       <term><option>--marcflavor</option></term>
103       <listitem>
104         <para>Specifies format of MARC records to be indexed by Zebra. Corresponds to the ZEBRA_MARC_FORMAT config file variable.</para>
105       </listitem>
106     </varlistentry>
107
108     <varlistentry>
109       <term><option>--passwdfile</option></term>
110       <listitem>
111         <para>Path to an alternative passwd file. This file is in the same format as the default (Koha) passwd file, see below for details.</para>
112       </listitem>
113     </varlistentry>
114
115     <varlistentry>
116       <term><option>--zebralang</option></term>
117       <listitem>
118         <para>Primary language for Zebra indexing. Corresponds to the ZEBRA_LANGUAGE config file variable.</para>
119       </listitem>
120     </varlistentry>
121
122     <varlistentry>
123       <term><option>--auth-idx</option></term>
124       <listitem>
125         <para>Specified the desired indexing mode for authority records. Valid options are <option>dom</option> (default) and <option>grs1</option>.</para>
126       </listitem>
127     </varlistentry>
128
129     <varlistentry>
130       <term><option>--biblio-idx</option></term>
131       <listitem>
132         <para>Specified the desired indexing mode for bibliographic records. Valid options are <option>dom</option> (default) and <option>grs1</option>.</para>
133       </listitem>
134     </varlistentry>
135
136     <varlistentry>
137       <term><option>--use-memcached</option></term>
138       <listitem>
139         <para>Make the Koha instance use memcached. <option>Disabled by default</option>.</para>
140       </listitem>
141     </varlistentry>
142
143     <varlistentry>
144       <term><option>--memcached-servers</option></term>
145       <listitem>
146         <para>Specify a comma-separated list of host:port memcached servers for using with the created Koha instance. Defaults to <option>127.0.0.1:11211</option>, the needed configuration for a locally installed memcached server.</para>
147       </listitem>
148     </varlistentry>
149
150     <varlistentry>
151       <term><option>--memcached-prefix</option></term>
152       <listitem>
153         <para>Specifiy a <option>namespace prefix</option> for memcached. You usually leave this option alone to avoid namespace collisions. It defaults to <option>koha_</option>.</para>
154       </listitem>
155     </varlistentry>
156
157     <varlistentry>
158       <term><option>--enable-sru</option></term>
159       <listitem>
160         <para>Enable the Z39.50/SRU server for the created instance.</para>
161       </listitem>
162     </varlistentry>
163
164     <varlistentry>
165       <term><option>--sru-port</option></term>
166       <listitem>
167         <para>Specifiy a <option> TCP port number</option> for the Z39.50/SRU server to listen on.</para>
168       </listitem>
169     </varlistentry>
170
171     <varlistentry>
172       <term><option>--upload-path</option></term>
173       <listitem>
174         <para>Specify a <option>directory</option> for storing the permanently uploaded files of the instance.
175               It defaults to <filename>/var/lib/koha/instance/uploads</filename>.</para>
176       </listitem>
177     </varlistentry>
178
179     <varlistentry>
180       <term><option>--help</option>,<option>-h</option></term>
181       <listitem>
182         <para>Print usage information.</para>
183       </listitem>
184     </varlistentry>
185
186
187   </variablelist>
188   </refsect1>
189
190   <refsect1><title>Description</title>
191     <para><command>koha-create</command>  creates  a new Koha instance.  It is meant for a site that provides Koha hosting, and serves several sites from the same host.</para>
192     <para>The name of the instance is used as the domain name  for  Apache,  Unix user and group names, and MySQL username and database names are derived from it.  Unix user and group are named instance-koha. MySQL username is koha_instance, and database is koha_instance.</para>
193     <para>The Unix user has logins disabled.  The password for MySQL is generated randomly, and printed to the terminal.</para>
194     <para>The instance name is used as the domain name (ServerName)  for  Apache. The public catalogue (OPAC), for library customers, is on port 80.  The staff client interface is configured similarly, depending on the settings in <filename>/etc/koha/koha-sites.conf</filename> or alternate config file.</para>
195     <para>After  the  Koha  instance  is created, it is ready to be used, but the librarian needs to log in via the intranet and configure things.</para>
196     <para>Several configuration variables are available for adjusting this behavior. The variables are put into <filename>/etc/koha/koha-sites.conf</filename>. The following variables are obeyed:</para>
197     
198     <variablelist>
199     
200       <varlistentry>
201         <term><option>DOMAIN</option></term>
202         <listitem>
203           <para>The domain to append to the instance name, for Apache ServerName. Default is empty. The value must begin with a period.</para>
204         </listitem>
205       </varlistentry>
206     
207       <varlistentry>
208         <term><option>OPACPORT</option></term>
209         <listitem>
210           <para>The port for the OPAC.</para>
211         </listitem>
212       </varlistentry>
213
214       <varlistentry>
215         <term><option>OPACPREFIX</option></term>
216         <listitem>
217           <para>This is inserted before the instance name  when  forming  Apache ServerName.  For subdomains, make sure it ends with a period.</para>
218         </listitem>
219       </varlistentry>
220
221       <varlistentry>
222         <term><option>OPACSUFFIX</option></term>
223         <listitem>
224           <para>This  is inserted after the instance name, but before the domain name, when forming Apache ServerName.</para>
225         </listitem>
226       </varlistentry>
227
228       <varlistentry>
229         <term><option>INTRAPORT</option></term>
230         <listitem>
231           <para>The port for the intranet.  If you set this to empty or 80, then you must also define INTRAPREFIX or INTRASUFFIX.</para>
232         </listitem>
233       </varlistentry>
234
235       <varlistentry>
236         <term><option>INTRAPREFIX</option></term>
237         <listitem>
238           <para>This is inserted before the instance name  when  forming  Apache ServerName.  For subdomains, make sure it ends with a period.</para>
239         </listitem>
240       </varlistentry>
241
242       <varlistentry>
243         <term><option>INTRASUFFIX</option></term>
244         <listitem>
245           <para>This  is inserted after the instance name, but before the domain name, when forming Apache ServerName.</para>
246         </listitem>
247       </varlistentry>
248
249       <varlistentry>
250         <term><option>DEFAULTSQL</option></term>
251         <listitem>
252           <para>An SQL file (compressed with gzip) that can be fed  to  mysql(1) to  initialize the database after it has been created.  Might be created using koha-dump-defaults(8).</para>
253         </listitem>
254       </varlistentry>
255
256       <varlistentry>
257         <term><option>USE_MEMCACHED</option></term>
258         <listitem>
259           <para>Valid values are <option>yes</option> and <option>no</option>. If not present koha-create will default to <option>no</option>. Also, this will be overriden by the <option>--use-memcached</option> switch.</para>
260         </listitem>
261       </varlistentry>
262
263       <varlistentry>
264         <term><option>MEMCACHED_SERVERS</option></term>
265         <listitem>
266           <para>A comma-separated list of valid memcached servers. Usually in the form of <option>host:port</option>. If not present koha-create will default to <option>127.0.0.1:11211</option>. Also, this will be overriden by the arguments of the <option>--memcached-servers</option> switch.</para>
267         </listitem>
268       </varlistentry>
269
270       <varlistentry>
271         <term><option>MEMCACHED_PREFIX</option></term>
272         <listitem>
273           <para>A prefix for all new Koha instances to use in memcached. If not present koha-create will default to <option>koha_</option>. Also, this will be overriden by the arguments of the <option>--memcached-prefix</option> switch.</para>
274         </listitem>
275       </varlistentry>
276
277
278       <varlistentry>
279         <term><option>ZEBRA_MARC_FORMAT</option></term>
280         <listitem>
281           <para>Specifies format of MARC records to be indexed by Zebra.  Possible values are 'marc21', 'normarc' and 'unimarc'.</para>
282         </listitem>
283       </varlistentry>
284               
285       <varlistentry>
286         <term><option>ZEBRA_LANGUAGE</option></term>
287         <listitem>
288           <para>Primary  language  for Zebra indexing. Possible values are 'en', 'es', 'fr', 'nb', 'ru' and 'uk'.</para>
289         </listitem>
290       </varlistentry>
291
292     </variablelist>
293
294     <para>Order of precedence for config options, from lowest to highest:</para>
295        
296     <orderedlist>
297       <listitem><para>The defaults set in the code of <command>koha-create</command></para></listitem>
298       <listitem><para><filename>/etc/koha/koha-sites.conf</filename></para></listitem>
299       <listitem><para>Config file specified with <option>--configfile</option></para></listitem>
300       <listitem><para>Individual command line options</para></listitem>
301     </orderedlist>
302     
303   </refsect1>
304
305   <refsect1><title>Files</title>
306   <variablelist>
307     <varlistentry>
308       <term><option><filename>/etc/koha/koha-sites.conf</filename></option></term>
309       <listitem>
310         <para>Configuration variables are read from this file, if it exists.</para>
311       </listitem>
312     </varlistentry>
313
314     <varlistentry>
315       <term><option><filename>/etc/koha/passwd</filename></option></term>
316       <listitem>
317         <para>Pre-selected database credentials are read from this file, if it exists. The format for this file is instancename:username:passwd:database. Database is optional, but the other three are required if you want to use pre-determined database user credentials.</para>
318       </listitem>
319     </varlistentry>
320   </variablelist>
321   </refsect1>
322
323   <refsect1><title>Bugs</title>
324   <para>The program is a bit fragile. If something goes wrong, it does not clean up after itself.</para>
325   <para>Bugs can be reported here: <uri>http://bugs.koha-community.org/bugzilla3/</uri></para>
326   </refsect1>
327   
328   <refsect1><title>Example</title>
329   
330     <para>To create a new Koha instance:</para>
331
332     <para><command>koha-create --create-db hslibrary</command></para>
333
334     <para>The public catalog is now at <uri>http://hslibrary/</uri> and the librarian interface at <uri>http://hslibrary:8080/</uri>.</para>
335
336     <para>To use full domain names, and have the intranet interface on port  80, but on a different domain name, add the following variables to the configuration file:</para>
337
338     <itemizedlist spacing="compact">
339       <listitem><para>DOMAIN=".example.com"</para></listitem>
340       <listitem><para>INTRAPORT=""</para></listitem>
341       <listitem><para>INTRASUFFIX="-intra"</para></listitem>
342     </itemizedlist>
343
344     <para>This will result in the addresses for the public and intranet interfaces becoming these:</para>
345
346     <itemizedlist spacing="compact">
347       <listitem><para><uri>http://hslibrary.example.com/</uri></para></listitem>
348       <listitem><para><uri>http://hslibrary-intra.example.com/</uri></para></listitem>
349     </itemizedlist>
350     <para>Configuration changes only apply to instances created afterwards.</para>
351
352   </refsect1>
353   
354   <refsect1><title>See also</title>
355
356   <simplelist type="inline">
357     <member><command>koha-remove(8)</command></member>
358   </simplelist>
359
360   </refsect1>
361
362 </refentry>
363
364 </article>