d879a69beb355ee7e3c7ea89ebe4bc1a84ed1f0c
[koha-equinox.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|nb|fr</arg>
30       <arg><option>--defaultsql</option> /path/to/some.sql</arg>
31       <arg><option>--configfile</option> /path/to/config</arg>
32       <arg><option>--passwdfile</option> /path/to/passwd</arg>
33       <arg><option>--database</option> database</arg>
34       <arg><option>--adminuser</option> n</arg>
35       <arg choice="req" rep="norepeat"><replaceable>instancename</replaceable></arg>
36     </cmdsynopsis>
37   </refsynopsisdiv>
38   
39   <refsect1><title>Options</title>
40   <variablelist>
41     
42     <varlistentry>
43       <term><option>--create-db</option></term>
44       <listitem>
45         <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>
46       </listitem>
47     </varlistentry>
48     
49     <varlistentry>
50       <term><option>--request-db</option></term>
51       <listitem>
52         <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>
53       </listitem>
54     </varlistentry>
55     
56     <varlistentry>
57       <term><option>--populate-db</option></term>
58       <listitem>
59         <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>
60       </listitem>
61     </varlistentry>
62
63     <varlistentry>
64       <term><option>--use-db</option></term>
65       <listitem>
66         <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>
67       </listitem>
68     </varlistentry>
69
70     <varlistentry>
71       <term><option>--configfile</option></term>
72       <listitem>
73         <para>Path to an alternative config file. This file can hold the same variables as the default config file, see below for details.</para>
74       </listitem>
75     </varlistentry>
76
77     <varlistentry>
78       <term><option>--database</option></term>
79       <listitem>
80         <para>MySQL database to use.</para>
81       </listitem>
82     </varlistentry>
83
84     <varlistentry>
85       <term><option>--defaultsql</option></term>
86       <listitem>
87         <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>
88       </listitem>
89     </varlistentry>
90
91     <varlistentry>
92       <term><option>--marcflavor</option></term>
93       <listitem>
94         <para>Specifies format of MARC records to be indexed by Zebra. Corresponds to the ZEBRA_MARC_FORMAT config file variable.</para>
95       </listitem>
96     </varlistentry>
97
98     <varlistentry>
99       <term><option>--passwdfile</option></term>
100       <listitem>
101         <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>
102       </listitem>
103     </varlistentry>
104
105     <varlistentry>
106       <term><option>--zebralang</option></term>
107       <listitem>
108         <para>Primary language for Zebra indexing. Corresponds to the ZEBRA_LANGUAGE config file variable.</para>
109       </listitem>
110     </varlistentry>
111
112   </variablelist>
113   </refsect1>
114
115   <refsect1><title>Description</title>
116     <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>
117     <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>
118     <para>The Unix user has logins disabled.  The password for MySQL is generated randomly, and printed to the terminal.</para>
119     <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>
120     <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>
121     <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>
122     
123     <variablelist>
124     
125       <varlistentry>
126         <term><option>DOMAIN</option></term>
127         <listitem>
128           <para>The domain to append to the instance name, for Apache ServerName. Default is empty. The value must begin with a period.</para>
129         </listitem>
130       </varlistentry>
131     
132       <varlistentry>
133         <term><option>OPACPORT</option></term>
134         <listitem>
135           <para>The port for the OPAC.</para>
136         </listitem>
137       </varlistentry>
138
139       <varlistentry>
140         <term><option>OPACPREFIX</option></term>
141         <listitem>
142           <para>This is inserted before the instance name  when  forming  Apache ServerName.  For subdomains, make sure it ends with a period.</para>
143         </listitem>
144       </varlistentry>
145
146       <varlistentry>
147         <term><option>OPACSUFFIX</option></term>
148         <listitem>
149           <para>This  is inserted after the instance name, but before the domain name, when forming Apache ServerName.</para>
150         </listitem>
151       </varlistentry>
152
153       <varlistentry>
154         <term><option>INTRAPORT</option></term>
155         <listitem>
156           <para>The port for the intranet.  If you set this to empty or 80, then you must also define INTRAPREFIX or INTRASUFFIX.</para>
157         </listitem>
158       </varlistentry>
159
160       <varlistentry>
161         <term><option>INTRAPREFIX</option></term>
162         <listitem>
163           <para>This is inserted before the instance name  when  forming  Apache ServerName.  For subdomains, make sure it ends with a period.</para>
164         </listitem>
165       </varlistentry>
166
167       <varlistentry>
168         <term><option>INTRASUFFIX</option></term>
169         <listitem>
170           <para>This  is inserted after the instance name, but before the domain name, when forming Apache ServerName.</para>
171         </listitem>
172       </varlistentry>
173
174       <varlistentry>
175         <term><option>DEFAULTSQL</option></term>
176         <listitem>
177           <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>
178         </listitem>
179       </varlistentry>
180
181       <varlistentry>
182         <term><option>ZEBRA_MARC_FORMAT</option></term>
183         <listitem>
184           <para>Specifies format of MARC records to be indexed by Zebra.  Possible values are 'marc21', 'normarc' and 'unimarc'.</para>
185         </listitem>
186       </varlistentry>
187               
188       <varlistentry>
189         <term><option>ZEBRA_LANGUAGE</option></term>
190         <listitem>
191           <para>Primary  language  for Zebra indexing. Possible values are 'en', 'fr' and 'nb'.</para>
192         </listitem>
193       </varlistentry>
194
195     </variablelist>
196
197     <para>Order of precedence for config options, from lowest to highest:</para>
198        
199     <orderedlist>
200       <listitem><para>The defaults set in the code of <command>koha-create</command></para></listitem>
201       <listitem><para><filename>/etc/koha/koha-sites.conf</filename></para></listitem>
202       <listitem><para>Config file specified with <option>--configfile</option></para></listitem>
203       <listitem><para>Individual command line options</para></listitem>
204     </orderedlist>
205     
206   </refsect1>
207
208   <refsect1><title>Files</title>
209   <variablelist>
210     <varlistentry>
211       <term><option><filename>/etc/koha/koha-sites.conf</filename></option></term>
212       <listitem>
213         <para>Configuration variables are read from this file, if it exists.</para>
214       </listitem>
215     </varlistentry>
216
217     <varlistentry>
218       <term><option><filename>/etc/koha/passwd</filename></option></term>
219       <listitem>
220         <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>
221       </listitem>
222     </varlistentry>
223   </variablelist>
224   </refsect1>
225
226   <refsect1><title>Bugs</title>
227   <para>The program is a bit fragile. If something goes wrong, it does not clean up after itself.</para>
228   <para>Bugs can be reported here: <uri>http://bugs.koha-community.org/bugzilla3/</uri></para>
229   </refsect1>
230   
231   <refsect1><title>Example</title>
232   
233     <para>To create a new Koha instance:</para>
234
235     <para><command>koha-create --create-db hslibrary</command></para>
236
237     <para>The public catalog is now at <uri>http://hslibrary/</uri> and the librarian interface at <uri>http://hslibrary:8080/</uri>.</para>
238
239     <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>
240
241     <itemizedlist spacing="compact">
242       <listitem><para>DOMAIN=".example.com"</para></listitem>
243       <listitem><para>INTRAPORT=""</para></listitem>
244       <listitem><para>INTRASUFFIX="-intra"</para></listitem>
245     </itemizedlist>
246
247     <para>This will result in the addresses for the public and intranet interfaces becoming these:</para>
248
249     <itemizedlist spacing="compact">
250       <listitem><para><uri>http://hslibrary.example.com/</uri></para></listitem>
251       <listitem><para><uri>http://hslibrary-intra.example.com/</uri></para></listitem>
252     </itemizedlist>
253     <para>Configuration changes only apply to instances created afterwards.</para>
254
255   </refsect1>
256   
257   <refsect1><title>See also</title>
258
259   <simplelist type="inline">
260     <member><command>koha-remove(8)</command></member>
261   </simplelist>
262
263   </refsect1>
264
265 </refentry>
266
267 </article>