Table of Contents
koha-create — Create a new Koha instance.UNIX/Linux
koha-create
[--create-db
|--request-db
|--populate-db
] [--marcflavor
marc21|normarc|unimarc] [--zebralang
en|nb|fr] [--defaultsql
/path/to/some.sql] [--configfile
/path/to/config] [--adminuser
n] {instancename
}
--create-db
Create a new datbase on localhost. If the database you want to use does not reside on localhost, you can use --request-db
and --populate-db
, see below.
--request-db
This option will create a file called instancename-db-request.txt
in your current directory that contains information about how the database needs to be set up.
--populate-db
When you have run koha-create with the --request-db
option, and a database has been set up, you can finnish your installation by running koha-create with this option.
--configfile
Path to an alternative config file. This file can hold the same variables as the default config file, see below for details.
--defaultsql
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.
--marcflavor
Specifies format of MARC records to be indexed by Zebra. Corresponds to the ZEBRA_MARC_FORMAT config file variable.
--zebralang
Primary language for Zebra indexing. Corresponds to the ZEBRA_LANGUAGE config file variable.
koha-create creates a new Koha instance. It is meant for a site that provides Koha hosting, and serves several sites from the same host.
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.
The Unix user has logins disabled. The password for MySQL is generated randomly, and printed to the terminal.
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 /etc/koha/koha-sites.conf
or alternate config file.
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.
Several configuration variables are available for adjusting this behavior. The variables are put into /etc/koha/koha-site.conf
. The following variables are obeyed:
DOMAIN
The domain to append to the instance name, for Apache ServerName. Default is empty. The value must begin with a period.
INTRAPORT
The port for the intranet. If you set this to empty or 80, then you must also define INTRAPREFIX or INTRASUFFIX.
INTRAPREFIX
This is inserted before the instance name when forming Apache ServerName. For subdomains, make sure it ends with a period.
INTRASUFFIX
This is inserted after the instance name, but before the domain name, when forming Apache ServerName.
DEFAULTSQL
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).
ZEBRA_MARC_FORMAT
Specifies format of MARC records to be indexed by Zebra. Possible values are 'marc21', 'normarc' and 'unimarc'.
ZEBRA_LANGUAGE
Primary language for Zebra indexing. Possible values are 'en', 'fr' and 'nb'.
Order of precedence for config options, from lowest to highest:
The defaults set in the code of koha-create
/etc/koha/koha-sites.conf
Config file specified with --configfile
Individual command line options
The program is a bit fragile. If something goes wrong, it does not clean up after itself.
Bugs can be reported here: http://bugs.koha-community.org/bugzilla3/
To create a new Koha instance:
koha-create hslibrary
The public catalog is now at http://hslibrary/
and the librarian interface at http://hslibrary:8080/
.
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:
DOMAIN=".example.com"
INTRAPORT=""
INTRASUFFIX="-intra"
This will result in the addresses for the public and intranet interfaces becoming these:
http://hslibrary.example.com/
http://hslibrary-intra.example.com/
Configuration changes only apply to instances created afterwards.