在 debian 12 里安装 request tracker 5

假设:RT5的访问网址是 https://rt.demo.anqun.org ,“售后”队列的收件箱是 support@rt.demo.anqun.org ,搭配 apache 与 mariadb 数据库。

步骤:

  1. hostnamectl set-hostname rt.demo.anqun.org # 设置好主机名
  2. apt update # 更新软件源
  3. apt install mariadb-server # 先安装数据库
  4. systemctl start mariadb # 启动数据库
  5. apt install apache2 rt5-db-mysql rt5-apache2 rt5-fcgi request-tracker5 # 安装RT5,如果提示输入RT的实例名称,我这里是填写了完整的主机名 rt.demo.anqun.org,还会提示设置RT使用的数据库密码和默认用户root的密码
  6. a2dismod mpm_event
  7. a2enmod mpm_prefork # 切换apache的运行模块
  8. a2enmod ssl # 启用https访问
  9. /etc/request-tracker5/RT_SiteConfig.d/50-debconf.pm # 修改配置文件中的 $WebPath 为空,因为本例是访问到/路径
  10. /etc/apache2/sites-enabled/rt.conf # RT的站点设置内容,如下:

    <VirtualHost *:443>
        ### Optional apache logs for RT
        # Ensure that your log rotation scripts know about these files
        # ErrorLog /opt/rt5/var/log/apache2.error
        # TransferLog /opt/rt5/var/log/apache2.access
        # LogLevel debug
        ServerName rt.demo.anqun.org
    
    SSLEngine on
    SSLCertificateFile  /root/.acme.sh/rt.demo.anqun.org_ecc/rt.demo.anqun.org.cer
    SSLCertificateKeyFile /root/.acme.sh/rt.demo.anqun.org_ecc/rt.demo.anqun.org.key
    SSLCertificateChainFile  /root/.acme.sh/rt.demo.anqun.org_ecc/ca.cer
    
        AddDefaultCharset UTF-8
        FcgidInitialEnv RT_SITE_CONFIG /etc/request-tracker5/RT_SiteConfig.pm
    # The defaults are unlikely to be big enough for an RT site handling
    # attachments
        FcgidMaxRequestLen 1073741824
    #        ScriptAlias / /opt/rt5/sbin/rt-server.fcgi/
    # Use the handler
    # Note: If you switch the configuration to be served up from / use a
    # trailing / - ie:
    #   ScriptAlias / /usr/share/request-tracker5/libexec/rt-server.fcgi/
    ScriptAlias / /usr/share/request-tracker5/libexec/rt-server.fcgi/
    
        DocumentRoot "/usr/share/request-tracker5/html"
    
    # Alias "/static" "/usr/share/request-tracker5/static"
    <Location />
    DirectoryIndex index.html
    #            Require all granted
    #            Options +ExecCGI
    #            AddHandler fcgid-script fcgi
    </Location>
    
    # Limit mail gateway access to localhost by default
    <Location /REST/1.0/NoAuth>
    <IfVersion >= 2.3>
        Require local
    </IfVersion>
    <IfVersion < 2.3>
        Order Allow,Deny
        Allow from 127.0.0.1
    </IfVersion>
    </Location>
    </VirtualHost>
  11. systemctl restart apache2 # 重启apache服务后,看看能否访问到RT的web页面。如果root能成功登录,请创建“售后”的队列,且设置收件箱为support。简化测试,让everyone可以有创建和回复工单的权限
  12. dpkg-reconfigure exim4-config # 配置 exim4 ,关键是填写收件箱的域,如 rt.demo.anqun.org 和监听的网络接口(本例是留空,表示在所有的网络接口里监听25端口)
  13. /etc/exim4/conf.d/router/050_exim4-config_rt5support # 创建收件箱地址的router,内容如下:

    rt5support_router:
    driver = accept
    local_parts = support
    transport = rt5support_transport
    
    rt5supportcomment_router:
    driver = accept
    local_parts = support-comment
    transport = rt5supportcomment_transport
  14. /etc/exim4/conf.d/transport/50_exim4-config_rt5support_pipe # 创建收件箱的pipe,内容如下:

    rt5support_transport:
     driver = pipe
     command = "/usr/bin/rt-mailgate --queue 售后 --action correspond --url https://rt.demo.anqun.org"
    
    rt5supportcomment_transport:
     driver = pipe
     command = "/usr/bin/rt-mailgate --queue 售后 --action comment --url https://rt.demo.anqun.org"
  15. update-exim4.conf.template -r && update-exim4.conf && systemctl reload exim4 # 将exim4的配置更新
  16. 如果顺利,发往suuport@rt.demo.anqun.org的邮件,会自动出现在“售后”队列中,从web里可以查看到

参考:

标签: RequestTracker, RT

添加新评论