一,OTRS的簡介
OTRS即英文“Open-source Ticket Request System”的簡寫– OTRS幫助IT部門,服務檯等相關部門跟蹤和處理用戶方請求(俗稱工單系統)– OTRS是全球範圍內最成功和使用壽命最長的開源項目,但目前有些商業化,支持文檔比較少了些了,應付日常使用也夠
二,安裝環境
安裝系統環境:CentOS7
主要軟件:otrs-6.0.25-01(https://ftp.otrs.org/pub/otrs/otrs-6.0.25.tar.gz)
三,數據庫安裝
1,開放http及mysql
命令:
- firewall-cmd --permanent --add-service http
- firewall-cmd --permanent --add-service mysql
- firewall-cmd --reload
- firewall-cmd --list-all
2,安裝MariaDB相關包
命令:
yum install -y mariadb-server mariadb mariadb-devel
3,修改配置文件(可選)
命令:
vim /etc/my.cnf
添加以下內容:
[mysqld]
max_allowed_packet = 64M
query_cache_size = 32M
innodb_log_file_size = 256M
4,啟動並配置服務自啟動
命令:
- systemctl start mariadb
- systemctl enable mariadb
5,初始化MariaDB服務
命令:
mysql_secure_installation
四,安裝OTRS
1,下載otrs源碼包並解壓
命令:
- wget https://ftp.otrs.org/pub/otrs/otrs-6.0.25.tar.gz
- tar -zxvf otrs-6.0.25.tar.gz
2,部署安裝包並安裝依賴
命令:
- mv otrs-6.0.25 /opt/otrs
- yum install -y perl-core httpd mod_perl
3,檢查依賴關係
命令:
perl /opt/otrs/bin/otrs.CheckModules.pl
注意以下信息:
4,安裝缺失的軟件包
命令:
yum install -y "perl(Archive::Zip)" "perl(Crypt::Eksblowfish::Bcrypt)" "perl(Crypt::SSLeay)" "perl(Date::Format)" "perl(DateTime)" "perl(DBD::Pg)" "perl(Encode::HanExtra)" "perl(IO::Socket::SSL)" "perl(JSON::XS)" "perl(Mail::IMAPClient)" "perl(IO::Socket::SSL)" "perl(Authen::SASL)" "perl(Authen::NTLM)" "perl(ModPerl::Util)" "perl(Net::DNS)" "perl(Net::LDAP)" "perl(Template)" "perl(Template::Stash::XS)" "perl(Text::CSV_XS)" "perl(XML::LibXML)" "perl(XML::LibXSLT)" "perl(XML::Parser)" "perl(YAML::XS)"
5,數據庫準備
命令:
mysql -uroot -p
執行:
- 5.1 create database otrs character set utf8;
- 5.2 grant all privileges on otrs.* to 'otrs'@'localhost' identified by 'otrspwd';
- 5.3 grant all privileges on otrs.* to 'otrs'@'127.0.0.1' identified by 'otrspwd';
- 5.4 flush privileges;
- 5.5 show databases;
6,導入數據庫結構
命令:
- mysql -uroot -p otrs < /opt/otrs/scripts/database/otrs-schema.mysql.sql
- mysql -uroot -p otrs < /opt/otrs/scripts/database/otrs-initial_insert.mysql.sql
- mysql -uroot -p otrs < /opt/otrs/scripts/database/otrs-schema-post.mysql.sql
五,配置OTRS
1,創建運行用戶、添加組並設置目錄權限
命令:
- useradd -d /opt/otrs -c 'OTRS user' otrs
- usermod -G apache otrs
- /opt/otrs/bin/otrs.SetPermissions.pl
2,部署配置文件
命令:
- cp /opt/otrs/Kernel/Config.pm.dist /opt/otrs/Kernel/Config.pm
- cp /opt/otrs/var/cron/otrs_daemon.dist /opt/otrs/var/cron/otrs_daemon
- vim /opt/otrs/Kernel/Config.pm
修改內容:
- $Self->{DatabaseHost} = '127.0.0.1';
- $Self->{Database} = 'otrs';
- $Self->{DatabaseUser} = 'otrs';
- $Self->{DatabasePw} = 'otrspwd';
- $Self->{DatabaseDSN} = "DBI:mysql:database=$Self->{Database};host=$Self->{DatabaseHost};";
3,檢查模塊狀態
命令:
- 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
4,部署配置文件到Apache及確認perl模塊
命令:
- ln -s /opt/otrs/scripts/apache2-httpd.include.conf /etc/httpd/conf.d/otrs.conf
- ls -lh /etc/httpd/modules/{mod_headers,mod_filter,mod_deflate,mod_version,mod_perl}.so
- grep -E "mod_perl|mod_version|mod_deflate|mod_filter".so /etc/httpd/conf.modules.d/*.conf
5,啟動httpd服務並配置自啟動
命令:
- systemctl start httpd
- systemctl enable httpd
6,手動測試守護進程
命令:
- su -s /bin/bash otrs -c "/opt/otrs/bin/otrs.Daemon.pl start"
- su -s /bin/bash otrs -c "/opt/otrs/bin/Cron.sh start"
- su -s /bin/bash otrs -c "/opt/otrs/bin/otrs.Daemon.pl status"
- su -s /bin/bash otrs -c "/opt/otrs/bin/otrs.Daemon.pl stop"
- su -s /bin/bash otrs -c "/opt/otrs/bin/Cron.sh stop"
7,登錄otrs
http://10.211.55.21/otrs/index.pl
user: root@localhost
password: root
至此,otrs工單系統搭建完畢,有好的意見或建議,請聯繫本人。
紅校生-專注互聯技術傳道授業!
閱讀更多 mugo老猴 的文章