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