《LINUX實(shí)戰(zhàn):如何在 Ubuntu 16.04 上安裝 OTRS (開源問題單系統(tǒng))》要點(diǎn):
本文介紹了LINUX實(shí)戰(zhàn):如何在 Ubuntu 16.04 上安裝 OTRS (開源問題單系統(tǒng)),希望對(duì)您有用。如果有疑問,可以聯(lián)系我們。
OTRS ,即開源問題單(ticket)申請(qǐng)系統(tǒng),是一個(gè)用于客戶服務(wù)、幫助臺(tái)和 IT 服務(wù)管理的開源問題單軟件.該軟件是用 Perl 和 javascript 編寫的.對(duì)于那些需要管理票據(jù)、投訴、支持哀求或其他類型的報(bào)告的公司和組織來說,這是一個(gè)問題單解決方案.OTRS 支持包括 MySQL、PostgreSQL、Oracle 和 SQL Server 在內(nèi)的多個(gè)數(shù)據(jù)庫系統(tǒng),它是一個(gè)可以安裝在 Windows 和 Linux 上的多平臺(tái)軟件.
在本教程中,我將介紹如安在 Ubuntu 16.04 上安裝和配置 OTRS.我將使用 PostgreSQL 作為 OTRS 的數(shù)據(jù)庫,將 Apache Web 服務(wù)器用作 Web 服務(wù)器.
先決前提
?
在第一步中,我們將安裝 Apache Web 服務(wù)器以及 PostgreSQL.我們將從 ubuntu 倉庫中使用最新的版本.
使用 SSH 登錄到你的 Ubuntu 服務(wù)器中:
ssh root@192.168.33.14
更新 Ubuntu 倉庫.
sudoapt-get update
使用 apt 安裝 Apache2 以及 PostgreSQL:
sudoapt-get install -y apache2 libapache2-mod-perl2 postgresql
通過反省服務(wù)器端口確保 Apache 以及 PostgreSQL 運(yùn)行了.
netstat-plntu
Install Apache and PostgreSQL
你可以看到 80 端口被 apache 使用了,5432 端口被 postgresql 數(shù)據(jù)庫使用了.
?
OTRS 基于 Perl,因此我們必要安裝一些 OTRS 必要的 Perl 模塊.
使用這個(gè) apt 敕令安裝 perl 模塊:
sudoapt-get install -y libapache2-mod-perl2 libdbd-pg-perl libnet-dns-perl libnet-ldap-perl libio-socket-ssl-perl libpdf-api2-perl libsoap-lite-perl libgd-text-perl libgd-graph-perl libapache-dbi-perl libarchive-zip-perl libcrypt-eksblowfish-perl libcrypt-ssleay-perl libencode-hanextra-perl libjson-xs-perl libmail-imapclient-perl libtemplate-perl libtemplate-perl libtext-csv-xs-perl libxml-libxml-perl libxml-libxslt-perl libpdf-api2-simple-perl libyaml-libyaml-perl
安裝完成后,我們必要為 apache 激活 Perl 模塊,接著重啟 apache 服務(wù).
a2enmod perl
systemctl restart apache2
接下來,使用下面的命令反省模塊是否已經(jīng)加載了:
apachectl -M |sort
Enable Apache Perl Module
你可以在 “Loaded Modules” 部門下看到 perl_module.
?
OTRS 是一個(gè)基于 web 的程序并且運(yùn)行與 apache web 服務(wù)器下.為了平安,我們需要以普通用戶運(yùn)行它,而不是 root 用戶.
使用 useradd 命令創(chuàng)立一個(gè) otrs
新用戶:
-r
:將用戶作為系統(tǒng)用戶.-d /opt/otrs
:在 /opt/otrs
下放置新用戶的主目錄.-c
:備注.接下來,將 otrs
用戶參加到 www-data
用戶組,因?yàn)?apache 運(yùn)行于 www-data
用戶及用戶組.
usermod-a -G www-data otrs
在 /etc/passwd
文件中已經(jīng)有 otrs
用戶了.
grep-rin otrs /etc/passwd
Create new user for OTRS
OTRS 的新用戶已經(jīng)創(chuàng)立了.
?
在這節(jié)中,我們會(huì)為 OTRS 系統(tǒng)創(chuàng)建一個(gè)新 PostgreSQL 數(shù)據(jù)庫,并對(duì) PostgreSQL 數(shù)據(jù)庫的配置做一些小的變動(dòng).
登錄到 postgres
用戶并拜訪 PostgreSQL shell.
su- postgres
psql
創(chuàng)建一個(gè)新的角色 otrs
,暗碼是 myotrspw
,并且是非特權(quán)用戶.
create user otrs password 'myotrspw' nosuperuser;
接著使用 otrs
用戶權(quán)限創(chuàng)立一個(gè)新的 otrs
數(shù)據(jù)庫:
create database otrs owner otrs;
\q
接下來為 otrs
角色驗(yàn)證編纂 PostgreSQL 配置文件.
vim/etc/postgresql/9.5/main/pg_hba.conf
在 84 行后粘貼下面的設(shè)置裝備擺設(shè):
local? otrs? ? ? ? ? ? otrs? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? password
host? ? otrs? ? ? ? ? ? otrs? ? ? ? ? ? 127.0.0.1/32? ? ? ? ? ? password
保留文件并退出 vim
Database Authentication OTRS
使用 exit
回到 root 權(quán)限并重啟 PostgreSQL:
exit
systemctl restart postgresql
PostgreSQL 已經(jīng)為 OTRS 的安裝準(zhǔn)備好了.
Configure PostgreSQL for OTRS
?
在本教程中,我們會(huì)使用 OTRS 網(wǎng)站中最新的版本.
進(jìn)入 /opt
目錄并使用 wget
敕令下載 OTRS 5.0:
cd/opt/
wget http://ftp.otrs.org/pub/otrs/otrs-5.0.16.tar.gz
展開該 otrs 文件,重命名目錄并變動(dòng)所有 otrs 的文件和目錄的所屬人為 otrs
.
tar-xzvf otrs-5.0.16.tar.gz
mv otrs-5.0.16 otrs
chown-R otrs:otrs otrs
接下來,我們必要檢查系統(tǒng)并確保可以安裝 OTRS 了.
使用下面的 otrs 腳本命令檢查 OTRS 安裝必要的系統(tǒng)軟件包:
/opt/otrs/bin/otrs.CheckModules.pl
確保所有的成果是對(duì)的,這意味著我們的服務(wù)器可以安裝 OTRS 了.
OTRS Chek Module needed for Installation
OTRS 已下載,而且我們的服務(wù)器可以安裝 OTRS 了.
接下,進(jìn)入 otrs 目次并復(fù)制配置文件.
cd/opt/otrs/
cpKernel/Config.pm.dist Kernel/Config.pm
使用 vim 編纂 Config.pm
文件:
vimKernel/Config.pm
更改 42 行的數(shù)據(jù)庫暗碼:
$Self->{DatabasePw}='myotrspw';
注釋 45 行的 MySQL 數(shù)據(jù)庫支持:
# $Self->{DatabaseDSN}="DBI:mysql:database=$Self->{Database};host=$Self->{DatabaseHost};";
撤消注釋 49 行的 PostgreSQL 數(shù)據(jù)庫支持:
$Self->{DatabaseDSN}="DBI:Pg:dbname=$Self->{Database};";
保留文件并退出 vim.
接著編纂 apache 啟動(dòng)文件來啟用 PostgreSQL 支持.
vim scripts/apache2-perl-startup.pl
撤消注釋 60 和 61 行:
# enable thisif you use postgresql
use DBD::Pg();
useKernel::System::DB::postgresql;
保留文件并退出編輯器.
最后,反省缺失的依賴和模塊.
perl -cw /opt/otrs/bin/cgi-bin/index.pl
perl -cw /opt/otrs/bin/cgi-bin/customer.pl
perl -cw /opt/otrs/bin/otrs.Console.pl
你可以在下面的截圖中看到成果是 “OK”:
Check all modules again
?
在本教程中,我們會(huì)使用樣本數(shù)據(jù)庫,這可以在腳本目錄中找到.因此我們只必要將所有的樣本數(shù)據(jù)庫以及表結(jié)構(gòu)導(dǎo)入到第 4 步創(chuàng)建的數(shù)據(jù)庫中.
登錄到 postgres
用戶并進(jìn)入 otrs 目次中.
su- postgres
cd/opt/otrs/
作為 otrs 用戶使用 psql
命令插入數(shù)據(jù)庫以及表布局.
psql -U otrs -W -f scripts/database/otrs-schema.postgresql.sql otrs
psql -U otrs -W -f scripts/database/otrs-initial_insert.postgresql.sql otrs
psql -U otrs -W -f scripts/database/otrs-schema-post.postgresql.sql otrs
在需要的時(shí)候輸入數(shù)據(jù)庫暗碼 myotrspw
.
Import OTRS Sample Database
?
數(shù)據(jù)庫以及 OTRS 已經(jīng)配置了,現(xiàn)在我們可以啟動(dòng) OTRS.
將 otrs 的文件及目次權(quán)限設(shè)置為 www-data
用戶和用戶組.
/opt/otrs/bin/otrs.SetPermissions.pl --otrs-user=www-data --web-group=www-data
通過創(chuàng)立一個(gè)新的鏈接文件到 apache 虛擬主機(jī)目錄中啟用 otrs apache 配置.
ln-s /opt/otrs/scripts/apache2-httpd.include.conf /etc/apache2/sites-available/otrs.conf
啟用 otrs 虛擬主機(jī)并重啟 apache.
a2ensite otrs
systemctl restart apache2
確保 apache 啟動(dòng)沒有差錯(cuò).
Enable OTRS Apache Virtual Host
?
OTRS 已經(jīng)安裝并運(yùn)行在 Apache Web 服務(wù)器中了,但是我們?nèi)匀槐匾渲?OTRS 計(jì)劃任務(wù).
登錄到 otrs
用戶,接著以 otrs 用戶進(jìn)入 var/cron
目次.
su- otrs
cdvar/cron/
pwd
使用下面的命令復(fù)制所有 .dist
方案任務(wù)腳本:
for foo in*.dist;docp $foo `basename $foo .dist`;done
使用 exit
回到 root 權(quán)限,并使用 otrs 用戶啟動(dòng)方案任務(wù)腳本.
exit
/opt/otrs/bin/Cron.sh start otrs
Enable OTRS Cron
接下來,手動(dòng)收取電子郵件的 PostMaster 創(chuàng)立一個(gè)新的計(jì)劃任務(wù).我會(huì)配置為每 2 分鐘收取一次郵件.
su- otrs
crontab -e
粘貼下面的設(shè)置裝備擺設(shè):
*/2 * * * *? ? $HOME/bin/otrs.PostMasterMailbox.pl >>/dev/null
保留并退出.
現(xiàn)在停止 otrs 守護(hù)過程并再次啟動(dòng).
bin/otrs.Daemon.pl stop
bin/otrs.Daemon.pl start
Enable OTRS Fetching Email
OTRS 安裝以及設(shè)置裝備擺設(shè)完成了.
?
打開你的 web 瀏覽器并輸入你的服務(wù)器 IP 地址: http://192.168.33.14/otrs/
使用默認(rèn)的用戶 root@localhost
以及暗碼 root
登錄.
Installation Successfully OTRS Home Page
使用默認(rèn)的 root 賬戶你會(huì)看到一個(gè)警告.點(diǎn)擊警告信息來創(chuàng)立一個(gè)新的 admin root 用戶.
下面是用另外的 admin root 用戶登錄后出現(xiàn)的 admin 頁面,這里沒有出現(xiàn)差錯(cuò)信息.
OTRS Admin Dashboard Without Error Messages
假如你想作為客戶登錄,你可以使用 customer.pl
:http://192.168.33.14/otrs/customer.pl
你會(huì)看到客戶登錄界面,輸入客戶的用戶名和暗碼.
OTRS Customer Login Page
下面是一個(gè)創(chuàng)立新單據(jù)的客戶頁面.
Customer Open Ticket
?
如果你仍舊看到 “OTRS Daemon is not running” 的錯(cuò)誤,你可以像這樣調(diào)試 OTRS 守護(hù)進(jìn)程.
su- otrs
cd/opt/otrs/
停止 OTRS 守護(hù)過程:
bin/otrs.Daemon.pl stop
使用 --debug
選項(xiàng)啟動(dòng) OTRS 守護(hù)過程.
bin/otrs.Daemon.pl start --debug
?
via: https://www.howtoforge.com/tutorial/how-to-install-otrs-opensource-trouble-ticket-system-on-ubuntu-16-04/
作者:Muhammad Arul 譯者:geekpi 校對(duì):wxy
本文由 LCTT 原創(chuàng)編譯,Linux中國(guó) 榮譽(yù)推出
本文永遠(yuǎn)更新鏈接地址:
更多LINUX教程,盡在維易PHP學(xué)院專欄。歡迎交流《LINUX實(shí)戰(zhàn):如何在 Ubuntu 16.04 上安裝 OTRS (開源問題單系統(tǒng))》!
轉(zhuǎn)載請(qǐng)注明本頁網(wǎng)址:
http://www.fzlkiss.com/jiaocheng/12989.html