溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊(cè)×
其他方式登錄
點(diǎn)擊 登錄注冊(cè) 即表示同意《億速云用戶服務(wù)條款》

Linux系統(tǒng)如何安裝OTRS

發(fā)布時(shí)間:2022-01-25 09:47:43 來源:億速云 閱讀:259 作者:小新 欄目:開發(fā)技術(shù)

這篇文章給大家分享的是有關(guān)Linux系統(tǒng)如何安裝OTRS的內(nèi)容。小編覺得挺實(shí)用的,因此分享給大家做個(gè)參考,一起跟隨小編過來看看吧。

OTRS 是由 Open Ticket Request System 首字母縮略字而來。是以全球業(yè)界公認(rèn)的 IT 服務(wù)管理標(biāo)準(zhǔn) ITIL V3 為基礎(chǔ),開發(fā)的一整套 IT 服務(wù)管理解決方案。OTRS 支持包括 MySQL、PostgreSQL、Oracle 和 SQL Server 在內(nèi)的多個(gè)數(shù)據(jù)庫系統(tǒng),它是一個(gè)可以安裝在 Windows 和 Linux 上的多平臺(tái)軟件。

Linux系統(tǒng)如何安裝OTRS

步驟 1 – 安裝 Apache 和 PostgreSQL

在第一步中,我們將安裝 Apache Web 服務(wù)器以及 PostgreSQL。我們將從 ubuntu 倉庫中使用最新的版本。

使用 SSH 登錄到你的 Ubuntu 服務(wù)器中:

 ssh root@192.168.33.14

更新 Ubuntu 倉庫。

 sudo apt-get update

使用 apt 安裝 Apache2 以及 PostgreSQL:

 sudo apt-get install -y apache2 libapache2-mod-perl2 postgresql

通過檢查服務(wù)器端口確保 Apache 以及 PostgreSQL 運(yùn)行了。

 netstat -plntu

Linux系統(tǒng)如何安裝OTRS

你可以看到 80 端口被 apache 使用了,5432 端口被 postgresql 數(shù)據(jù)庫使用了。

步驟 2 – 安裝 Perl 模塊

OTRS 基于 Perl,因此我們需要安裝一些 OTRS 需要的 Perl 模塊。

使用這個(gè) apt 命令安裝 perl 模塊:

 sudo apt-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

Linux系統(tǒng)如何安裝OTRS

步驟 3 – 為 OTRS 創(chuàng)建新用戶

OTRS 是一個(gè)基于 web 的程序并且運(yùn)行與 apache web 服務(wù)器下。為了安全,我們需要以普通用戶運(yùn)行它,而不是 root 用戶。

使用 useradd 命令創(chuàng)建一個(gè) otrs 新用戶:

 useradd -r -d /opt/otrs -c 'OTRS User' 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

Linux系統(tǒng)如何安裝OTRS

OTRS 的新用戶已經(jīng)創(chuàng)建了。

步驟 4 – 創(chuàng)建和配置數(shù)據(jù)庫

在這節(jié)中,我們會(huì)為 OTRS 系統(tǒng)創(chuàng)建一個(gè)新 PostgreSQL 數(shù)據(jù)庫,并對(duì) PostgreSQL 數(shù)據(jù)庫的配置做一些小的更改。

登錄到 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 行后粘貼下面的配置:

 local   otrs            otrs                                    password
 host    otrs            otrs            127.0.0.1/32            password

保存文件并退出 vim

Linux系統(tǒng)如何安裝OTRS

使用 exit 回到 root 權(quán)限并重啟 PostgreSQL:

 exit
 systemctl restart postgresql

PostgreSQL 已經(jīng)為 OTRS 的安裝準(zhǔn)備好了。

Linux系統(tǒng)如何安裝OTRS

步驟 5 – 下載和配置 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 文件,重命名目錄并更改所有 otrs 的文件和目錄的所屬人為 otrs。

 tar -xzvf otrs-5.0.16.tar.gz
 mv otrs-5.0.16 otrs
 chown -R otrs:otrs otrs

接下來,我們需要檢查系統(tǒng)并確??梢园惭b OTRS 了。

使用下面的 otrs 腳本命令檢查 OTRS 安裝需要的系統(tǒng)軟件包:

 /opt/otrs/bin/otrs.CheckModules.pl

確保所有的結(jié)果是對(duì)的,這意味著我們的服務(wù)器可以安裝 OTRS 了。

Linux系統(tǒng)如何安裝OTRS

OTRS 已下載,并且我們的服務(wù)器可以安裝 OTRS 了。

接下,進(jìn)入 otrs 目錄并復(fù)制配置文件。

 cd /opt/otrs/
 cp Kernel/Config.pm.dist Kernel/Config.pm

使用 vim 編輯 Config.pm 文件:

 vim Kernel/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 this if you use postgresql
 use DBD::Pg ();
 use Kernel::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

你可以在下面的截圖中看到結(jié)果是 “OK”:

Linux系統(tǒng)如何安裝OTRS

步驟 6 – 導(dǎo)入樣本數(shù)據(jù)庫

在本教程中,我們會(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ù)庫以及表結(jié)構(gòu)。

 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。

Linux系統(tǒng)如何安裝OTRS

步驟 7 – 啟動(dòng) OTRS數(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ò)誤。

Linux系統(tǒng)如何安裝OTRS

步驟 8 – 配置 OTRS 計(jì)劃任務(wù)

OTRS 已經(jīng)安裝并運(yùn)行在 Apache Web 服務(wù)器中了,但是我們?nèi)匀恍枰渲?OTRS 計(jì)劃任務(wù)。

登錄到 otrs 用戶,接著以 otrs 用戶進(jìn)入 var/cron 目錄。

 su - otrs
 cd var/cron/
 pwd

使用下面的命令復(fù)制所有 .dist 計(jì)劃任務(wù)腳本:

 for foo in *.dist; do cp $foo `basename $foo .dist`; done

使用 exit 回到 root 權(quán)限,并使用 otrs 用戶啟動(dòng)計(jì)劃任務(wù)腳本。

 exit
 /opt/otrs/bin/Cron.sh start otrs

Linux系統(tǒng)如何安裝OTRS

接下來,手動(dòng)收取電子郵件的 PostMaster 創(chuàng)建一個(gè)新的計(jì)劃任務(wù)。我會(huì)配置為每 2 分鐘收取一次郵件。

 su - otrs
 crontab -e

粘貼下面的配置:

 */2 * * * *    $HOME/bin/otrs.PostMasterMailbox.pl >> /dev/null

保存并退出。

現(xiàn)在停止 otrs 守護(hù)進(jìn)程并再次啟動(dòng)。

 bin/otrs.Daemon.pl stop
 bin/otrs.Daemon.pl start

Linux系統(tǒng)如何安裝OTRS

OTRS 安裝以及配置完成了。

步驟 9 – 測(cè)試 OTRS

打開你的 web 瀏覽器并輸入你的服務(wù)器 IP 地址: http://192.168.33.14/otrs/

使用默認(rèn)的用戶 root@localhost 以及密碼 root 登錄。

Linux系統(tǒng)如何安裝OTRS

使用默認(rèn)的 root 賬戶你會(huì)看到一個(gè)警告。點(diǎn)擊警告信息來創(chuàng)建一個(gè)新的 admin root 用戶。

下面是用另外的 admin root 用戶登錄后出現(xiàn)的 admin 頁面,這里沒有出現(xiàn)錯(cuò)誤信息。

Linux系統(tǒng)如何安裝OTRS

如果你想作為客戶登錄,你可以使用 customer.pl :http://192.168.33.14/otrs/customer.pl

你會(huì)看到客戶登錄界面,輸入客戶的用戶名和密碼。

Linux系統(tǒng)如何安裝OTRS

下面是一個(gè)創(chuàng)建新單據(jù)的客戶頁面。

Linux系統(tǒng)如何安裝OTRS

步驟 10 – 疑難排查

如果你仍舊看到 “OTRS Daemon is not running” 的錯(cuò)誤,你可以像這樣調(diào)試 OTRS 守護(hù)進(jìn)程。

 su - otrs
 cd /opt/otrs/

停止 OTRS 守護(hù)進(jìn)程:

 bin/otrs.Daemon.pl stop

使用 –debug 選項(xiàng)啟動(dòng) OTRS 守護(hù)進(jìn)程。

 bin/otrs.Daemon.pl start --debug

感謝各位的閱讀!關(guān)于“Linux系統(tǒng)如何安裝OTRS”這篇文章就分享到這里了,希望以上內(nèi)容可以對(duì)大家有一定的幫助,讓大家可以學(xué)到更多知識(shí),如果覺得文章不錯(cuò),可以把它分享出去讓更多的人看到吧!

向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI