Bug 12372: Updated man pages for koha-mysql
[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>--help</option>|<option>-h</option></arg>
43
44       <arg choice="req" rep="norepeat"><replaceable>instancename</replaceable></arg>
45     </cmdsynopsis>
46   </refsynopsisdiv>
47   
48   <refsect1><title>Options</title>
49   <variablelist>
50     
51     <varlistentry>
52       <term><option>--create-db</option></term>
53       <listitem>
54         <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>
55       </listitem>
56     </varlistentry>
57     
58     <varlistentry>
59       <term><option>--request-db</option></term>
60       <listitem>
61         <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>
62       </listitem>
63     </varlistentry>
64     
65     <varlistentry>
66       <term><option>--populate-db</option></term>
67       <listitem>
68         <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>
69       </listitem>
70     </varlistentry>
71
72     <varlistentry>
73       <term><option>--use-db</option></term>
74       <listitem>
75         <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>
76       </listitem>
77     </varlistentry>
78
79     <varlistentry>
80       <term><option>--configfile</option></term>
81       <listitem>
82         <para>Path to an alternative config file. This file can hold the same variables as the default config file, see below for details.</para>
83       </listitem>
84     </varlistentry>
85
86     <varlistentry>
87       <term><option>--database</option></term>
88       <listitem>
89         <para>MySQL database to use.</para>
90       </listitem>
91     </varlistentry>
92
93     <varlistentry>
94       <term><option>--defaultsql</option></term>
95       <listitem>
96         <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>
97       </listitem>
98     </varlistentry>
99
100     <varlistentry>
101       <term><option>--marcflavor</option></term>
102       <listitem>
103         <para>Specifies format of MARC records to be indexed by Zebra. Corresponds to the ZEBRA_MARC_FORMAT config file variable.</para>
104       </listitem>
105     </varlistentry>
106
107     <varlistentry>
108       <term><option>--passwdfile</option></term>
109       <listitem>
110         <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>
111       </listitem>
112     </varlistentry>
113
114     <varlistentry>
115       <term><option>--zebralang</option></term>
116       <listitem>
117         <para>Primary language for Zebra indexing. Corresponds to the ZEBRA_LANGUAGE config file variable.</para>
118       </listitem>
119     </varlistentry>
120
121     <varlistentry>
122       <term><option>--auth-idx</option></term>
123       <listitem>
124         <para>Specified the desired indexing mode for authority records. Valid options are <option>dom</option> (default) and <option>grs1</option>.</para>
125       </listitem>
126     </varlistentry>
127
128     <varlistentry>
129       <term><option>--biblio-idx</option></term>
130       <listitem>
131         <para>Specified the desired indexing mode for bibliographic records. Valid options are <option>dom</option> (default) and <option>grs1</option>.</para>
132       </listitem>
133     </varlistentry>
134
135     <varlistentry>
136       <term><option>--use-memcached</option></term>
137       <listitem>
138         <para>Make the Koha instance use memcached. <option>Disabled by default</option>.</para>
139       </listitem>
140     </varlistentry>
141
142     <varlistentry>
143       <term><option>--memcached-servers</option></term>
144       <listitem>
145         <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>
146       </listitem>
147     </varlistentry>
148
149     <varlistentry>
150       <term><option>--memcached-prefix</option></term>
151       <listitem>
152         <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>
153       </listitem>
154     </varlistentry>
155
156     <varlistentry>
157       <term><option>--enable-sru</option></term>
158       <listitem>
159         <para>Enable the Z39.50/SRU server for the created instance.</para>
160       </listitem>
161     </varlistentry>
162
163     <varlistentry>
164       <term><option>--sru-port</option></term>
165       <listitem>
166         <para>Specifiy a <option> TCP port number</option> for the Z39.50/SRU server to listen on.</para>
167       </listitem>
168     </varlistentry>
169
170     <varlistentry>
171       <term><option>--help</option>,<option>-h</option></term>
172       <listitem>
173         <para>Print usage information.</para>
174       </listitem>
175     </varlistentry>
176
177
178   </variablelist>
179   </refsect1>
180
181   <refsect1><title>Description</title>
182     <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>
183     <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>
184     <para>The Unix user has logins disabled.  The password for MySQL is generated randomly, and printed to the terminal.</para>
185     <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>
186     <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>
187     <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>
188     
189     <variablelist>
190     
191       <varlistentry>
192         <term><option>DOMAIN</option></term>
193         <listitem>
194           <para>The domain to append to the instance name, for Apache ServerName. Default is empty. The value must begin with a period.</para>
195         </listitem>
196       </varlistentry>
197     
198       <varlistentry>
199         <term><option>OPACPORT</option></term>
200         <listitem>
201           <para>The port for the OPAC.</para>
202         </listitem>
203       </varlistentry>
204
205       <varlistentry>
206         <term><option>OPACPREFIX</option></term>
207         <listitem>
208           <para>This is inserted before the instance name  when  forming  Apache ServerName.  For subdomains, make sure it ends with a period.</para>
209         </listitem>
210       </varlistentry>
211
212       <varlistentry>
213         <term><option>OPACSUFFIX</option></term>
214         <listitem>
215           <para>This  is inserted after the instance name, but before the domain name, when forming Apache ServerName.</para>
216         </listitem>
217       </varlistentry>
218
219       <varlistentry>
220         <term><option>INTRAPORT</option></term>
221         <listitem>
222           <para>The port for the intranet.  If you set this to empty or 80, then you must also define INTRAPREFIX or INTRASUFFIX.</para>
223         </listitem>
224       </varlistentry>
225
226       <varlistentry>
227         <term><option>INTRAPREFIX</option></term>
228         <listitem>
229           <para>This is inserted before the instance name  when  forming  Apache ServerName.  For subdomains, make sure it ends with a period.</para>
230         </listitem>
231       </varlistentry>
232
233       <varlistentry>
234         <term><option>INTRASUFFIX</option></term>
235         <listitem>
236           <para>This  is inserted after the instance name, but before the domain name, when forming Apache ServerName.</para>
237         </listitem>
238       </varlistentry>
239
240       <varlistentry>
241         <term><option>DEFAULTSQL</option></term>
242         <listitem>
243           <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>
244         </listitem>
245       </varlistentry>
246
247       <varlistentry>
248         <term><option>USE_MEMCACHED</option></term>
249         <listitem>
250           <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>
251         </listitem>
252       </varlistentry>
253
254       <varlistentry>
255         <term><option>MEMCACHED_SERVERS</option></term>
256         <listitem>
257           <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>
258         </listitem>
259       </varlistentry>
260
261       <varlistentry>
262         <term><option>MEMCACHED_PREFIX</option></term>
263         <listitem>
264           <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>
265         </listitem>
266       </varlistentry>
267
268
269       <varlistentry>
270         <term><option>ZEBRA_MARC_FORMAT</option></term>
271         <listitem>
272           <para>Specifies format of MARC records to be indexed by Zebra.  Possible values are 'marc21', 'normarc' and 'unimarc'.</para>
273         </listitem>
274       </varlistentry>
275               
276       <varlistentry>
277         <term><option>ZEBRA_LANGUAGE</option></term>
278         <listitem>
279           <para>Primary  language  for Zebra indexing. Possible values are 'en', 'es', 'fr', 'nb', 'ru' and 'uk'.</para>
280         </listitem>
281       </varlistentry>
282
283     </variablelist>
284
285     <para>Order of precedence for config options, from lowest to highest:</para>
286        
287     <orderedlist>
288       <listitem><para>The defaults set in the code of <command>koha-create</command></para></listitem>
289       <listitem><para><filename>/etc/koha/koha-sites.conf</filename></para></listitem>
290       <listitem><para>Config file specified with <option>--configfile</option></para></listitem>
291       <listitem><para>Individual command line options</para></listitem>
292     </orderedlist>
293     
294   </refsect1>
295
296   <refsect1><title>Files</title>
297   <variablelist>
298     <varlistentry>
299       <term><option><filename>/etc/koha/koha-sites.conf</filename></option></term>
300       <listitem>
301         <para>Configuration variables are read from this file, if it exists.</para>
302       </listitem>
303     </varlistentry>
304
305     <varlistentry>
306       <term><option><filename>/etc/koha/passwd</filename></option></term>
307       <listitem>
308         <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>
309       </listitem>
310     </varlistentry>
311   </variablelist>
312   </refsect1>
313
314   <refsect1><title>Bugs</title>
315   <para>The program is a bit fragile. If something goes wrong, it does not clean up after itself.</para>
316   <para>Bugs can be reported here: <uri>http://bugs.koha-community.org/bugzilla3/</uri></para>
317   </refsect1>
318   
319   <refsect1><title>Example</title>
320   
321     <para>To create a new Koha instance:</para>
322
323     <para><command>koha-create --create-db hslibrary</command></para>
324
325     <para>The public catalog is now at <uri>http://hslibrary/</uri> and the librarian interface at <uri>http://hslibrary:8080/</uri>.</para>
326
327     <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>
328
329     <itemizedlist spacing="compact">
330       <listitem><para>DOMAIN=".example.com"</para></listitem>
331       <listitem><para>INTRAPORT=""</para></listitem>
332       <listitem><para>INTRASUFFIX="-intra"</para></listitem>
333     </itemizedlist>
334
335     <para>This will result in the addresses for the public and intranet interfaces becoming these:</para>
336
337     <itemizedlist spacing="compact">
338       <listitem><para><uri>http://hslibrary.example.com/</uri></para></listitem>
339       <listitem><para><uri>http://hslibrary-intra.example.com/</uri></para></listitem>
340     </itemizedlist>
341     <para>Configuration changes only apply to instances created afterwards.</para>
342
343   </refsect1>
344   
345   <refsect1><title>See also</title>
346
347   <simplelist type="inline">
348     <member><command>koha-remove(8)</command></member>
349   </simplelist>
350
351   </refsect1>
352
353 </refentry>
354
355 </article>