2016年4月24日 星期日

Koha圖書館管理系統13-20160418_koha安裝手冊



1、安裝ubuntu14.04
建立使用者koha,並設定密碼

在終端機開始執行以下指令


先使用此步驟的話,就可以免去加sudo,因為已進到root權限裡
新增root密碼
>sudo passwd root 打上密碼,設定密碼
>su root 切換到root帳號(root帳號下指令就不須加sudo
打上cd 切換到root目錄
>此符號在此代表要輸入的指定

---------------------------------------------------------------------------------


2、加入koha的source
>sudo gedit /etc/apt/sources.list
跳出gedit編輯視窗後,在最下面貼 :
deb http://debian.koha-community.org/koha stable main 


















儲存,關閉gedit編輯視窗,回到終端機
>sudo  wget -O- http://debian.koha-community.org/koha/gpg.asc | sudo apt-key add -
>sudo apt-get update

---------------------------------------------------------------------------------


3、下載koha
>wget http://download.koha-community.org/koha-3.22.05.tar.gz
要去koha官網(https://koha-community.org/)確認最新版本,或欲安裝版本的檔案是否還存在,此手冊安裝3.22.05版本
>tar zxvf koha-3.22.05.tar.gz

---------------------------------------------------------------------------------


4、安裝koha套件
>sudo apt-get install mysql-server
如果有問Do you want to continue? [Y/n],則輸入y繼續
設定root密碼,並在確認一次密碼














>sudo apt-get install g++
如有問如果有問Do you want to continue? [Y/n],則輸入y繼續
>sudo apt-get install make
>sudo apt-get install koha-common
如有問如果有問Do you want to continue? [Y/n],則輸入y繼續
遇見以下設定畫面,繼續選確定即可


















若出現
處理時發生錯誤:
libapache2-mpm-itk
apache2-mpm-itk
koha-common
則輸入
>sudo a2dismod mpm_event
>sudo apt-get install -f
再重新執行上一指令
>sudo apt-get install koha-common

重新執行,直到問題解決為止

>sudo echo "ServerName localhost" | sudo tee /etc/apache2/conf-available/fqdn.conf
>sudo ln -s /etc/apache2/conf-available/fqdn.conf /etc/apache2/conf-enabled/fqdn.conf
>sudo a2dismod mpm_event
>sudo a2enmod mpm_prefork
>sudo service apache2 restart
>sudo apt-get install -f

---------------------------------------------------------------------------------

5、切換到koha資料夾
>cd koha-3.22.05

檢查perl套件
>perl koha_perl_deps.pl -m -u | awk -F ' ' {'print $1'}
此圖中即顯示了目前缺少的4個套件
HTTPD::Bench::ApacheBench
Test::DBIx::Class
Exception::Class
Test::WWW::Mechanize









因此要補上缺少的套件,前面加cpan,後面加缺少的套件名稱,例如:
>sudo cpan HTTPD::Bench::ApacheBench
跑完後再以perl koha_perl_deps.pl -m -u | awk -F ' ' {'print $1'}檢查是否還有缺少的套件

>gedit /etc/perl/XML/SAX/ParserDetails.ini
改成下圖的樣子



















---------------------------------------------------------------------------------

6、新增koha資料庫及使用者
>mysql -u root -p (登入資料庫)
>create database koha; (建立koha資料庫)
>grant all on *.* to 'koha'@'localhost' identified by '你的密碼'; (koha userc和密碼)
>exit; (離開)

---------------------------------------------------------------------------------

7、安裝koha
>perl Makefile.PL

對照下列繼續
Installation mode (dev, single, standard) [standard]按enter繼續下去
Base installation directory [/usr/share/koha]輸入koha
User account [koha]
Group [koha]
DBMS to use (Pg, mysql) [mysql]
Database server [localhost]
DMBS [3306]
Please specify the name of the database to be used by Koha [koha]
Please specify the user that owns the database to be used by Koha [kohaadmin] koha Please specify the password of the user that owns the database to be used by Koha [katikoan] koha的密碼
MARC format for Zebra indexing (marc21, normarc, unimarc) [marc21]
Primary language for Zebra indexing (en, es, fr, gr, nb, ru, uk) [en]
Bibliographic indexing mode (dom, grs1) [dom]
Authorities indexing mode (dom, grs1) [dom]
characters. (chr, icu) [chr] icu(需選擇icu)
Please specify Zebra database user [kohauser]
Please specify the Zebra database password [zebrastripes]
Install the SRU configuration files? (no, yes) [yes]
SRU Database host? [localhost]
SRU port for bibliographic data? [9998]
SRU port for authority data? [9999]
Install the PazPar2 configuration files? [no]
You will need a Memcached server running. (no, yes) [no]
Path to DejaVu fonts? [/usr/share/fonts/truetype/ttf-dejavu]
Would you like to run the database-dependent test suite? (no, yes) [no]

>make
>make install

---------------------------------------------------------------------------------

8、新增koha設定檔
>koha-create --use-db koha
如有出現sudo a2enmod rewrite,再執行一次koha-create --use-db koha
如還是出現sudo a2enmod rewrite,則按他說要run什麼,就執行
再執行一次koha-create --use-db koha,直到出現如下圖有ok















---------------------------------------------------------------------------------

9、修改koha.conf
>gedit /etc/apache2/sites-available/koha.conf

SetEnv KOHA_CONF後路徑改成 /etc/koha/koha-conf.xml(Intranet和OPAC的都要改)
Intranet改成<VirtualHost *:8080>
改後如下圖


































---------------------------------------------------------------------------------

10、開啟8080 port
>gedit /etc/apache2/ports.conf

加Listen 8080在Listen 80下
改後如下圖



















---------------------------------------------------------------------------------

11、apache使用koha設定
>a2ensite koha.conf
>a2dissite 000-default
>apache2ctl restart

---------------------------------------------------------------------------------

12、環境變數
>gedit ~/.profile

在最下面加上
export KOHA_CONF="/etc/koha/koha-conf.xml"
export PERL5LIB="/usr/share/koha/lib"
改後如下圖

















>source ~/.profile
>gedit /home/koha/.profile

在最下面加上
export KOHA_CONF="/etc/koha/koha-conf.xml"
export PERL5LIB="/usr/share/koha/lib"
改後如下圖


















>source /home/koha/.profile

---------------------------------------------------------------------------------


13、完成安裝  

瀏覽器輸入http://自己電腦的ip位置:8080/

打上koha資料庫的帳號密碼














接下next,繼續~










根據自身需求選擇
















繼續,並登入















登入後,可以看到全空的KOHA,這帳號是資料庫管理員(不建議以此登入),要創立自己的帳號
需依序新增圖書館->讀者類型->館藏類型->館藏類型等規則

















---------------------------------------------------------------------------------


14、安裝中文語系

回到終端機

>cd /usr/share/koha/misc/translator
>./translate install zh-Hans-TW(最前面的點.也要打入, zh-Hans-TW為繁體中文)

到koha網站館員介面
koha administration -> Global system preferences->I18N/L10N preferences->
language要得語言打勾
opaclanguages要得語言打勾
opaclanguagesdisplay 選擇allow
改後如下圖























---------------------------------------------------------------------------------


15、開機啟動zebra

回到終端機

>cd /etc/init.d
>ln -s /usr/share/koha/bin/koha-zebra-ctl.sh koha-zebra
>update-rc.d koha-zebra defaults
>/etc/init.d/koha-zebra start

---------------------------------------------------------------------------------


16、排程設定

>su koha (將檔案權限修改為koha)

>cd /var/lock/koha/
>chown -R koha:koha zebradb

---------------------------------------------------------------------------------


17.執行索引

>su koha(切換至koha帳號)

>/usr/share/koha/bin/migration_tools/rebuild_zebra.pl -a -b -v -r --run-as-root 
(重建索引)
>/usr/share/koha/bin/migration_tools/rebuild_zebra.pl -a -b -v -z --run-as-root 
(更新變動部分)
執行後如下圖

















---------------------------------------------------------------------------------

18、加入排程(還在koha帳號下)
>crontab -e
按enter進入在最下面加入這一大串:
*/1 * * * * export KOHA_CONF=/etc/koha/koha-conf.xml;export PERL5LIB=/usr/share/koha/lib;/usr/share/koha/bin/migration_tools/rebuild_zebra.pl -a -b -v -z --run-as-root
改後如下圖
















-----------------------------結束----------------------------------------------------

沒有留言:

張貼留言