說明:因博主是后期整理,所以部署過程中遇到的坑沒有截圖
前提:
1.確保selinux關閉
2.確保防火牆關閉
搭建開始:
1.選擇合適版本的zip包(找個最新的就行),解壓縮到/opt
https://ftp.otrs.org/pub/otrs/
注意:解壓縮后,文件夾名字務必修改成otrs
2.更新yum,並安裝perl、cpan
yum -y update
yum -y install perl
yum -y install cpan
3.配置文件名稱修改
cp /opt/otrs/Kernel/Config.pm.dist /opt/otrs/Kernel/Config.pm cp /opt/otrs/Kernel/Config.pod.dist /opt/otrs/Kernel/Config.pod
cp /opt/otrs/var/cron/aaa_base.dist /opt/otrs/var/cron/aaa_base
cp /opt/otrs/var/cron/otrs_daemon.dist /opt/otrs/var/cron/otrs_daemon
4.文件授權
useradd -d /opt/otrs -c 'OTRS user' otrs usermod -G apache otrs /opt/otrs/bin/otrs.SetPermissions.pl --web-group=apache
5.依賴檢測 1
perl /opt/otrs/bin/otrs.CheckModules.pl
說明:按照檢測要求,yum安裝所有依賴
采坑:1>有的插件無法安裝,可通過“cpan 插件”進行安裝
2>有的插件安裝完成后,顯示插件版本過低,尤其是mail模塊相關,可通過“cpan -u”先將cpan升級,此命令會升級所有cpan源,很耗時,可以先跑一段時間(需要的插件源可能已經更新完成),另開一個窗口,執行“cpan 插件”,如果升級成功(檢測不再提示版本過低),則繼續嘗試其他,都安裝好后,將cpan升級進程kill掉就好
6.依賴檢測 2
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
采坑:1>
此錯誤可以通過以下命令進行安裝排除
perl -MCPAN -e shell install Moo
2>
此錯誤可以通過以下命令進行安裝排除,注意看紅色字體部分,要進行拼接(踩了好久的坑,無意間看到一篇國外博客 慢慢試出來的,欲哭無淚。。。)
yum -y install perl-namespace-clean
7.修改httpd配置(如果服務器沒有,可通過 yum -y install httpd 進行安裝)vi /etc/httpd/conf/httpd.conf
#查找 Include conf.d/*.conf,在下面添加一句: Include /opt/otrs/scripts/apache2-httpd.include.conf
#查找User 修改為otrs:
User otrs
8.mysql配置修改(因需要修改配置,暫時不清楚rds能否修改,所以在本地服務器搭了一個)
如果下載過慢,可以將yum源換成阿里的
yum install mysql mysql-server mysql-devel -y
采坑:找不到mysql-server包
解決:
wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm rpm -ivh mysql-community-release-el7-5.noarch.rpm
9.mysql配置修改 1
在 /etc/my.conf [mysqld] 模塊下添加如下配置,並重啟 systemctl restart httpd.service
max_allowed_packet = 64M query_cache_size = 32M innodb_log_file_size = 256M character_set_server = utf8 collation-server=utf8_general_ci
10.mysql配置修改 2
進入mysql,為root用戶設置密碼
set password for root@localhost = password('root'); flush privileges;
11.啟動httpd
systemctl start httpd.service
12.訪問
采坑:1>訪問后顯示服務器內部錯誤,看日志,說是otrs密碼錯誤,可通過臨時修改/opt/otrs/Kernel/Config.pm解決,將其修改成自己的root賬密,web可以訪問后,先不要開始安裝,將之前修改的配置再改回去
# The database host $Self->{'DatabaseHost'} = '127.0.0.1'; # The database name $Self->{'Database'} = "otrs"; # The database user $Self->{'DatabaseUser'} = "root"; # The password of database user. You also can use bin/otrs.Console.pl Maint::Database::PasswordCrypt # for crypted passwords $Self->{'DatabasePw'} = 'root';
13.web安裝
按照步驟一步步安裝即可,配置郵件的時候,如果暫時不記得郵件服務器的配置,或者配置完檢測報錯,可跳過,安裝完成后到“系統設置”->"core"->"mail"里進行配置即可
14.通過httpd配置https方式訪問
此處引用大佬的博客:
https://www.cnblogs.com/hanshanxiaoheshang/p/9142521.html
15.總結
博主從dev到pord環境都試過了,因環境問題踩的坑都不一樣,希望能為大家提供點經驗幫助,溜了溜了,說多了都是淚啊。。。