View | Details | Raw Unified | Return to bug 10733
Collapse All | Expand All

(-)a/debian/docs/koha-create.xml (+46 lines)
Lines 29-34 Link Here
29
      <arg><option>--zebralang</option> en|es|fr|nb|ru|uk</arg>
29
      <arg><option>--zebralang</option> en|es|fr|nb|ru|uk</arg>
30
      <arg><option>--auth-idx</option> dom|grs1</arg>
30
      <arg><option>--auth-idx</option> dom|grs1</arg>
31
      <arg><option>--biblio-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>
32
      <arg><option>--defaultsql</option> /path/to/some.sql</arg>
35
      <arg><option>--defaultsql</option> /path/to/some.sql</arg>
33
      <arg><option>--configfile</option> /path/to/config</arg>
36
      <arg><option>--configfile</option> /path/to/config</arg>
34
      <arg><option>--passwdfile</option> /path/to/passwd</arg>
37
      <arg><option>--passwdfile</option> /path/to/passwd</arg>
Lines 125-130 Link Here
125
      </listitem>
128
      </listitem>
126
    </varlistentry>
129
    </varlistentry>
127
130
131
    <varlistentry>
132
      <term><option>--use-memcached</option></term>
133
      <listitem>
134
        <para>Make the Koha instance use memcached. <option>Disabled by default</option>.</para>
135
      </listitem>
136
    </varlistentry>
137
138
    <varlistentry>
139
      <term><option>--memcached-servers</option></term>
140
      <listitem>
141
        <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>
142
      </listitem>
143
    </varlistentry>
144
145
    <varlistentry>
146
      <term><option>--memcached-prefix</option></term>
147
      <listitem>
148
        <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>
149
      </listitem>
150
    </varlistentry>
151
128
  </variablelist>
152
  </variablelist>
129
  </refsect1>
153
  </refsect1>
130
154
Lines 195-200 Link Here
195
      </varlistentry>
219
      </varlistentry>
196
220
197
      <varlistentry>
221
      <varlistentry>
222
        <term><option>USE_MEMCACHED</option></term>
223
        <listitem>
224
          <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>
225
        </listitem>
226
      </varlistentry>
227
228
      <varlistentry>
229
        <term><option>MEMCACHED_SERVERS</option></term>
230
        <listitem>
231
          <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>
232
        </listitem>
233
      </varlistentry>
234
235
      <varlistentry>
236
        <term><option>MEMCACHED_PREFIX</option></term>
237
        <listitem>
238
          <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>
239
        </listitem>
240
      </varlistentry>
241
242
243
      <varlistentry>
198
        <term><option>ZEBRA_MARC_FORMAT</option></term>
244
        <term><option>ZEBRA_MARC_FORMAT</option></term>
199
        <listitem>
245
        <listitem>
200
          <para>Specifies format of MARC records to be indexed by Zebra.  Possible values are 'marc21', 'normarc' and 'unimarc'.</para>
246
          <para>Specifies format of MARC records to be indexed by Zebra.  Possible values are 'marc21', 'normarc' and 'unimarc'.</para>
(-)a/debian/scripts/koha-create (-18 / +96 lines)
Lines 23-28 usage="Usage: $0 [--create-db|--request-db|--populate-db|--use-db] \ Link Here
23
    [--marcflavor marc21|normarc|unimarc] \
23
    [--marcflavor marc21|normarc|unimarc] \
24
    [--zebralang en|es|fr|nb|ru|uk] \
24
    [--zebralang en|es|fr|nb|ru|uk] \
25
    [--auth-idx dom|grs1] [--biblio-idx dom|grs1] \
25
    [--auth-idx dom|grs1] [--biblio-idx dom|grs1] \
26
    [--use-memcached] \
27
    [--memcached-servers server:port] [--memcached-prefix prefix] \
26
    [--defaultsql /path/to/some.sql] \
28
    [--defaultsql /path/to/some.sql] \
27
    [--configfile /path/to/config] [--passwdfile /path/to/passwd] \
29
    [--configfile /path/to/config] [--passwdfile /path/to/passwd] \
28
    [--database database] [--adminuser n] instancename"
30
    [--database database] [--adminuser n] instancename"
Lines 61-66 generate_config_file() { Link Here
61
        -e "s/__UNIXUSER__/$username/g" \
63
        -e "s/__UNIXUSER__/$username/g" \
62
        -e "s/__UNIXGROUP__/$username/g" \
64
        -e "s/__UNIXGROUP__/$username/g" \
63
        -e "s/__PLUGINS_DIR__/\/var\/lib\/koha\/$name\/plugins/g" \
65
        -e "s/__PLUGINS_DIR__/\/var\/lib\/koha\/$name\/plugins/g" \
66
        -e "s/__MEMCACHED_NAMESPACE__/$MEMCACHED_NAMESPACE/g" \
67
        -e "s/__MEMCACHED_SERVERS__/$MEMCACHED_SERVERS/g" \
64
        "/etc/koha/$1" > "$2"
68
        "/etc/koha/$1" > "$2"
65
69
66
}
70
}
Lines 154-159 EOF` Link Here
154
    esac
158
    esac
155
}
159
}
156
160
161
162
set_memcached()
163
{
164
    local instance="$1"
165
166
    if [ "$CLO_MEMCACHED_SERVERS" != "" ]; then
167
        MEMCACHED_SERVERS=$CLO_MEMCACHED_SERVERS
168
    else
169
        if [ "$MEMCACHED_SERVERS" = "" ]; then
170
            MEMCACHED_SERVERS=$DEFAULT_MEMCACHED_SERVERS
171
        # else: was set by the koha-sites.conf file
172
        fi
173
    fi
174
175
    if [ "$CLO_MEMCACHED_PREFIX" != "" ]; then
176
        MEMCACHED_NAMESPACE="$CLO_MEMCACHED_PREFIX$instance"
177
    else
178
        if [ "$MEMCACHED_PREFIX" != "" ]; then
179
            MEMCACHED_NAMESPACE="$MEMCACHED_PREFIX$instance"
180
        else
181
            MEMCACHED_NAMESPACE="$DEFAULT_MEMCACHED_PREFIX$instance"
182
        fi
183
    fi
184
185
}
186
157
# Set defaults and read config file, if it exists.
187
# Set defaults and read config file, if it exists.
158
DOMAIN=""
188
DOMAIN=""
159
OPACPORT="80"
189
OPACPORT="80"
Lines 168-173 ZEBRA_LANGUAGE="en" Link Here
168
ADMINUSER="1"
198
ADMINUSER="1"
169
PASSWDFILE="/etc/koha/passwd"
199
PASSWDFILE="/etc/koha/passwd"
170
200
201
# memcached variables
202
USE_MEMCACHED="no"
203
MEMCACHED_SERVERS=""
204
MEMCACHED_PREFIX=""
205
# hardcoded memcached defaults
206
DEFAULT_MEMCACHED_SERVERS="127.0.0.1:11211"
207
DEFAULT_MEMCACHED_PREFIX="koha_"
208
171
# Indexing mode variables (default is DOM)
209
# Indexing mode variables (default is DOM)
172
BIBLIOS_INDEXING_MODE="dom"
210
BIBLIOS_INDEXING_MODE="dom"
173
AUTHORITIES_INDEXING_MODE="dom"
211
AUTHORITIES_INDEXING_MODE="dom"
Lines 184-190 fi Link Here
184
222
185
[ $# -ge 2 ] && [ $# -le 16 ] || die $usage
223
[ $# -ge 2 ] && [ $# -le 16 ] || die $usage
186
224
187
TEMP=`getopt -o crpm:l:d:f:b:a: -l create-db,request-db,populate-db,use-db,marcflavor:,auth-idx:,biblio-idx:,zebralang:,defaultsql:,configfile:,passwdfile:,database:,adminuser: \
225
TEMP=`getopt -o crpm:l:d:f:b:a: -l create-db,request-db,populate-db,use-db,use-memcached,marcflavor:,auth-idx:,biblio-idx:,zebralang:,defaultsql:,configfile:,passwdfile:,database:,adminuser:,memcached-servers:,memcached-prefix:, \
188
     -n "$0" -- "$@"`
226
     -n "$0" -- "$@"`
189
227
190
# Note the quotes around `$TEMP': they are essential!
228
# Note the quotes around `$TEMP': they are essential!
Lines 197-222 CLO_DEFAULTSQL="" Link Here
197
CLO_ADMINUSER=""
235
CLO_ADMINUSER=""
198
CLO_BIBLIOS_INDEXING_MODE=""
236
CLO_BIBLIOS_INDEXING_MODE=""
199
CLO_AUTHORITIES_INDEXING_MODE=""
237
CLO_AUTHORITIES_INDEXING_MODE=""
238
CLO_MEMCACHED_SERVERS=""
239
CLO_MEMCACHED_PREFIX=""
200
240
201
241
202
while true ; do
242
while true ; do
203
	case "$1" in
243
    case "$1" in
204
		-c|--create-db) op=create ; shift ;;
244
        -c|--create-db)
205
		-r|--request-db) op=request ; shift ;;
245
            op=create ; shift ;;
206
		-p|--populate-db) op=populate ; shift ;;
246
        -r|--request-db)
207
        -u|--use-db) op=use ; shift ;;
247
            op=request ; shift ;;
208
		-m|--marcflavor) CLO_ZEBRA_MARC_FORMAT="$2" ; shift 2 ;;
248
        -p|--populate-db)
209
		-l|--zebralang) CLO_ZEBRA_LANGUAGE="$2" ; shift 2 ;;
249
            op=populate ; shift ;;
210
		--auth-idx) CLO_AUTHORITIES_INDEXING_MODE="$2" ; shift 2 ;;
250
        -u|--use-db)
211
		--biblio-idx) CLO_BIBLIOS_INDEXING_MODE="$2" ; shift 2 ;;
251
            op=use ; shift ;;
212
		-d|--defaultsql) CLO_DEFAULTSQL="$2" ; shift 2 ;;
252
        --use-memcached)
213
		-f|--configfile) configfile="$2" ; shift 2 ;;
253
            USE_MEMCACHED="yes" ; shift ;;
214
        -s|--passwdfile) CLO_PASSWDFILE="$2" ; shift 2 ;;
254
        --memcached-servers)
215
        -b|--database) CLO_DATABASE="$2" ; shift 2 ;;
255
            CLO_MEMCACHED_SERVERS="$2" ; shift 2 ;;
216
		-a|--adminuser) CLO_ADMINUSER="$2" ; shift 2 ;;
256
        --memcached-prefix)
217
		--) shift ; break ;;
257
            CLO_MEMCACHED_PREFIX="$2" ; shift 2;;
218
		*) die "Internal error processing command line arguments" ;;
258
        -m|--marcflavor)
219
	esac
259
            CLO_ZEBRA_MARC_FORMAT="$2" ; shift 2 ;;
260
    -l|--zebralang)
261
            CLO_ZEBRA_LANGUAGE="$2" ; shift 2 ;;
262
    --auth-idx)
263
            CLO_AUTHORITIES_INDEXING_MODE="$2" ; shift 2 ;;
264
    --biblio-idx)
265
            CLO_BIBLIOS_INDEXING_MODE="$2" ; shift 2 ;;
266
        -d|--defaultsql)
267
            CLO_DEFAULTSQL="$2" ; shift 2 ;;
268
        -f|--configfile)
269
            configfile="$2" ; shift 2 ;;
270
        -s|--passwdfile)
271
            CLO_PASSWDFILE="$2" ; shift 2 ;;
272
        -b|--database)
273
            CLO_DATABASE="$2" ; shift 2 ;;
274
        -a|--adminuser)
275
            CLO_ADMINUSER="$2" ; shift 2 ;;
276
        --)
277
            shift ; break ;;
278
        *)
279
            die "Internal error processing command line arguments" ;;
280
    esac
220
done
281
done
221
282
222
# Load the configfile given on the command line
283
# Load the configfile given on the command line
Lines 267-272 set_authorities_indexing_mode $AUTHORITIES_INDEXING_MODE $ZEBRA_MARC_FORMAT Link Here
267
328
268
name="$1"
329
name="$1"
269
330
331
if [ "$USE_MEMCACHED" = "yes" ]; then
332
    set_memcached $name
333
elif [ "$CLO_MEMCACHED_SERVERS" != "" ] || \
334
     [ "$CLO_MEMCACHED_PREFIX" != "" ]; then
335
336
    MSG=`cat <<EOF
337
338
Error: you provided memcached configuration switches but memcached is not enabled.
339
Please set USE_MEMCACHED="yes" on /etc/koha/koha-sites.conf or use the
340
--use-memcached optio switch to enable it.
341
342
EOF`
343
344
    echo $usage
345
    die $MSG
346
fi
347
270
opacdomain="$OPACPREFIX$name$OPACSUFFIX$DOMAIN"
348
opacdomain="$OPACPREFIX$name$OPACSUFFIX$DOMAIN"
271
intradomain="$INTRAPREFIX$name$INTRASUFFIX$DOMAIN"
349
intradomain="$INTRAPREFIX$name$INTRASUFFIX$DOMAIN"
272
350
(-)a/debian/templates/apache-site.conf.in (+4 lines)
Lines 8-13 Link Here
8
8
9
   ServerName __OPACSERVER__
9
   ServerName __OPACSERVER__
10
   SetEnv KOHA_CONF "/etc/koha/sites/__KOHASITE__/koha-conf.xml"
10
   SetEnv KOHA_CONF "/etc/koha/sites/__KOHASITE__/koha-conf.xml"
11
   SetEnv MEMCACHED_SERVERS "__MEMCACHED_SERVERS__"
12
   SetEnv MEMCACHED_NAMESPACE "__MEMCACHED_NAMESPACE__"
11
   AssignUserID __UNIXUSER__ __UNIXGROUP__
13
   AssignUserID __UNIXUSER__ __UNIXGROUP__
12
14
13
   ErrorLog    /var/log/koha/__KOHASITE__/opac-error.log
15
   ErrorLog    /var/log/koha/__KOHASITE__/opac-error.log
Lines 23-28 Link Here
23
   
25
   
24
   ServerName __INTRASERVER__
26
   ServerName __INTRASERVER__
25
   SetEnv KOHA_CONF "/etc/koha/sites/__KOHASITE__/koha-conf.xml"
27
   SetEnv KOHA_CONF "/etc/koha/sites/__KOHASITE__/koha-conf.xml"
28
   SetEnv MEMCACHED_SERVERS "__MEMCACHED_SERVERS__"
29
   SetEnv MEMCACHED_NAMESPACE "__MEMCACHED_NAMESPACE__"
26
   AssignUserID __UNIXUSER__ __UNIXGROUP__
30
   AssignUserID __UNIXUSER__ __UNIXGROUP__
27
31
28
   ErrorLog    /var/log/koha/__KOHASITE__/intranet-error.log
32
   ErrorLog    /var/log/koha/__KOHASITE__/intranet-error.log
(-)a/debian/templates/koha-conf-site.xml.in (-3 / +2 lines)
Lines 276-283 Link Here
276
 <!-- <pazpar2url>http://__PAZPAR2_HOST__:__PAZPAR2_PORT__/search.pz2</pazpar2url> -->
276
 <!-- <pazpar2url>http://__PAZPAR2_HOST__:__PAZPAR2_PORT__/search.pz2</pazpar2url> -->
277
 <install_log>/usr/share/koha/misc/koha-install-log</install_log>
277
 <install_log>/usr/share/koha/misc/koha-install-log</install_log>
278
 <useldapserver>0</useldapserver><!-- see C4::Auth_with_ldap for extra configs you must add if you want to turn this on -->
278
 <useldapserver>0</useldapserver><!-- see C4::Auth_with_ldap for extra configs you must add if you want to turn this on -->
279
 <memcached_servers></memcached_servers>
279
 <memcached_servers>__MEMCACHED_SERVERS__</memcached_servers>
280
 <memcached_namespace></memcached_namespace>
280
 <memcached_namespace>__MEMCACHED_NAMESPACE__</memcached_namespace>
281
 <zebra_bib_index_mode>__BIBLIOS_INDEXING_MODE__</zebra_bib_index_mode>
281
 <zebra_bib_index_mode>__BIBLIOS_INDEXING_MODE__</zebra_bib_index_mode>
282
 <zebra_auth_index_mode>__AUTHORITIES_INDEXING_MODE__</zebra_auth_index_mode>
282
 <zebra_auth_index_mode>__AUTHORITIES_INDEXING_MODE__</zebra_auth_index_mode>
283
 <queryparser_config>/etc/koha/searchengine/queryparser.yaml</queryparser_config>
283
 <queryparser_config>/etc/koha/searchengine/queryparser.yaml</queryparser_config>
284
- 

Return to bug 10733