How to install OTRS (CentOS7)

  • Category: 電腦相關
  • Last Updated: Monday, 17 July 2017 17:41
  • Published: Saturday, 10 June 2017 22:09
  • Written by sam

How to install OTRS (CentOS7)

Someone told me, he wants a ticket system to control our job.

So here is a setup process about "OTRS".

Ready OS and login

Enter passphrase for key '/Users/sam/Desktop/id_rsa':
Last login: Sat Jun 10 18:15:27 2017 from 10.0.253.246
[root@aft-otrs ~]# yum update

Disable SELINUX

[root@aft-otrs ~]# cat /etc/selinux/config |grep SELINUX
# SELINUX= can take one of these three values:
SELINUX=disabled

Then check

[root@aft-otrs ~]# getenforce
Disabled

DB

[root@aft-otrs ~]# yum -y install mariadb-server

Config my.cnf

[root@aft-otrs ~]# vi /etc/my.cnf

Add some

max_allowed_packet = 20M
query_cache_size = 32M
innodb_log_file_size = 256M
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
thread_cache_size = 8
innodb_buffer_pool_size = 3G
innodb_buffer_pool_instances = 2

Restart db

[root@aft-otrs ~]# systemctl start mariadb
[root@aft-otrs ~]# usr/bin/mysql_secure_installation

Enable db

[root@aft-otrs ~]# systemctl enable mariadb.service

Download OTRS

[root@aft-otrs tmp]# wget http://ftp.otrs.org/pub/otrs/RPMS/rhel/7/otrs-5.0.20-01.noarch.rpm

Install EPEL

[root@aft-otrs tmp]# yum -y http://mirror.globo.com/epel/7/x86_64/e/epel-release-7-9.noarch.rpm

Install OTRS

[root@aft-otrs tmp]# yum install otrs-5.0.20-01.noarch.rpm

Start http

[root@aft-otrs tmp]# systemctl start httpd.service
[root@aft-otrs tmp]# systemctl enable httpd.service

Install mod_ssl

[root@aft-otrs tmp]# yum -y install mod_ssl

Generate a self-signed SSL

[root@aft-otrs tmp]# cd /etc/pki/tls/certs/
[root@aft-otrs tmp]# make sam.key
[root@aft-otrs tmp]# openssl rsa -in sam.key -out sam.key
[root@aft-otrs tmp]# make sam.csr
[root@aft-otrs tmp]# openssl x509 -in sam.csr -out sam.crt -req -signkey sam.key

Modify SSL file

[root@aft-otrs tmp]# vi /etc/httpd/conf.d/ssl.conf
ServerName aft-otrs:443
SSLProtocol -ALL +TLSv1 +TLSv1.1 +TLSv1.2 -SSLv2
SSLCertificateFile /etc/pki/tls/certs/sam.crt
SSLCertificateKeyFile /etc/pki/tls/certs/sam.key

Restart httpd

[root@aft-otrs bin]# systemctl restart httpd

For more secure, force http to https

[root@aft-otrs bin]# vi /etc/httpd/conf/httpd.conf
IncludeOptional conf.d/*.conf

Add config

[root@aft-otrs bin]# vi /etc/httpd/conf.d/otrs.conf
Add some before mod_version.c
        RewriteEngine On
        RewriteCond %{HTTPS} off
        RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

Restart httpd

[root@aft-otrs bin]# systemctl restart httpd

Install Perl some

[root@aft-otrs bin]# yum -y install "perl(Text::CSV_XS)" "perl(Crypt::Eksblowfish::Bcrypt)" "perl(YAML::XS)" "perl(JSON::XS)" "perl(Encode::HanExtra)" "perl(Mail::IMAPClient)" "perl(ModPerl::Util)"

Check Perl

[root@aft-otrs bin]# cd /opt/otrs/bin
[root@aft-otrs bin]# ./otrs.CheckModules.pl
[root@aft-otrs bin]# ./otrs.CheckModules.pl
  o Apache::DBI......................ok (v1.12)
  o Apache2::Reload..................ok (v0.13)
  o Archive::Tar.....................ok (v1.92)
  o Archive::Zip.....................ok (v1.30)
  o Crypt::Eksblowfish::Bcrypt.......ok (v0.009)
  o Crypt::SSLeay....................ok (v0.64)
  o Date::Format.....................ok (v2.24)
  o DBI..............................ok (v1.627)
  o DBD::mysql.......................ok (v4.023)
  o DBD::ODBC........................Not installed! (optional - Required to connect to a MS-SQL database.)
  o DBD::Oracle......................Not installed! (optional - Required to connect to a Oracle database.)
  o DBD::Pg..........................Not installed! Use: 'yum install "perl(DBD::Pg)"' (optional - Required to connect to a PostgreSQL database.)
  o Digest::SHA......................ok (v5.85)
  o Encode::HanExtra.................ok (v0.23)
  o IO::Socket::SSL..................ok (v1.94)
  o JSON::XS.........................ok (v3.01)
  o List::Util::XS...................ok (v1.27)
  o LWP::UserAgent...................ok (v6.13)
  o Mail::IMAPClient.................ok (v3.37)
    o IO::Socket::SSL................ok (v1.94)
    o Authen::SASL...................ok (v2.15)
    o Authen::NTLM...................ok (v1.09)
  o ModPerl::Util....................ok (v2.000010)
  o Net::DNS.........................ok (v0.72)
  o Net::LDAP........................ok (v0.56)
  o Template.........................ok (v2.24)
  o Template::Stash::XS..............ok (undef)
  o Text::CSV_XS.....................ok (v1.00)
  o Time::HiRes......................ok (v1.9725)
  o Time::Piece......................ok (v1.20_01)
  o XML::LibXML......................ok (v2.0018)
  o XML::LibXSLT.....................ok (v1.80)
  o XML::Parser......................ok (v2.41)
  o YAML::XS.........................ok (v0.54)
If something miss use copy and paste

Start it

[root@aft-otrs bin]# su -c "/opt/otrs/bin/otrs.Daemon.pl start" -s /bin/bash otrs

Add cron job

[root@aft-otrs bin]# su - otrs
Last login: Fri Jun  9 22:57:47 CST 2017 on pts/0
-bash-4.2$ crontab -e

MAILTO="This email address is being protected from spambots. You need JavaScript enabled to view it."
*/5 * * * *    $HOME/bin/otrs.Daemon.pl start >> /dev/null

Open browser and point to your ip

http://10.0.252.178/otrs/installer.pl

And click and click

 photo 2017-06-09 8.41.58_zpsz0q93fce.png

 photo 2017-06-09 8.41.46_zpsfcaou1tv.png

 photo 2017-06-09 8.44.40_zpsreqc8gca.png

Select your DB

 photo 2017-06-09 8.42.10_zpsa7akm4op.png

 photo 2017-06-09 8.42.25_zps6gliwedl.png

 

 photo 2017-06-09 8.44.59_zpso0dcb6rr.png

 photo 2017-06-09 8.56.50_zpsoxecexjl.png

Login your gmail account and do it

 photo 2017-06-09 8.59.20_zpscdccl26d.png

 photo 2017-06-09 8.59.28_zpstnxdzc9s.png

Dot't forget Password

 photo 2017-06-09 8.59.58_zpsacdhy9nj.png

Everything is done.

#####check perl-status#####

[root@aft-otrs conf.d]# pwd
/etc/httpd/conf.d [root@aft-otrs conf.d]# vi perl.conf uncomment 
<Location /perl-status>
SetHandler perl-script
PerlResponseHandler Apache2::Status
Order deny,allow
Deny from all
Allow from 10.0.0.0/8 #IP address you permit
</Location>

And open browser

https://10.0.252.178/perl-status
Embedded Perl version v5.16.3 for Apache/2.4.6 (CentOS) OpenSSL/1.0.1e-fips mod_perl/2.0.10 Perl/v5.16.3 process 351,
running since Thu Jun 15 10:04:53 2017

Environment
Loaded Modules
Inheritance Tree
ISA Tree
Perl Configuration
Compiled Registry Scripts
PerlRequire'd Files
Signal Handlers
Symbol Table Dump