<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://rt-wiki.bestpractical.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Brett</id>
	<title>Request Tracker Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://rt-wiki.bestpractical.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Brett"/>
	<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/wiki/Special:Contributions/Brett"/>
	<updated>2026-08-22T10:53:43Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.41.1</generator>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=ManualInstallation&amp;diff=27102</id>
		<title>ManualInstallation</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=ManualInstallation&amp;diff=27102"/>
		<updated>2022-10-21T19:48:36Z</updated>

		<summary type="html">&lt;p&gt;Brett: update LogToSTDERR explanation to match the rest of the deployment strategy&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Prev: [[ManualRequirements]] — Up: [[UserManual]] — Next: [[ManualApacheConfig]]&lt;br /&gt;
&lt;br /&gt;
This guide walks you through installing RT from source on a modern, popular Linux distro. Specifically, that means a distribution based on Debian or Red Hat that’s been released since around 2020.&lt;br /&gt;
&lt;br /&gt;
This guide assumes:&lt;br /&gt;
&lt;br /&gt;
* You can install packages generally available in Debian/Ubuntu or Red Hat/Fedora/CentOS.&lt;br /&gt;
* You want to install RT, and all of its Perl dependencies, from source to get the latest versions. (This is a trade-off. It means the boundaries of your install will be very clear, but you won’t get security updates for RT or Perl modules from your distribution.)&lt;br /&gt;
* You are willing to install a couple of extra tools to manage the RT installation similarly to how you would in other packaging systems (like PyPI, npm, etc.).&lt;br /&gt;
* You are willing to do a relatively maximal install of RT, enabling all the options during installation and then setting what you need in the configuration. (You could save a little space and time by being pickier about your options, but then that complicates the guide and makes it harder to turn those options on later if you want.)&lt;br /&gt;
* You are using a regular user account on the Linux system that can get superuser privileges with sudo.&lt;br /&gt;
&lt;br /&gt;
== Install the base dependencies ==&lt;br /&gt;
&lt;br /&gt;
These are required by RT, either to run or to install the dependencies.&lt;br /&gt;
&lt;br /&gt;
=== Debian/Ubuntu ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo apt install autoconf build-essential cpanminus curl libexpat-dev libgd-dev libssl-dev libz-dev gnupg graphviz multiwatch openssl perl w3m&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Red Hat Enterprise Linux ===&lt;br /&gt;
&lt;br /&gt;
These instructions are for RHEL specifically. For RHEL-derived distributions like CentOS and Rocky, go to the next section.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;MAJDISTVER=&amp;quot;$(. /etc/os-release &amp;amp;&amp;amp; echo &amp;quot;${VERSION_ID%%.*}&amp;quot;)&amp;quot;&lt;br /&gt;
sudo subscription-manager repos --enable &amp;quot;codeready-builder-for-rhel-$MAJDISTVER-$(arch)-rpms&amp;quot;&lt;br /&gt;
sudo dnf install &amp;quot;https://dl.fedoraproject.org/pub/epel/epel-release-latest-$MAJDISTVER.noarch.rpm&amp;quot;&lt;br /&gt;
sudo dnf install patch tar which gcc gcc-c++ perl-core perl-App-cpanminus graphviz expat-devel gd-devel multiwatch openssl openssl-devel w3m&lt;br /&gt;
sudo sed -i~ &#039;/^SELINUX=/ c SELINUX=disabled&#039; /etc/selinux/config&lt;br /&gt;
sudo setenforce 0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Turning off SELinux enforcement is required on Red Hat-based distributions because, as of March 2022, nobody has written a policy for RT.)&lt;br /&gt;
&lt;br /&gt;
=== RHEL Community Distributions: Fedora/CentOS/Rocky ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo dnf install epel-release&lt;br /&gt;
sudo dnf install patch tar which gcc gcc-c++ perl-core perl-App-cpanminus graphviz expat-devel gd-devel multiwatch openssl openssl-devel w3m&lt;br /&gt;
sudo sed -i~ &#039;/^SELINUX=/ c SELINUX=disabled&#039; /etc/selinux/config&lt;br /&gt;
sudo setenforce 0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Turning off SELinux enforcement is required on Red Hat-based distributions because, as of March 2022, nobody has written a policy for RT.)&lt;br /&gt;
&lt;br /&gt;
== Install a database ==&lt;br /&gt;
&lt;br /&gt;
You need access to a database server. It can be remote, or you can install a database server alongside RT. RT supports a few different databases, but the best supported options are PostgreSQL and MariaDB.&lt;br /&gt;
&lt;br /&gt;
=== Installing and configuring the PostgreSQL server ===&lt;br /&gt;
&lt;br /&gt;
If you want to install a fresh PostgreSQL database server alongside RT:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install postgresql&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install postgresql-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In order to set up RT’s database, you will need a PostgreSQL account that can create databases and roles and be authenticated with a password. If you don’t have that, you can create it by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo createuser --createdb --createrole --login --pwprompt rt_admin&amp;lt;/pre&amp;gt;&lt;br /&gt;
Set the password when prompted. Record this; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
=== Enable password authentication in PostgreSQL ===&lt;br /&gt;
&lt;br /&gt;
You need to consider this step whether you install the database locally, or use an existing one already running. RT supports connecting to PostgreSQL a few different ways, but authenticating with a username and password is simplest, and this guide is written based on that. Not all PostgreSQL installations allow this authentication method by default. You need to review your &amp;lt;code&amp;gt;pg_hba.conf&amp;lt;/code&amp;gt; file located at:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;/etc/postgresql/VERSION/main/pg_hba.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;/var/lib/pgsql/VERSION/data/pg_hba.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Replace &amp;lt;code&amp;gt;VERSION&amp;lt;/code&amp;gt; with the version of your PostgreSQL database. Add these two lines &#039;&#039;&#039;above&#039;&#039;&#039; any other lines that start with &amp;lt;code&amp;gt;host&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;host  rt5  rt_user   all  md5&lt;br /&gt;
host  rt5  rt_admin  all  md5&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This configuration will let &amp;lt;code&amp;gt;rt_user&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;rt_admin&amp;lt;/code&amp;gt; authorize themselves for the &amp;lt;code&amp;gt;rt5&amp;lt;/code&amp;gt; database using an &amp;lt;code&amp;gt;md5&amp;lt;/code&amp;gt; crypted password over a network connection (possibly using the localhost loopback network). You might be able to further restrict some of these fields for improved security, but doing so is outside the scope of this install guide. Refer to [https://www.postgresql.org/docs/current/auth-pg-hba-conf.html the pg_hba.conf documentation] for more details.&lt;br /&gt;
&lt;br /&gt;
Save your changes and reload the database:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo systemctl reload postgresql&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Installing the PostgreSQL client libraries ===&lt;br /&gt;
&lt;br /&gt;
These are required for RT to be able to talk to any PostgreSQL server.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install libpq-dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install postgresql-devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Once this is done you can skip ahead to installing RT.&lt;br /&gt;
&lt;br /&gt;
=== Installing and configuring the MariaDB server ===&lt;br /&gt;
&lt;br /&gt;
If you want to install a fresh MariaDB database server alongside RT:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install mariadb-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install mariadb-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In order to set up RT’s database, you will need a MySQL superuser account. To stay consistent with PostgreSQL, I suggest setting a password for it. You can do that by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo mysql mysql&lt;br /&gt;
MariaDB [mysql]&amp;amp;gt; GRANT ALL PRIVILEGES ON rt5.* TO rt_admin@localhost IDENTIFIED BY &#039;YourPassphraseHere&#039; WITH GRANT OPTION;&amp;lt;/pre&amp;gt;&lt;br /&gt;
Record your passphrase; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
=== Adjust MariaDB’s max_allowed_packet setting ===&lt;br /&gt;
&lt;br /&gt;
You need to consider this step whether you install the database locally, or use an existing one already running. [https://mariadb.com/kb/en/server-system-variables/#max_allowed_packet MariaDB’s &amp;lt;code&amp;gt;max_allowed_packet&amp;lt;/code&amp;gt; setting] functionally limits the size of attachments in RT. The default is 16MiB, which is too small for most installations. You can ultimately choose any setting you’re comfortable with; 64MiB here should allow most requests without being too open.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;echo -e &#039;[server]\nmax_allowed_packet=64M&#039; | sudo tee /etc/mysql/conf.d/max_allowed_packet.cnf&lt;br /&gt;
sudo systemctl reload mariadb&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;echo -e &#039;[server]\nmax_allowed_packet=64M&#039; | sudo tee /etc/my.cnf.d/max_allowed_packet.cnf&lt;br /&gt;
sudo systemctl reload mariadb&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Installing the MariaDB client libraries ===&lt;br /&gt;
&lt;br /&gt;
These are required for RT to be able to talk to any MariaDB server.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install libmariadb-dev libmariadb-dev-compat&amp;lt;/pre&amp;gt;&lt;br /&gt;
|On latest versions:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo dnf install mariadb-connector-c-devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you&#039;re on an older version that doesn&#039;t have that package:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo dnf install mariadb-devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Install RT ==&lt;br /&gt;
&lt;br /&gt;
=== Create RT system accounts ===&lt;br /&gt;
&lt;br /&gt;
This account will be used throughout the install process to control access to sensitive files. Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo groupadd --system rt&lt;br /&gt;
sudo useradd --system --home-dir=/opt/rt5/var --gid=rt rt&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Get and unpack the RT source code ===&lt;br /&gt;
&lt;br /&gt;
Download the latest source code using the link on the [https://bestpractical.com/download-page RT download page], extract it using &amp;lt;code&amp;gt;tar -xf&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt; into the source code directory to run the rest of the commands in this section. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;curl -O https://download.bestpractical.com/pub/rt/release/rt-5.0.3.tar.gz&lt;br /&gt;
tar -xf rt-5.0.3.tar.gz&lt;br /&gt;
cd rt-5.0.3&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Pre-configure RT ===&lt;br /&gt;
&lt;br /&gt;
This command will detect some information about your system in order to install RT properly, and decide which set of dependencies to install. Here’s what the different parts of our command are doing:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;PERL=…&amp;lt;/code&amp;gt; configures RT to run under Perl with some options that load its dependencies from a dedicated directory. The &amp;lt;code&amp;gt;/opt/rt5&amp;lt;/code&amp;gt; part of this string should match your &amp;lt;code&amp;gt;prefix&amp;lt;/code&amp;gt; setting (see next item). If you know you want to use a specific Perl installed on your system, you can specify its full path instead of the plain &amp;lt;code&amp;gt;perl&amp;lt;/code&amp;gt; here.&lt;br /&gt;
* &amp;lt;code&amp;gt;--prefix=/opt/rt5&amp;lt;/code&amp;gt; sets the directory where RT will install all of its libraries, tools, and supporting files. You can choose another path if you like.&lt;br /&gt;
* &amp;lt;code&amp;gt;--with-db-type=TYPE&amp;lt;/code&amp;gt; - Replace &amp;lt;code&amp;gt;TYPE&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;Pg&amp;lt;/code&amp;gt; for PostgreSQL, or &amp;lt;code&amp;gt;mysql&amp;lt;/code&amp;gt; for MariaDB.&lt;br /&gt;
* &amp;lt;code&amp;gt;--with-web-user=rt --with-web-group=rt&amp;lt;/code&amp;gt; installs RT using the dedicated accounts we created earlier.&lt;br /&gt;
* The rest of the options tell RT to install additional dependencies for optional features.&lt;br /&gt;
&lt;br /&gt;
Make sure you have &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt;ed into the RT source directory, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;PERL=&amp;quot;/usr/bin/env -S perl -I/opt/rt5/local/lib/perl5&amp;quot; ./configure --prefix=/opt/rt5 --with-db-type=TYPE --with-web-user=rt --with-web-group=rt --with-attachment-store=disk --enable-externalauth --enable-gd --enable-graphviz --enable-gpg --enable-smime&amp;lt;/pre&amp;gt;&lt;br /&gt;
For more background, [https://docs.bestpractical.com/rt/latest/configure.html refer to the RT configure options documentation].&lt;br /&gt;
&lt;br /&gt;
=== Install RT and its Perl dependencies ===&lt;br /&gt;
&lt;br /&gt;
This command will download, build, and install all of the Perl modules necessary to run RT with the configuration you set above. Here’s what the different parts of the command are doing:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;make dirs&amp;lt;/code&amp;gt; creates RT&#039;s directory structure, so we can install dependencies inside it.&lt;br /&gt;
* &amp;lt;code&amp;gt;make fixdeps&amp;lt;/code&amp;gt; actually installs those dependencies.&lt;br /&gt;
* &amp;lt;code&amp;gt;RT_FIX_DEPS_CMD=…&amp;lt;/code&amp;gt; tells RT to use cpanminus to install dependencies (instead of the older, default &amp;lt;code&amp;gt;cpan&amp;lt;/code&amp;gt; command) inside RT&#039;s directory structure.&lt;br /&gt;
* &amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt; installs all of RT’s files under &amp;lt;code&amp;gt;/opt/rt5&amp;lt;/code&amp;gt; (or the prefix directory you set earlier). It will only run if &amp;lt;code&amp;gt;fixdeps&amp;lt;/code&amp;gt; succeeded.&lt;br /&gt;
&lt;br /&gt;
Make sure you have &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt;ed into the RT source directory, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo make dirs&lt;br /&gt;
make fixdeps RT_FIX_DEPS_CMD=&amp;quot;cpanm --sudo --local-lib-contained=/opt/rt5/local&amp;quot;&lt;br /&gt;
sudo make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
If it works, the command will eventually output a message that says “Congratulations. RT is now installed.” followed by instructions about configuring and setting up the database. We’ll do that next.&lt;br /&gt;
&lt;br /&gt;
=== Configure RT ===&lt;br /&gt;
&lt;br /&gt;
[https://docs.bestpractical.com/rt/latest/RT_Config.html RT has many configuration options.] You can put configuration options in the file &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/code&amp;gt;, or in individual files under &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.d/&amp;lt;/code&amp;gt;. Use an editor to save all the text below to &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/code&amp;gt; (you can just overwrite the existing file, or add this to the bottom of what’s there) and then fill in settings for your site everywhere the text &amp;lt;code&amp;gt;EDIT WITH&amp;lt;/code&amp;gt; appears.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Single-quote all values EXCEPT the special value `undef`&lt;br /&gt;
# that turns off a setting.&lt;br /&gt;
&lt;br /&gt;
# rtname appears in ticket email subjects. It needs to be globally unique,&lt;br /&gt;
# so use your organization&#039;s domain name.&lt;br /&gt;
Set($rtname, &#039;EDIT WITH yourdomain.example.com&#039;);&lt;br /&gt;
# Organization is used in the database for ticket links, etc. It also needs to&lt;br /&gt;
# be globally unique, so use your organization&#039;s domain name.&lt;br /&gt;
Set($Organization, &#039;EDIT WITH yourdomain.example.com&#039;);&lt;br /&gt;
# WebDomain is domain name of the RT web server. RT uses it to construct links&lt;br /&gt;
# and defend against CSRFs.&lt;br /&gt;
Set($WebDomain, &#039;EDIT WITH rt.yourdomain.example.com&#039;);&lt;br /&gt;
# WebPort is the port where the RT web server runs. Edit the number below if&lt;br /&gt;
# you&#039;re not using the standard HTTPS port.&lt;br /&gt;
Set($WebPort, &#039;443&#039;);&lt;br /&gt;
# WebPath is the path where the RT web server runs on your WebDomain.&lt;br /&gt;
# Edit the path below if you&#039;re using a specific path.&lt;br /&gt;
Set($WebPath, &#039;/&#039;);&lt;br /&gt;
&lt;br /&gt;
# DatabaseUser is the name of the database account RT uses to read and store&lt;br /&gt;
# data. &#039;rt_user&#039; is the default but you can change it if you like.&lt;br /&gt;
# DO NOT use the &#039;rt_admin&#039; superuser created in the instructions above.&lt;br /&gt;
Set($DatabaseUser, &#039;rt_user&#039;);&lt;br /&gt;
# DatabasePassword is the password for DatabaseUser.&lt;br /&gt;
Set($DatabasePassword, &#039;EDIT WITH SomePassphraseHere&#039;);&lt;br /&gt;
# DatabaseHost is the hostname of the database server RT should use.&lt;br /&gt;
# Change &#039;localhost&#039; if it lives on a different server.&lt;br /&gt;
Set($DatabaseHost, &#039;localhost&#039;);&lt;br /&gt;
# DatabasePort is the port number of the database server RT should use.&lt;br /&gt;
# `undef` means the default for that database. Change it if you&#039;re not&lt;br /&gt;
# using the standard port.&lt;br /&gt;
Set($DatabasePort, undef);&lt;br /&gt;
# DatabaseName is the name of RT&#039;s database hosted on DatabaseHost.&lt;br /&gt;
# &#039;rt5&#039; is the default but you can change it if you like.&lt;br /&gt;
Set($DatabaseName, &#039;rt5&#039;);&lt;br /&gt;
# DatabaseAdmin is the name of the user in the database used to perform&lt;br /&gt;
# major administrative tasks. Change &#039;rt_admin&#039; if you&#039;re using a user&lt;br /&gt;
# besides the one created in this guide.&lt;br /&gt;
Set($DatabaseAdmin, &#039;rt_admin&#039;);&lt;br /&gt;
&lt;br /&gt;
# RT can log to syslog, stderr, and/or a dedicated file.&lt;br /&gt;
# Log settings are used both by the primary server and by command line&lt;br /&gt;
# tools like rt-crontool, rt-ldapimport, etc.&lt;br /&gt;
# You set all of RT&#039;s $LogTo* paramaters to a standard log level: &#039;debug&#039;,&lt;br /&gt;
# &#039;info&#039;, &#039;notice&#039;, &#039;warning&#039;, &#039;error&#039;, &#039;critical&#039;, &#039;alert&#039;, or &#039;emergency&#039;.&lt;br /&gt;
# For a modern install, I recommend logging primarily to syslog, so it goes&lt;br /&gt;
# to journald where it&#039;s easy to query and automatically gets rotated.&lt;br /&gt;
Set($LogToSyslog, &#039;info&#039;);&lt;br /&gt;
&lt;br /&gt;
# When the RT server logs to stderr, that will go to the rt-server journal.&lt;br /&gt;
# Command line tools log to their own stderr. Setting this to&lt;br /&gt;
# &#039;warning&#039; or &#039;error&#039; helps ensure you get notified if RT&#039;s cron jobs&lt;br /&gt;
# encounter problems.&lt;br /&gt;
Set($LogToSTDERR, &#039;warning&#039;);&lt;br /&gt;
&lt;br /&gt;
# Turn off optional features that require additional configuration.&lt;br /&gt;
# If you want to use these, refer to the RT_Config documentation for&lt;br /&gt;
# instructions on how to set them up.&lt;br /&gt;
Set(%GnuPG, &#039;Enable&#039; =&amp;gt; &#039;0&#039;);&lt;br /&gt;
Set(%SMIME, &#039;Enable&#039; =&amp;gt; &#039;0&#039;);&lt;br /&gt;
&lt;br /&gt;
# Perl expects to find this 1 at the end of the file.&lt;br /&gt;
1;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;RT_SiteConfig.pm&amp;lt;/code&amp;gt; is actually Perl code. RT runs the code directly to load the configuration. Any time you finish editing it, you can check that you didn’t make any syntax errors by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;perl -c /opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Set up RT’s database ===&lt;br /&gt;
&lt;br /&gt;
RT includes a tool to help you set up its database. By default, it connects to the database as an administrator to create the database and user that you configured in the previous step.&lt;br /&gt;
&lt;br /&gt;
(The instructions from &amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt; and RT’s README file tell you to run &amp;lt;code&amp;gt;make initialize-database&amp;lt;/code&amp;gt;. That just runs &amp;lt;code&amp;gt;rt-setup-database&amp;lt;/code&amp;gt; for you. Running the tool directly makes it easier to pass the options you need.)&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;--action=init&amp;lt;/code&amp;gt; tells the tool to create the user, the database, the tables inside it, and insert core data RT needs to function.&lt;br /&gt;
* &#039;&#039;&#039;If&#039;&#039;&#039; you are using an existing database server and the database adminstrator has already created the user account and database for RT, then you can add the &amp;lt;code&amp;gt;--skip-create&amp;lt;/code&amp;gt; option.&lt;br /&gt;
* &#039;&#039;&#039;If&#039;&#039;&#039; you have a less common database setup, this tool has additional options to give you finer-grained control over what steps are run and how. Refer to [https://docs.bestpractical.com/rt/latest/rt-setup-database.html the full rt-setup-database documentation] to learn more about those.&lt;br /&gt;
* The command reads files from RT’s &amp;lt;code&amp;gt;etc/&amp;lt;/code&amp;gt; directory by default, so the easiest way to run it is to &amp;lt;code&amp;gt;cd /opt/rt5&amp;lt;/code&amp;gt; first, and then it will find the necessary files automatically.&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /opt/rt5&lt;br /&gt;
sudo sbin/rt-setup-database --action=init&amp;lt;/pre&amp;gt;&lt;br /&gt;
Enter the password for your database administrator account when prompted.&lt;br /&gt;
&lt;br /&gt;
=== Set up fulltext indexing ===&lt;br /&gt;
&lt;br /&gt;
Fulltext indexing speeds up searches for ticket content, which makes RT a lot nicer to use.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;--noask&amp;lt;/code&amp;gt; uses the default names for the index, which will be fine for a new install and simplifies the setup.&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo /opt/rt5/sbin/rt-setup-fulltext-index --noask&amp;lt;/pre&amp;gt;&lt;br /&gt;
Enter the password for your database administrator account when prompted. The end of the process will output some RT configuration that looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;### EXAMPLE OUTPUT ONLY - Don&#039;t use this directly!&lt;br /&gt;
Set( %FullTextSearch,&lt;br /&gt;
    Enable     =&amp;gt; 1,&lt;br /&gt;
    Indexed    =&amp;gt; 1,&lt;br /&gt;
    # Additional output from rt-setup-fulltext-index should be here.&lt;br /&gt;
    # The configuration varies by database type.&lt;br /&gt;
);&amp;lt;/pre&amp;gt;&lt;br /&gt;
Copy the output generated when you run &amp;lt;code&amp;gt;rt-setup-fulltext-index&amp;lt;/code&amp;gt; and save it to the file &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.d/FulltextIndex.pm&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Set permissions ===&lt;br /&gt;
&lt;br /&gt;
All of RT’s configuration files should be readable by the user that runs the web server, and no other users, in order to protect sensitive information like the database password. RT provides a command to set permissions appropriately according to your distribution and configuration. &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt; to the directory where you extracted the RT source code, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd rt-5.0.3&lt;br /&gt;
sudo make fixperms&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Verify the installation ===&lt;br /&gt;
&lt;br /&gt;
If everything has gone well, then you should be able to set a password for RT’s &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; user. You’ll use this later to log in to the web interface and continue setting up your system. Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo /opt/rt5/sbin/rt-passwd root&amp;lt;/pre&amp;gt;&lt;br /&gt;
Set the password when prompted. Record this; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
== Set up RT FastCGI service ==&lt;br /&gt;
&lt;br /&gt;
=== Create the RT service ===&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo systemctl edit --force --full rt-server.service&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This opens an editor to define the RT service to systemd. Use the editor to add this text to the file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[Unit]&lt;br /&gt;
Description=RT FCGI server&lt;br /&gt;
&lt;br /&gt;
[Service]&lt;br /&gt;
# The --forks option is the number of RT servers to run in parallel.&lt;br /&gt;
# 3 should be good for most initial installs. You can increase this&lt;br /&gt;
# number later if needed for performance.&lt;br /&gt;
ExecStart=/usr/bin/multiwatch --forks=3 --signal=TERM -- /opt/rt5/sbin/rt-server.fcgi&lt;br /&gt;
StandardInput=socket&lt;br /&gt;
User=rt&lt;br /&gt;
UMask=027&lt;br /&gt;
&lt;br /&gt;
CapabilityBoundingSet=&lt;br /&gt;
DevicePolicy=closed&lt;br /&gt;
PrivateMounts=true&lt;br /&gt;
PrivateNetwork=false&lt;br /&gt;
PrivateTmp=true&lt;br /&gt;
PrivateUsers=true&lt;br /&gt;
ProtectControlGroups=true&lt;br /&gt;
ProtectHome=true&lt;br /&gt;
ProtectSystem=full&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save the file and close your editor.&lt;br /&gt;
&lt;br /&gt;
=== Create the RT socket ===&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo systemctl edit --force --full rt-server.socket&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This opens an editor to define the RT socket to systemd. Use the editor to add this text to the file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[Unit]&lt;br /&gt;
Description=RT FCGI server socket&lt;br /&gt;
Wants=network.target&lt;br /&gt;
After=network.target&lt;br /&gt;
Before=apache2.service httpd.service nginx.service&lt;br /&gt;
&lt;br /&gt;
[Install]&lt;br /&gt;
WantedBy=sockets.target&lt;br /&gt;
&lt;br /&gt;
[Socket]&lt;br /&gt;
# ListenStream defines the address and port where the RT FastCGI server listens.&lt;br /&gt;
# This is NOT the web server itself, so don&#039;t make this port 80, 443, etc.&lt;br /&gt;
# You may edit this if you like, but note:&lt;br /&gt;
# Connections are unencrypted. You should only listen on a secure network&lt;br /&gt;
# interface.&lt;br /&gt;
# The server can only accept a single socket. You cannot specify more than&lt;br /&gt;
# one ListenStream address.&lt;br /&gt;
ListenStream=[::1]:5000&lt;br /&gt;
Accept=no&lt;br /&gt;
FreeBind=yes&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save the file and close your editor.&lt;br /&gt;
&lt;br /&gt;
=== Enable the RT socket ===&lt;br /&gt;
&lt;br /&gt;
Start the server socket and enable it on future boots:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo systemctl enable --now rt-server.socket&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s web server ==&lt;br /&gt;
&lt;br /&gt;
Fully documenting how to set up a web server configured for your network with encryption is outside the scope of this guide. This page only highlights the configuration you need to pass web requests onto the RT FastCGI service.&lt;br /&gt;
&lt;br /&gt;
=== nginx ===&lt;br /&gt;
&lt;br /&gt;
Make sure you have the necessary packages installed:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install nginx&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install nginx&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In the &amp;lt;code&amp;gt;http server&amp;lt;/code&amp;gt; configuration blocks where you want to serve RT, add a configuration block like this, &#039;&#039;&#039;above&#039;&#039;&#039; any other &amp;lt;code&amp;gt;location&amp;lt;/code&amp;gt; blocks:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# The location path should match the WebPath in your RT site configuration.&lt;br /&gt;
location / {&lt;br /&gt;
  include /etc/nginx/fastcgi.conf;&lt;br /&gt;
  # SCRIPT_NAME should match RT&#039;s WebPath, without a trailing slash.&lt;br /&gt;
  # This means when WebPath is /, it&#039;s the empty string &amp;quot;&amp;quot;.&lt;br /&gt;
  fastcgi_param SCRIPT_NAME &amp;quot;&amp;quot;;&lt;br /&gt;
  # This network location should match the ListenStream in rt-server.socket.&lt;br /&gt;
  fastcgi_pass localhost:5000;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you&#039;re doing a fresh install, the default &amp;lt;code&amp;gt;http server&amp;lt;/code&amp;gt; configuration location varies by distribution:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|Edit &amp;lt;code&amp;gt;/etc/nginx/sites-available/default&amp;lt;/code&amp;gt;&lt;br /&gt;
|Add a new file &amp;lt;code&amp;gt;/etc/nginx/default.d/rt-server.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
After you’ve edited your configuration, load it by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo systemctl reload nginx&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once this is done you can skip ahead to Verify the web interface.&lt;br /&gt;
&lt;br /&gt;
=== Apache httpd ===&lt;br /&gt;
&lt;br /&gt;
Make sure you have the necessary packages installed, and the proxy_fcgi module enabled:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install apache2&lt;br /&gt;
sudo a2enmod proxy&lt;br /&gt;
sudo a2enmod proxy_fcgi&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install httpd&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In the &amp;lt;code&amp;gt;&amp;amp;lt;VirtualHost&amp;amp;gt;&amp;lt;/code&amp;gt; configuration blocks where you want to serve RT, add a configuration block like this, &#039;&#039;&#039;above&#039;&#039;&#039; any other &amp;lt;code&amp;gt;Alias&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;ProxyPass&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;ScriptAlias&amp;lt;/code&amp;gt; lines:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# SCRIPT_NAME should match RT&#039;s WebPath, without a trailing slash.&lt;br /&gt;
# This means when WebPath is /, it&#039;s the empty string &amp;quot;&amp;quot;.&lt;br /&gt;
ProxyFCGISetEnvIf true SCRIPT_NAME &amp;quot;&amp;quot;&lt;br /&gt;
# The location path in the first argument should match the WebPath in your&lt;br /&gt;
# RT site configuration.  The network location after fcgi:// should match&lt;br /&gt;
# the ListenStream in rt-server.socket.&lt;br /&gt;
ProxyPass / fcgi://localhost:5000/&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you&#039;re doing a fresh install, the default &amp;lt;code&amp;gt;&amp;amp;lt;VirtualHost&amp;amp;gt;&amp;lt;/code&amp;gt; configuration location varies by distribution and whether or not you&#039;re using HTTPS:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|With HTTPS: &amp;lt;code&amp;gt;/etc/apache2/sites-available/default-ssl.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
With plain HTTP: &amp;lt;code&amp;gt;/etc/apache2/sites-available/000-default.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
|With HTTPS: &amp;lt;code&amp;gt;/etc/httpd/conf.d/ssl.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
With plain HTTP: Write a new file &amp;lt;code&amp;gt;/etc/httpd/conf.d/vhost_RT.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
After you’ve edited your configuration, load it by running:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo systemctl reload apache2&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo systemctl reload httpd&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Verify the web interface ===&lt;br /&gt;
&lt;br /&gt;
You should be able to visit your web server in your browser, and be presented with RT’s login screen. You should be able to log in with username &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; and the password you set previously.&lt;br /&gt;
&lt;br /&gt;
If the web server returns a 502 Bad Gateway response, it&#039;s having trouble connecting to the RT FCGI server. Check the error logs for your web server:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 33%;&amp;quot;|nginx&lt;br /&gt;
! style=&amp;quot;width: 33%;&amp;quot;|Apache on Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 33%;&amp;quot;|httpd on Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;/var/log/nginx/error.log&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;/var/log/apache2/error.log&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;/var/log/httpd/error_log&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For all kinds of errors, you can check the logs for the RT FCGI server and its socket:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo journalctl --unit rt-server.\*&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s mail server ==&lt;br /&gt;
&lt;br /&gt;
RT both can both send and receive ticket updates via email. Unfortunately, there are too many variables to document a useful setup process here: getting this working usually requires creating DNS records, and coordinating with existing mail servers, which will be the main constraint on your setup. Instead this guide provides a brief overview of how the integration works, and where the connection points are that you likely need to work on.&lt;br /&gt;
&lt;br /&gt;
=== Sending Mail ===&lt;br /&gt;
&lt;br /&gt;
RT only knows how to send mail by passing it off to another program on the system. It cannot connect or authenticate directly to external mail servers. In the default configuration, RT runs the standard &amp;lt;code&amp;gt;sendmail&amp;lt;/code&amp;gt; command. There are [https://docs.bestpractical.com/rt/latest/RT_Config.html#Outgoing-mail configuration options to send mail through different commands] if you need.&lt;br /&gt;
&lt;br /&gt;
The most common setup is to install and configure a proper Mail Transfer Agent (MTA) like Postfix or Exim, and then configure it to send mail to the wider Internet as you need. This works well because the MTAs are robust and well-tested; they have flexible configuration to let you send mail out by relaying to other mail servers you specify with optional authentication; and most distributions install one by default anyway. The only hard part is configuring the MTA to send mail following your site’s policies.&lt;br /&gt;
&lt;br /&gt;
Other software is available that provides a slimmer version of the &amp;lt;code&amp;gt;sendmail&amp;lt;/code&amp;gt; command that connects to an external mail server for you, like msmtp. These programs are usually easier to configure than an MTA, but they often lose email permanently if they can’t connect to the external server at the time it’s sent. (MTAs keep email queued locally until they successfully deliver it to another server.)&lt;br /&gt;
&lt;br /&gt;
=== Receiving email ===&lt;br /&gt;
&lt;br /&gt;
RT installs a command called &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; that receives an email on standard input and posts it to RT’s REST web interface, where it gets saved in the database and added to a ticket. You need to arrange for a way to send incoming email to this command.&lt;br /&gt;
&lt;br /&gt;
The most common setup is to have an MTA on the same box as RT receive email directly, and then set up mail aliases that call this command when mail comes in. Example &amp;lt;code&amp;gt;/etc/aliases&amp;lt;/code&amp;gt; entries look like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rt: &amp;quot;|/opt/rt5/bin/rt-mailgate --queue general --action correspond --url https://rt.yourdomain.example.com/&amp;quot;&lt;br /&gt;
rt-comment: &amp;quot;|/opt/rt5/bin/rt-mailgate --queue general --action comment --url https://rt.yourdomain.example.com/&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
This works well because, again, you’re probably running an MTA anyway; and the MTA can hold and queue mail if it comes in while RT is down for any reason, giving you a buffer against downtime.&lt;br /&gt;
&lt;br /&gt;
Another common option is to periodically run a tool that fetches mail using a protocol like IMAP, like fetchmail or getmail, and passes it on to &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt;. This is less common because it requires setting up another tool to run, and securely storing another set of mail server credentials. But it is useful when local policy prevents the RT server from receiving email directly.&lt;br /&gt;
&lt;br /&gt;
This is much less common, but it might help to know that &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; doesn’t have to run on the same system as RT itself. It just needs to be able to connect to RT’s web interface. If you don’t have any other options, you can install the RT software on a different system that receives email, and configure &#039;&#039;that&#039;&#039; system to run &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; and pass it on to the RT server. To do that, install the [https://metacpan.org/pod/RT::Client::CLI RT::Client::CLI] Perl package on the mail server. For example, you could install cpanminus, then run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cpanm --sudo RT::Client::CLI&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s background jobs ==&lt;br /&gt;
&lt;br /&gt;
Create a file &amp;lt;code&amp;gt;/etc/cron.d/rt&amp;lt;/code&amp;gt; with the following content. You may edit all of the time fields as you see fit. Refer to the crontab(5) man page for details about their definitions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Update the fulltext index with new ticket data&lt;br /&gt;
*/3 *   *   *   *   rt    /opt/rt5/sbin/rt-fulltext-indexer&lt;br /&gt;
# Email out dashboards that users have subscribed to&lt;br /&gt;
1   *   *   *   *   rt    /opt/rt5/sbin/rt-email-dashboards&lt;br /&gt;
# Clean old sessions from the database&lt;br /&gt;
50  3   *   *   *   rt    /opt/rt5/sbin/rt-clean-sessions --older 8d&lt;br /&gt;
# Email out weekly digests for users who have requested it&lt;br /&gt;
50  4   *   *   Mon rt    /opt/rt5/sbin/rt-email-digest -m weekly&lt;br /&gt;
# Email out daily digests for users who have requested it&lt;br /&gt;
50  5   *   *   *   rt    /opt/rt5/sbin/rt-email-digest -m daily&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Set up RT ==&lt;br /&gt;
&lt;br /&gt;
If you’ve gotten this far, congratulations, your RT install is really done now. You can start setting up RT with users, groups, queues, and business logic. [[Main Page|Head back to the main page]] to start exploring those topics.&lt;/div&gt;</summary>
		<author><name>Brett</name></author>
	</entry>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=ManualInstallation&amp;diff=27099</id>
		<title>ManualInstallation</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=ManualInstallation&amp;diff=27099"/>
		<updated>2022-10-12T17:45:55Z</updated>

		<summary type="html">&lt;p&gt;Brett: small extra niceties in cron job scheduling&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Prev: [[ManualRequirements]] — Up: [[UserManual]] — Next: [[ManualApacheConfig]]&lt;br /&gt;
&lt;br /&gt;
This guide walks you through installing RT from source on a modern, popular Linux distro. Specifically, that means a distribution based on Debian or Red Hat that’s been released since around 2020.&lt;br /&gt;
&lt;br /&gt;
This guide assumes:&lt;br /&gt;
&lt;br /&gt;
* You can install packages generally available in Debian/Ubuntu or Red Hat/Fedora/CentOS.&lt;br /&gt;
* You want to install RT, and all of its Perl dependencies, from source to get the latest versions. (This is a trade-off. It means the boundaries of your install will be very clear, but you won’t get security updates for RT or Perl modules from your distribution.)&lt;br /&gt;
* You are willing to install a couple of extra tools to manage the RT installation similarly to how you would in other packaging systems (like PyPI, npm, etc.).&lt;br /&gt;
* You are willing to do a relatively maximal install of RT, enabling all the options during installation and then setting what you need in the configuration. (You could save a little space and time by being pickier about your options, but then that complicates the guide and makes it harder to turn those options on later if you want.)&lt;br /&gt;
* You are using a regular user account on the Linux system that can get superuser privileges with sudo.&lt;br /&gt;
&lt;br /&gt;
== Install the base dependencies ==&lt;br /&gt;
&lt;br /&gt;
These are required by RT, either to run or to install the dependencies.&lt;br /&gt;
&lt;br /&gt;
=== Debian/Ubuntu ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo apt install autoconf build-essential cpanminus curl libexpat-dev libgd-dev libssl-dev libz-dev gnupg graphviz multiwatch openssl perl w3m&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Red Hat Enterprise Linux ===&lt;br /&gt;
&lt;br /&gt;
These instructions are for RHEL specifically. For RHEL-derived distributions like CentOS and Rocky, go to the next section.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;MAJDISTVER=&amp;quot;$(. /etc/os-release &amp;amp;&amp;amp; echo &amp;quot;${VERSION_ID%%.*}&amp;quot;)&amp;quot;&lt;br /&gt;
sudo subscription-manager repos --enable &amp;quot;codeready-builder-for-rhel-$MAJDISTVER-$(arch)-rpms&amp;quot;&lt;br /&gt;
sudo dnf install &amp;quot;https://dl.fedoraproject.org/pub/epel/epel-release-latest-$MAJDISTVER.noarch.rpm&amp;quot;&lt;br /&gt;
sudo dnf install patch tar which gcc gcc-c++ perl-core perl-App-cpanminus graphviz expat-devel gd-devel multiwatch openssl openssl-devel w3m&lt;br /&gt;
sudo sed -i~ &#039;/^SELINUX=/ c SELINUX=disabled&#039; /etc/selinux/config&lt;br /&gt;
sudo setenforce 0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Turning off SELinux enforcement is required on Red Hat-based distributions because, as of March 2022, nobody has written a policy for RT.)&lt;br /&gt;
&lt;br /&gt;
=== RHEL Community Distributions: Fedora/CentOS/Rocky ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo dnf install epel-release&lt;br /&gt;
sudo dnf install patch tar which gcc gcc-c++ perl-core perl-App-cpanminus graphviz expat-devel gd-devel multiwatch openssl openssl-devel w3m&lt;br /&gt;
sudo sed -i~ &#039;/^SELINUX=/ c SELINUX=disabled&#039; /etc/selinux/config&lt;br /&gt;
sudo setenforce 0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Turning off SELinux enforcement is required on Red Hat-based distributions because, as of March 2022, nobody has written a policy for RT.)&lt;br /&gt;
&lt;br /&gt;
== Install a database ==&lt;br /&gt;
&lt;br /&gt;
You need access to a database server. It can be remote, or you can install a database server alongside RT. RT supports a few different databases, but the best supported options are PostgreSQL and MariaDB.&lt;br /&gt;
&lt;br /&gt;
=== Installing and configuring the PostgreSQL server ===&lt;br /&gt;
&lt;br /&gt;
If you want to install a fresh PostgreSQL database server alongside RT:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install postgresql&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install postgresql-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In order to set up RT’s database, you will need a PostgreSQL account that can create databases and roles and be authenticated with a password. If you don’t have that, you can create it by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo createuser --createdb --createrole --login --pwprompt rt_admin&amp;lt;/pre&amp;gt;&lt;br /&gt;
Set the password when prompted. Record this; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
=== Enable password authentication in PostgreSQL ===&lt;br /&gt;
&lt;br /&gt;
You need to consider this step whether you install the database locally, or use an existing one already running. RT supports connecting to PostgreSQL a few different ways, but authenticating with a username and password is simplest, and this guide is written based on that. Not all PostgreSQL installations allow this authentication method by default. You need to review your &amp;lt;code&amp;gt;pg_hba.conf&amp;lt;/code&amp;gt; file located at:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;/etc/postgresql/VERSION/main/pg_hba.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;/var/lib/pgsql/VERSION/data/pg_hba.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Replace &amp;lt;code&amp;gt;VERSION&amp;lt;/code&amp;gt; with the version of your PostgreSQL database. Add these two lines &#039;&#039;&#039;above&#039;&#039;&#039; any other lines that start with &amp;lt;code&amp;gt;host&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;host  rt5  rt_user   all  md5&lt;br /&gt;
host  rt5  rt_admin  all  md5&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This configuration will let &amp;lt;code&amp;gt;rt_user&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;rt_admin&amp;lt;/code&amp;gt; authorize themselves for the &amp;lt;code&amp;gt;rt5&amp;lt;/code&amp;gt; database using an &amp;lt;code&amp;gt;md5&amp;lt;/code&amp;gt; crypted password over a network connection (possibly using the localhost loopback network). You might be able to further restrict some of these fields for improved security, but doing so is outside the scope of this install guide. Refer to [https://www.postgresql.org/docs/current/auth-pg-hba-conf.html the pg_hba.conf documentation] for more details.&lt;br /&gt;
&lt;br /&gt;
Save your changes and reload the database:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo systemctl reload postgresql&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Installing the PostgreSQL client libraries ===&lt;br /&gt;
&lt;br /&gt;
These are required for RT to be able to talk to any PostgreSQL server.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install libpq-dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install postgresql-devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Once this is done you can skip ahead to installing RT.&lt;br /&gt;
&lt;br /&gt;
=== Installing and configuring the MariaDB server ===&lt;br /&gt;
&lt;br /&gt;
If you want to install a fresh MariaDB database server alongside RT:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install mariadb-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install mariadb-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In order to set up RT’s database, you will need a MySQL superuser account. To stay consistent with PostgreSQL, I suggest setting a password for it. You can do that by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo mysql mysql&lt;br /&gt;
MariaDB [mysql]&amp;amp;gt; GRANT ALL PRIVILEGES ON rt5.* TO rt_admin@localhost IDENTIFIED BY &#039;YourPassphraseHere&#039; WITH GRANT OPTION;&amp;lt;/pre&amp;gt;&lt;br /&gt;
Record your passphrase; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
=== Adjust MariaDB’s max_allowed_packet setting ===&lt;br /&gt;
&lt;br /&gt;
You need to consider this step whether you install the database locally, or use an existing one already running. [https://mariadb.com/kb/en/server-system-variables/#max_allowed_packet MariaDB’s &amp;lt;code&amp;gt;max_allowed_packet&amp;lt;/code&amp;gt; setting] functionally limits the size of attachments in RT. The default is 16MiB, which is too small for most installations. You can ultimately choose any setting you’re comfortable with; 64MiB here should allow most requests without being too open.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;echo -e &#039;[server]\nmax_allowed_packet=64M&#039; | sudo tee /etc/mysql/conf.d/max_allowed_packet.cnf&lt;br /&gt;
sudo systemctl reload mariadb&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;echo -e &#039;[server]\nmax_allowed_packet=64M&#039; | sudo tee /etc/my.cnf.d/max_allowed_packet.cnf&lt;br /&gt;
sudo systemctl reload mariadb&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Installing the MariaDB client libraries ===&lt;br /&gt;
&lt;br /&gt;
These are required for RT to be able to talk to any MariaDB server.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install libmariadb-dev libmariadb-dev-compat&amp;lt;/pre&amp;gt;&lt;br /&gt;
|On latest versions:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo dnf install mariadb-connector-c-devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you&#039;re on an older version that doesn&#039;t have that package:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo dnf install mariadb-devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Install RT ==&lt;br /&gt;
&lt;br /&gt;
=== Create RT system accounts ===&lt;br /&gt;
&lt;br /&gt;
This account will be used throughout the install process to control access to sensitive files. Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo groupadd --system rt&lt;br /&gt;
sudo useradd --system --home-dir=/opt/rt5/var --gid=rt rt&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Get and unpack the RT source code ===&lt;br /&gt;
&lt;br /&gt;
Download the latest source code using the link on the [https://bestpractical.com/download-page RT download page], extract it using &amp;lt;code&amp;gt;tar -xf&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt; into the source code directory to run the rest of the commands in this section. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;curl -O https://download.bestpractical.com/pub/rt/release/rt-5.0.3.tar.gz&lt;br /&gt;
tar -xf rt-5.0.3.tar.gz&lt;br /&gt;
cd rt-5.0.3&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Pre-configure RT ===&lt;br /&gt;
&lt;br /&gt;
This command will detect some information about your system in order to install RT properly, and decide which set of dependencies to install. Here’s what the different parts of our command are doing:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;PERL=…&amp;lt;/code&amp;gt; configures RT to run under Perl with some options that load its dependencies from a dedicated directory. The &amp;lt;code&amp;gt;/opt/rt5&amp;lt;/code&amp;gt; part of this string should match your &amp;lt;code&amp;gt;prefix&amp;lt;/code&amp;gt; setting (see next item). If you know you want to use a specific Perl installed on your system, you can specify its full path instead of the plain &amp;lt;code&amp;gt;perl&amp;lt;/code&amp;gt; here.&lt;br /&gt;
* &amp;lt;code&amp;gt;--prefix=/opt/rt5&amp;lt;/code&amp;gt; sets the directory where RT will install all of its libraries, tools, and supporting files. You can choose another path if you like.&lt;br /&gt;
* &amp;lt;code&amp;gt;--with-db-type=TYPE&amp;lt;/code&amp;gt; - Replace &amp;lt;code&amp;gt;TYPE&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;Pg&amp;lt;/code&amp;gt; for PostgreSQL, or &amp;lt;code&amp;gt;mysql&amp;lt;/code&amp;gt; for MariaDB.&lt;br /&gt;
* &amp;lt;code&amp;gt;--with-web-user=rt --with-web-group=rt&amp;lt;/code&amp;gt; installs RT using the dedicated accounts we created earlier.&lt;br /&gt;
* The rest of the options tell RT to install additional dependencies for optional features.&lt;br /&gt;
&lt;br /&gt;
Make sure you have &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt;ed into the RT source directory, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;PERL=&amp;quot;/usr/bin/env -S perl -I/opt/rt5/local/lib/perl5&amp;quot; ./configure --prefix=/opt/rt5 --with-db-type=TYPE --with-web-user=rt --with-web-group=rt --with-attachment-store=disk --enable-externalauth --enable-gd --enable-graphviz --enable-gpg --enable-smime&amp;lt;/pre&amp;gt;&lt;br /&gt;
For more background, [https://docs.bestpractical.com/rt/latest/configure.html refer to the RT configure options documentation].&lt;br /&gt;
&lt;br /&gt;
=== Install RT and its Perl dependencies ===&lt;br /&gt;
&lt;br /&gt;
This command will download, build, and install all of the Perl modules necessary to run RT with the configuration you set above. Here’s what the different parts of the command are doing:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;make dirs&amp;lt;/code&amp;gt; creates RT&#039;s directory structure, so we can install dependencies inside it.&lt;br /&gt;
* &amp;lt;code&amp;gt;make fixdeps&amp;lt;/code&amp;gt; actually installs those dependencies.&lt;br /&gt;
* &amp;lt;code&amp;gt;RT_FIX_DEPS_CMD=…&amp;lt;/code&amp;gt; tells RT to use cpanminus to install dependencies (instead of the older, default &amp;lt;code&amp;gt;cpan&amp;lt;/code&amp;gt; command) inside RT&#039;s directory structure.&lt;br /&gt;
* &amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt; installs all of RT’s files under &amp;lt;code&amp;gt;/opt/rt5&amp;lt;/code&amp;gt; (or the prefix directory you set earlier). It will only run if &amp;lt;code&amp;gt;fixdeps&amp;lt;/code&amp;gt; succeeded.&lt;br /&gt;
&lt;br /&gt;
Make sure you have &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt;ed into the RT source directory, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo make dirs&lt;br /&gt;
make fixdeps RT_FIX_DEPS_CMD=&amp;quot;cpanm --sudo --local-lib-contained=/opt/rt5/local&amp;quot;&lt;br /&gt;
sudo make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
If it works, the command will eventually output a message that says “Congratulations. RT is now installed.” followed by instructions about configuring and setting up the database. We’ll do that next.&lt;br /&gt;
&lt;br /&gt;
=== Configure RT ===&lt;br /&gt;
&lt;br /&gt;
[https://docs.bestpractical.com/rt/latest/RT_Config.html RT has many configuration options.] You can put configuration options in the file &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/code&amp;gt;, or in individual files under &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.d/&amp;lt;/code&amp;gt;. Use an editor to save all the text below to &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/code&amp;gt; (you can just overwrite the existing file, or add this to the bottom of what’s there) and then fill in settings for your site everywhere the text &amp;lt;code&amp;gt;EDIT WITH&amp;lt;/code&amp;gt; appears.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Single-quote all values EXCEPT the special value `undef`&lt;br /&gt;
# that turns off a setting.&lt;br /&gt;
&lt;br /&gt;
# rtname appears in ticket email subjects. It needs to be globally unique,&lt;br /&gt;
# so use your organization&#039;s domain name.&lt;br /&gt;
Set($rtname, &#039;EDIT WITH yourdomain.example.com&#039;);&lt;br /&gt;
# Organization is used in the database for ticket links, etc. It also needs to&lt;br /&gt;
# be globally unique, so use your organization&#039;s domain name.&lt;br /&gt;
Set($Organization, &#039;EDIT WITH yourdomain.example.com&#039;);&lt;br /&gt;
# WebDomain is domain name of the RT web server. RT uses it to construct links&lt;br /&gt;
# and defend against CSRFs.&lt;br /&gt;
Set($WebDomain, &#039;EDIT WITH rt.yourdomain.example.com&#039;);&lt;br /&gt;
# WebPort is the port where the RT web server runs. Edit the number below if&lt;br /&gt;
# you&#039;re not using the standard HTTPS port.&lt;br /&gt;
Set($WebPort, &#039;443&#039;);&lt;br /&gt;
# WebPath is the path where the RT web server runs on your WebDomain.&lt;br /&gt;
# Edit the path below if you&#039;re using a specific path.&lt;br /&gt;
Set($WebPath, &#039;/&#039;);&lt;br /&gt;
&lt;br /&gt;
# DatabaseUser is the name of the database account RT uses to read and store&lt;br /&gt;
# data. &#039;rt_user&#039; is the default but you can change it if you like.&lt;br /&gt;
# DO NOT use the &#039;rt_admin&#039; superuser created in the instructions above.&lt;br /&gt;
Set($DatabaseUser, &#039;rt_user&#039;);&lt;br /&gt;
# DatabasePassword is the password for DatabaseUser.&lt;br /&gt;
Set($DatabasePassword, &#039;EDIT WITH SomePassphraseHere&#039;);&lt;br /&gt;
# DatabaseHost is the hostname of the database server RT should use.&lt;br /&gt;
# Change &#039;localhost&#039; if it lives on a different server.&lt;br /&gt;
Set($DatabaseHost, &#039;localhost&#039;);&lt;br /&gt;
# DatabasePort is the port number of the database server RT should use.&lt;br /&gt;
# `undef` means the default for that database. Change it if you&#039;re not&lt;br /&gt;
# using the standard port.&lt;br /&gt;
Set($DatabasePort, undef);&lt;br /&gt;
# DatabaseName is the name of RT&#039;s database hosted on DatabaseHost.&lt;br /&gt;
# &#039;rt5&#039; is the default but you can change it if you like.&lt;br /&gt;
Set($DatabaseName, &#039;rt5&#039;);&lt;br /&gt;
# DatabaseAdmin is the name of the user in the database used to perform&lt;br /&gt;
# major administrative tasks. Change &#039;rt_admin&#039; if you&#039;re using a user&lt;br /&gt;
# besides the one created in this guide.&lt;br /&gt;
Set($DatabaseAdmin, &#039;rt_admin&#039;);&lt;br /&gt;
&lt;br /&gt;
# RT can log to syslog, stderr, and/or a dedicated file.&lt;br /&gt;
# Log settings are used both by the primary server and by command line&lt;br /&gt;
# tools like rt-crontool, rt-ldapimport, etc.&lt;br /&gt;
# You set all of RT&#039;s $LogTo* paramaters to a standard log level: &#039;debug&#039;,&lt;br /&gt;
# &#039;info&#039;, &#039;notice&#039;, &#039;warning&#039;, &#039;error&#039;, &#039;critical&#039;, &#039;alert&#039;, or &#039;emergency&#039;.&lt;br /&gt;
# For a modern install, I recommend logging primarily to syslog, so it goes&lt;br /&gt;
# to journald where it&#039;s easy to query and automatically gets rotated.&lt;br /&gt;
Set($LogToSyslog, &#039;info&#039;);&lt;br /&gt;
&lt;br /&gt;
# When the RT server logs to stderr, that usually goes to your web server&#039;s&lt;br /&gt;
# error log. Command line tools log to their own stderr. Setting this to&lt;br /&gt;
# &#039;warning&#039; or &#039;error&#039; helps ensure you get notified if RT&#039;s cron jobs&lt;br /&gt;
# encounter problems.&lt;br /&gt;
Set($LogToSTDERR, &#039;warning&#039;);&lt;br /&gt;
&lt;br /&gt;
# Turn off optional features that require additional configuration.&lt;br /&gt;
# If you want to use these, refer to the RT_Config documentation for&lt;br /&gt;
# instructions on how to set them up.&lt;br /&gt;
Set(%GnuPG, &#039;Enable&#039; =&amp;gt; &#039;0&#039;);&lt;br /&gt;
Set(%SMIME, &#039;Enable&#039; =&amp;gt; &#039;0&#039;);&lt;br /&gt;
&lt;br /&gt;
# Perl expects to find this 1 at the end of the file.&lt;br /&gt;
1;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;RT_SiteConfig.pm&amp;lt;/code&amp;gt; is actually Perl code. RT runs the code directly to load the configuration. Any time you finish editing it, you can check that you didn’t make any syntax errors by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;perl -c /opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Set up RT’s database ===&lt;br /&gt;
&lt;br /&gt;
RT includes a tool to help you set up its database. By default, it connects to the database as an administrator to create the database and user that you configured in the previous step.&lt;br /&gt;
&lt;br /&gt;
(The instructions from &amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt; and RT’s README file tell you to run &amp;lt;code&amp;gt;make initialize-database&amp;lt;/code&amp;gt;. That just runs &amp;lt;code&amp;gt;rt-setup-database&amp;lt;/code&amp;gt; for you. Running the tool directly makes it easier to pass the options you need.)&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;--action=init&amp;lt;/code&amp;gt; tells the tool to create the user, the database, the tables inside it, and insert core data RT needs to function.&lt;br /&gt;
* &#039;&#039;&#039;If&#039;&#039;&#039; you are using an existing database server and the database adminstrator has already created the user account and database for RT, then you can add the &amp;lt;code&amp;gt;--skip-create&amp;lt;/code&amp;gt; option.&lt;br /&gt;
* &#039;&#039;&#039;If&#039;&#039;&#039; you have a less common database setup, this tool has additional options to give you finer-grained control over what steps are run and how. Refer to [https://docs.bestpractical.com/rt/latest/rt-setup-database.html the full rt-setup-database documentation] to learn more about those.&lt;br /&gt;
* The command reads files from RT’s &amp;lt;code&amp;gt;etc/&amp;lt;/code&amp;gt; directory by default, so the easiest way to run it is to &amp;lt;code&amp;gt;cd /opt/rt5&amp;lt;/code&amp;gt; first, and then it will find the necessary files automatically.&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /opt/rt5&lt;br /&gt;
sudo sbin/rt-setup-database --action=init&amp;lt;/pre&amp;gt;&lt;br /&gt;
Enter the password for your database administrator account when prompted.&lt;br /&gt;
&lt;br /&gt;
=== Set up fulltext indexing ===&lt;br /&gt;
&lt;br /&gt;
Fulltext indexing speeds up searches for ticket content, which makes RT a lot nicer to use.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;--noask&amp;lt;/code&amp;gt; uses the default names for the index, which will be fine for a new install and simplifies the setup.&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo /opt/rt5/sbin/rt-setup-fulltext-index --noask&amp;lt;/pre&amp;gt;&lt;br /&gt;
Enter the password for your database administrator account when prompted. The end of the process will output some RT configuration that looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;### EXAMPLE OUTPUT ONLY - Don&#039;t use this directly!&lt;br /&gt;
Set( %FullTextSearch,&lt;br /&gt;
    Enable     =&amp;gt; 1,&lt;br /&gt;
    Indexed    =&amp;gt; 1,&lt;br /&gt;
    # Additional output from rt-setup-fulltext-index should be here.&lt;br /&gt;
    # The configuration varies by database type.&lt;br /&gt;
);&amp;lt;/pre&amp;gt;&lt;br /&gt;
Copy the output generated when you run &amp;lt;code&amp;gt;rt-setup-fulltext-index&amp;lt;/code&amp;gt; and save it to the file &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.d/FulltextIndex.pm&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Set permissions ===&lt;br /&gt;
&lt;br /&gt;
All of RT’s configuration files should be readable by the user that runs the web server, and no other users, in order to protect sensitive information like the database password. RT provides a command to set permissions appropriately according to your distribution and configuration. &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt; to the directory where you extracted the RT source code, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd rt-5.0.3&lt;br /&gt;
sudo make fixperms&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Verify the installation ===&lt;br /&gt;
&lt;br /&gt;
If everything has gone well, then you should be able to set a password for RT’s &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; user. You’ll use this later to log in to the web interface and continue setting up your system. Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo /opt/rt5/sbin/rt-passwd root&amp;lt;/pre&amp;gt;&lt;br /&gt;
Set the password when prompted. Record this; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
== Set up RT FastCGI service ==&lt;br /&gt;
&lt;br /&gt;
=== Create the RT service ===&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo systemctl edit --force --full rt-server.service&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This opens an editor to define the RT service to systemd. Use the editor to add this text to the file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[Unit]&lt;br /&gt;
Description=RT FCGI server&lt;br /&gt;
&lt;br /&gt;
[Service]&lt;br /&gt;
# The --forks option is the number of RT servers to run in parallel.&lt;br /&gt;
# 3 should be good for most initial installs. You can increase this&lt;br /&gt;
# number later if needed for performance.&lt;br /&gt;
ExecStart=/usr/bin/multiwatch --forks=3 --signal=TERM -- /opt/rt5/sbin/rt-server.fcgi&lt;br /&gt;
StandardInput=socket&lt;br /&gt;
User=rt&lt;br /&gt;
UMask=027&lt;br /&gt;
&lt;br /&gt;
CapabilityBoundingSet=&lt;br /&gt;
DevicePolicy=closed&lt;br /&gt;
PrivateMounts=true&lt;br /&gt;
PrivateNetwork=false&lt;br /&gt;
PrivateTmp=true&lt;br /&gt;
PrivateUsers=true&lt;br /&gt;
ProtectControlGroups=true&lt;br /&gt;
ProtectHome=true&lt;br /&gt;
ProtectSystem=full&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save the file and close your editor.&lt;br /&gt;
&lt;br /&gt;
=== Create the RT socket ===&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo systemctl edit --force --full rt-server.socket&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This opens an editor to define the RT socket to systemd. Use the editor to add this text to the file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[Unit]&lt;br /&gt;
Description=RT FCGI server socket&lt;br /&gt;
Wants=network.target&lt;br /&gt;
After=network.target&lt;br /&gt;
Before=apache2.service httpd.service nginx.service&lt;br /&gt;
&lt;br /&gt;
[Install]&lt;br /&gt;
WantedBy=sockets.target&lt;br /&gt;
&lt;br /&gt;
[Socket]&lt;br /&gt;
# ListenStream defines the address and port where the RT FastCGI server listens.&lt;br /&gt;
# This is NOT the web server itself, so don&#039;t make this port 80, 443, etc.&lt;br /&gt;
# You may edit this if you like, but note:&lt;br /&gt;
# Connections are unencrypted. You should only listen on a secure network&lt;br /&gt;
# interface.&lt;br /&gt;
# The server can only accept a single socket. You cannot specify more than&lt;br /&gt;
# one ListenStream address.&lt;br /&gt;
ListenStream=[::1]:5000&lt;br /&gt;
Accept=no&lt;br /&gt;
FreeBind=yes&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save the file and close your editor.&lt;br /&gt;
&lt;br /&gt;
=== Enable the RT socket ===&lt;br /&gt;
&lt;br /&gt;
Start the server socket and enable it on future boots:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo systemctl enable --now rt-server.socket&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s web server ==&lt;br /&gt;
&lt;br /&gt;
Fully documenting how to set up a web server configured for your network with encryption is outside the scope of this guide. This page only highlights the configuration you need to pass web requests onto the RT FastCGI service.&lt;br /&gt;
&lt;br /&gt;
=== nginx ===&lt;br /&gt;
&lt;br /&gt;
Make sure you have the necessary packages installed:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install nginx&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install nginx&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In the &amp;lt;code&amp;gt;http server&amp;lt;/code&amp;gt; configuration blocks where you want to serve RT, add a configuration block like this, &#039;&#039;&#039;above&#039;&#039;&#039; any other &amp;lt;code&amp;gt;location&amp;lt;/code&amp;gt; blocks:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# The location path should match the WebPath in your RT site configuration.&lt;br /&gt;
location / {&lt;br /&gt;
  include /etc/nginx/fastcgi.conf;&lt;br /&gt;
  # SCRIPT_NAME should match RT&#039;s WebPath, without a trailing slash.&lt;br /&gt;
  # This means when WebPath is /, it&#039;s the empty string &amp;quot;&amp;quot;.&lt;br /&gt;
  fastcgi_param SCRIPT_NAME &amp;quot;&amp;quot;;&lt;br /&gt;
  # This network location should match the ListenStream in rt-server.socket.&lt;br /&gt;
  fastcgi_pass localhost:5000;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you&#039;re doing a fresh install, the default &amp;lt;code&amp;gt;http server&amp;lt;/code&amp;gt; configuration location varies by distribution:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|Edit &amp;lt;code&amp;gt;/etc/nginx/sites-available/default&amp;lt;/code&amp;gt;&lt;br /&gt;
|Add a new file &amp;lt;code&amp;gt;/etc/nginx/default.d/rt-server.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
After you’ve edited your configuration, load it by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo systemctl reload nginx&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once this is done you can skip ahead to Verify the web interface.&lt;br /&gt;
&lt;br /&gt;
=== Apache httpd ===&lt;br /&gt;
&lt;br /&gt;
Make sure you have the necessary packages installed, and the proxy_fcgi module enabled:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install apache2&lt;br /&gt;
sudo a2enmod proxy&lt;br /&gt;
sudo a2enmod proxy_fcgi&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install httpd&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In the &amp;lt;code&amp;gt;&amp;amp;lt;VirtualHost&amp;amp;gt;&amp;lt;/code&amp;gt; configuration blocks where you want to serve RT, add a configuration block like this, &#039;&#039;&#039;above&#039;&#039;&#039; any other &amp;lt;code&amp;gt;Alias&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;ProxyPass&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;ScriptAlias&amp;lt;/code&amp;gt; lines:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# SCRIPT_NAME should match RT&#039;s WebPath, without a trailing slash.&lt;br /&gt;
# This means when WebPath is /, it&#039;s the empty string &amp;quot;&amp;quot;.&lt;br /&gt;
ProxyFCGISetEnvIf true SCRIPT_NAME &amp;quot;&amp;quot;&lt;br /&gt;
# The location path in the first argument should match the WebPath in your&lt;br /&gt;
# RT site configuration.  The network location after fcgi:// should match&lt;br /&gt;
# the ListenStream in rt-server.socket.&lt;br /&gt;
ProxyPass / fcgi://localhost:5000/&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you&#039;re doing a fresh install, the default &amp;lt;code&amp;gt;&amp;amp;lt;VirtualHost&amp;amp;gt;&amp;lt;/code&amp;gt; configuration location varies by distribution and whether or not you&#039;re using HTTPS:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|With HTTPS: &amp;lt;code&amp;gt;/etc/apache2/sites-available/default-ssl.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
With plain HTTP: &amp;lt;code&amp;gt;/etc/apache2/sites-available/000-default.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
|With HTTPS: &amp;lt;code&amp;gt;/etc/httpd/conf.d/ssl.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
With plain HTTP: Write a new file &amp;lt;code&amp;gt;/etc/httpd/conf.d/vhost_RT.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
After you’ve edited your configuration, load it by running:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo systemctl reload apache2&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo systemctl reload httpd&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Verify the web interface ===&lt;br /&gt;
&lt;br /&gt;
You should be able to visit your web server in your browser, and be presented with RT’s login screen. You should be able to log in with username &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; and the password you set previously.&lt;br /&gt;
&lt;br /&gt;
If the web server returns a 502 Bad Gateway response, it&#039;s having trouble connecting to the RT FCGI server. Check the error logs for your web server:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 33%;&amp;quot;|nginx&lt;br /&gt;
! style=&amp;quot;width: 33%;&amp;quot;|Apache on Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 33%;&amp;quot;|httpd on Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;/var/log/nginx/error.log&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;/var/log/apache2/error.log&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;/var/log/httpd/error_log&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For all kinds of errors, you can check the logs for the RT FCGI server and its socket:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo journalctl --unit rt-server.\*&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s mail server ==&lt;br /&gt;
&lt;br /&gt;
RT both can both send and receive ticket updates via email. Unfortunately, there are too many variables to document a useful setup process here: getting this working usually requires creating DNS records, and coordinating with existing mail servers, which will be the main constraint on your setup. Instead this guide provides a brief overview of how the integration works, and where the connection points are that you likely need to work on.&lt;br /&gt;
&lt;br /&gt;
=== Sending Mail ===&lt;br /&gt;
&lt;br /&gt;
RT only knows how to send mail by passing it off to another program on the system. It cannot connect or authenticate directly to external mail servers. In the default configuration, RT runs the standard &amp;lt;code&amp;gt;sendmail&amp;lt;/code&amp;gt; command. There are [https://docs.bestpractical.com/rt/latest/RT_Config.html#Outgoing-mail configuration options to send mail through different commands] if you need.&lt;br /&gt;
&lt;br /&gt;
The most common setup is to install and configure a proper Mail Transfer Agent (MTA) like Postfix or Exim, and then configure it to send mail to the wider Internet as you need. This works well because the MTAs are robust and well-tested; they have flexible configuration to let you send mail out by relaying to other mail servers you specify with optional authentication; and most distributions install one by default anyway. The only hard part is configuring the MTA to send mail following your site’s policies.&lt;br /&gt;
&lt;br /&gt;
Other software is available that provides a slimmer version of the &amp;lt;code&amp;gt;sendmail&amp;lt;/code&amp;gt; command that connects to an external mail server for you, like msmtp. These programs are usually easier to configure than an MTA, but they often lose email permanently if they can’t connect to the external server at the time it’s sent. (MTAs keep email queued locally until they successfully deliver it to another server.)&lt;br /&gt;
&lt;br /&gt;
=== Receiving email ===&lt;br /&gt;
&lt;br /&gt;
RT installs a command called &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; that receives an email on standard input and posts it to RT’s REST web interface, where it gets saved in the database and added to a ticket. You need to arrange for a way to send incoming email to this command.&lt;br /&gt;
&lt;br /&gt;
The most common setup is to have an MTA on the same box as RT receive email directly, and then set up mail aliases that call this command when mail comes in. Example &amp;lt;code&amp;gt;/etc/aliases&amp;lt;/code&amp;gt; entries look like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rt: &amp;quot;|/opt/rt5/bin/rt-mailgate --queue general --action correspond --url https://rt.yourdomain.example.com/&amp;quot;&lt;br /&gt;
rt-comment: &amp;quot;|/opt/rt5/bin/rt-mailgate --queue general --action comment --url https://rt.yourdomain.example.com/&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
This works well because, again, you’re probably running an MTA anyway; and the MTA can hold and queue mail if it comes in while RT is down for any reason, giving you a buffer against downtime.&lt;br /&gt;
&lt;br /&gt;
Another common option is to periodically run a tool that fetches mail using a protocol like IMAP, like fetchmail or getmail, and passes it on to &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt;. This is less common because it requires setting up another tool to run, and securely storing another set of mail server credentials. But it is useful when local policy prevents the RT server from receiving email directly.&lt;br /&gt;
&lt;br /&gt;
This is much less common, but it might help to know that &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; doesn’t have to run on the same system as RT itself. It just needs to be able to connect to RT’s web interface. If you don’t have any other options, you can install the RT software on a different system that receives email, and configure &#039;&#039;that&#039;&#039; system to run &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; and pass it on to the RT server. To do that, install the [https://metacpan.org/pod/RT::Client::CLI RT::Client::CLI] Perl package on the mail server. For example, you could install cpanminus, then run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cpanm --sudo RT::Client::CLI&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s background jobs ==&lt;br /&gt;
&lt;br /&gt;
Create a file &amp;lt;code&amp;gt;/etc/cron.d/rt&amp;lt;/code&amp;gt; with the following content. You may edit all of the time fields as you see fit. Refer to the crontab(5) man page for details about their definitions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Update the fulltext index with new ticket data&lt;br /&gt;
*/3 *   *   *   *   rt    /opt/rt5/sbin/rt-fulltext-indexer&lt;br /&gt;
# Email out dashboards that users have subscribed to&lt;br /&gt;
1   *   *   *   *   rt    /opt/rt5/sbin/rt-email-dashboards&lt;br /&gt;
# Clean old sessions from the database&lt;br /&gt;
50  3   *   *   *   rt    /opt/rt5/sbin/rt-clean-sessions --older 8d&lt;br /&gt;
# Email out weekly digests for users who have requested it&lt;br /&gt;
50  4   *   *   Mon rt    /opt/rt5/sbin/rt-email-digest -m weekly&lt;br /&gt;
# Email out daily digests for users who have requested it&lt;br /&gt;
50  5   *   *   *   rt    /opt/rt5/sbin/rt-email-digest -m daily&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Set up RT ==&lt;br /&gt;
&lt;br /&gt;
If you’ve gotten this far, congratulations, your RT install is really done now. You can start setting up RT with users, groups, queues, and business logic. [[Main Page|Head back to the main page]] to start exploring those topics.&lt;/div&gt;</summary>
		<author><name>Brett</name></author>
	</entry>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=ManualInstallation&amp;diff=27098</id>
		<title>ManualInstallation</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=ManualInstallation&amp;diff=27098"/>
		<updated>2022-10-12T17:20:59Z</updated>

		<summary type="html">&lt;p&gt;Brett: update rt-mailgate install instructions for 5.0.3&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Prev: [[ManualRequirements]] — Up: [[UserManual]] — Next: [[ManualApacheConfig]]&lt;br /&gt;
&lt;br /&gt;
This guide walks you through installing RT from source on a modern, popular Linux distro. Specifically, that means a distribution based on Debian or Red Hat that’s been released since around 2020.&lt;br /&gt;
&lt;br /&gt;
This guide assumes:&lt;br /&gt;
&lt;br /&gt;
* You can install packages generally available in Debian/Ubuntu or Red Hat/Fedora/CentOS.&lt;br /&gt;
* You want to install RT, and all of its Perl dependencies, from source to get the latest versions. (This is a trade-off. It means the boundaries of your install will be very clear, but you won’t get security updates for RT or Perl modules from your distribution.)&lt;br /&gt;
* You are willing to install a couple of extra tools to manage the RT installation similarly to how you would in other packaging systems (like PyPI, npm, etc.).&lt;br /&gt;
* You are willing to do a relatively maximal install of RT, enabling all the options during installation and then setting what you need in the configuration. (You could save a little space and time by being pickier about your options, but then that complicates the guide and makes it harder to turn those options on later if you want.)&lt;br /&gt;
* You are using a regular user account on the Linux system that can get superuser privileges with sudo.&lt;br /&gt;
&lt;br /&gt;
== Install the base dependencies ==&lt;br /&gt;
&lt;br /&gt;
These are required by RT, either to run or to install the dependencies.&lt;br /&gt;
&lt;br /&gt;
=== Debian/Ubuntu ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo apt install autoconf build-essential cpanminus curl libexpat-dev libgd-dev libssl-dev libz-dev gnupg graphviz multiwatch openssl perl w3m&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Red Hat Enterprise Linux ===&lt;br /&gt;
&lt;br /&gt;
These instructions are for RHEL specifically. For RHEL-derived distributions like CentOS and Rocky, go to the next section.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;MAJDISTVER=&amp;quot;$(. /etc/os-release &amp;amp;&amp;amp; echo &amp;quot;${VERSION_ID%%.*}&amp;quot;)&amp;quot;&lt;br /&gt;
sudo subscription-manager repos --enable &amp;quot;codeready-builder-for-rhel-$MAJDISTVER-$(arch)-rpms&amp;quot;&lt;br /&gt;
sudo dnf install &amp;quot;https://dl.fedoraproject.org/pub/epel/epel-release-latest-$MAJDISTVER.noarch.rpm&amp;quot;&lt;br /&gt;
sudo dnf install patch tar which gcc gcc-c++ perl-core perl-App-cpanminus graphviz expat-devel gd-devel multiwatch openssl openssl-devel w3m&lt;br /&gt;
sudo sed -i~ &#039;/^SELINUX=/ c SELINUX=disabled&#039; /etc/selinux/config&lt;br /&gt;
sudo setenforce 0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Turning off SELinux enforcement is required on Red Hat-based distributions because, as of March 2022, nobody has written a policy for RT.)&lt;br /&gt;
&lt;br /&gt;
=== RHEL Community Distributions: Fedora/CentOS/Rocky ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo dnf install epel-release&lt;br /&gt;
sudo dnf install patch tar which gcc gcc-c++ perl-core perl-App-cpanminus graphviz expat-devel gd-devel multiwatch openssl openssl-devel w3m&lt;br /&gt;
sudo sed -i~ &#039;/^SELINUX=/ c SELINUX=disabled&#039; /etc/selinux/config&lt;br /&gt;
sudo setenforce 0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Turning off SELinux enforcement is required on Red Hat-based distributions because, as of March 2022, nobody has written a policy for RT.)&lt;br /&gt;
&lt;br /&gt;
== Install a database ==&lt;br /&gt;
&lt;br /&gt;
You need access to a database server. It can be remote, or you can install a database server alongside RT. RT supports a few different databases, but the best supported options are PostgreSQL and MariaDB.&lt;br /&gt;
&lt;br /&gt;
=== Installing and configuring the PostgreSQL server ===&lt;br /&gt;
&lt;br /&gt;
If you want to install a fresh PostgreSQL database server alongside RT:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install postgresql&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install postgresql-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In order to set up RT’s database, you will need a PostgreSQL account that can create databases and roles and be authenticated with a password. If you don’t have that, you can create it by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo createuser --createdb --createrole --login --pwprompt rt_admin&amp;lt;/pre&amp;gt;&lt;br /&gt;
Set the password when prompted. Record this; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
=== Enable password authentication in PostgreSQL ===&lt;br /&gt;
&lt;br /&gt;
You need to consider this step whether you install the database locally, or use an existing one already running. RT supports connecting to PostgreSQL a few different ways, but authenticating with a username and password is simplest, and this guide is written based on that. Not all PostgreSQL installations allow this authentication method by default. You need to review your &amp;lt;code&amp;gt;pg_hba.conf&amp;lt;/code&amp;gt; file located at:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;/etc/postgresql/VERSION/main/pg_hba.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;/var/lib/pgsql/VERSION/data/pg_hba.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Replace &amp;lt;code&amp;gt;VERSION&amp;lt;/code&amp;gt; with the version of your PostgreSQL database. Add these two lines &#039;&#039;&#039;above&#039;&#039;&#039; any other lines that start with &amp;lt;code&amp;gt;host&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;host  rt5  rt_user   all  md5&lt;br /&gt;
host  rt5  rt_admin  all  md5&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This configuration will let &amp;lt;code&amp;gt;rt_user&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;rt_admin&amp;lt;/code&amp;gt; authorize themselves for the &amp;lt;code&amp;gt;rt5&amp;lt;/code&amp;gt; database using an &amp;lt;code&amp;gt;md5&amp;lt;/code&amp;gt; crypted password over a network connection (possibly using the localhost loopback network). You might be able to further restrict some of these fields for improved security, but doing so is outside the scope of this install guide. Refer to [https://www.postgresql.org/docs/current/auth-pg-hba-conf.html the pg_hba.conf documentation] for more details.&lt;br /&gt;
&lt;br /&gt;
Save your changes and reload the database:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo systemctl reload postgresql&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Installing the PostgreSQL client libraries ===&lt;br /&gt;
&lt;br /&gt;
These are required for RT to be able to talk to any PostgreSQL server.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install libpq-dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install postgresql-devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Once this is done you can skip ahead to installing RT.&lt;br /&gt;
&lt;br /&gt;
=== Installing and configuring the MariaDB server ===&lt;br /&gt;
&lt;br /&gt;
If you want to install a fresh MariaDB database server alongside RT:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install mariadb-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install mariadb-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In order to set up RT’s database, you will need a MySQL superuser account. To stay consistent with PostgreSQL, I suggest setting a password for it. You can do that by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo mysql mysql&lt;br /&gt;
MariaDB [mysql]&amp;amp;gt; GRANT ALL PRIVILEGES ON rt5.* TO rt_admin@localhost IDENTIFIED BY &#039;YourPassphraseHere&#039; WITH GRANT OPTION;&amp;lt;/pre&amp;gt;&lt;br /&gt;
Record your passphrase; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
=== Adjust MariaDB’s max_allowed_packet setting ===&lt;br /&gt;
&lt;br /&gt;
You need to consider this step whether you install the database locally, or use an existing one already running. [https://mariadb.com/kb/en/server-system-variables/#max_allowed_packet MariaDB’s &amp;lt;code&amp;gt;max_allowed_packet&amp;lt;/code&amp;gt; setting] functionally limits the size of attachments in RT. The default is 16MiB, which is too small for most installations. You can ultimately choose any setting you’re comfortable with; 64MiB here should allow most requests without being too open.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;echo -e &#039;[server]\nmax_allowed_packet=64M&#039; | sudo tee /etc/mysql/conf.d/max_allowed_packet.cnf&lt;br /&gt;
sudo systemctl reload mariadb&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;echo -e &#039;[server]\nmax_allowed_packet=64M&#039; | sudo tee /etc/my.cnf.d/max_allowed_packet.cnf&lt;br /&gt;
sudo systemctl reload mariadb&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Installing the MariaDB client libraries ===&lt;br /&gt;
&lt;br /&gt;
These are required for RT to be able to talk to any MariaDB server.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install libmariadb-dev libmariadb-dev-compat&amp;lt;/pre&amp;gt;&lt;br /&gt;
|On latest versions:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo dnf install mariadb-connector-c-devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you&#039;re on an older version that doesn&#039;t have that package:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo dnf install mariadb-devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Install RT ==&lt;br /&gt;
&lt;br /&gt;
=== Create RT system accounts ===&lt;br /&gt;
&lt;br /&gt;
This account will be used throughout the install process to control access to sensitive files. Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo groupadd --system rt&lt;br /&gt;
sudo useradd --system --home-dir=/opt/rt5/var --gid=rt rt&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Get and unpack the RT source code ===&lt;br /&gt;
&lt;br /&gt;
Download the latest source code using the link on the [https://bestpractical.com/download-page RT download page], extract it using &amp;lt;code&amp;gt;tar -xf&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt; into the source code directory to run the rest of the commands in this section. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;curl -O https://download.bestpractical.com/pub/rt/release/rt-5.0.3.tar.gz&lt;br /&gt;
tar -xf rt-5.0.3.tar.gz&lt;br /&gt;
cd rt-5.0.3&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Pre-configure RT ===&lt;br /&gt;
&lt;br /&gt;
This command will detect some information about your system in order to install RT properly, and decide which set of dependencies to install. Here’s what the different parts of our command are doing:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;PERL=…&amp;lt;/code&amp;gt; configures RT to run under Perl with some options that load its dependencies from a dedicated directory. The &amp;lt;code&amp;gt;/opt/rt5&amp;lt;/code&amp;gt; part of this string should match your &amp;lt;code&amp;gt;prefix&amp;lt;/code&amp;gt; setting (see next item). If you know you want to use a specific Perl installed on your system, you can specify its full path instead of the plain &amp;lt;code&amp;gt;perl&amp;lt;/code&amp;gt; here.&lt;br /&gt;
* &amp;lt;code&amp;gt;--prefix=/opt/rt5&amp;lt;/code&amp;gt; sets the directory where RT will install all of its libraries, tools, and supporting files. You can choose another path if you like.&lt;br /&gt;
* &amp;lt;code&amp;gt;--with-db-type=TYPE&amp;lt;/code&amp;gt; - Replace &amp;lt;code&amp;gt;TYPE&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;Pg&amp;lt;/code&amp;gt; for PostgreSQL, or &amp;lt;code&amp;gt;mysql&amp;lt;/code&amp;gt; for MariaDB.&lt;br /&gt;
* &amp;lt;code&amp;gt;--with-web-user=rt --with-web-group=rt&amp;lt;/code&amp;gt; installs RT using the dedicated accounts we created earlier.&lt;br /&gt;
* The rest of the options tell RT to install additional dependencies for optional features.&lt;br /&gt;
&lt;br /&gt;
Make sure you have &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt;ed into the RT source directory, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;PERL=&amp;quot;/usr/bin/env -S perl -I/opt/rt5/local/lib/perl5&amp;quot; ./configure --prefix=/opt/rt5 --with-db-type=TYPE --with-web-user=rt --with-web-group=rt --with-attachment-store=disk --enable-externalauth --enable-gd --enable-graphviz --enable-gpg --enable-smime&amp;lt;/pre&amp;gt;&lt;br /&gt;
For more background, [https://docs.bestpractical.com/rt/latest/configure.html refer to the RT configure options documentation].&lt;br /&gt;
&lt;br /&gt;
=== Install RT and its Perl dependencies ===&lt;br /&gt;
&lt;br /&gt;
This command will download, build, and install all of the Perl modules necessary to run RT with the configuration you set above. Here’s what the different parts of the command are doing:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;make dirs&amp;lt;/code&amp;gt; creates RT&#039;s directory structure, so we can install dependencies inside it.&lt;br /&gt;
* &amp;lt;code&amp;gt;make fixdeps&amp;lt;/code&amp;gt; actually installs those dependencies.&lt;br /&gt;
* &amp;lt;code&amp;gt;RT_FIX_DEPS_CMD=…&amp;lt;/code&amp;gt; tells RT to use cpanminus to install dependencies (instead of the older, default &amp;lt;code&amp;gt;cpan&amp;lt;/code&amp;gt; command) inside RT&#039;s directory structure.&lt;br /&gt;
* &amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt; installs all of RT’s files under &amp;lt;code&amp;gt;/opt/rt5&amp;lt;/code&amp;gt; (or the prefix directory you set earlier). It will only run if &amp;lt;code&amp;gt;fixdeps&amp;lt;/code&amp;gt; succeeded.&lt;br /&gt;
&lt;br /&gt;
Make sure you have &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt;ed into the RT source directory, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo make dirs&lt;br /&gt;
make fixdeps RT_FIX_DEPS_CMD=&amp;quot;cpanm --sudo --local-lib-contained=/opt/rt5/local&amp;quot;&lt;br /&gt;
sudo make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
If it works, the command will eventually output a message that says “Congratulations. RT is now installed.” followed by instructions about configuring and setting up the database. We’ll do that next.&lt;br /&gt;
&lt;br /&gt;
=== Configure RT ===&lt;br /&gt;
&lt;br /&gt;
[https://docs.bestpractical.com/rt/latest/RT_Config.html RT has many configuration options.] You can put configuration options in the file &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/code&amp;gt;, or in individual files under &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.d/&amp;lt;/code&amp;gt;. Use an editor to save all the text below to &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/code&amp;gt; (you can just overwrite the existing file, or add this to the bottom of what’s there) and then fill in settings for your site everywhere the text &amp;lt;code&amp;gt;EDIT WITH&amp;lt;/code&amp;gt; appears.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Single-quote all values EXCEPT the special value `undef`&lt;br /&gt;
# that turns off a setting.&lt;br /&gt;
&lt;br /&gt;
# rtname appears in ticket email subjects. It needs to be globally unique,&lt;br /&gt;
# so use your organization&#039;s domain name.&lt;br /&gt;
Set($rtname, &#039;EDIT WITH yourdomain.example.com&#039;);&lt;br /&gt;
# Organization is used in the database for ticket links, etc. It also needs to&lt;br /&gt;
# be globally unique, so use your organization&#039;s domain name.&lt;br /&gt;
Set($Organization, &#039;EDIT WITH yourdomain.example.com&#039;);&lt;br /&gt;
# WebDomain is domain name of the RT web server. RT uses it to construct links&lt;br /&gt;
# and defend against CSRFs.&lt;br /&gt;
Set($WebDomain, &#039;EDIT WITH rt.yourdomain.example.com&#039;);&lt;br /&gt;
# WebPort is the port where the RT web server runs. Edit the number below if&lt;br /&gt;
# you&#039;re not using the standard HTTPS port.&lt;br /&gt;
Set($WebPort, &#039;443&#039;);&lt;br /&gt;
# WebPath is the path where the RT web server runs on your WebDomain.&lt;br /&gt;
# Edit the path below if you&#039;re using a specific path.&lt;br /&gt;
Set($WebPath, &#039;/&#039;);&lt;br /&gt;
&lt;br /&gt;
# DatabaseUser is the name of the database account RT uses to read and store&lt;br /&gt;
# data. &#039;rt_user&#039; is the default but you can change it if you like.&lt;br /&gt;
# DO NOT use the &#039;rt_admin&#039; superuser created in the instructions above.&lt;br /&gt;
Set($DatabaseUser, &#039;rt_user&#039;);&lt;br /&gt;
# DatabasePassword is the password for DatabaseUser.&lt;br /&gt;
Set($DatabasePassword, &#039;EDIT WITH SomePassphraseHere&#039;);&lt;br /&gt;
# DatabaseHost is the hostname of the database server RT should use.&lt;br /&gt;
# Change &#039;localhost&#039; if it lives on a different server.&lt;br /&gt;
Set($DatabaseHost, &#039;localhost&#039;);&lt;br /&gt;
# DatabasePort is the port number of the database server RT should use.&lt;br /&gt;
# `undef` means the default for that database. Change it if you&#039;re not&lt;br /&gt;
# using the standard port.&lt;br /&gt;
Set($DatabasePort, undef);&lt;br /&gt;
# DatabaseName is the name of RT&#039;s database hosted on DatabaseHost.&lt;br /&gt;
# &#039;rt5&#039; is the default but you can change it if you like.&lt;br /&gt;
Set($DatabaseName, &#039;rt5&#039;);&lt;br /&gt;
# DatabaseAdmin is the name of the user in the database used to perform&lt;br /&gt;
# major administrative tasks. Change &#039;rt_admin&#039; if you&#039;re using a user&lt;br /&gt;
# besides the one created in this guide.&lt;br /&gt;
Set($DatabaseAdmin, &#039;rt_admin&#039;);&lt;br /&gt;
&lt;br /&gt;
# RT can log to syslog, stderr, and/or a dedicated file.&lt;br /&gt;
# Log settings are used both by the primary server and by command line&lt;br /&gt;
# tools like rt-crontool, rt-ldapimport, etc.&lt;br /&gt;
# You set all of RT&#039;s $LogTo* paramaters to a standard log level: &#039;debug&#039;,&lt;br /&gt;
# &#039;info&#039;, &#039;notice&#039;, &#039;warning&#039;, &#039;error&#039;, &#039;critical&#039;, &#039;alert&#039;, or &#039;emergency&#039;.&lt;br /&gt;
# For a modern install, I recommend logging primarily to syslog, so it goes&lt;br /&gt;
# to journald where it&#039;s easy to query and automatically gets rotated.&lt;br /&gt;
Set($LogToSyslog, &#039;info&#039;);&lt;br /&gt;
&lt;br /&gt;
# When the RT server logs to stderr, that usually goes to your web server&#039;s&lt;br /&gt;
# error log. Command line tools log to their own stderr. Setting this to&lt;br /&gt;
# &#039;warning&#039; or &#039;error&#039; helps ensure you get notified if RT&#039;s cron jobs&lt;br /&gt;
# encounter problems.&lt;br /&gt;
Set($LogToSTDERR, &#039;warning&#039;);&lt;br /&gt;
&lt;br /&gt;
# Turn off optional features that require additional configuration.&lt;br /&gt;
# If you want to use these, refer to the RT_Config documentation for&lt;br /&gt;
# instructions on how to set them up.&lt;br /&gt;
Set(%GnuPG, &#039;Enable&#039; =&amp;gt; &#039;0&#039;);&lt;br /&gt;
Set(%SMIME, &#039;Enable&#039; =&amp;gt; &#039;0&#039;);&lt;br /&gt;
&lt;br /&gt;
# Perl expects to find this 1 at the end of the file.&lt;br /&gt;
1;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;RT_SiteConfig.pm&amp;lt;/code&amp;gt; is actually Perl code. RT runs the code directly to load the configuration. Any time you finish editing it, you can check that you didn’t make any syntax errors by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;perl -c /opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Set up RT’s database ===&lt;br /&gt;
&lt;br /&gt;
RT includes a tool to help you set up its database. By default, it connects to the database as an administrator to create the database and user that you configured in the previous step.&lt;br /&gt;
&lt;br /&gt;
(The instructions from &amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt; and RT’s README file tell you to run &amp;lt;code&amp;gt;make initialize-database&amp;lt;/code&amp;gt;. That just runs &amp;lt;code&amp;gt;rt-setup-database&amp;lt;/code&amp;gt; for you. Running the tool directly makes it easier to pass the options you need.)&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;--action=init&amp;lt;/code&amp;gt; tells the tool to create the user, the database, the tables inside it, and insert core data RT needs to function.&lt;br /&gt;
* &#039;&#039;&#039;If&#039;&#039;&#039; you are using an existing database server and the database adminstrator has already created the user account and database for RT, then you can add the &amp;lt;code&amp;gt;--skip-create&amp;lt;/code&amp;gt; option.&lt;br /&gt;
* &#039;&#039;&#039;If&#039;&#039;&#039; you have a less common database setup, this tool has additional options to give you finer-grained control over what steps are run and how. Refer to [https://docs.bestpractical.com/rt/latest/rt-setup-database.html the full rt-setup-database documentation] to learn more about those.&lt;br /&gt;
* The command reads files from RT’s &amp;lt;code&amp;gt;etc/&amp;lt;/code&amp;gt; directory by default, so the easiest way to run it is to &amp;lt;code&amp;gt;cd /opt/rt5&amp;lt;/code&amp;gt; first, and then it will find the necessary files automatically.&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /opt/rt5&lt;br /&gt;
sudo sbin/rt-setup-database --action=init&amp;lt;/pre&amp;gt;&lt;br /&gt;
Enter the password for your database administrator account when prompted.&lt;br /&gt;
&lt;br /&gt;
=== Set up fulltext indexing ===&lt;br /&gt;
&lt;br /&gt;
Fulltext indexing speeds up searches for ticket content, which makes RT a lot nicer to use.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;--noask&amp;lt;/code&amp;gt; uses the default names for the index, which will be fine for a new install and simplifies the setup.&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo /opt/rt5/sbin/rt-setup-fulltext-index --noask&amp;lt;/pre&amp;gt;&lt;br /&gt;
Enter the password for your database administrator account when prompted. The end of the process will output some RT configuration that looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;### EXAMPLE OUTPUT ONLY - Don&#039;t use this directly!&lt;br /&gt;
Set( %FullTextSearch,&lt;br /&gt;
    Enable     =&amp;gt; 1,&lt;br /&gt;
    Indexed    =&amp;gt; 1,&lt;br /&gt;
    # Additional output from rt-setup-fulltext-index should be here.&lt;br /&gt;
    # The configuration varies by database type.&lt;br /&gt;
);&amp;lt;/pre&amp;gt;&lt;br /&gt;
Copy the output generated when you run &amp;lt;code&amp;gt;rt-setup-fulltext-index&amp;lt;/code&amp;gt; and save it to the file &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.d/FulltextIndex.pm&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Set permissions ===&lt;br /&gt;
&lt;br /&gt;
All of RT’s configuration files should be readable by the user that runs the web server, and no other users, in order to protect sensitive information like the database password. RT provides a command to set permissions appropriately according to your distribution and configuration. &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt; to the directory where you extracted the RT source code, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd rt-5.0.3&lt;br /&gt;
sudo make fixperms&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Verify the installation ===&lt;br /&gt;
&lt;br /&gt;
If everything has gone well, then you should be able to set a password for RT’s &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; user. You’ll use this later to log in to the web interface and continue setting up your system. Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo /opt/rt5/sbin/rt-passwd root&amp;lt;/pre&amp;gt;&lt;br /&gt;
Set the password when prompted. Record this; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
== Set up RT FastCGI service ==&lt;br /&gt;
&lt;br /&gt;
=== Create the RT service ===&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo systemctl edit --force --full rt-server.service&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This opens an editor to define the RT service to systemd. Use the editor to add this text to the file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[Unit]&lt;br /&gt;
Description=RT FCGI server&lt;br /&gt;
&lt;br /&gt;
[Service]&lt;br /&gt;
# The --forks option is the number of RT servers to run in parallel.&lt;br /&gt;
# 3 should be good for most initial installs. You can increase this&lt;br /&gt;
# number later if needed for performance.&lt;br /&gt;
ExecStart=/usr/bin/multiwatch --forks=3 --signal=TERM -- /opt/rt5/sbin/rt-server.fcgi&lt;br /&gt;
StandardInput=socket&lt;br /&gt;
User=rt&lt;br /&gt;
UMask=027&lt;br /&gt;
&lt;br /&gt;
CapabilityBoundingSet=&lt;br /&gt;
DevicePolicy=closed&lt;br /&gt;
PrivateMounts=true&lt;br /&gt;
PrivateNetwork=false&lt;br /&gt;
PrivateTmp=true&lt;br /&gt;
PrivateUsers=true&lt;br /&gt;
ProtectControlGroups=true&lt;br /&gt;
ProtectHome=true&lt;br /&gt;
ProtectSystem=full&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save the file and close your editor.&lt;br /&gt;
&lt;br /&gt;
=== Create the RT socket ===&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo systemctl edit --force --full rt-server.socket&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This opens an editor to define the RT socket to systemd. Use the editor to add this text to the file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[Unit]&lt;br /&gt;
Description=RT FCGI server socket&lt;br /&gt;
Wants=network.target&lt;br /&gt;
After=network.target&lt;br /&gt;
Before=apache2.service httpd.service nginx.service&lt;br /&gt;
&lt;br /&gt;
[Install]&lt;br /&gt;
WantedBy=sockets.target&lt;br /&gt;
&lt;br /&gt;
[Socket]&lt;br /&gt;
# ListenStream defines the address and port where the RT FastCGI server listens.&lt;br /&gt;
# This is NOT the web server itself, so don&#039;t make this port 80, 443, etc.&lt;br /&gt;
# You may edit this if you like, but note:&lt;br /&gt;
# Connections are unencrypted. You should only listen on a secure network&lt;br /&gt;
# interface.&lt;br /&gt;
# The server can only accept a single socket. You cannot specify more than&lt;br /&gt;
# one ListenStream address.&lt;br /&gt;
ListenStream=[::1]:5000&lt;br /&gt;
Accept=no&lt;br /&gt;
FreeBind=yes&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save the file and close your editor.&lt;br /&gt;
&lt;br /&gt;
=== Enable the RT socket ===&lt;br /&gt;
&lt;br /&gt;
Start the server socket and enable it on future boots:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo systemctl enable --now rt-server.socket&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s web server ==&lt;br /&gt;
&lt;br /&gt;
Fully documenting how to set up a web server configured for your network with encryption is outside the scope of this guide. This page only highlights the configuration you need to pass web requests onto the RT FastCGI service.&lt;br /&gt;
&lt;br /&gt;
=== nginx ===&lt;br /&gt;
&lt;br /&gt;
Make sure you have the necessary packages installed:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install nginx&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install nginx&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In the &amp;lt;code&amp;gt;http server&amp;lt;/code&amp;gt; configuration blocks where you want to serve RT, add a configuration block like this, &#039;&#039;&#039;above&#039;&#039;&#039; any other &amp;lt;code&amp;gt;location&amp;lt;/code&amp;gt; blocks:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# The location path should match the WebPath in your RT site configuration.&lt;br /&gt;
location / {&lt;br /&gt;
  include /etc/nginx/fastcgi.conf;&lt;br /&gt;
  # SCRIPT_NAME should match RT&#039;s WebPath, without a trailing slash.&lt;br /&gt;
  # This means when WebPath is /, it&#039;s the empty string &amp;quot;&amp;quot;.&lt;br /&gt;
  fastcgi_param SCRIPT_NAME &amp;quot;&amp;quot;;&lt;br /&gt;
  # This network location should match the ListenStream in rt-server.socket.&lt;br /&gt;
  fastcgi_pass localhost:5000;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you&#039;re doing a fresh install, the default &amp;lt;code&amp;gt;http server&amp;lt;/code&amp;gt; configuration location varies by distribution:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|Edit &amp;lt;code&amp;gt;/etc/nginx/sites-available/default&amp;lt;/code&amp;gt;&lt;br /&gt;
|Add a new file &amp;lt;code&amp;gt;/etc/nginx/default.d/rt-server.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
After you’ve edited your configuration, load it by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo systemctl reload nginx&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once this is done you can skip ahead to Verify the web interface.&lt;br /&gt;
&lt;br /&gt;
=== Apache httpd ===&lt;br /&gt;
&lt;br /&gt;
Make sure you have the necessary packages installed, and the proxy_fcgi module enabled:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install apache2&lt;br /&gt;
sudo a2enmod proxy&lt;br /&gt;
sudo a2enmod proxy_fcgi&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install httpd&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In the &amp;lt;code&amp;gt;&amp;amp;lt;VirtualHost&amp;amp;gt;&amp;lt;/code&amp;gt; configuration blocks where you want to serve RT, add a configuration block like this, &#039;&#039;&#039;above&#039;&#039;&#039; any other &amp;lt;code&amp;gt;Alias&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;ProxyPass&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;ScriptAlias&amp;lt;/code&amp;gt; lines:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# SCRIPT_NAME should match RT&#039;s WebPath, without a trailing slash.&lt;br /&gt;
# This means when WebPath is /, it&#039;s the empty string &amp;quot;&amp;quot;.&lt;br /&gt;
ProxyFCGISetEnvIf true SCRIPT_NAME &amp;quot;&amp;quot;&lt;br /&gt;
# The location path in the first argument should match the WebPath in your&lt;br /&gt;
# RT site configuration.  The network location after fcgi:// should match&lt;br /&gt;
# the ListenStream in rt-server.socket.&lt;br /&gt;
ProxyPass / fcgi://localhost:5000/&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you&#039;re doing a fresh install, the default &amp;lt;code&amp;gt;&amp;amp;lt;VirtualHost&amp;amp;gt;&amp;lt;/code&amp;gt; configuration location varies by distribution and whether or not you&#039;re using HTTPS:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|With HTTPS: &amp;lt;code&amp;gt;/etc/apache2/sites-available/default-ssl.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
With plain HTTP: &amp;lt;code&amp;gt;/etc/apache2/sites-available/000-default.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
|With HTTPS: &amp;lt;code&amp;gt;/etc/httpd/conf.d/ssl.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
With plain HTTP: Write a new file &amp;lt;code&amp;gt;/etc/httpd/conf.d/vhost_RT.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
After you’ve edited your configuration, load it by running:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo systemctl reload apache2&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo systemctl reload httpd&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Verify the web interface ===&lt;br /&gt;
&lt;br /&gt;
You should be able to visit your web server in your browser, and be presented with RT’s login screen. You should be able to log in with username &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; and the password you set previously.&lt;br /&gt;
&lt;br /&gt;
If the web server returns a 502 Bad Gateway response, it&#039;s having trouble connecting to the RT FCGI server. Check the error logs for your web server:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 33%;&amp;quot;|nginx&lt;br /&gt;
! style=&amp;quot;width: 33%;&amp;quot;|Apache on Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 33%;&amp;quot;|httpd on Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;/var/log/nginx/error.log&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;/var/log/apache2/error.log&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;/var/log/httpd/error_log&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For all kinds of errors, you can check the logs for the RT FCGI server and its socket:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo journalctl --unit rt-server.\*&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s mail server ==&lt;br /&gt;
&lt;br /&gt;
RT both can both send and receive ticket updates via email. Unfortunately, there are too many variables to document a useful setup process here: getting this working usually requires creating DNS records, and coordinating with existing mail servers, which will be the main constraint on your setup. Instead this guide provides a brief overview of how the integration works, and where the connection points are that you likely need to work on.&lt;br /&gt;
&lt;br /&gt;
=== Sending Mail ===&lt;br /&gt;
&lt;br /&gt;
RT only knows how to send mail by passing it off to another program on the system. It cannot connect or authenticate directly to external mail servers. In the default configuration, RT runs the standard &amp;lt;code&amp;gt;sendmail&amp;lt;/code&amp;gt; command. There are [https://docs.bestpractical.com/rt/latest/RT_Config.html#Outgoing-mail configuration options to send mail through different commands] if you need.&lt;br /&gt;
&lt;br /&gt;
The most common setup is to install and configure a proper Mail Transfer Agent (MTA) like Postfix or Exim, and then configure it to send mail to the wider Internet as you need. This works well because the MTAs are robust and well-tested; they have flexible configuration to let you send mail out by relaying to other mail servers you specify with optional authentication; and most distributions install one by default anyway. The only hard part is configuring the MTA to send mail following your site’s policies.&lt;br /&gt;
&lt;br /&gt;
Other software is available that provides a slimmer version of the &amp;lt;code&amp;gt;sendmail&amp;lt;/code&amp;gt; command that connects to an external mail server for you, like msmtp. These programs are usually easier to configure than an MTA, but they often lose email permanently if they can’t connect to the external server at the time it’s sent. (MTAs keep email queued locally until they successfully deliver it to another server.)&lt;br /&gt;
&lt;br /&gt;
=== Receiving email ===&lt;br /&gt;
&lt;br /&gt;
RT installs a command called &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; that receives an email on standard input and posts it to RT’s REST web interface, where it gets saved in the database and added to a ticket. You need to arrange for a way to send incoming email to this command.&lt;br /&gt;
&lt;br /&gt;
The most common setup is to have an MTA on the same box as RT receive email directly, and then set up mail aliases that call this command when mail comes in. Example &amp;lt;code&amp;gt;/etc/aliases&amp;lt;/code&amp;gt; entries look like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rt: &amp;quot;|/opt/rt5/bin/rt-mailgate --queue general --action correspond --url https://rt.yourdomain.example.com/&amp;quot;&lt;br /&gt;
rt-comment: &amp;quot;|/opt/rt5/bin/rt-mailgate --queue general --action comment --url https://rt.yourdomain.example.com/&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
This works well because, again, you’re probably running an MTA anyway; and the MTA can hold and queue mail if it comes in while RT is down for any reason, giving you a buffer against downtime.&lt;br /&gt;
&lt;br /&gt;
Another common option is to periodically run a tool that fetches mail using a protocol like IMAP, like fetchmail or getmail, and passes it on to &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt;. This is less common because it requires setting up another tool to run, and securely storing another set of mail server credentials. But it is useful when local policy prevents the RT server from receiving email directly.&lt;br /&gt;
&lt;br /&gt;
This is much less common, but it might help to know that &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; doesn’t have to run on the same system as RT itself. It just needs to be able to connect to RT’s web interface. If you don’t have any other options, you can install the RT software on a different system that receives email, and configure &#039;&#039;that&#039;&#039; system to run &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; and pass it on to the RT server. To do that, install the [https://metacpan.org/pod/RT::Client::CLI RT::Client::CLI] Perl package on the mail server. For example, you could install cpanminus, then run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cpanm --sudo RT::Client::CLI&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s background jobs ==&lt;br /&gt;
&lt;br /&gt;
Create a file &amp;lt;code&amp;gt;/etc/cron.d/rt&amp;lt;/code&amp;gt; with the following content. You may edit all of the time fields as you see fit. Refer to the crontab(5) man page for details about their definitions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Update the fulltext index with new ticket data&lt;br /&gt;
*/3 *   *   *   *   rt    /opt/rt5/sbin/rt-fulltext-indexer&lt;br /&gt;
# Email out dashboards that users have subscribed to&lt;br /&gt;
0   *   *   *   *   rt    /opt/rt5/sbin/rt-email-dashboards&lt;br /&gt;
# Clean old sessions from the database&lt;br /&gt;
10  3   *   *   *   rt    /opt/rt5/sbin/rt-clean-sessions --older 8d&lt;br /&gt;
# Email out weekly digests for users who have requested it&lt;br /&gt;
50  4   *   *   Mon rt    /opt/rt5/sbin/rt-email-digest -m weekly&lt;br /&gt;
# Email out daily digests for users who have requested it&lt;br /&gt;
50  5   *   *   *   rt    /opt/rt5/sbin/rt-email-digest -m daily&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Set up RT ==&lt;br /&gt;
&lt;br /&gt;
If you’ve gotten this far, congratulations, your RT install is really done now. You can start setting up RT with users, groups, queues, and business logic. [[Main Page|Head back to the main page]] to start exploring those topics.&lt;/div&gt;</summary>
		<author><name>Brett</name></author>
	</entry>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=ManualInstallation&amp;diff=27097</id>
		<title>ManualInstallation</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=ManualInstallation&amp;diff=27097"/>
		<updated>2022-10-12T17:17:01Z</updated>

		<summary type="html">&lt;p&gt;Brett: update for 5.0.3 release&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Prev: [[ManualRequirements]] — Up: [[UserManual]] — Next: [[ManualApacheConfig]]&lt;br /&gt;
&lt;br /&gt;
This guide walks you through installing RT from source on a modern, popular Linux distro. Specifically, that means a distribution based on Debian or Red Hat that’s been released since around 2020.&lt;br /&gt;
&lt;br /&gt;
This guide assumes:&lt;br /&gt;
&lt;br /&gt;
* You can install packages generally available in Debian/Ubuntu or Red Hat/Fedora/CentOS.&lt;br /&gt;
* You want to install RT, and all of its Perl dependencies, from source to get the latest versions. (This is a trade-off. It means the boundaries of your install will be very clear, but you won’t get security updates for RT or Perl modules from your distribution.)&lt;br /&gt;
* You are willing to install a couple of extra tools to manage the RT installation similarly to how you would in other packaging systems (like PyPI, npm, etc.).&lt;br /&gt;
* You are willing to do a relatively maximal install of RT, enabling all the options during installation and then setting what you need in the configuration. (You could save a little space and time by being pickier about your options, but then that complicates the guide and makes it harder to turn those options on later if you want.)&lt;br /&gt;
* You are using a regular user account on the Linux system that can get superuser privileges with sudo.&lt;br /&gt;
&lt;br /&gt;
== Install the base dependencies ==&lt;br /&gt;
&lt;br /&gt;
These are required by RT, either to run or to install the dependencies.&lt;br /&gt;
&lt;br /&gt;
=== Debian/Ubuntu ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo apt install autoconf build-essential cpanminus curl libexpat-dev libgd-dev libssl-dev libz-dev gnupg graphviz multiwatch openssl perl w3m&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Red Hat Enterprise Linux ===&lt;br /&gt;
&lt;br /&gt;
These instructions are for RHEL specifically. For RHEL-derived distributions like CentOS and Rocky, go to the next section.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;MAJDISTVER=&amp;quot;$(. /etc/os-release &amp;amp;&amp;amp; echo &amp;quot;${VERSION_ID%%.*}&amp;quot;)&amp;quot;&lt;br /&gt;
sudo subscription-manager repos --enable &amp;quot;codeready-builder-for-rhel-$MAJDISTVER-$(arch)-rpms&amp;quot;&lt;br /&gt;
sudo dnf install &amp;quot;https://dl.fedoraproject.org/pub/epel/epel-release-latest-$MAJDISTVER.noarch.rpm&amp;quot;&lt;br /&gt;
sudo dnf install patch tar which gcc gcc-c++ perl-core perl-App-cpanminus graphviz expat-devel gd-devel multiwatch openssl openssl-devel w3m&lt;br /&gt;
sudo sed -i~ &#039;/^SELINUX=/ c SELINUX=disabled&#039; /etc/selinux/config&lt;br /&gt;
sudo setenforce 0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Turning off SELinux enforcement is required on Red Hat-based distributions because, as of March 2022, nobody has written a policy for RT.)&lt;br /&gt;
&lt;br /&gt;
=== RHEL Community Distributions: Fedora/CentOS/Rocky ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo dnf install epel-release&lt;br /&gt;
sudo dnf install patch tar which gcc gcc-c++ perl-core perl-App-cpanminus graphviz expat-devel gd-devel multiwatch openssl openssl-devel w3m&lt;br /&gt;
sudo sed -i~ &#039;/^SELINUX=/ c SELINUX=disabled&#039; /etc/selinux/config&lt;br /&gt;
sudo setenforce 0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Turning off SELinux enforcement is required on Red Hat-based distributions because, as of March 2022, nobody has written a policy for RT.)&lt;br /&gt;
&lt;br /&gt;
== Install a database ==&lt;br /&gt;
&lt;br /&gt;
You need access to a database server. It can be remote, or you can install a database server alongside RT. RT supports a few different databases, but the best supported options are PostgreSQL and MariaDB.&lt;br /&gt;
&lt;br /&gt;
=== Installing and configuring the PostgreSQL server ===&lt;br /&gt;
&lt;br /&gt;
If you want to install a fresh PostgreSQL database server alongside RT:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install postgresql&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install postgresql-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In order to set up RT’s database, you will need a PostgreSQL account that can create databases and roles and be authenticated with a password. If you don’t have that, you can create it by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo createuser --createdb --createrole --login --pwprompt rt_admin&amp;lt;/pre&amp;gt;&lt;br /&gt;
Set the password when prompted. Record this; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
=== Enable password authentication in PostgreSQL ===&lt;br /&gt;
&lt;br /&gt;
You need to consider this step whether you install the database locally, or use an existing one already running. RT supports connecting to PostgreSQL a few different ways, but authenticating with a username and password is simplest, and this guide is written based on that. Not all PostgreSQL installations allow this authentication method by default. You need to review your &amp;lt;code&amp;gt;pg_hba.conf&amp;lt;/code&amp;gt; file located at:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;/etc/postgresql/VERSION/main/pg_hba.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;/var/lib/pgsql/VERSION/data/pg_hba.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Replace &amp;lt;code&amp;gt;VERSION&amp;lt;/code&amp;gt; with the version of your PostgreSQL database. Add these two lines &#039;&#039;&#039;above&#039;&#039;&#039; any other lines that start with &amp;lt;code&amp;gt;host&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;host  rt5  rt_user   all  md5&lt;br /&gt;
host  rt5  rt_admin  all  md5&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This configuration will let &amp;lt;code&amp;gt;rt_user&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;rt_admin&amp;lt;/code&amp;gt; authorize themselves for the &amp;lt;code&amp;gt;rt5&amp;lt;/code&amp;gt; database using an &amp;lt;code&amp;gt;md5&amp;lt;/code&amp;gt; crypted password over a network connection (possibly using the localhost loopback network). You might be able to further restrict some of these fields for improved security, but doing so is outside the scope of this install guide. Refer to [https://www.postgresql.org/docs/current/auth-pg-hba-conf.html the pg_hba.conf documentation] for more details.&lt;br /&gt;
&lt;br /&gt;
Save your changes and reload the database:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo systemctl reload postgresql&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Installing the PostgreSQL client libraries ===&lt;br /&gt;
&lt;br /&gt;
These are required for RT to be able to talk to any PostgreSQL server.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install libpq-dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install postgresql-devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Once this is done you can skip ahead to installing RT.&lt;br /&gt;
&lt;br /&gt;
=== Installing and configuring the MariaDB server ===&lt;br /&gt;
&lt;br /&gt;
If you want to install a fresh MariaDB database server alongside RT:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install mariadb-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install mariadb-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In order to set up RT’s database, you will need a MySQL superuser account. To stay consistent with PostgreSQL, I suggest setting a password for it. You can do that by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo mysql mysql&lt;br /&gt;
MariaDB [mysql]&amp;amp;gt; GRANT ALL PRIVILEGES ON rt5.* TO rt_admin@localhost IDENTIFIED BY &#039;YourPassphraseHere&#039; WITH GRANT OPTION;&amp;lt;/pre&amp;gt;&lt;br /&gt;
Record your passphrase; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
=== Adjust MariaDB’s max_allowed_packet setting ===&lt;br /&gt;
&lt;br /&gt;
You need to consider this step whether you install the database locally, or use an existing one already running. [https://mariadb.com/kb/en/server-system-variables/#max_allowed_packet MariaDB’s &amp;lt;code&amp;gt;max_allowed_packet&amp;lt;/code&amp;gt; setting] functionally limits the size of attachments in RT. The default is 16MiB, which is too small for most installations. You can ultimately choose any setting you’re comfortable with; 64MiB here should allow most requests without being too open.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;echo -e &#039;[server]\nmax_allowed_packet=64M&#039; | sudo tee /etc/mysql/conf.d/max_allowed_packet.cnf&lt;br /&gt;
sudo systemctl reload mariadb&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;echo -e &#039;[server]\nmax_allowed_packet=64M&#039; | sudo tee /etc/my.cnf.d/max_allowed_packet.cnf&lt;br /&gt;
sudo systemctl reload mariadb&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Installing the MariaDB client libraries ===&lt;br /&gt;
&lt;br /&gt;
These are required for RT to be able to talk to any MariaDB server.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install libmariadb-dev libmariadb-dev-compat&amp;lt;/pre&amp;gt;&lt;br /&gt;
|On latest versions:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo dnf install mariadb-connector-c-devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you&#039;re on an older version that doesn&#039;t have that package:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo dnf install mariadb-devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Install RT ==&lt;br /&gt;
&lt;br /&gt;
=== Create RT system accounts ===&lt;br /&gt;
&lt;br /&gt;
This account will be used throughout the install process to control access to sensitive files. Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo groupadd --system rt&lt;br /&gt;
sudo useradd --system --home-dir=/opt/rt5/var --gid=rt rt&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Get and unpack the RT source code ===&lt;br /&gt;
&lt;br /&gt;
Download the latest source code using the link on the [https://bestpractical.com/download-page RT download page], extract it using &amp;lt;code&amp;gt;tar -xf&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt; into the source code directory to run the rest of the commands in this section. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;curl -O https://download.bestpractical.com/pub/rt/release/rt-5.0.3.tar.gz&lt;br /&gt;
tar -xf rt-5.0.3.tar.gz&lt;br /&gt;
cd rt-5.0.3&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Pre-configure RT ===&lt;br /&gt;
&lt;br /&gt;
This command will detect some information about your system in order to install RT properly, and decide which set of dependencies to install. Here’s what the different parts of our command are doing:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;PERL=…&amp;lt;/code&amp;gt; configures RT to run under Perl with some options that load its dependencies from a dedicated directory. The &amp;lt;code&amp;gt;/opt/rt5&amp;lt;/code&amp;gt; part of this string should match your &amp;lt;code&amp;gt;prefix&amp;lt;/code&amp;gt; setting (see next item). If you know you want to use a specific Perl installed on your system, you can specify its full path instead of the plain &amp;lt;code&amp;gt;perl&amp;lt;/code&amp;gt; here.&lt;br /&gt;
* &amp;lt;code&amp;gt;--prefix=/opt/rt5&amp;lt;/code&amp;gt; sets the directory where RT will install all of its libraries, tools, and supporting files. You can choose another path if you like.&lt;br /&gt;
* &amp;lt;code&amp;gt;--with-db-type=TYPE&amp;lt;/code&amp;gt; - Replace &amp;lt;code&amp;gt;TYPE&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;Pg&amp;lt;/code&amp;gt; for PostgreSQL, or &amp;lt;code&amp;gt;mysql&amp;lt;/code&amp;gt; for MariaDB.&lt;br /&gt;
* &amp;lt;code&amp;gt;--with-web-user=rt --with-web-group=rt&amp;lt;/code&amp;gt; installs RT using the dedicated accounts we created earlier.&lt;br /&gt;
* The rest of the options tell RT to install additional dependencies for optional features.&lt;br /&gt;
&lt;br /&gt;
Make sure you have &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt;ed into the RT source directory, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;PERL=&amp;quot;/usr/bin/env -S perl -I/opt/rt5/local/lib/perl5&amp;quot; ./configure --prefix=/opt/rt5 --with-db-type=TYPE --with-web-user=rt --with-web-group=rt --with-attachment-store=disk --enable-externalauth --enable-gd --enable-graphviz --enable-gpg --enable-smime&amp;lt;/pre&amp;gt;&lt;br /&gt;
For more background, [https://docs.bestpractical.com/rt/latest/configure.html refer to the RT configure options documentation].&lt;br /&gt;
&lt;br /&gt;
=== Install RT and its Perl dependencies ===&lt;br /&gt;
&lt;br /&gt;
This command will download, build, and install all of the Perl modules necessary to run RT with the configuration you set above. Here’s what the different parts of the command are doing:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;make dirs&amp;lt;/code&amp;gt; creates RT&#039;s directory structure, so we can install dependencies inside it.&lt;br /&gt;
* &amp;lt;code&amp;gt;make fixdeps&amp;lt;/code&amp;gt; actually installs those dependencies.&lt;br /&gt;
* &amp;lt;code&amp;gt;RT_FIX_DEPS_CMD=…&amp;lt;/code&amp;gt; tells RT to use cpanminus to install dependencies (instead of the older, default &amp;lt;code&amp;gt;cpan&amp;lt;/code&amp;gt; command) inside RT&#039;s directory structure.&lt;br /&gt;
* &amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt; installs all of RT’s files under &amp;lt;code&amp;gt;/opt/rt5&amp;lt;/code&amp;gt; (or the prefix directory you set earlier). It will only run if &amp;lt;code&amp;gt;fixdeps&amp;lt;/code&amp;gt; succeeded.&lt;br /&gt;
&lt;br /&gt;
Make sure you have &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt;ed into the RT source directory, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo make dirs&lt;br /&gt;
make fixdeps RT_FIX_DEPS_CMD=&amp;quot;cpanm --sudo --local-lib-contained=/opt/rt5/local&amp;quot;&lt;br /&gt;
sudo make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
If it works, the command will eventually output a message that says “Congratulations. RT is now installed.” followed by instructions about configuring and setting up the database. We’ll do that next.&lt;br /&gt;
&lt;br /&gt;
=== Configure RT ===&lt;br /&gt;
&lt;br /&gt;
[https://docs.bestpractical.com/rt/latest/RT_Config.html RT has many configuration options.] You can put configuration options in the file &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/code&amp;gt;, or in individual files under &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.d/&amp;lt;/code&amp;gt;. Use an editor to save all the text below to &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/code&amp;gt; (you can just overwrite the existing file, or add this to the bottom of what’s there) and then fill in settings for your site everywhere the text &amp;lt;code&amp;gt;EDIT WITH&amp;lt;/code&amp;gt; appears.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Single-quote all values EXCEPT the special value `undef`&lt;br /&gt;
# that turns off a setting.&lt;br /&gt;
&lt;br /&gt;
# rtname appears in ticket email subjects. It needs to be globally unique,&lt;br /&gt;
# so use your organization&#039;s domain name.&lt;br /&gt;
Set($rtname, &#039;EDIT WITH yourdomain.example.com&#039;);&lt;br /&gt;
# Organization is used in the database for ticket links, etc. It also needs to&lt;br /&gt;
# be globally unique, so use your organization&#039;s domain name.&lt;br /&gt;
Set($Organization, &#039;EDIT WITH yourdomain.example.com&#039;);&lt;br /&gt;
# WebDomain is domain name of the RT web server. RT uses it to construct links&lt;br /&gt;
# and defend against CSRFs.&lt;br /&gt;
Set($WebDomain, &#039;EDIT WITH rt.yourdomain.example.com&#039;);&lt;br /&gt;
# WebPort is the port where the RT web server runs. Edit the number below if&lt;br /&gt;
# you&#039;re not using the standard HTTPS port.&lt;br /&gt;
Set($WebPort, &#039;443&#039;);&lt;br /&gt;
# WebPath is the path where the RT web server runs on your WebDomain.&lt;br /&gt;
# Edit the path below if you&#039;re using a specific path.&lt;br /&gt;
Set($WebPath, &#039;/&#039;);&lt;br /&gt;
&lt;br /&gt;
# DatabaseUser is the name of the database account RT uses to read and store&lt;br /&gt;
# data. &#039;rt_user&#039; is the default but you can change it if you like.&lt;br /&gt;
# DO NOT use the &#039;rt_admin&#039; superuser created in the instructions above.&lt;br /&gt;
Set($DatabaseUser, &#039;rt_user&#039;);&lt;br /&gt;
# DatabasePassword is the password for DatabaseUser.&lt;br /&gt;
Set($DatabasePassword, &#039;EDIT WITH SomePassphraseHere&#039;);&lt;br /&gt;
# DatabaseHost is the hostname of the database server RT should use.&lt;br /&gt;
# Change &#039;localhost&#039; if it lives on a different server.&lt;br /&gt;
Set($DatabaseHost, &#039;localhost&#039;);&lt;br /&gt;
# DatabasePort is the port number of the database server RT should use.&lt;br /&gt;
# `undef` means the default for that database. Change it if you&#039;re not&lt;br /&gt;
# using the standard port.&lt;br /&gt;
Set($DatabasePort, undef);&lt;br /&gt;
# DatabaseName is the name of RT&#039;s database hosted on DatabaseHost.&lt;br /&gt;
# &#039;rt5&#039; is the default but you can change it if you like.&lt;br /&gt;
Set($DatabaseName, &#039;rt5&#039;);&lt;br /&gt;
# DatabaseAdmin is the name of the user in the database used to perform&lt;br /&gt;
# major administrative tasks. Change &#039;rt_admin&#039; if you&#039;re using a user&lt;br /&gt;
# besides the one created in this guide.&lt;br /&gt;
Set($DatabaseAdmin, &#039;rt_admin&#039;);&lt;br /&gt;
&lt;br /&gt;
# RT can log to syslog, stderr, and/or a dedicated file.&lt;br /&gt;
# Log settings are used both by the primary server and by command line&lt;br /&gt;
# tools like rt-crontool, rt-ldapimport, etc.&lt;br /&gt;
# You set all of RT&#039;s $LogTo* paramaters to a standard log level: &#039;debug&#039;,&lt;br /&gt;
# &#039;info&#039;, &#039;notice&#039;, &#039;warning&#039;, &#039;error&#039;, &#039;critical&#039;, &#039;alert&#039;, or &#039;emergency&#039;.&lt;br /&gt;
# For a modern install, I recommend logging primarily to syslog, so it goes&lt;br /&gt;
# to journald where it&#039;s easy to query and automatically gets rotated.&lt;br /&gt;
Set($LogToSyslog, &#039;info&#039;);&lt;br /&gt;
&lt;br /&gt;
# When the RT server logs to stderr, that usually goes to your web server&#039;s&lt;br /&gt;
# error log. Command line tools log to their own stderr. Setting this to&lt;br /&gt;
# &#039;warning&#039; or &#039;error&#039; helps ensure you get notified if RT&#039;s cron jobs&lt;br /&gt;
# encounter problems.&lt;br /&gt;
Set($LogToSTDERR, &#039;warning&#039;);&lt;br /&gt;
&lt;br /&gt;
# Turn off optional features that require additional configuration.&lt;br /&gt;
# If you want to use these, refer to the RT_Config documentation for&lt;br /&gt;
# instructions on how to set them up.&lt;br /&gt;
Set(%GnuPG, &#039;Enable&#039; =&amp;gt; &#039;0&#039;);&lt;br /&gt;
Set(%SMIME, &#039;Enable&#039; =&amp;gt; &#039;0&#039;);&lt;br /&gt;
&lt;br /&gt;
# Perl expects to find this 1 at the end of the file.&lt;br /&gt;
1;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;RT_SiteConfig.pm&amp;lt;/code&amp;gt; is actually Perl code. RT runs the code directly to load the configuration. Any time you finish editing it, you can check that you didn’t make any syntax errors by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;perl -c /opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Set up RT’s database ===&lt;br /&gt;
&lt;br /&gt;
RT includes a tool to help you set up its database. By default, it connects to the database as an administrator to create the database and user that you configured in the previous step.&lt;br /&gt;
&lt;br /&gt;
(The instructions from &amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt; and RT’s README file tell you to run &amp;lt;code&amp;gt;make initialize-database&amp;lt;/code&amp;gt;. That just runs &amp;lt;code&amp;gt;rt-setup-database&amp;lt;/code&amp;gt; for you. Running the tool directly makes it easier to pass the options you need.)&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;--action=init&amp;lt;/code&amp;gt; tells the tool to create the user, the database, the tables inside it, and insert core data RT needs to function.&lt;br /&gt;
* &#039;&#039;&#039;If&#039;&#039;&#039; you are using an existing database server and the database adminstrator has already created the user account and database for RT, then you can add the &amp;lt;code&amp;gt;--skip-create&amp;lt;/code&amp;gt; option.&lt;br /&gt;
* &#039;&#039;&#039;If&#039;&#039;&#039; you have a less common database setup, this tool has additional options to give you finer-grained control over what steps are run and how. Refer to [https://docs.bestpractical.com/rt/latest/rt-setup-database.html the full rt-setup-database documentation] to learn more about those.&lt;br /&gt;
* The command reads files from RT’s &amp;lt;code&amp;gt;etc/&amp;lt;/code&amp;gt; directory by default, so the easiest way to run it is to &amp;lt;code&amp;gt;cd /opt/rt5&amp;lt;/code&amp;gt; first, and then it will find the necessary files automatically.&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /opt/rt5&lt;br /&gt;
sudo sbin/rt-setup-database --action=init&amp;lt;/pre&amp;gt;&lt;br /&gt;
Enter the password for your database administrator account when prompted.&lt;br /&gt;
&lt;br /&gt;
=== Set up fulltext indexing ===&lt;br /&gt;
&lt;br /&gt;
Fulltext indexing speeds up searches for ticket content, which makes RT a lot nicer to use.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;--noask&amp;lt;/code&amp;gt; uses the default names for the index, which will be fine for a new install and simplifies the setup.&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo /opt/rt5/sbin/rt-setup-fulltext-index --noask&amp;lt;/pre&amp;gt;&lt;br /&gt;
Enter the password for your database administrator account when prompted. The end of the process will output some RT configuration that looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;### EXAMPLE OUTPUT ONLY - Don&#039;t use this directly!&lt;br /&gt;
Set( %FullTextSearch,&lt;br /&gt;
    Enable     =&amp;gt; 1,&lt;br /&gt;
    Indexed    =&amp;gt; 1,&lt;br /&gt;
    # Additional output from rt-setup-fulltext-index should be here.&lt;br /&gt;
    # The configuration varies by database type.&lt;br /&gt;
);&amp;lt;/pre&amp;gt;&lt;br /&gt;
Copy the output generated when you run &amp;lt;code&amp;gt;rt-setup-fulltext-index&amp;lt;/code&amp;gt; and save it to the file &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.d/FulltextIndex.pm&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Set permissions ===&lt;br /&gt;
&lt;br /&gt;
All of RT’s configuration files should be readable by the user that runs the web server, and no other users, in order to protect sensitive information like the database password. RT provides a command to set permissions appropriately according to your distribution and configuration. &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt; to the directory where you extracted the RT source code, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd rt-5.0.3&lt;br /&gt;
sudo make fixperms&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Verify the installation ===&lt;br /&gt;
&lt;br /&gt;
If everything has gone well, then you should be able to set a password for RT’s &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; user. You’ll use this later to log in to the web interface and continue setting up your system. Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo /opt/rt5/sbin/rt-passwd root&amp;lt;/pre&amp;gt;&lt;br /&gt;
Set the password when prompted. Record this; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
== Set up RT FastCGI service ==&lt;br /&gt;
&lt;br /&gt;
=== Create the RT service ===&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo systemctl edit --force --full rt-server.service&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This opens an editor to define the RT service to systemd. Use the editor to add this text to the file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[Unit]&lt;br /&gt;
Description=RT FCGI server&lt;br /&gt;
&lt;br /&gt;
[Service]&lt;br /&gt;
# The --forks option is the number of RT servers to run in parallel.&lt;br /&gt;
# 3 should be good for most initial installs. You can increase this&lt;br /&gt;
# number later if needed for performance.&lt;br /&gt;
ExecStart=/usr/bin/multiwatch --forks=3 --signal=TERM -- /opt/rt5/sbin/rt-server.fcgi&lt;br /&gt;
StandardInput=socket&lt;br /&gt;
User=rt&lt;br /&gt;
UMask=027&lt;br /&gt;
&lt;br /&gt;
CapabilityBoundingSet=&lt;br /&gt;
DevicePolicy=closed&lt;br /&gt;
PrivateMounts=true&lt;br /&gt;
PrivateNetwork=false&lt;br /&gt;
PrivateTmp=true&lt;br /&gt;
PrivateUsers=true&lt;br /&gt;
ProtectControlGroups=true&lt;br /&gt;
ProtectHome=true&lt;br /&gt;
ProtectSystem=full&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save the file and close your editor.&lt;br /&gt;
&lt;br /&gt;
=== Create the RT socket ===&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo systemctl edit --force --full rt-server.socket&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This opens an editor to define the RT socket to systemd. Use the editor to add this text to the file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[Unit]&lt;br /&gt;
Description=RT FCGI server socket&lt;br /&gt;
Wants=network.target&lt;br /&gt;
After=network.target&lt;br /&gt;
Before=apache2.service httpd.service nginx.service&lt;br /&gt;
&lt;br /&gt;
[Install]&lt;br /&gt;
WantedBy=sockets.target&lt;br /&gt;
&lt;br /&gt;
[Socket]&lt;br /&gt;
# ListenStream defines the address and port where the RT FastCGI server listens.&lt;br /&gt;
# This is NOT the web server itself, so don&#039;t make this port 80, 443, etc.&lt;br /&gt;
# You may edit this if you like, but note:&lt;br /&gt;
# Connections are unencrypted. You should only listen on a secure network&lt;br /&gt;
# interface.&lt;br /&gt;
# The server can only accept a single socket. You cannot specify more than&lt;br /&gt;
# one ListenStream address.&lt;br /&gt;
ListenStream=[::1]:5000&lt;br /&gt;
Accept=no&lt;br /&gt;
FreeBind=yes&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save the file and close your editor.&lt;br /&gt;
&lt;br /&gt;
=== Enable the RT socket ===&lt;br /&gt;
&lt;br /&gt;
Start the server socket and enable it on future boots:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo systemctl enable --now rt-server.socket&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s web server ==&lt;br /&gt;
&lt;br /&gt;
Fully documenting how to set up a web server configured for your network with encryption is outside the scope of this guide. This page only highlights the configuration you need to pass web requests onto the RT FastCGI service.&lt;br /&gt;
&lt;br /&gt;
=== nginx ===&lt;br /&gt;
&lt;br /&gt;
Make sure you have the necessary packages installed:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install nginx&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install nginx&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In the &amp;lt;code&amp;gt;http server&amp;lt;/code&amp;gt; configuration blocks where you want to serve RT, add a configuration block like this, &#039;&#039;&#039;above&#039;&#039;&#039; any other &amp;lt;code&amp;gt;location&amp;lt;/code&amp;gt; blocks:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# The location path should match the WebPath in your RT site configuration.&lt;br /&gt;
location / {&lt;br /&gt;
  include /etc/nginx/fastcgi.conf;&lt;br /&gt;
  # SCRIPT_NAME should match RT&#039;s WebPath, without a trailing slash.&lt;br /&gt;
  # This means when WebPath is /, it&#039;s the empty string &amp;quot;&amp;quot;.&lt;br /&gt;
  fastcgi_param SCRIPT_NAME &amp;quot;&amp;quot;;&lt;br /&gt;
  # This network location should match the ListenStream in rt-server.socket.&lt;br /&gt;
  fastcgi_pass localhost:5000;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you&#039;re doing a fresh install, the default &amp;lt;code&amp;gt;http server&amp;lt;/code&amp;gt; configuration location varies by distribution:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|Edit &amp;lt;code&amp;gt;/etc/nginx/sites-available/default&amp;lt;/code&amp;gt;&lt;br /&gt;
|Add a new file &amp;lt;code&amp;gt;/etc/nginx/default.d/rt-server.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
After you’ve edited your configuration, load it by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo systemctl reload nginx&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once this is done you can skip ahead to Verify the web interface.&lt;br /&gt;
&lt;br /&gt;
=== Apache httpd ===&lt;br /&gt;
&lt;br /&gt;
Make sure you have the necessary packages installed, and the proxy_fcgi module enabled:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install apache2&lt;br /&gt;
sudo a2enmod proxy&lt;br /&gt;
sudo a2enmod proxy_fcgi&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install httpd&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In the &amp;lt;code&amp;gt;&amp;amp;lt;VirtualHost&amp;amp;gt;&amp;lt;/code&amp;gt; configuration blocks where you want to serve RT, add a configuration block like this, &#039;&#039;&#039;above&#039;&#039;&#039; any other &amp;lt;code&amp;gt;Alias&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;ProxyPass&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;ScriptAlias&amp;lt;/code&amp;gt; lines:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# SCRIPT_NAME should match RT&#039;s WebPath, without a trailing slash.&lt;br /&gt;
# This means when WebPath is /, it&#039;s the empty string &amp;quot;&amp;quot;.&lt;br /&gt;
ProxyFCGISetEnvIf true SCRIPT_NAME &amp;quot;&amp;quot;&lt;br /&gt;
# The location path in the first argument should match the WebPath in your&lt;br /&gt;
# RT site configuration.  The network location after fcgi:// should match&lt;br /&gt;
# the ListenStream in rt-server.socket.&lt;br /&gt;
ProxyPass / fcgi://localhost:5000/&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you&#039;re doing a fresh install, the default &amp;lt;code&amp;gt;&amp;amp;lt;VirtualHost&amp;amp;gt;&amp;lt;/code&amp;gt; configuration location varies by distribution and whether or not you&#039;re using HTTPS:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|With HTTPS: &amp;lt;code&amp;gt;/etc/apache2/sites-available/default-ssl.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
With plain HTTP: &amp;lt;code&amp;gt;/etc/apache2/sites-available/000-default.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
|With HTTPS: &amp;lt;code&amp;gt;/etc/httpd/conf.d/ssl.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
With plain HTTP: Write a new file &amp;lt;code&amp;gt;/etc/httpd/conf.d/vhost_RT.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
After you’ve edited your configuration, load it by running:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo systemctl reload apache2&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo systemctl reload httpd&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Verify the web interface ===&lt;br /&gt;
&lt;br /&gt;
You should be able to visit your web server in your browser, and be presented with RT’s login screen. You should be able to log in with username &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; and the password you set previously.&lt;br /&gt;
&lt;br /&gt;
If the web server returns a 502 Bad Gateway response, it&#039;s having trouble connecting to the RT FCGI server. Check the error logs for your web server:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 33%;&amp;quot;|nginx&lt;br /&gt;
! style=&amp;quot;width: 33%;&amp;quot;|Apache on Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 33%;&amp;quot;|httpd on Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;/var/log/nginx/error.log&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;/var/log/apache2/error.log&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;/var/log/httpd/error_log&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For all kinds of errors, you can check the logs for the RT FCGI server and its socket:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo journalctl --unit rt-server.\*&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s mail server ==&lt;br /&gt;
&lt;br /&gt;
RT both can both send and receive ticket updates via email. Unfortunately, there are too many variables to document a useful setup process here: getting this working usually requires creating DNS records, and coordinating with existing mail servers, which will be the main constraint on your setup. Instead this guide provides a brief overview of how the integration works, and where the connection points are that you likely need to work on.&lt;br /&gt;
&lt;br /&gt;
=== Sending Mail ===&lt;br /&gt;
&lt;br /&gt;
RT only knows how to send mail by passing it off to another program on the system. It cannot connect or authenticate directly to external mail servers. In the default configuration, RT runs the standard &amp;lt;code&amp;gt;sendmail&amp;lt;/code&amp;gt; command. There are [https://docs.bestpractical.com/rt/latest/RT_Config.html#Outgoing-mail configuration options to send mail through different commands] if you need.&lt;br /&gt;
&lt;br /&gt;
The most common setup is to install and configure a proper Mail Transfer Agent (MTA) like Postfix or Exim, and then configure it to send mail to the wider Internet as you need. This works well because the MTAs are robust and well-tested; they have flexible configuration to let you send mail out by relaying to other mail servers you specify with optional authentication; and most distributions install one by default anyway. The only hard part is configuring the MTA to send mail following your site’s policies.&lt;br /&gt;
&lt;br /&gt;
Other software is available that provides a slimmer version of the &amp;lt;code&amp;gt;sendmail&amp;lt;/code&amp;gt; command that connects to an external mail server for you, like msmtp. These programs are usually easier to configure than an MTA, but they often lose email permanently if they can’t connect to the external server at the time it’s sent. (MTAs keep email queued locally until they successfully deliver it to another server.)&lt;br /&gt;
&lt;br /&gt;
=== Receiving email ===&lt;br /&gt;
&lt;br /&gt;
RT installs a command called &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; that receives an email on standard input and posts it to RT’s REST web interface, where it gets saved in the database and added to a ticket. You need to arrange for a way to send incoming email to this command.&lt;br /&gt;
&lt;br /&gt;
The most common setup is to have an MTA on the same box as RT receive email directly, and then set up mail aliases that call this command when mail comes in. Example &amp;lt;code&amp;gt;/etc/aliases&amp;lt;/code&amp;gt; entries look like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rt: &amp;quot;|/opt/rt5/bin/rt-mailgate --queue general --action correspond --url https://rt.yourdomain.example.com/&amp;quot;&lt;br /&gt;
rt-comment: &amp;quot;|/opt/rt5/bin/rt-mailgate --queue general --action comment --url https://rt.yourdomain.example.com/&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
This works well because, again, you’re probably running an MTA anyway; and the MTA can hold and queue mail if it comes in while RT is down for any reason, giving you a buffer against downtime.&lt;br /&gt;
&lt;br /&gt;
Another common option is to periodically run a tool that fetches mail using a protocol like IMAP, like fetchmail or getmail, and passes it on to &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt;. This is less common because it requires setting up another tool to run, and securely storing another set of mail server credentials. But it is useful when local policy prevents the RT server from receiving email directly.&lt;br /&gt;
&lt;br /&gt;
This is much less common, but it might help to know that &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; doesn’t have to run on the same system as RT itself. It just needs to be able to connect to RT’s web interface. If you don’t have any other options, you can install the RT software on a different system that receives email, and configure &#039;&#039;that&#039;&#039; system to run &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; and pass it on to the RT server. To do that, just repeat the installation instructions above, skipping the steps about installing the database and web server.&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s background jobs ==&lt;br /&gt;
&lt;br /&gt;
Create a file &amp;lt;code&amp;gt;/etc/cron.d/rt&amp;lt;/code&amp;gt; with the following content. You may edit all of the time fields as you see fit. Refer to the crontab(5) man page for details about their definitions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Update the fulltext index with new ticket data&lt;br /&gt;
*/3 *   *   *   *   rt    /opt/rt5/sbin/rt-fulltext-indexer&lt;br /&gt;
# Email out dashboards that users have subscribed to&lt;br /&gt;
0   *   *   *   *   rt    /opt/rt5/sbin/rt-email-dashboards&lt;br /&gt;
# Clean old sessions from the database&lt;br /&gt;
10  3   *   *   *   rt    /opt/rt5/sbin/rt-clean-sessions --older 8d&lt;br /&gt;
# Email out weekly digests for users who have requested it&lt;br /&gt;
50  4   *   *   Mon rt    /opt/rt5/sbin/rt-email-digest -m weekly&lt;br /&gt;
# Email out daily digests for users who have requested it&lt;br /&gt;
50  5   *   *   *   rt    /opt/rt5/sbin/rt-email-digest -m daily&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Set up RT ==&lt;br /&gt;
&lt;br /&gt;
If you’ve gotten this far, congratulations, your RT install is really done now. You can start setting up RT with users, groups, queues, and business logic. [[Main Page|Head back to the main page]] to start exploring those topics.&lt;/div&gt;</summary>
		<author><name>Brett</name></author>
	</entry>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=ManualInstallation&amp;diff=27096</id>
		<title>ManualInstallation</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=ManualInstallation&amp;diff=27096"/>
		<updated>2022-10-12T17:15:38Z</updated>

		<summary type="html">&lt;p&gt;Brett: prefer a static User to avoid NoNewPrivileges and problems with sendmailpipe&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Prev: [[ManualRequirements]] — Up: [[UserManual]] — Next: [[ManualApacheConfig]]&lt;br /&gt;
&lt;br /&gt;
This guide walks you through installing RT from source on a modern, popular Linux distro. Specifically, that means a distribution based on Debian or Red Hat that’s been released since around 2020.&lt;br /&gt;
&lt;br /&gt;
This guide assumes:&lt;br /&gt;
&lt;br /&gt;
* You can install packages generally available in Debian/Ubuntu or Red Hat/Fedora/CentOS.&lt;br /&gt;
* You want to install RT, and all of its Perl dependencies, from source to get the latest versions. (This is a trade-off. It means the boundaries of your install will be very clear, but you won’t get security updates for RT or Perl modules from your distribution.)&lt;br /&gt;
* You are willing to install a couple of extra tools to manage the RT installation similarly to how you would in other packaging systems (like PyPI, npm, etc.).&lt;br /&gt;
* You are willing to do a relatively maximal install of RT, enabling all the options during installation and then setting what you need in the configuration. (You could save a little space and time by being pickier about your options, but then that complicates the guide and makes it harder to turn those options on later if you want.)&lt;br /&gt;
* You are using a regular user account on the Linux system that can get superuser privileges with sudo.&lt;br /&gt;
&lt;br /&gt;
== Install the base dependencies ==&lt;br /&gt;
&lt;br /&gt;
These are required by RT, either to run or to install the dependencies.&lt;br /&gt;
&lt;br /&gt;
=== Debian/Ubuntu ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo apt install autoconf build-essential cpanminus curl libexpat-dev libgd-dev libssl-dev libz-dev gnupg graphviz multiwatch openssl perl w3m&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Red Hat Enterprise Linux ===&lt;br /&gt;
&lt;br /&gt;
These instructions are for RHEL specifically. For RHEL-derived distributions like CentOS and Rocky, go to the next section.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;MAJDISTVER=&amp;quot;$(. /etc/os-release &amp;amp;&amp;amp; echo &amp;quot;${VERSION_ID%%.*}&amp;quot;)&amp;quot;&lt;br /&gt;
sudo subscription-manager repos --enable &amp;quot;codeready-builder-for-rhel-$MAJDISTVER-$(arch)-rpms&amp;quot;&lt;br /&gt;
sudo dnf install &amp;quot;https://dl.fedoraproject.org/pub/epel/epel-release-latest-$MAJDISTVER.noarch.rpm&amp;quot;&lt;br /&gt;
sudo dnf install patch tar which gcc gcc-c++ perl-core perl-App-cpanminus graphviz expat-devel gd-devel multiwatch openssl openssl-devel w3m&lt;br /&gt;
sudo sed -i~ &#039;/^SELINUX=/ c SELINUX=disabled&#039; /etc/selinux/config&lt;br /&gt;
sudo setenforce 0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Turning off SELinux enforcement is required on Red Hat-based distributions because, as of March 2022, nobody has written a policy for RT.)&lt;br /&gt;
&lt;br /&gt;
=== RHEL Community Distributions: Fedora/CentOS/Rocky ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo dnf install epel-release&lt;br /&gt;
sudo dnf install patch tar which gcc gcc-c++ perl-core perl-App-cpanminus graphviz expat-devel gd-devel multiwatch openssl openssl-devel w3m&lt;br /&gt;
sudo sed -i~ &#039;/^SELINUX=/ c SELINUX=disabled&#039; /etc/selinux/config&lt;br /&gt;
sudo setenforce 0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Turning off SELinux enforcement is required on Red Hat-based distributions because, as of March 2022, nobody has written a policy for RT.)&lt;br /&gt;
&lt;br /&gt;
== Install a database ==&lt;br /&gt;
&lt;br /&gt;
You need access to a database server. It can be remote, or you can install a database server alongside RT. RT supports a few different databases, but the best supported options are PostgreSQL and MariaDB.&lt;br /&gt;
&lt;br /&gt;
=== Installing and configuring the PostgreSQL server ===&lt;br /&gt;
&lt;br /&gt;
If you want to install a fresh PostgreSQL database server alongside RT:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install postgresql&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install postgresql-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In order to set up RT’s database, you will need a PostgreSQL account that can create databases and roles and be authenticated with a password. If you don’t have that, you can create it by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo createuser --createdb --createrole --login --pwprompt rt_admin&amp;lt;/pre&amp;gt;&lt;br /&gt;
Set the password when prompted. Record this; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
=== Enable password authentication in PostgreSQL ===&lt;br /&gt;
&lt;br /&gt;
You need to consider this step whether you install the database locally, or use an existing one already running. RT supports connecting to PostgreSQL a few different ways, but authenticating with a username and password is simplest, and this guide is written based on that. Not all PostgreSQL installations allow this authentication method by default. You need to review your &amp;lt;code&amp;gt;pg_hba.conf&amp;lt;/code&amp;gt; file located at:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;/etc/postgresql/VERSION/main/pg_hba.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;/var/lib/pgsql/VERSION/data/pg_hba.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Replace &amp;lt;code&amp;gt;VERSION&amp;lt;/code&amp;gt; with the version of your PostgreSQL database. Add these two lines &#039;&#039;&#039;above&#039;&#039;&#039; any other lines that start with &amp;lt;code&amp;gt;host&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;host  rt5  rt_user   all  md5&lt;br /&gt;
host  rt5  rt_admin  all  md5&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This configuration will let &amp;lt;code&amp;gt;rt_user&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;rt_admin&amp;lt;/code&amp;gt; authorize themselves for the &amp;lt;code&amp;gt;rt5&amp;lt;/code&amp;gt; database using an &amp;lt;code&amp;gt;md5&amp;lt;/code&amp;gt; crypted password over a network connection (possibly using the localhost loopback network). You might be able to further restrict some of these fields for improved security, but doing so is outside the scope of this install guide. Refer to [https://www.postgresql.org/docs/current/auth-pg-hba-conf.html the pg_hba.conf documentation] for more details.&lt;br /&gt;
&lt;br /&gt;
Save your changes and reload the database:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo systemctl reload postgresql&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Installing the PostgreSQL client libraries ===&lt;br /&gt;
&lt;br /&gt;
These are required for RT to be able to talk to any PostgreSQL server.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install libpq-dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install postgresql-devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Once this is done you can skip ahead to installing RT.&lt;br /&gt;
&lt;br /&gt;
=== Installing and configuring the MariaDB server ===&lt;br /&gt;
&lt;br /&gt;
If you want to install a fresh MariaDB database server alongside RT:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install mariadb-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install mariadb-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In order to set up RT’s database, you will need a MySQL superuser account. To stay consistent with PostgreSQL, I suggest setting a password for it. You can do that by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo mysql mysql&lt;br /&gt;
MariaDB [mysql]&amp;amp;gt; GRANT ALL PRIVILEGES ON rt5.* TO rt_admin@localhost IDENTIFIED BY &#039;YourPassphraseHere&#039; WITH GRANT OPTION;&amp;lt;/pre&amp;gt;&lt;br /&gt;
Record your passphrase; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
=== Adjust MariaDB’s max_allowed_packet setting ===&lt;br /&gt;
&lt;br /&gt;
You need to consider this step whether you install the database locally, or use an existing one already running. [https://mariadb.com/kb/en/server-system-variables/#max_allowed_packet MariaDB’s &amp;lt;code&amp;gt;max_allowed_packet&amp;lt;/code&amp;gt; setting] functionally limits the size of attachments in RT. The default is 16MiB, which is too small for most installations. You can ultimately choose any setting you’re comfortable with; 64MiB here should allow most requests without being too open.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;echo -e &#039;[server]\nmax_allowed_packet=64M&#039; | sudo tee /etc/mysql/conf.d/max_allowed_packet.cnf&lt;br /&gt;
sudo systemctl reload mariadb&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;echo -e &#039;[server]\nmax_allowed_packet=64M&#039; | sudo tee /etc/my.cnf.d/max_allowed_packet.cnf&lt;br /&gt;
sudo systemctl reload mariadb&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Installing the MariaDB client libraries ===&lt;br /&gt;
&lt;br /&gt;
These are required for RT to be able to talk to any MariaDB server.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install libmariadb-dev libmariadb-dev-compat&amp;lt;/pre&amp;gt;&lt;br /&gt;
|On latest versions:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo dnf install mariadb-connector-c-devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you&#039;re on an older version that doesn&#039;t have that package:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo dnf install mariadb-devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Install RT ==&lt;br /&gt;
&lt;br /&gt;
=== Create RT system accounts ===&lt;br /&gt;
&lt;br /&gt;
This account will be used throughout the install process to control access to sensitive files. Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo groupadd --system rt&lt;br /&gt;
sudo useradd --system --home-dir=/opt/rt5/var --gid=rt rt&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Get and unpack the RT source code ===&lt;br /&gt;
&lt;br /&gt;
Download the latest source code using the link on the [https://bestpractical.com/download-page RT download page], extract it using &amp;lt;code&amp;gt;tar -xf&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt; into the source code directory to run the rest of the commands in this section. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;curl -O https://download.bestpractical.com/pub/rt/release/rt-5.0.2.tar.gz&lt;br /&gt;
tar -xf rt-5.0.2.tar.gz&lt;br /&gt;
cd rt-5.0.2&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Pre-configure RT ===&lt;br /&gt;
&lt;br /&gt;
This command will detect some information about your system in order to install RT properly, and decide which set of dependencies to install. Here’s what the different parts of our command are doing:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;PERL=…&amp;lt;/code&amp;gt; configures RT to run under Perl with some options that load its dependencies from a dedicated directory. The &amp;lt;code&amp;gt;/opt/rt5&amp;lt;/code&amp;gt; part of this string should match your &amp;lt;code&amp;gt;prefix&amp;lt;/code&amp;gt; setting (see next item). If you know you want to use a specific Perl installed on your system, you can specify its full path instead of the plain &amp;lt;code&amp;gt;perl&amp;lt;/code&amp;gt; here.&lt;br /&gt;
* &amp;lt;code&amp;gt;--prefix=/opt/rt5&amp;lt;/code&amp;gt; sets the directory where RT will install all of its libraries, tools, and supporting files. You can choose another path if you like.&lt;br /&gt;
* &amp;lt;code&amp;gt;--with-db-type=TYPE&amp;lt;/code&amp;gt; - Replace &amp;lt;code&amp;gt;TYPE&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;Pg&amp;lt;/code&amp;gt; for PostgreSQL, or &amp;lt;code&amp;gt;mysql&amp;lt;/code&amp;gt; for MariaDB.&lt;br /&gt;
* &amp;lt;code&amp;gt;--with-web-user=rt --with-web-group=rt&amp;lt;/code&amp;gt; installs RT using the dedicated accounts we created earlier.&lt;br /&gt;
* The rest of the options tell RT to install additional dependencies for optional features.&lt;br /&gt;
&lt;br /&gt;
Make sure you have &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt;ed into the RT source directory, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;PERL=&amp;quot;/usr/bin/env -S perl -I/opt/rt5/local/lib/perl5&amp;quot; ./configure --prefix=/opt/rt5 --with-db-type=TYPE --with-web-user=rt --with-web-group=rt --with-attachment-store=disk --enable-externalauth --enable-gd --enable-graphviz --enable-gpg --enable-smime&amp;lt;/pre&amp;gt;&lt;br /&gt;
For more background, [https://docs.bestpractical.com/rt/latest/configure.html refer to the RT configure options documentation].&lt;br /&gt;
&lt;br /&gt;
=== Install RT and its Perl dependencies ===&lt;br /&gt;
&lt;br /&gt;
This command will download, build, and install all of the Perl modules necessary to run RT with the configuration you set above. Here’s what the different parts of the command are doing:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;make dirs&amp;lt;/code&amp;gt; creates RT&#039;s directory structure, so we can install dependencies inside it.&lt;br /&gt;
* &amp;lt;code&amp;gt;make fixdeps&amp;lt;/code&amp;gt; actually installs those dependencies.&lt;br /&gt;
* &amp;lt;code&amp;gt;RT_FIX_DEPS_CMD=…&amp;lt;/code&amp;gt; tells RT to use cpanminus to install dependencies (instead of the older, default &amp;lt;code&amp;gt;cpan&amp;lt;/code&amp;gt; command) inside RT&#039;s directory structure.&lt;br /&gt;
* &amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt; installs all of RT’s files under &amp;lt;code&amp;gt;/opt/rt5&amp;lt;/code&amp;gt; (or the prefix directory you set earlier). It will only run if &amp;lt;code&amp;gt;fixdeps&amp;lt;/code&amp;gt; succeeded.&lt;br /&gt;
&lt;br /&gt;
Make sure you have &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt;ed into the RT source directory, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo make dirs&lt;br /&gt;
make fixdeps RT_FIX_DEPS_CMD=&amp;quot;cpanm --sudo --local-lib-contained=/opt/rt5/local&amp;quot;&lt;br /&gt;
sudo make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
If it works, the command will eventually output a message that says “Congratulations. RT is now installed.” followed by instructions about configuring and setting up the database. We’ll do that next.&lt;br /&gt;
&lt;br /&gt;
=== Configure RT ===&lt;br /&gt;
&lt;br /&gt;
[https://docs.bestpractical.com/rt/latest/RT_Config.html RT has many configuration options.] You can put configuration options in the file &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/code&amp;gt;, or in individual files under &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.d/&amp;lt;/code&amp;gt;. Use an editor to save all the text below to &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/code&amp;gt; (you can just overwrite the existing file, or add this to the bottom of what’s there) and then fill in settings for your site everywhere the text &amp;lt;code&amp;gt;EDIT WITH&amp;lt;/code&amp;gt; appears.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Single-quote all values EXCEPT the special value `undef`&lt;br /&gt;
# that turns off a setting.&lt;br /&gt;
&lt;br /&gt;
# rtname appears in ticket email subjects. It needs to be globally unique,&lt;br /&gt;
# so use your organization&#039;s domain name.&lt;br /&gt;
Set($rtname, &#039;EDIT WITH yourdomain.example.com&#039;);&lt;br /&gt;
# Organization is used in the database for ticket links, etc. It also needs to&lt;br /&gt;
# be globally unique, so use your organization&#039;s domain name.&lt;br /&gt;
Set($Organization, &#039;EDIT WITH yourdomain.example.com&#039;);&lt;br /&gt;
# WebDomain is domain name of the RT web server. RT uses it to construct links&lt;br /&gt;
# and defend against CSRFs.&lt;br /&gt;
Set($WebDomain, &#039;EDIT WITH rt.yourdomain.example.com&#039;);&lt;br /&gt;
# WebPort is the port where the RT web server runs. Edit the number below if&lt;br /&gt;
# you&#039;re not using the standard HTTPS port.&lt;br /&gt;
Set($WebPort, &#039;443&#039;);&lt;br /&gt;
# WebPath is the path where the RT web server runs on your WebDomain.&lt;br /&gt;
# Edit the path below if you&#039;re using a specific path.&lt;br /&gt;
Set($WebPath, &#039;/&#039;);&lt;br /&gt;
&lt;br /&gt;
# DatabaseUser is the name of the database account RT uses to read and store&lt;br /&gt;
# data. &#039;rt_user&#039; is the default but you can change it if you like.&lt;br /&gt;
# DO NOT use the &#039;rt_admin&#039; superuser created in the instructions above.&lt;br /&gt;
Set($DatabaseUser, &#039;rt_user&#039;);&lt;br /&gt;
# DatabasePassword is the password for DatabaseUser.&lt;br /&gt;
Set($DatabasePassword, &#039;EDIT WITH SomePassphraseHere&#039;);&lt;br /&gt;
# DatabaseHost is the hostname of the database server RT should use.&lt;br /&gt;
# Change &#039;localhost&#039; if it lives on a different server.&lt;br /&gt;
Set($DatabaseHost, &#039;localhost&#039;);&lt;br /&gt;
# DatabasePort is the port number of the database server RT should use.&lt;br /&gt;
# `undef` means the default for that database. Change it if you&#039;re not&lt;br /&gt;
# using the standard port.&lt;br /&gt;
Set($DatabasePort, undef);&lt;br /&gt;
# DatabaseName is the name of RT&#039;s database hosted on DatabaseHost.&lt;br /&gt;
# &#039;rt5&#039; is the default but you can change it if you like.&lt;br /&gt;
Set($DatabaseName, &#039;rt5&#039;);&lt;br /&gt;
# DatabaseAdmin is the name of the user in the database used to perform&lt;br /&gt;
# major administrative tasks. Change &#039;rt_admin&#039; if you&#039;re using a user&lt;br /&gt;
# besides the one created in this guide.&lt;br /&gt;
Set($DatabaseAdmin, &#039;rt_admin&#039;);&lt;br /&gt;
&lt;br /&gt;
# RT can log to syslog, stderr, and/or a dedicated file.&lt;br /&gt;
# Log settings are used both by the primary server and by command line&lt;br /&gt;
# tools like rt-crontool, rt-ldapimport, etc.&lt;br /&gt;
# You set all of RT&#039;s $LogTo* paramaters to a standard log level: &#039;debug&#039;,&lt;br /&gt;
# &#039;info&#039;, &#039;notice&#039;, &#039;warning&#039;, &#039;error&#039;, &#039;critical&#039;, &#039;alert&#039;, or &#039;emergency&#039;.&lt;br /&gt;
# For a modern install, I recommend logging primarily to syslog, so it goes&lt;br /&gt;
# to journald where it&#039;s easy to query and automatically gets rotated.&lt;br /&gt;
Set($LogToSyslog, &#039;info&#039;);&lt;br /&gt;
&lt;br /&gt;
# When the RT server logs to stderr, that usually goes to your web server&#039;s&lt;br /&gt;
# error log. Command line tools log to their own stderr. Setting this to&lt;br /&gt;
# &#039;warning&#039; or &#039;error&#039; helps ensure you get notified if RT&#039;s cron jobs&lt;br /&gt;
# encounter problems.&lt;br /&gt;
Set($LogToSTDERR, &#039;warning&#039;);&lt;br /&gt;
&lt;br /&gt;
# Turn off optional features that require additional configuration.&lt;br /&gt;
# If you want to use these, refer to the RT_Config documentation for&lt;br /&gt;
# instructions on how to set them up.&lt;br /&gt;
Set(%GnuPG, &#039;Enable&#039; =&amp;gt; &#039;0&#039;);&lt;br /&gt;
Set(%SMIME, &#039;Enable&#039; =&amp;gt; &#039;0&#039;);&lt;br /&gt;
&lt;br /&gt;
# Perl expects to find this 1 at the end of the file.&lt;br /&gt;
1;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;RT_SiteConfig.pm&amp;lt;/code&amp;gt; is actually Perl code. RT runs the code directly to load the configuration. Any time you finish editing it, you can check that you didn’t make any syntax errors by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;perl -c /opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Set up RT’s database ===&lt;br /&gt;
&lt;br /&gt;
RT includes a tool to help you set up its database. By default, it connects to the database as an administrator to create the database and user that you configured in the previous step.&lt;br /&gt;
&lt;br /&gt;
(The instructions from &amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt; and RT’s README file tell you to run &amp;lt;code&amp;gt;make initialize-database&amp;lt;/code&amp;gt;. That just runs &amp;lt;code&amp;gt;rt-setup-database&amp;lt;/code&amp;gt; for you. Running the tool directly makes it easier to pass the options you need.)&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;--action=init&amp;lt;/code&amp;gt; tells the tool to create the user, the database, the tables inside it, and insert core data RT needs to function.&lt;br /&gt;
* &#039;&#039;&#039;If&#039;&#039;&#039; you are using an existing database server and the database adminstrator has already created the user account and database for RT, then you can add the &amp;lt;code&amp;gt;--skip-create&amp;lt;/code&amp;gt; option.&lt;br /&gt;
* &#039;&#039;&#039;If&#039;&#039;&#039; you have a less common database setup, this tool has additional options to give you finer-grained control over what steps are run and how. Refer to [https://docs.bestpractical.com/rt/latest/rt-setup-database.html the full rt-setup-database documentation] to learn more about those.&lt;br /&gt;
* The command reads files from RT’s &amp;lt;code&amp;gt;etc/&amp;lt;/code&amp;gt; directory by default, so the easiest way to run it is to &amp;lt;code&amp;gt;cd /opt/rt5&amp;lt;/code&amp;gt; first, and then it will find the necessary files automatically.&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /opt/rt5&lt;br /&gt;
sudo sbin/rt-setup-database --action=init&amp;lt;/pre&amp;gt;&lt;br /&gt;
Enter the password for your database administrator account when prompted.&lt;br /&gt;
&lt;br /&gt;
=== Set up fulltext indexing ===&lt;br /&gt;
&lt;br /&gt;
Fulltext indexing speeds up searches for ticket content, which makes RT a lot nicer to use.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;--noask&amp;lt;/code&amp;gt; uses the default names for the index, which will be fine for a new install and simplifies the setup.&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo /opt/rt5/sbin/rt-setup-fulltext-index --noask&amp;lt;/pre&amp;gt;&lt;br /&gt;
Enter the password for your database administrator account when prompted. The end of the process will output some RT configuration that looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;### EXAMPLE OUTPUT ONLY - Don&#039;t use this directly!&lt;br /&gt;
Set( %FullTextSearch,&lt;br /&gt;
    Enable     =&amp;gt; 1,&lt;br /&gt;
    Indexed    =&amp;gt; 1,&lt;br /&gt;
    # Additional output from rt-setup-fulltext-index should be here.&lt;br /&gt;
    # The configuration varies by database type.&lt;br /&gt;
);&amp;lt;/pre&amp;gt;&lt;br /&gt;
Copy the output generated when you run &amp;lt;code&amp;gt;rt-setup-fulltext-index&amp;lt;/code&amp;gt; and save it to the file &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.d/FulltextIndex.pm&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Set permissions ===&lt;br /&gt;
&lt;br /&gt;
All of RT’s configuration files should be readable by the user that runs the web server, and no other users, in order to protect sensitive information like the database password. RT provides a command to set permissions appropriately according to your distribution and configuration. &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt; to the directory where you extracted the RT source code, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd rt-5.0.2&lt;br /&gt;
sudo make fixperms&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Verify the installation ===&lt;br /&gt;
&lt;br /&gt;
If everything has gone well, then you should be able to set a password for RT’s &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; user. You’ll use this later to log in to the web interface and continue setting up your system. Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo /opt/rt5/sbin/rt-passwd root&amp;lt;/pre&amp;gt;&lt;br /&gt;
Set the password when prompted. Record this; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
== Set up RT FastCGI service ==&lt;br /&gt;
&lt;br /&gt;
=== Create the RT service ===&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo systemctl edit --force --full rt-server.service&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This opens an editor to define the RT service to systemd. Use the editor to add this text to the file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[Unit]&lt;br /&gt;
Description=RT FCGI server&lt;br /&gt;
&lt;br /&gt;
[Service]&lt;br /&gt;
# The --forks option is the number of RT servers to run in parallel.&lt;br /&gt;
# 3 should be good for most initial installs. You can increase this&lt;br /&gt;
# number later if needed for performance.&lt;br /&gt;
ExecStart=/usr/bin/multiwatch --forks=3 --signal=TERM -- /opt/rt5/sbin/rt-server.fcgi&lt;br /&gt;
StandardInput=socket&lt;br /&gt;
User=rt&lt;br /&gt;
UMask=027&lt;br /&gt;
&lt;br /&gt;
CapabilityBoundingSet=&lt;br /&gt;
DevicePolicy=closed&lt;br /&gt;
PrivateMounts=true&lt;br /&gt;
PrivateNetwork=false&lt;br /&gt;
PrivateTmp=true&lt;br /&gt;
PrivateUsers=true&lt;br /&gt;
ProtectControlGroups=true&lt;br /&gt;
ProtectHome=true&lt;br /&gt;
ProtectSystem=full&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save the file and close your editor.&lt;br /&gt;
&lt;br /&gt;
=== Create the RT socket ===&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo systemctl edit --force --full rt-server.socket&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This opens an editor to define the RT socket to systemd. Use the editor to add this text to the file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[Unit]&lt;br /&gt;
Description=RT FCGI server socket&lt;br /&gt;
Wants=network.target&lt;br /&gt;
After=network.target&lt;br /&gt;
Before=apache2.service httpd.service nginx.service&lt;br /&gt;
&lt;br /&gt;
[Install]&lt;br /&gt;
WantedBy=sockets.target&lt;br /&gt;
&lt;br /&gt;
[Socket]&lt;br /&gt;
# ListenStream defines the address and port where the RT FastCGI server listens.&lt;br /&gt;
# This is NOT the web server itself, so don&#039;t make this port 80, 443, etc.&lt;br /&gt;
# You may edit this if you like, but note:&lt;br /&gt;
# Connections are unencrypted. You should only listen on a secure network&lt;br /&gt;
# interface.&lt;br /&gt;
# The server can only accept a single socket. You cannot specify more than&lt;br /&gt;
# one ListenStream address.&lt;br /&gt;
ListenStream=[::1]:5000&lt;br /&gt;
Accept=no&lt;br /&gt;
FreeBind=yes&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save the file and close your editor.&lt;br /&gt;
&lt;br /&gt;
=== Enable the RT socket ===&lt;br /&gt;
&lt;br /&gt;
Start the server socket and enable it on future boots:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo systemctl enable --now rt-server.socket&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s web server ==&lt;br /&gt;
&lt;br /&gt;
Fully documenting how to set up a web server configured for your network with encryption is outside the scope of this guide. This page only highlights the configuration you need to pass web requests onto the RT FastCGI service.&lt;br /&gt;
&lt;br /&gt;
=== nginx ===&lt;br /&gt;
&lt;br /&gt;
Make sure you have the necessary packages installed:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install nginx&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install nginx&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In the &amp;lt;code&amp;gt;http server&amp;lt;/code&amp;gt; configuration blocks where you want to serve RT, add a configuration block like this, &#039;&#039;&#039;above&#039;&#039;&#039; any other &amp;lt;code&amp;gt;location&amp;lt;/code&amp;gt; blocks:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# The location path should match the WebPath in your RT site configuration.&lt;br /&gt;
location / {&lt;br /&gt;
  include /etc/nginx/fastcgi.conf;&lt;br /&gt;
  # SCRIPT_NAME should match RT&#039;s WebPath, without a trailing slash.&lt;br /&gt;
  # This means when WebPath is /, it&#039;s the empty string &amp;quot;&amp;quot;.&lt;br /&gt;
  fastcgi_param SCRIPT_NAME &amp;quot;&amp;quot;;&lt;br /&gt;
  # This network location should match the ListenStream in rt-server.socket.&lt;br /&gt;
  fastcgi_pass localhost:5000;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you&#039;re doing a fresh install, the default &amp;lt;code&amp;gt;http server&amp;lt;/code&amp;gt; configuration location varies by distribution:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|Edit &amp;lt;code&amp;gt;/etc/nginx/sites-available/default&amp;lt;/code&amp;gt;&lt;br /&gt;
|Add a new file &amp;lt;code&amp;gt;/etc/nginx/default.d/rt-server.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
After you’ve edited your configuration, load it by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo systemctl reload nginx&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once this is done you can skip ahead to Verify the web interface.&lt;br /&gt;
&lt;br /&gt;
=== Apache httpd ===&lt;br /&gt;
&lt;br /&gt;
Make sure you have the necessary packages installed, and the proxy_fcgi module enabled:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install apache2&lt;br /&gt;
sudo a2enmod proxy&lt;br /&gt;
sudo a2enmod proxy_fcgi&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install httpd&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In the &amp;lt;code&amp;gt;&amp;amp;lt;VirtualHost&amp;amp;gt;&amp;lt;/code&amp;gt; configuration blocks where you want to serve RT, add a configuration block like this, &#039;&#039;&#039;above&#039;&#039;&#039; any other &amp;lt;code&amp;gt;Alias&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;ProxyPass&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;ScriptAlias&amp;lt;/code&amp;gt; lines:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# SCRIPT_NAME should match RT&#039;s WebPath, without a trailing slash.&lt;br /&gt;
# This means when WebPath is /, it&#039;s the empty string &amp;quot;&amp;quot;.&lt;br /&gt;
ProxyFCGISetEnvIf true SCRIPT_NAME &amp;quot;&amp;quot;&lt;br /&gt;
# The location path in the first argument should match the WebPath in your&lt;br /&gt;
# RT site configuration.  The network location after fcgi:// should match&lt;br /&gt;
# the ListenStream in rt-server.socket.&lt;br /&gt;
ProxyPass / fcgi://localhost:5000/&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you&#039;re doing a fresh install, the default &amp;lt;code&amp;gt;&amp;amp;lt;VirtualHost&amp;amp;gt;&amp;lt;/code&amp;gt; configuration location varies by distribution and whether or not you&#039;re using HTTPS:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|With HTTPS: &amp;lt;code&amp;gt;/etc/apache2/sites-available/default-ssl.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
With plain HTTP: &amp;lt;code&amp;gt;/etc/apache2/sites-available/000-default.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
|With HTTPS: &amp;lt;code&amp;gt;/etc/httpd/conf.d/ssl.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
With plain HTTP: Write a new file &amp;lt;code&amp;gt;/etc/httpd/conf.d/vhost_RT.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
After you’ve edited your configuration, load it by running:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo systemctl reload apache2&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo systemctl reload httpd&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Verify the web interface ===&lt;br /&gt;
&lt;br /&gt;
You should be able to visit your web server in your browser, and be presented with RT’s login screen. You should be able to log in with username &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; and the password you set previously.&lt;br /&gt;
&lt;br /&gt;
If the web server returns a 502 Bad Gateway response, it&#039;s having trouble connecting to the RT FCGI server. Check the error logs for your web server:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 33%;&amp;quot;|nginx&lt;br /&gt;
! style=&amp;quot;width: 33%;&amp;quot;|Apache on Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 33%;&amp;quot;|httpd on Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;/var/log/nginx/error.log&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;/var/log/apache2/error.log&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;/var/log/httpd/error_log&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For all kinds of errors, you can check the logs for the RT FCGI server and its socket:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo journalctl --unit rt-server.\*&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s mail server ==&lt;br /&gt;
&lt;br /&gt;
RT both can both send and receive ticket updates via email. Unfortunately, there are too many variables to document a useful setup process here: getting this working usually requires creating DNS records, and coordinating with existing mail servers, which will be the main constraint on your setup. Instead this guide provides a brief overview of how the integration works, and where the connection points are that you likely need to work on.&lt;br /&gt;
&lt;br /&gt;
=== Sending Mail ===&lt;br /&gt;
&lt;br /&gt;
RT only knows how to send mail by passing it off to another program on the system. It cannot connect or authenticate directly to external mail servers. In the default configuration, RT runs the standard &amp;lt;code&amp;gt;sendmail&amp;lt;/code&amp;gt; command. There are [https://docs.bestpractical.com/rt/latest/RT_Config.html#Outgoing-mail configuration options to send mail through different commands] if you need.&lt;br /&gt;
&lt;br /&gt;
The most common setup is to install and configure a proper Mail Transfer Agent (MTA) like Postfix or Exim, and then configure it to send mail to the wider Internet as you need. This works well because the MTAs are robust and well-tested; they have flexible configuration to let you send mail out by relaying to other mail servers you specify with optional authentication; and most distributions install one by default anyway. The only hard part is configuring the MTA to send mail following your site’s policies.&lt;br /&gt;
&lt;br /&gt;
Other software is available that provides a slimmer version of the &amp;lt;code&amp;gt;sendmail&amp;lt;/code&amp;gt; command that connects to an external mail server for you, like msmtp. These programs are usually easier to configure than an MTA, but they often lose email permanently if they can’t connect to the external server at the time it’s sent. (MTAs keep email queued locally until they successfully deliver it to another server.)&lt;br /&gt;
&lt;br /&gt;
=== Receiving email ===&lt;br /&gt;
&lt;br /&gt;
RT installs a command called &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; that receives an email on standard input and posts it to RT’s REST web interface, where it gets saved in the database and added to a ticket. You need to arrange for a way to send incoming email to this command.&lt;br /&gt;
&lt;br /&gt;
The most common setup is to have an MTA on the same box as RT receive email directly, and then set up mail aliases that call this command when mail comes in. Example &amp;lt;code&amp;gt;/etc/aliases&amp;lt;/code&amp;gt; entries look like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rt: &amp;quot;|/opt/rt5/bin/rt-mailgate --queue general --action correspond --url https://rt.yourdomain.example.com/&amp;quot;&lt;br /&gt;
rt-comment: &amp;quot;|/opt/rt5/bin/rt-mailgate --queue general --action comment --url https://rt.yourdomain.example.com/&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
This works well because, again, you’re probably running an MTA anyway; and the MTA can hold and queue mail if it comes in while RT is down for any reason, giving you a buffer against downtime.&lt;br /&gt;
&lt;br /&gt;
Another common option is to periodically run a tool that fetches mail using a protocol like IMAP, like fetchmail or getmail, and passes it on to &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt;. This is less common because it requires setting up another tool to run, and securely storing another set of mail server credentials. But it is useful when local policy prevents the RT server from receiving email directly.&lt;br /&gt;
&lt;br /&gt;
This is much less common, but it might help to know that &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; doesn’t have to run on the same system as RT itself. It just needs to be able to connect to RT’s web interface. If you don’t have any other options, you can install the RT software on a different system that receives email, and configure &#039;&#039;that&#039;&#039; system to run &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; and pass it on to the RT server. To do that, just repeat the installation instructions above, skipping the steps about installing the database and web server.&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s background jobs ==&lt;br /&gt;
&lt;br /&gt;
Create a file &amp;lt;code&amp;gt;/etc/cron.d/rt&amp;lt;/code&amp;gt; with the following content. You may edit all of the time fields as you see fit. Refer to the crontab(5) man page for details about their definitions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Update the fulltext index with new ticket data&lt;br /&gt;
*/3 *   *   *   *   rt    /opt/rt5/sbin/rt-fulltext-indexer&lt;br /&gt;
# Email out dashboards that users have subscribed to&lt;br /&gt;
0   *   *   *   *   rt    /opt/rt5/sbin/rt-email-dashboards&lt;br /&gt;
# Clean old sessions from the database&lt;br /&gt;
10  3   *   *   *   rt    /opt/rt5/sbin/rt-clean-sessions --older 8d&lt;br /&gt;
# Email out weekly digests for users who have requested it&lt;br /&gt;
50  4   *   *   Mon rt    /opt/rt5/sbin/rt-email-digest -m weekly&lt;br /&gt;
# Email out daily digests for users who have requested it&lt;br /&gt;
50  5   *   *   *   rt    /opt/rt5/sbin/rt-email-digest -m daily&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Set up RT ==&lt;br /&gt;
&lt;br /&gt;
If you’ve gotten this far, congratulations, your RT install is really done now. You can start setting up RT with users, groups, queues, and business logic. [[Main Page|Head back to the main page]] to start exploring those topics.&lt;/div&gt;</summary>
		<author><name>Brett</name></author>
	</entry>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=ManualInstallation&amp;diff=27090</id>
		<title>ManualInstallation</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=ManualInstallation&amp;diff=27090"/>
		<updated>2022-09-07T17:17:41Z</updated>

		<summary type="html">&lt;p&gt;Brett: note new Red Hat name for MariaDB libraries&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Prev: [[ManualRequirements]] — Up: [[UserManual]] — Next: [[ManualApacheConfig]]&lt;br /&gt;
&lt;br /&gt;
This guide walks you through installing RT from source on a modern, popular Linux distro. Specifically, that means a distribution based on Debian or Red Hat that’s been released since around 2020.&lt;br /&gt;
&lt;br /&gt;
This guide assumes:&lt;br /&gt;
&lt;br /&gt;
* You can install packages generally available in Debian/Ubuntu or Red Hat/Fedora/CentOS.&lt;br /&gt;
* You want to install RT, and all of its Perl dependencies, from source to get the latest versions. (This is a trade-off. It means the boundaries of your install will be very clear, but you won’t get security updates for RT or Perl modules from your distribution.)&lt;br /&gt;
* You are willing to install a couple of extra tools to manage the RT installation similarly to how you would in other packaging systems (like PyPI, npm, etc.).&lt;br /&gt;
* You are willing to do a relatively maximal install of RT, enabling all the options during installation and then setting what you need in the configuration. (You could save a little space and time by being pickier about your options, but then that complicates the guide and makes it harder to turn those options on later if you want.)&lt;br /&gt;
* You are using a regular user account on the Linux system that can get superuser privileges with sudo.&lt;br /&gt;
&lt;br /&gt;
== Install the base dependencies ==&lt;br /&gt;
&lt;br /&gt;
These are required by RT, either to run or to install the dependencies.&lt;br /&gt;
&lt;br /&gt;
=== Debian/Ubuntu ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo apt install autoconf build-essential cpanminus curl libexpat-dev libgd-dev libssl-dev libz-dev gnupg graphviz multiwatch openssl perl w3m&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Red Hat Enterprise Linux ===&lt;br /&gt;
&lt;br /&gt;
These instructions are for RHEL specifically. For RHEL-derived distributions like CentOS and Rocky, go to the next section.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;MAJDISTVER=&amp;quot;$(. /etc/os-release &amp;amp;&amp;amp; echo &amp;quot;${VERSION_ID%%.*}&amp;quot;)&amp;quot;&lt;br /&gt;
sudo subscription-manager repos --enable &amp;quot;codeready-builder-for-rhel-$MAJDISTVER-$(arch)-rpms&amp;quot;&lt;br /&gt;
sudo dnf install &amp;quot;https://dl.fedoraproject.org/pub/epel/epel-release-latest-$MAJDISTVER.noarch.rpm&amp;quot;&lt;br /&gt;
sudo dnf install patch tar which gcc gcc-c++ perl-core perl-App-cpanminus graphviz expat-devel gd-devel multiwatch openssl openssl-devel w3m&lt;br /&gt;
sudo sed -i~ &#039;/^SELINUX=/ c SELINUX=disabled&#039; /etc/selinux/config&lt;br /&gt;
sudo setenforce 0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Turning off SELinux enforcement is required on Red Hat-based distributions because, as of March 2022, nobody has written a policy for RT.)&lt;br /&gt;
&lt;br /&gt;
=== RHEL Community Distributions: Fedora/CentOS/Rocky ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo dnf install epel-release&lt;br /&gt;
sudo dnf install patch tar which gcc gcc-c++ perl-core perl-App-cpanminus graphviz expat-devel gd-devel multiwatch openssl openssl-devel w3m&lt;br /&gt;
sudo sed -i~ &#039;/^SELINUX=/ c SELINUX=disabled&#039; /etc/selinux/config&lt;br /&gt;
sudo setenforce 0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Turning off SELinux enforcement is required on Red Hat-based distributions because, as of March 2022, nobody has written a policy for RT.)&lt;br /&gt;
&lt;br /&gt;
== Install a database ==&lt;br /&gt;
&lt;br /&gt;
You need access to a database server. It can be remote, or you can install a database server alongside RT. RT supports a few different databases, but the best supported options are PostgreSQL and MariaDB.&lt;br /&gt;
&lt;br /&gt;
=== Installing and configuring the PostgreSQL server ===&lt;br /&gt;
&lt;br /&gt;
If you want to install a fresh PostgreSQL database server alongside RT:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install postgresql&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install postgresql-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In order to set up RT’s database, you will need a PostgreSQL account that can create databases and roles and be authenticated with a password. If you don’t have that, you can create it by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo createuser --createdb --createrole --login --pwprompt rt_admin&amp;lt;/pre&amp;gt;&lt;br /&gt;
Set the password when prompted. Record this; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
=== Enable password authentication in PostgreSQL ===&lt;br /&gt;
&lt;br /&gt;
You need to consider this step whether you install the database locally, or use an existing one already running. RT supports connecting to PostgreSQL a few different ways, but authenticating with a username and password is simplest, and this guide is written based on that. Not all PostgreSQL installations allow this authentication method by default. You need to review your &amp;lt;code&amp;gt;pg_hba.conf&amp;lt;/code&amp;gt; file located at:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;/etc/postgresql/VERSION/main/pg_hba.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;/var/lib/pgsql/VERSION/data/pg_hba.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Replace &amp;lt;code&amp;gt;VERSION&amp;lt;/code&amp;gt; with the version of your PostgreSQL database. Add these two lines &#039;&#039;&#039;above&#039;&#039;&#039; any other lines that start with &amp;lt;code&amp;gt;host&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;host  rt5  rt_user   all  md5&lt;br /&gt;
host  rt5  rt_admin  all  md5&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This configuration will let &amp;lt;code&amp;gt;rt_user&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;rt_admin&amp;lt;/code&amp;gt; authorize themselves for the &amp;lt;code&amp;gt;rt5&amp;lt;/code&amp;gt; database using an &amp;lt;code&amp;gt;md5&amp;lt;/code&amp;gt; crypted password over a network connection (possibly using the localhost loopback network). You might be able to further restrict some of these fields for improved security, but doing so is outside the scope of this install guide. Refer to [https://www.postgresql.org/docs/current/auth-pg-hba-conf.html the pg_hba.conf documentation] for more details.&lt;br /&gt;
&lt;br /&gt;
Save your changes and reload the database:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo systemctl reload postgresql&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Installing the PostgreSQL client libraries ===&lt;br /&gt;
&lt;br /&gt;
These are required for RT to be able to talk to any PostgreSQL server.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install libpq-dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install postgresql-devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Once this is done you can skip ahead to installing RT.&lt;br /&gt;
&lt;br /&gt;
=== Installing and configuring the MariaDB server ===&lt;br /&gt;
&lt;br /&gt;
If you want to install a fresh MariaDB database server alongside RT:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install mariadb-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install mariadb-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In order to set up RT’s database, you will need a MySQL superuser account. To stay consistent with PostgreSQL, I suggest setting a password for it. You can do that by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo mysql mysql&lt;br /&gt;
MariaDB [mysql]&amp;amp;gt; GRANT ALL PRIVILEGES ON rt5.* TO rt_admin@localhost IDENTIFIED BY &#039;YourPassphraseHere&#039; WITH GRANT OPTION;&amp;lt;/pre&amp;gt;&lt;br /&gt;
Record your passphrase; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
=== Adjust MariaDB’s max_allowed_packet setting ===&lt;br /&gt;
&lt;br /&gt;
You need to consider this step whether you install the database locally, or use an existing one already running. [https://mariadb.com/kb/en/server-system-variables/#max_allowed_packet MariaDB’s &amp;lt;code&amp;gt;max_allowed_packet&amp;lt;/code&amp;gt; setting] functionally limits the size of attachments in RT. The default is 16MiB, which is too small for most installations. You can ultimately choose any setting you’re comfortable with; 64MiB here should allow most requests without being too open.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;echo -e &#039;[server]\nmax_allowed_packet=64M&#039; | sudo tee /etc/mysql/conf.d/max_allowed_packet.cnf&lt;br /&gt;
sudo systemctl reload mariadb&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;echo -e &#039;[server]\nmax_allowed_packet=64M&#039; | sudo tee /etc/my.cnf.d/max_allowed_packet.cnf&lt;br /&gt;
sudo systemctl reload mariadb&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Installing the MariaDB client libraries ===&lt;br /&gt;
&lt;br /&gt;
These are required for RT to be able to talk to any MariaDB server.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install libmariadb-dev libmariadb-dev-compat&amp;lt;/pre&amp;gt;&lt;br /&gt;
|On latest versions:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo dnf install mariadb-connector-c-devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you&#039;re on an older version that doesn&#039;t have that package:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo dnf install mariadb-devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Install RT ==&lt;br /&gt;
&lt;br /&gt;
=== Create an RT system group ===&lt;br /&gt;
&lt;br /&gt;
This group will be used throughout the install process to control access to sensitive files. Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo groupadd --system rt&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Get and unpack the RT source code ===&lt;br /&gt;
&lt;br /&gt;
Download the latest source code using the link on the [https://bestpractical.com/download-page RT download page], extract it using &amp;lt;code&amp;gt;tar -xf&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt; into the source code directory to run the rest of the commands in this section. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;curl -O https://download.bestpractical.com/pub/rt/release/rt-5.0.2.tar.gz&lt;br /&gt;
tar -xf rt-5.0.2.tar.gz&lt;br /&gt;
cd rt-5.0.2&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Pre-configure RT ===&lt;br /&gt;
&lt;br /&gt;
This command will detect some information about your system in order to install RT properly, and decide which set of dependencies to install. Here’s what the different parts of our command are doing:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;PERL=…&amp;lt;/code&amp;gt; configures RT to run under Perl with some options that load its dependencies from a dedicated directory. The &amp;lt;code&amp;gt;/opt/rt5&amp;lt;/code&amp;gt; part of this string should match your &amp;lt;code&amp;gt;prefix&amp;lt;/code&amp;gt; setting (see next item). If you know you want to use a specific Perl installed on your system, you can specify its full path instead of the plain &amp;lt;code&amp;gt;perl&amp;lt;/code&amp;gt; here.&lt;br /&gt;
* &amp;lt;code&amp;gt;--prefix=/opt/rt5&amp;lt;/code&amp;gt; sets the directory where RT will install all of its libraries, tools, and supporting files. You can choose another path if you like.&lt;br /&gt;
* &amp;lt;code&amp;gt;--with-db-type=TYPE&amp;lt;/code&amp;gt; - Replace &amp;lt;code&amp;gt;TYPE&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;Pg&amp;lt;/code&amp;gt; for PostgreSQL, or &amp;lt;code&amp;gt;mysql&amp;lt;/code&amp;gt; for MariaDB.&lt;br /&gt;
* &amp;lt;code&amp;gt;--with-web-group=rt&amp;lt;/code&amp;gt; installs RT using the dedicated group we created earlier.&lt;br /&gt;
* The rest of the options tell RT to install additional dependencies for optional features.&lt;br /&gt;
&lt;br /&gt;
Make sure you have &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt;ed into the RT source directory, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;PERL=&amp;quot;/usr/bin/env -S perl -I/opt/rt5/local/lib/perl5&amp;quot; ./configure --prefix=/opt/rt5 --with-db-type=TYPE --with-web-group=rt --with-attachment-store=disk --enable-externalauth --enable-gd --enable-graphviz --enable-gpg --enable-smime&amp;lt;/pre&amp;gt;&lt;br /&gt;
For more background, [https://docs.bestpractical.com/rt/latest/configure.html refer to the RT configure options documentation].&lt;br /&gt;
&lt;br /&gt;
=== Install RT and its Perl dependencies ===&lt;br /&gt;
&lt;br /&gt;
This command will download, build, and install all of the Perl modules necessary to run RT with the configuration you set above. Here’s what the different parts of the command are doing:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;make dirs&amp;lt;/code&amp;gt; creates RT&#039;s directory structure, so we can install dependencies inside it.&lt;br /&gt;
* &amp;lt;code&amp;gt;make fixdeps&amp;lt;/code&amp;gt; actually installs those dependencies.&lt;br /&gt;
* &amp;lt;code&amp;gt;RT_FIX_DEPS_CMD=…&amp;lt;/code&amp;gt; tells RT to use cpanminus to install dependencies (instead of the older, default &amp;lt;code&amp;gt;cpan&amp;lt;/code&amp;gt; command) inside RT&#039;s directory structure.&lt;br /&gt;
* &amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt; installs all of RT’s files under &amp;lt;code&amp;gt;/opt/rt5&amp;lt;/code&amp;gt; (or the prefix directory you set earlier). It will only run if &amp;lt;code&amp;gt;fixdeps&amp;lt;/code&amp;gt; succeeded.&lt;br /&gt;
&lt;br /&gt;
Make sure you have &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt;ed into the RT source directory, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo make dirs&lt;br /&gt;
make fixdeps RT_FIX_DEPS_CMD=&amp;quot;cpanm --sudo --local-lib-contained=/opt/rt5/local&amp;quot;&lt;br /&gt;
sudo make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
If it works, the command will eventually output a message that says “Congratulations. RT is now installed.” followed by instructions about configuring and setting up the database. We’ll do that next.&lt;br /&gt;
&lt;br /&gt;
=== Configure RT ===&lt;br /&gt;
&lt;br /&gt;
[https://docs.bestpractical.com/rt/latest/RT_Config.html RT has many configuration options.] You can put configuration options in the file &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/code&amp;gt;, or in individual files under &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.d/&amp;lt;/code&amp;gt;. Use an editor to save all the text below to &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/code&amp;gt; (you can just overwrite the existing file, or add this to the bottom of what’s there) and then fill in settings for your site everywhere the text &amp;lt;code&amp;gt;EDIT WITH&amp;lt;/code&amp;gt; appears.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Single-quote all values EXCEPT the special value `undef`&lt;br /&gt;
# that turns off a setting.&lt;br /&gt;
&lt;br /&gt;
# rtname appears in ticket email subjects. It needs to be globally unique,&lt;br /&gt;
# so use your organization&#039;s domain name.&lt;br /&gt;
Set($rtname, &#039;EDIT WITH yourdomain.example.com&#039;);&lt;br /&gt;
# Organization is used in the database for ticket links, etc. It also needs to&lt;br /&gt;
# be globally unique, so use your organization&#039;s domain name.&lt;br /&gt;
Set($Organization, &#039;EDIT WITH yourdomain.example.com&#039;);&lt;br /&gt;
# WebDomain is domain name of the RT web server. RT uses it to construct links&lt;br /&gt;
# and defend against CSRFs.&lt;br /&gt;
Set($WebDomain, &#039;EDIT WITH rt.yourdomain.example.com&#039;);&lt;br /&gt;
# WebPort is the port where the RT web server runs. Edit the number below if&lt;br /&gt;
# you&#039;re not using the standard HTTPS port.&lt;br /&gt;
Set($WebPort, &#039;443&#039;);&lt;br /&gt;
# WebPath is the path where the RT web server runs on your WebDomain.&lt;br /&gt;
# Edit the path below if you&#039;re using a specific path.&lt;br /&gt;
Set($WebPath, &#039;/&#039;);&lt;br /&gt;
&lt;br /&gt;
# DatabaseUser is the name of the database account RT uses to read and store&lt;br /&gt;
# data. &#039;rt_user&#039; is the default but you can change it if you like.&lt;br /&gt;
# DO NOT use the &#039;rt_admin&#039; superuser created in the instructions above.&lt;br /&gt;
Set($DatabaseUser, &#039;rt_user&#039;);&lt;br /&gt;
# DatabasePassword is the password for DatabaseUser.&lt;br /&gt;
Set($DatabasePassword, &#039;EDIT WITH SomePassphraseHere&#039;);&lt;br /&gt;
# DatabaseHost is the hostname of the database server RT should use.&lt;br /&gt;
# Change &#039;localhost&#039; if it lives on a different server.&lt;br /&gt;
Set($DatabaseHost, &#039;localhost&#039;);&lt;br /&gt;
# DatabasePort is the port number of the database server RT should use.&lt;br /&gt;
# `undef` means the default for that database. Change it if you&#039;re not&lt;br /&gt;
# using the standard port.&lt;br /&gt;
Set($DatabasePort, undef);&lt;br /&gt;
# DatabaseName is the name of RT&#039;s database hosted on DatabaseHost.&lt;br /&gt;
# &#039;rt5&#039; is the default but you can change it if you like.&lt;br /&gt;
Set($DatabaseName, &#039;rt5&#039;);&lt;br /&gt;
# DatabaseAdmin is the name of the user in the database used to perform&lt;br /&gt;
# major administrative tasks. Change &#039;rt_admin&#039; if you&#039;re using a user&lt;br /&gt;
# besides the one created in this guide.&lt;br /&gt;
Set($DatabaseAdmin, &#039;rt_admin&#039;);&lt;br /&gt;
&lt;br /&gt;
# RT can log to syslog, stderr, and/or a dedicated file.&lt;br /&gt;
# Log settings are used both by the primary server and by command line&lt;br /&gt;
# tools like rt-crontool, rt-ldapimport, etc.&lt;br /&gt;
# You set all of RT&#039;s $LogTo* paramaters to a standard log level: &#039;debug&#039;,&lt;br /&gt;
# &#039;info&#039;, &#039;notice&#039;, &#039;warning&#039;, &#039;error&#039;, &#039;critical&#039;, &#039;alert&#039;, or &#039;emergency&#039;.&lt;br /&gt;
# For a modern install, I recommend logging primarily to syslog, so it goes&lt;br /&gt;
# to journald where it&#039;s easy to query and automatically gets rotated.&lt;br /&gt;
Set($LogToSyslog, &#039;info&#039;);&lt;br /&gt;
&lt;br /&gt;
# When the RT server logs to stderr, that usually goes to your web server&#039;s&lt;br /&gt;
# error log. Command line tools log to their own stderr. Setting this to&lt;br /&gt;
# &#039;warning&#039; or &#039;error&#039; helps ensure you get notified if RT&#039;s cron jobs&lt;br /&gt;
# encounter problems.&lt;br /&gt;
Set($LogToSTDERR, &#039;warning&#039;);&lt;br /&gt;
&lt;br /&gt;
# Turn off optional features that require additional configuration.&lt;br /&gt;
# If you want to use these, refer to the RT_Config documentation for&lt;br /&gt;
# instructions on how to set them up.&lt;br /&gt;
Set(%GnuPG, &#039;Enable&#039; =&amp;gt; &#039;0&#039;);&lt;br /&gt;
Set(%SMIME, &#039;Enable&#039; =&amp;gt; &#039;0&#039;);&lt;br /&gt;
&lt;br /&gt;
# Perl expects to find this 1 at the end of the file.&lt;br /&gt;
1;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;RT_SiteConfig.pm&amp;lt;/code&amp;gt; is actually Perl code. RT runs the code directly to load the configuration. Any time you finish editing it, you can check that you didn’t make any syntax errors by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;perl -c /opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Set up RT’s database ===&lt;br /&gt;
&lt;br /&gt;
RT includes a tool to help you set up its database. By default, it connects to the database as an administrator to create the database and user that you configured in the previous step.&lt;br /&gt;
&lt;br /&gt;
(The instructions from &amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt; and RT’s README file tell you to run &amp;lt;code&amp;gt;make initialize-database&amp;lt;/code&amp;gt;. That just runs &amp;lt;code&amp;gt;rt-setup-database&amp;lt;/code&amp;gt; for you. Running the tool directly makes it easier to pass the options you need.)&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;--action=init&amp;lt;/code&amp;gt; tells the tool to create the user, the database, the tables inside it, and insert core data RT needs to function.&lt;br /&gt;
* &#039;&#039;&#039;If&#039;&#039;&#039; you are using an existing database server and the database adminstrator has already created the user account and database for RT, then you can add the &amp;lt;code&amp;gt;--skip-create&amp;lt;/code&amp;gt; option.&lt;br /&gt;
* &#039;&#039;&#039;If&#039;&#039;&#039; you have a less common database setup, this tool has additional options to give you finer-grained control over what steps are run and how. Refer to [https://docs.bestpractical.com/rt/latest/rt-setup-database.html the full rt-setup-database documentation] to learn more about those.&lt;br /&gt;
* The command reads files from RT’s &amp;lt;code&amp;gt;etc/&amp;lt;/code&amp;gt; directory by default, so the easiest way to run it is to &amp;lt;code&amp;gt;cd /opt/rt5&amp;lt;/code&amp;gt; first, and then it will find the necessary files automatically.&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /opt/rt5&lt;br /&gt;
sudo sbin/rt-setup-database --action=init&amp;lt;/pre&amp;gt;&lt;br /&gt;
Enter the password for your database administrator account when prompted.&lt;br /&gt;
&lt;br /&gt;
=== Set up fulltext indexing ===&lt;br /&gt;
&lt;br /&gt;
Fulltext indexing speeds up searches for ticket content, which makes RT a lot nicer to use.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;--noask&amp;lt;/code&amp;gt; uses the default names for the index, which will be fine for a new install and simplifies the setup.&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo /opt/rt5/sbin/rt-setup-fulltext-index --noask&amp;lt;/pre&amp;gt;&lt;br /&gt;
Enter the password for your database administrator account when prompted. The end of the process will output some RT configuration that looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;### EXAMPLE OUTPUT ONLY - Don&#039;t use this directly!&lt;br /&gt;
Set( %FullTextSearch,&lt;br /&gt;
    Enable     =&amp;gt; 1,&lt;br /&gt;
    Indexed    =&amp;gt; 1,&lt;br /&gt;
    # Additional output from rt-setup-fulltext-index should be here.&lt;br /&gt;
    # The configuration varies by database type.&lt;br /&gt;
);&amp;lt;/pre&amp;gt;&lt;br /&gt;
Copy the output generated when you run &amp;lt;code&amp;gt;rt-setup-fulltext-index&amp;lt;/code&amp;gt; and save it to the file &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.d/FulltextIndex.pm&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Set permissions ===&lt;br /&gt;
&lt;br /&gt;
All of RT’s configuration files should be readable by the user that runs the web server, and no other users, in order to protect sensitive information like the database password. RT provides a command to set permissions appropriately according to your distribution and configuration. &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt; to the directory where you extracted the RT source code, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd rt-5.0.2&lt;br /&gt;
sudo make fixperms&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Verify the installation ===&lt;br /&gt;
&lt;br /&gt;
If everything has gone well, then you should be able to set a password for RT’s &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; user. You’ll use this later to log in to the web interface and continue setting up your system. Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo /opt/rt5/sbin/rt-passwd root&amp;lt;/pre&amp;gt;&lt;br /&gt;
Set the password when prompted. Record this; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
== Set up RT FastCGI service ==&lt;br /&gt;
&lt;br /&gt;
=== Create the RT service ===&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo systemctl edit --force --full rt-server.service&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This opens an editor to define the RT service to systemd. Use the editor to add this text to the file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[Unit]&lt;br /&gt;
Description=RT FCGI server&lt;br /&gt;
&lt;br /&gt;
[Service]&lt;br /&gt;
# The --forks option is the number of RT servers to run in parallel.&lt;br /&gt;
# 3 should be good for most initial installs. You can increase this&lt;br /&gt;
# number later if needed for performance.&lt;br /&gt;
ExecStart=/usr/bin/multiwatch --forks=3 --signal=TERM -- /opt/rt5/sbin/rt-server.fcgi&lt;br /&gt;
StandardInput=socket&lt;br /&gt;
DynamicUser=true&lt;br /&gt;
SupplementaryGroups=rt&lt;br /&gt;
UMask=027&lt;br /&gt;
&lt;br /&gt;
CapabilityBoundingSet=&lt;br /&gt;
DevicePolicy=closed&lt;br /&gt;
PrivateMounts=true&lt;br /&gt;
PrivateNetwork=false&lt;br /&gt;
PrivateTmp=true&lt;br /&gt;
PrivateUsers=true&lt;br /&gt;
ProtectControlGroups=true&lt;br /&gt;
ProtectHome=true&lt;br /&gt;
ProtectSystem=full&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save the file and close your editor.&lt;br /&gt;
&lt;br /&gt;
=== Create the RT socket ===&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo systemctl edit --force --full rt-server.socket&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This opens an editor to define the RT socket to systemd. Use the editor to add this text to the file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[Unit]&lt;br /&gt;
Description=RT FCGI server socket&lt;br /&gt;
Wants=network.target&lt;br /&gt;
After=network.target&lt;br /&gt;
Before=apache2.service httpd.service nginx.service&lt;br /&gt;
&lt;br /&gt;
[Install]&lt;br /&gt;
WantedBy=sockets.target&lt;br /&gt;
&lt;br /&gt;
[Socket]&lt;br /&gt;
# ListenStream defines the address and port where the RT FastCGI server listens.&lt;br /&gt;
# This is NOT the web server itself, so don&#039;t make this port 80, 443, etc.&lt;br /&gt;
# You may edit this if you like, but note:&lt;br /&gt;
# Connections are unencrypted. You should only listen on a secure network&lt;br /&gt;
# interface.&lt;br /&gt;
# The server can only accept a single socket. You cannot specify more than&lt;br /&gt;
# one ListenStream address.&lt;br /&gt;
ListenStream=[::1]:5000&lt;br /&gt;
Accept=no&lt;br /&gt;
FreeBind=yes&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save the file and close your editor.&lt;br /&gt;
&lt;br /&gt;
=== Enable the RT socket ===&lt;br /&gt;
&lt;br /&gt;
Load the new services into RT, start the server socket, and enable it on future boots:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo systemctl daemon-reload&lt;br /&gt;
sudo systemctl enable --now rt-server.socket&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s web server ==&lt;br /&gt;
&lt;br /&gt;
Fully documenting how to set up a web server configured for your network with encryption is outside the scope of this guide. This page only highlights the configuration you need to pass web requests onto the RT FastCGI service.&lt;br /&gt;
&lt;br /&gt;
=== nginx ===&lt;br /&gt;
&lt;br /&gt;
Make sure you have the necessary packages installed:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install nginx&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install nginx&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In the &amp;lt;code&amp;gt;http server&amp;lt;/code&amp;gt; configuration blocks where you want to serve RT, add a configuration block like this, &#039;&#039;&#039;above&#039;&#039;&#039; any other &amp;lt;code&amp;gt;location&amp;lt;/code&amp;gt; blocks:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# The location path should match the WebPath in your RT site configuration.&lt;br /&gt;
location / {&lt;br /&gt;
  include /etc/nginx/fastcgi.conf;&lt;br /&gt;
  # SCRIPT_NAME should match RT&#039;s WebPath, without a trailing slash.&lt;br /&gt;
  # This means when WebPath is /, it&#039;s the empty string &amp;quot;&amp;quot;.&lt;br /&gt;
  fastcgi_param SCRIPT_NAME &amp;quot;&amp;quot;;&lt;br /&gt;
  # This network location should match the ListenStream in rt-server.socket.&lt;br /&gt;
  fastcgi_pass localhost:5000;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you&#039;re doing a fresh install, the default &amp;lt;code&amp;gt;http server&amp;lt;/code&amp;gt; configuration location varies by distribution:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|Edit &amp;lt;code&amp;gt;/etc/nginx/sites-available/default&amp;lt;/code&amp;gt;&lt;br /&gt;
|Add a new file &amp;lt;code&amp;gt;/etc/nginx/default.d/rt-server.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
After you’ve edited your configuration, load it by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo systemctl reload nginx&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once this is done you can skip ahead to Verify the web interface.&lt;br /&gt;
&lt;br /&gt;
=== Apache httpd ===&lt;br /&gt;
&lt;br /&gt;
Make sure you have the necessary packages installed, and the proxy_fcgi module enabled:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install apache2&lt;br /&gt;
sudo a2enmod proxy&lt;br /&gt;
sudo a2enmod proxy_fcgi&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install httpd&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In the &amp;lt;code&amp;gt;&amp;amp;lt;VirtualHost&amp;amp;gt;&amp;lt;/code&amp;gt; configuration blocks where you want to serve RT, add a configuration block like this, &#039;&#039;&#039;above&#039;&#039;&#039; any other &amp;lt;code&amp;gt;Alias&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;ProxyPass&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;ScriptAlias&amp;lt;/code&amp;gt; lines:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# SCRIPT_NAME should match RT&#039;s WebPath, without a trailing slash.&lt;br /&gt;
# This means when WebPath is /, it&#039;s the empty string &amp;quot;&amp;quot;.&lt;br /&gt;
ProxyFCGISetEnvIf true SCRIPT_NAME &amp;quot;&amp;quot;&lt;br /&gt;
# The location path in the first argument should match the WebPath in your&lt;br /&gt;
# RT site configuration.  The network location after fcgi:// should match&lt;br /&gt;
# the ListenStream in rt-server.socket.&lt;br /&gt;
ProxyPass / fcgi://localhost:5000/&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you&#039;re doing a fresh install, the default &amp;lt;code&amp;gt;&amp;amp;lt;VirtualHost&amp;amp;gt;&amp;lt;/code&amp;gt; configuration location varies by distribution and whether or not you&#039;re using HTTPS:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|With HTTPS: &amp;lt;code&amp;gt;/etc/apache2/sites-available/default-ssl.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
With plain HTTP: &amp;lt;code&amp;gt;/etc/apache2/sites-available/000-default.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
|With HTTPS: &amp;lt;code&amp;gt;/etc/httpd/conf.d/ssl.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
With plain HTTP: Write a new file &amp;lt;code&amp;gt;/etc/httpd/conf.d/vhost_RT.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
After you’ve edited your configuration, load it by running:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo systemctl reload apache2&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo systemctl reload httpd&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Verify the web interface ===&lt;br /&gt;
&lt;br /&gt;
You should be able to visit your web server in your browser, and be presented with RT’s login screen. You should be able to log in with username &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; and the password you set previously.&lt;br /&gt;
&lt;br /&gt;
If the web server returns a 502 Bad Gateway response, it&#039;s having trouble connecting to the RT FCGI server. Check the error logs for your web server:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 33%;&amp;quot;|nginx&lt;br /&gt;
! style=&amp;quot;width: 33%;&amp;quot;|Apache on Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 33%;&amp;quot;|httpd on Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;/var/log/nginx/error.log&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;/var/log/apache2/error.log&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;/var/log/httpd/error_log&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For all kinds of errors, you can check the logs for the RT FCGI server and its socket:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo journalctl --unit rt-server.\*&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s mail server ==&lt;br /&gt;
&lt;br /&gt;
RT both can both send and receive ticket updates via email. Unfortunately, there are too many variables to document a useful setup process here: getting this working usually requires creating DNS records, and coordinating with existing mail servers, which will be the main constraint on your setup. Instead this guide provides a brief overview of how the integration works, and where the connection points are that you likely need to work on.&lt;br /&gt;
&lt;br /&gt;
=== Sending Mail ===&lt;br /&gt;
&lt;br /&gt;
RT only knows how to send mail by passing it off to another program on the system. It cannot connect or authenticate directly to external mail servers. In the default configuration, RT runs the standard &amp;lt;code&amp;gt;sendmail&amp;lt;/code&amp;gt; command. There are [https://docs.bestpractical.com/rt/latest/RT_Config.html#Outgoing-mail configuration options to send mail through different commands] if you need.&lt;br /&gt;
&lt;br /&gt;
The most common setup is to install and configure a proper Mail Transfer Agent (MTA) like Postfix or Exim, and then configure it to send mail to the wider Internet as you need. This works well because the MTAs are robust and well-tested; they have flexible configuration to let you send mail out by relaying to other mail servers you specify with optional authentication; and most distributions install one by default anyway. The only hard part is configuring the MTA to send mail following your site’s policies.&lt;br /&gt;
&lt;br /&gt;
Other software is available that provides a slimmer version of the &amp;lt;code&amp;gt;sendmail&amp;lt;/code&amp;gt; command that connects to an external mail server for you, like msmtp. These programs are usually easier to configure than an MTA, but they often lose email permanently if they can’t connect to the external server at the time it’s sent. (MTAs keep email queued locally until they successfully deliver it to another server.)&lt;br /&gt;
&lt;br /&gt;
=== Receiving email ===&lt;br /&gt;
&lt;br /&gt;
RT installs a command called &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; that receives an email on standard input and posts it to RT’s REST web interface, where it gets saved in the database and added to a ticket. You need to arrange for a way to send incoming email to this command.&lt;br /&gt;
&lt;br /&gt;
The most common setup is to have an MTA on the same box as RT receive email directly, and then set up mail aliases that call this command when mail comes in. Example &amp;lt;code&amp;gt;/etc/aliases&amp;lt;/code&amp;gt; entries look like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rt: &amp;quot;|/opt/rt5/bin/rt-mailgate --queue general --action correspond --url https://rt.yourdomain.example.com/&amp;quot;&lt;br /&gt;
rt-comment: &amp;quot;|/opt/rt5/bin/rt-mailgate --queue general --action comment --url https://rt.yourdomain.example.com/&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
This works well because, again, you’re probably running an MTA anyway; and the MTA can hold and queue mail if it comes in while RT is down for any reason, giving you a buffer against downtime.&lt;br /&gt;
&lt;br /&gt;
Another common option is to periodically run a tool that fetches mail using a protocol like IMAP, like fetchmail or getmail, and passes it on to &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt;. This is less common because it requires setting up another tool to run, and securely storing another set of mail server credentials. But it is useful when local policy prevents the RT server from receiving email directly.&lt;br /&gt;
&lt;br /&gt;
This is much less common, but it might help to know that &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; doesn’t have to run on the same system as RT itself. It just needs to be able to connect to RT’s web interface. If you don’t have any other options, you can install the RT software on a different system that receives email, and configure &#039;&#039;that&#039;&#039; system to run &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; and pass it on to the RT server. To do that, just repeat the installation instructions above, skipping the steps about installing the database and web server.&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s background jobs ==&lt;br /&gt;
&lt;br /&gt;
Create a file &amp;lt;code&amp;gt;/etc/cron.d/rt&amp;lt;/code&amp;gt; with the following content. You may edit all of the time fields as you see fit. Refer to the crontab(5) man page for details about their definitions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Update the fulltext index with new ticket data&lt;br /&gt;
*/3 *   *   *   *   root    /opt/rt5/sbin/rt-fulltext-indexer&lt;br /&gt;
# Email out dashboards that users have subscribed to&lt;br /&gt;
0   *   *   *   *   root    /opt/rt5/sbin/rt-email-dashboards&lt;br /&gt;
# Clean old sessions from the database&lt;br /&gt;
10  3   *   *   *   root    /opt/rt5/sbin/rt-clean-sessions --older 8d&lt;br /&gt;
# Email out weekly digests for users who have requested it&lt;br /&gt;
50  4   *   *   Mon root    /opt/rt5/sbin/rt-email-digest -m weekly&lt;br /&gt;
# Email out daily digests for users who have requested it&lt;br /&gt;
50  5   *   *   *   root    /opt/rt5/sbin/rt-email-digest -m daily&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Set up RT ==&lt;br /&gt;
&lt;br /&gt;
If you’ve gotten this far, congratulations, your RT install is really done now. You can start setting up RT with users, groups, queues, and business logic. [[Main Page|Head back to the main page]] to start exploring those topics.&lt;/div&gt;</summary>
		<author><name>Brett</name></author>
	</entry>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=ManualInstallation&amp;diff=27089</id>
		<title>ManualInstallation</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=ManualInstallation&amp;diff=27089"/>
		<updated>2022-08-03T13:03:46Z</updated>

		<summary type="html">&lt;p&gt;Brett: refer to the better-maintained msmtp&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Prev: [[ManualRequirements]] — Up: [[UserManual]] — Next: [[ManualApacheConfig]]&lt;br /&gt;
&lt;br /&gt;
This guide walks you through installing RT from source on a modern, popular Linux distro. Specifically, that means a distribution based on Debian or Red Hat that’s been released since around 2020.&lt;br /&gt;
&lt;br /&gt;
This guide assumes:&lt;br /&gt;
&lt;br /&gt;
* You can install packages generally available in Debian/Ubuntu or Red Hat/Fedora/CentOS.&lt;br /&gt;
* You want to install RT, and all of its Perl dependencies, from source to get the latest versions. (This is a trade-off. It means the boundaries of your install will be very clear, but you won’t get security updates for RT or Perl modules from your distribution.)&lt;br /&gt;
* You are willing to install a couple of extra tools to manage the RT installation similarly to how you would in other packaging systems (like PyPI, npm, etc.).&lt;br /&gt;
* You are willing to do a relatively maximal install of RT, enabling all the options during installation and then setting what you need in the configuration. (You could save a little space and time by being pickier about your options, but then that complicates the guide and makes it harder to turn those options on later if you want.)&lt;br /&gt;
* You are using a regular user account on the Linux system that can get superuser privileges with sudo.&lt;br /&gt;
&lt;br /&gt;
== Install the base dependencies ==&lt;br /&gt;
&lt;br /&gt;
These are required by RT, either to run or to install the dependencies.&lt;br /&gt;
&lt;br /&gt;
=== Debian/Ubuntu ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo apt install autoconf build-essential cpanminus curl libexpat-dev libgd-dev libssl-dev libz-dev gnupg graphviz multiwatch openssl perl w3m&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Red Hat Enterprise Linux ===&lt;br /&gt;
&lt;br /&gt;
These instructions are for RHEL specifically. For RHEL-derived distributions like CentOS and Rocky, go to the next section.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;MAJDISTVER=&amp;quot;$(. /etc/os-release &amp;amp;&amp;amp; echo &amp;quot;${VERSION_ID%%.*}&amp;quot;)&amp;quot;&lt;br /&gt;
sudo subscription-manager repos --enable &amp;quot;codeready-builder-for-rhel-$MAJDISTVER-$(arch)-rpms&amp;quot;&lt;br /&gt;
sudo dnf install &amp;quot;https://dl.fedoraproject.org/pub/epel/epel-release-latest-$MAJDISTVER.noarch.rpm&amp;quot;&lt;br /&gt;
sudo dnf install patch tar which gcc gcc-c++ perl-core perl-App-cpanminus graphviz expat-devel gd-devel multiwatch openssl openssl-devel w3m&lt;br /&gt;
sudo sed -i~ &#039;/^SELINUX=/ c SELINUX=disabled&#039; /etc/selinux/config&lt;br /&gt;
sudo setenforce 0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Turning off SELinux enforcement is required on Red Hat-based distributions because, as of March 2022, nobody has written a policy for RT.)&lt;br /&gt;
&lt;br /&gt;
=== RHEL Community Distributions: Fedora/CentOS/Rocky ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo dnf install epel-release&lt;br /&gt;
sudo dnf install patch tar which gcc gcc-c++ perl-core perl-App-cpanminus graphviz expat-devel gd-devel multiwatch openssl openssl-devel w3m&lt;br /&gt;
sudo sed -i~ &#039;/^SELINUX=/ c SELINUX=disabled&#039; /etc/selinux/config&lt;br /&gt;
sudo setenforce 0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Turning off SELinux enforcement is required on Red Hat-based distributions because, as of March 2022, nobody has written a policy for RT.)&lt;br /&gt;
&lt;br /&gt;
== Install a database ==&lt;br /&gt;
&lt;br /&gt;
You need access to a database server. It can be remote, or you can install a database server alongside RT. RT supports a few different databases, but the best supported options are PostgreSQL and MariaDB.&lt;br /&gt;
&lt;br /&gt;
=== Installing and configuring the PostgreSQL server ===&lt;br /&gt;
&lt;br /&gt;
If you want to install a fresh PostgreSQL database server alongside RT:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install postgresql&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install postgresql-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In order to set up RT’s database, you will need a PostgreSQL account that can create databases and roles and be authenticated with a password. If you don’t have that, you can create it by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo createuser --createdb --createrole --login --pwprompt rt_admin&amp;lt;/pre&amp;gt;&lt;br /&gt;
Set the password when prompted. Record this; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
=== Enable password authentication in PostgreSQL ===&lt;br /&gt;
&lt;br /&gt;
You need to consider this step whether you install the database locally, or use an existing one already running. RT supports connecting to PostgreSQL a few different ways, but authenticating with a username and password is simplest, and this guide is written based on that. Not all PostgreSQL installations allow this authentication method by default. You need to review your &amp;lt;code&amp;gt;pg_hba.conf&amp;lt;/code&amp;gt; file located at:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;/etc/postgresql/VERSION/main/pg_hba.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;/var/lib/pgsql/VERSION/data/pg_hba.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Replace &amp;lt;code&amp;gt;VERSION&amp;lt;/code&amp;gt; with the version of your PostgreSQL database. Add these two lines &#039;&#039;&#039;above&#039;&#039;&#039; any other lines that start with &amp;lt;code&amp;gt;host&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;host  rt5  rt_user   all  md5&lt;br /&gt;
host  rt5  rt_admin  all  md5&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This configuration will let &amp;lt;code&amp;gt;rt_user&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;rt_admin&amp;lt;/code&amp;gt; authorize themselves for the &amp;lt;code&amp;gt;rt5&amp;lt;/code&amp;gt; database using an &amp;lt;code&amp;gt;md5&amp;lt;/code&amp;gt; crypted password over a network connection (possibly using the localhost loopback network). You might be able to further restrict some of these fields for improved security, but doing so is outside the scope of this install guide. Refer to [https://www.postgresql.org/docs/current/auth-pg-hba-conf.html the pg_hba.conf documentation] for more details.&lt;br /&gt;
&lt;br /&gt;
Save your changes and reload the database:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo systemctl reload postgresql&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Installing the PostgreSQL client libraries ===&lt;br /&gt;
&lt;br /&gt;
These are required for RT to be able to talk to any PostgreSQL server.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install libpq-dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install postgresql-devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Once this is done you can skip ahead to installing RT.&lt;br /&gt;
&lt;br /&gt;
=== Installing and configuring the MariaDB server ===&lt;br /&gt;
&lt;br /&gt;
If you want to install a fresh MariaDB database server alongside RT:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install mariadb-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install mariadb-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In order to set up RT’s database, you will need a MySQL superuser account. To stay consistent with PostgreSQL, I suggest setting a password for it. You can do that by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo mysql mysql&lt;br /&gt;
MariaDB [mysql]&amp;amp;gt; GRANT ALL PRIVILEGES ON rt5.* TO rt_admin@localhost IDENTIFIED BY &#039;YourPassphraseHere&#039; WITH GRANT OPTION;&amp;lt;/pre&amp;gt;&lt;br /&gt;
Record your passphrase; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
=== Adjust MariaDB’s max_allowed_packet setting ===&lt;br /&gt;
&lt;br /&gt;
You need to consider this step whether you install the database locally, or use an existing one already running. [https://mariadb.com/kb/en/server-system-variables/#max_allowed_packet MariaDB’s &amp;lt;code&amp;gt;max_allowed_packet&amp;lt;/code&amp;gt; setting] functionally limits the size of attachments in RT. The default is 16MiB, which is too small for most installations. You can ultimately choose any setting you’re comfortable with; 64MiB here should allow most requests without being too open.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;echo -e &#039;[server]\nmax_allowed_packet=64M&#039; | sudo tee /etc/mysql/conf.d/max_allowed_packet.cnf&lt;br /&gt;
sudo systemctl reload mariadb&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;echo -e &#039;[server]\nmax_allowed_packet=64M&#039; | sudo tee /etc/my.cnf.d/max_allowed_packet.cnf&lt;br /&gt;
sudo systemctl reload mariadb&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Installing the MariaDB client libraries ===&lt;br /&gt;
&lt;br /&gt;
These are required for RT to be able to talk to any MariaDB server.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install libmariadb-dev libmariadb-dev-compat&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install mariadb-devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Install RT ==&lt;br /&gt;
&lt;br /&gt;
=== Create an RT system group ===&lt;br /&gt;
&lt;br /&gt;
This group will be used throughout the install process to control access to sensitive files. Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo groupadd --system rt&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Get and unpack the RT source code ===&lt;br /&gt;
&lt;br /&gt;
Download the latest source code using the link on the [https://bestpractical.com/download-page RT download page], extract it using &amp;lt;code&amp;gt;tar -xf&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt; into the source code directory to run the rest of the commands in this section. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;curl -O https://download.bestpractical.com/pub/rt/release/rt-5.0.2.tar.gz&lt;br /&gt;
tar -xf rt-5.0.2.tar.gz&lt;br /&gt;
cd rt-5.0.2&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Pre-configure RT ===&lt;br /&gt;
&lt;br /&gt;
This command will detect some information about your system in order to install RT properly, and decide which set of dependencies to install. Here’s what the different parts of our command are doing:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;PERL=…&amp;lt;/code&amp;gt; configures RT to run under Perl with some options that load its dependencies from a dedicated directory. The &amp;lt;code&amp;gt;/opt/rt5&amp;lt;/code&amp;gt; part of this string should match your &amp;lt;code&amp;gt;prefix&amp;lt;/code&amp;gt; setting (see next item). If you know you want to use a specific Perl installed on your system, you can specify its full path instead of the plain &amp;lt;code&amp;gt;perl&amp;lt;/code&amp;gt; here.&lt;br /&gt;
* &amp;lt;code&amp;gt;--prefix=/opt/rt5&amp;lt;/code&amp;gt; sets the directory where RT will install all of its libraries, tools, and supporting files. You can choose another path if you like.&lt;br /&gt;
* &amp;lt;code&amp;gt;--with-db-type=TYPE&amp;lt;/code&amp;gt; - Replace &amp;lt;code&amp;gt;TYPE&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;Pg&amp;lt;/code&amp;gt; for PostgreSQL, or &amp;lt;code&amp;gt;mysql&amp;lt;/code&amp;gt; for MariaDB.&lt;br /&gt;
* &amp;lt;code&amp;gt;--with-web-group=rt&amp;lt;/code&amp;gt; installs RT using the dedicated group we created earlier.&lt;br /&gt;
* The rest of the options tell RT to install additional dependencies for optional features.&lt;br /&gt;
&lt;br /&gt;
Make sure you have &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt;ed into the RT source directory, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;PERL=&amp;quot;/usr/bin/env -S perl -I/opt/rt5/local/lib/perl5&amp;quot; ./configure --prefix=/opt/rt5 --with-db-type=TYPE --with-web-group=rt --with-attachment-store=disk --enable-externalauth --enable-gd --enable-graphviz --enable-gpg --enable-smime&amp;lt;/pre&amp;gt;&lt;br /&gt;
For more background, [https://docs.bestpractical.com/rt/latest/configure.html refer to the RT configure options documentation].&lt;br /&gt;
&lt;br /&gt;
=== Install RT and its Perl dependencies ===&lt;br /&gt;
&lt;br /&gt;
This command will download, build, and install all of the Perl modules necessary to run RT with the configuration you set above. Here’s what the different parts of the command are doing:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;make dirs&amp;lt;/code&amp;gt; creates RT&#039;s directory structure, so we can install dependencies inside it.&lt;br /&gt;
* &amp;lt;code&amp;gt;make fixdeps&amp;lt;/code&amp;gt; actually installs those dependencies.&lt;br /&gt;
* &amp;lt;code&amp;gt;RT_FIX_DEPS_CMD=…&amp;lt;/code&amp;gt; tells RT to use cpanminus to install dependencies (instead of the older, default &amp;lt;code&amp;gt;cpan&amp;lt;/code&amp;gt; command) inside RT&#039;s directory structure.&lt;br /&gt;
* &amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt; installs all of RT’s files under &amp;lt;code&amp;gt;/opt/rt5&amp;lt;/code&amp;gt; (or the prefix directory you set earlier). It will only run if &amp;lt;code&amp;gt;fixdeps&amp;lt;/code&amp;gt; succeeded.&lt;br /&gt;
&lt;br /&gt;
Make sure you have &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt;ed into the RT source directory, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo make dirs&lt;br /&gt;
make fixdeps RT_FIX_DEPS_CMD=&amp;quot;cpanm --sudo --local-lib-contained=/opt/rt5/local&amp;quot;&lt;br /&gt;
sudo make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
If it works, the command will eventually output a message that says “Congratulations. RT is now installed.” followed by instructions about configuring and setting up the database. We’ll do that next.&lt;br /&gt;
&lt;br /&gt;
=== Configure RT ===&lt;br /&gt;
&lt;br /&gt;
[https://docs.bestpractical.com/rt/latest/RT_Config.html RT has many configuration options.] You can put configuration options in the file &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/code&amp;gt;, or in individual files under &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.d/&amp;lt;/code&amp;gt;. Use an editor to save all the text below to &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/code&amp;gt; (you can just overwrite the existing file, or add this to the bottom of what’s there) and then fill in settings for your site everywhere the text &amp;lt;code&amp;gt;EDIT WITH&amp;lt;/code&amp;gt; appears.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Single-quote all values EXCEPT the special value `undef`&lt;br /&gt;
# that turns off a setting.&lt;br /&gt;
&lt;br /&gt;
# rtname appears in ticket email subjects. It needs to be globally unique,&lt;br /&gt;
# so use your organization&#039;s domain name.&lt;br /&gt;
Set($rtname, &#039;EDIT WITH yourdomain.example.com&#039;);&lt;br /&gt;
# Organization is used in the database for ticket links, etc. It also needs to&lt;br /&gt;
# be globally unique, so use your organization&#039;s domain name.&lt;br /&gt;
Set($Organization, &#039;EDIT WITH yourdomain.example.com&#039;);&lt;br /&gt;
# WebDomain is domain name of the RT web server. RT uses it to construct links&lt;br /&gt;
# and defend against CSRFs.&lt;br /&gt;
Set($WebDomain, &#039;EDIT WITH rt.yourdomain.example.com&#039;);&lt;br /&gt;
# WebPort is the port where the RT web server runs. Edit the number below if&lt;br /&gt;
# you&#039;re not using the standard HTTPS port.&lt;br /&gt;
Set($WebPort, &#039;443&#039;);&lt;br /&gt;
# WebPath is the path where the RT web server runs on your WebDomain.&lt;br /&gt;
# Edit the path below if you&#039;re using a specific path.&lt;br /&gt;
Set($WebPath, &#039;/&#039;);&lt;br /&gt;
&lt;br /&gt;
# DatabaseUser is the name of the database account RT uses to read and store&lt;br /&gt;
# data. &#039;rt_user&#039; is the default but you can change it if you like.&lt;br /&gt;
# DO NOT use the &#039;rt_admin&#039; superuser created in the instructions above.&lt;br /&gt;
Set($DatabaseUser, &#039;rt_user&#039;);&lt;br /&gt;
# DatabasePassword is the password for DatabaseUser.&lt;br /&gt;
Set($DatabasePassword, &#039;EDIT WITH SomePassphraseHere&#039;);&lt;br /&gt;
# DatabaseHost is the hostname of the database server RT should use.&lt;br /&gt;
# Change &#039;localhost&#039; if it lives on a different server.&lt;br /&gt;
Set($DatabaseHost, &#039;localhost&#039;);&lt;br /&gt;
# DatabasePort is the port number of the database server RT should use.&lt;br /&gt;
# `undef` means the default for that database. Change it if you&#039;re not&lt;br /&gt;
# using the standard port.&lt;br /&gt;
Set($DatabasePort, undef);&lt;br /&gt;
# DatabaseName is the name of RT&#039;s database hosted on DatabaseHost.&lt;br /&gt;
# &#039;rt5&#039; is the default but you can change it if you like.&lt;br /&gt;
Set($DatabaseName, &#039;rt5&#039;);&lt;br /&gt;
# DatabaseAdmin is the name of the user in the database used to perform&lt;br /&gt;
# major administrative tasks. Change &#039;rt_admin&#039; if you&#039;re using a user&lt;br /&gt;
# besides the one created in this guide.&lt;br /&gt;
Set($DatabaseAdmin, &#039;rt_admin&#039;);&lt;br /&gt;
&lt;br /&gt;
# RT can log to syslog, stderr, and/or a dedicated file.&lt;br /&gt;
# Log settings are used both by the primary server and by command line&lt;br /&gt;
# tools like rt-crontool, rt-ldapimport, etc.&lt;br /&gt;
# You set all of RT&#039;s $LogTo* paramaters to a standard log level: &#039;debug&#039;,&lt;br /&gt;
# &#039;info&#039;, &#039;notice&#039;, &#039;warning&#039;, &#039;error&#039;, &#039;critical&#039;, &#039;alert&#039;, or &#039;emergency&#039;.&lt;br /&gt;
# For a modern install, I recommend logging primarily to syslog, so it goes&lt;br /&gt;
# to journald where it&#039;s easy to query and automatically gets rotated.&lt;br /&gt;
Set($LogToSyslog, &#039;info&#039;);&lt;br /&gt;
&lt;br /&gt;
# When the RT server logs to stderr, that usually goes to your web server&#039;s&lt;br /&gt;
# error log. Command line tools log to their own stderr. Setting this to&lt;br /&gt;
# &#039;warning&#039; or &#039;error&#039; helps ensure you get notified if RT&#039;s cron jobs&lt;br /&gt;
# encounter problems.&lt;br /&gt;
Set($LogToSTDERR, &#039;warning&#039;);&lt;br /&gt;
&lt;br /&gt;
# Turn off optional features that require additional configuration.&lt;br /&gt;
# If you want to use these, refer to the RT_Config documentation for&lt;br /&gt;
# instructions on how to set them up.&lt;br /&gt;
Set(%GnuPG, &#039;Enable&#039; =&amp;gt; &#039;0&#039;);&lt;br /&gt;
Set(%SMIME, &#039;Enable&#039; =&amp;gt; &#039;0&#039;);&lt;br /&gt;
&lt;br /&gt;
# Perl expects to find this 1 at the end of the file.&lt;br /&gt;
1;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;RT_SiteConfig.pm&amp;lt;/code&amp;gt; is actually Perl code. RT runs the code directly to load the configuration. Any time you finish editing it, you can check that you didn’t make any syntax errors by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;perl -c /opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Set up RT’s database ===&lt;br /&gt;
&lt;br /&gt;
RT includes a tool to help you set up its database. By default, it connects to the database as an administrator to create the database and user that you configured in the previous step.&lt;br /&gt;
&lt;br /&gt;
(The instructions from &amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt; and RT’s README file tell you to run &amp;lt;code&amp;gt;make initialize-database&amp;lt;/code&amp;gt;. That just runs &amp;lt;code&amp;gt;rt-setup-database&amp;lt;/code&amp;gt; for you. Running the tool directly makes it easier to pass the options you need.)&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;--action=init&amp;lt;/code&amp;gt; tells the tool to create the user, the database, the tables inside it, and insert core data RT needs to function.&lt;br /&gt;
* &#039;&#039;&#039;If&#039;&#039;&#039; you are using an existing database server and the database adminstrator has already created the user account and database for RT, then you can add the &amp;lt;code&amp;gt;--skip-create&amp;lt;/code&amp;gt; option.&lt;br /&gt;
* &#039;&#039;&#039;If&#039;&#039;&#039; you have a less common database setup, this tool has additional options to give you finer-grained control over what steps are run and how. Refer to [https://docs.bestpractical.com/rt/latest/rt-setup-database.html the full rt-setup-database documentation] to learn more about those.&lt;br /&gt;
* The command reads files from RT’s &amp;lt;code&amp;gt;etc/&amp;lt;/code&amp;gt; directory by default, so the easiest way to run it is to &amp;lt;code&amp;gt;cd /opt/rt5&amp;lt;/code&amp;gt; first, and then it will find the necessary files automatically.&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /opt/rt5&lt;br /&gt;
sudo sbin/rt-setup-database --action=init&amp;lt;/pre&amp;gt;&lt;br /&gt;
Enter the password for your database administrator account when prompted.&lt;br /&gt;
&lt;br /&gt;
=== Set up fulltext indexing ===&lt;br /&gt;
&lt;br /&gt;
Fulltext indexing speeds up searches for ticket content, which makes RT a lot nicer to use.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;--noask&amp;lt;/code&amp;gt; uses the default names for the index, which will be fine for a new install and simplifies the setup.&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo /opt/rt5/sbin/rt-setup-fulltext-index --noask&amp;lt;/pre&amp;gt;&lt;br /&gt;
Enter the password for your database administrator account when prompted. The end of the process will output some RT configuration that looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;### EXAMPLE OUTPUT ONLY - Don&#039;t use this directly!&lt;br /&gt;
Set( %FullTextSearch,&lt;br /&gt;
    Enable     =&amp;gt; 1,&lt;br /&gt;
    Indexed    =&amp;gt; 1,&lt;br /&gt;
    # Additional output from rt-setup-fulltext-index should be here.&lt;br /&gt;
    # The configuration varies by database type.&lt;br /&gt;
);&amp;lt;/pre&amp;gt;&lt;br /&gt;
Copy the output generated when you run &amp;lt;code&amp;gt;rt-setup-fulltext-index&amp;lt;/code&amp;gt; and save it to the file &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.d/FulltextIndex.pm&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Set permissions ===&lt;br /&gt;
&lt;br /&gt;
All of RT’s configuration files should be readable by the user that runs the web server, and no other users, in order to protect sensitive information like the database password. RT provides a command to set permissions appropriately according to your distribution and configuration. &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt; to the directory where you extracted the RT source code, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd rt-5.0.2&lt;br /&gt;
sudo make fixperms&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Verify the installation ===&lt;br /&gt;
&lt;br /&gt;
If everything has gone well, then you should be able to set a password for RT’s &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; user. You’ll use this later to log in to the web interface and continue setting up your system. Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo /opt/rt5/sbin/rt-passwd root&amp;lt;/pre&amp;gt;&lt;br /&gt;
Set the password when prompted. Record this; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
== Set up RT FastCGI service ==&lt;br /&gt;
&lt;br /&gt;
=== Create the RT service ===&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo systemctl edit --force --full rt-server.service&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This opens an editor to define the RT service to systemd. Use the editor to add this text to the file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[Unit]&lt;br /&gt;
Description=RT FCGI server&lt;br /&gt;
&lt;br /&gt;
[Service]&lt;br /&gt;
# The --forks option is the number of RT servers to run in parallel.&lt;br /&gt;
# 3 should be good for most initial installs. You can increase this&lt;br /&gt;
# number later if needed for performance.&lt;br /&gt;
ExecStart=/usr/bin/multiwatch --forks=3 --signal=TERM -- /opt/rt5/sbin/rt-server.fcgi&lt;br /&gt;
StandardInput=socket&lt;br /&gt;
DynamicUser=true&lt;br /&gt;
SupplementaryGroups=rt&lt;br /&gt;
UMask=027&lt;br /&gt;
&lt;br /&gt;
CapabilityBoundingSet=&lt;br /&gt;
DevicePolicy=closed&lt;br /&gt;
PrivateMounts=true&lt;br /&gt;
PrivateNetwork=false&lt;br /&gt;
PrivateTmp=true&lt;br /&gt;
PrivateUsers=true&lt;br /&gt;
ProtectControlGroups=true&lt;br /&gt;
ProtectHome=true&lt;br /&gt;
ProtectSystem=full&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save the file and close your editor.&lt;br /&gt;
&lt;br /&gt;
=== Create the RT socket ===&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo systemctl edit --force --full rt-server.socket&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This opens an editor to define the RT socket to systemd. Use the editor to add this text to the file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[Unit]&lt;br /&gt;
Description=RT FCGI server socket&lt;br /&gt;
Wants=network.target&lt;br /&gt;
After=network.target&lt;br /&gt;
Before=apache2.service httpd.service nginx.service&lt;br /&gt;
&lt;br /&gt;
[Install]&lt;br /&gt;
WantedBy=sockets.target&lt;br /&gt;
&lt;br /&gt;
[Socket]&lt;br /&gt;
# ListenStream defines the address and port where the RT FastCGI server listens.&lt;br /&gt;
# This is NOT the web server itself, so don&#039;t make this port 80, 443, etc.&lt;br /&gt;
# You may edit this if you like, but note:&lt;br /&gt;
# Connections are unencrypted. You should only listen on a secure network&lt;br /&gt;
# interface.&lt;br /&gt;
# The server can only accept a single socket. You cannot specify more than&lt;br /&gt;
# one ListenStream address.&lt;br /&gt;
ListenStream=[::1]:5000&lt;br /&gt;
Accept=no&lt;br /&gt;
FreeBind=yes&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save the file and close your editor.&lt;br /&gt;
&lt;br /&gt;
=== Enable the RT socket ===&lt;br /&gt;
&lt;br /&gt;
Load the new services into RT, start the server socket, and enable it on future boots:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo systemctl daemon-reload&lt;br /&gt;
sudo systemctl enable --now rt-server.socket&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s web server ==&lt;br /&gt;
&lt;br /&gt;
Fully documenting how to set up a web server configured for your network with encryption is outside the scope of this guide. This page only highlights the configuration you need to pass web requests onto the RT FastCGI service.&lt;br /&gt;
&lt;br /&gt;
=== nginx ===&lt;br /&gt;
&lt;br /&gt;
Make sure you have the necessary packages installed:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install nginx&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install nginx&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In the &amp;lt;code&amp;gt;http server&amp;lt;/code&amp;gt; configuration blocks where you want to serve RT, add a configuration block like this, &#039;&#039;&#039;above&#039;&#039;&#039; any other &amp;lt;code&amp;gt;location&amp;lt;/code&amp;gt; blocks:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# The location path should match the WebPath in your RT site configuration.&lt;br /&gt;
location / {&lt;br /&gt;
  include /etc/nginx/fastcgi.conf;&lt;br /&gt;
  # SCRIPT_NAME should match RT&#039;s WebPath, without a trailing slash.&lt;br /&gt;
  # This means when WebPath is /, it&#039;s the empty string &amp;quot;&amp;quot;.&lt;br /&gt;
  fastcgi_param SCRIPT_NAME &amp;quot;&amp;quot;;&lt;br /&gt;
  # This network location should match the ListenStream in rt-server.socket.&lt;br /&gt;
  fastcgi_pass localhost:5000;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you&#039;re doing a fresh install, the default &amp;lt;code&amp;gt;http server&amp;lt;/code&amp;gt; configuration location varies by distribution:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|Edit &amp;lt;code&amp;gt;/etc/nginx/sites-available/default&amp;lt;/code&amp;gt;&lt;br /&gt;
|Add a new file &amp;lt;code&amp;gt;/etc/nginx/default.d/rt-server.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
After you’ve edited your configuration, load it by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo systemctl reload nginx&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once this is done you can skip ahead to Verify the web interface.&lt;br /&gt;
&lt;br /&gt;
=== Apache httpd ===&lt;br /&gt;
&lt;br /&gt;
Make sure you have the necessary packages installed, and the proxy_fcgi module enabled:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install apache2&lt;br /&gt;
sudo a2enmod proxy&lt;br /&gt;
sudo a2enmod proxy_fcgi&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install httpd&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In the &amp;lt;code&amp;gt;&amp;amp;lt;VirtualHost&amp;amp;gt;&amp;lt;/code&amp;gt; configuration blocks where you want to serve RT, add a configuration block like this, &#039;&#039;&#039;above&#039;&#039;&#039; any other &amp;lt;code&amp;gt;Alias&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;ProxyPass&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;ScriptAlias&amp;lt;/code&amp;gt; lines:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# SCRIPT_NAME should match RT&#039;s WebPath, without a trailing slash.&lt;br /&gt;
# This means when WebPath is /, it&#039;s the empty string &amp;quot;&amp;quot;.&lt;br /&gt;
ProxyFCGISetEnvIf true SCRIPT_NAME &amp;quot;&amp;quot;&lt;br /&gt;
# The location path in the first argument should match the WebPath in your&lt;br /&gt;
# RT site configuration.  The network location after fcgi:// should match&lt;br /&gt;
# the ListenStream in rt-server.socket.&lt;br /&gt;
ProxyPass / fcgi://localhost:5000/&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you&#039;re doing a fresh install, the default &amp;lt;code&amp;gt;&amp;amp;lt;VirtualHost&amp;amp;gt;&amp;lt;/code&amp;gt; configuration location varies by distribution and whether or not you&#039;re using HTTPS:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|With HTTPS: &amp;lt;code&amp;gt;/etc/apache2/sites-available/default-ssl.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
With plain HTTP: &amp;lt;code&amp;gt;/etc/apache2/sites-available/000-default.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
|With HTTPS: &amp;lt;code&amp;gt;/etc/httpd/conf.d/ssl.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
With plain HTTP: Write a new file &amp;lt;code&amp;gt;/etc/httpd/conf.d/vhost_RT.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
After you’ve edited your configuration, load it by running:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo systemctl reload apache2&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo systemctl reload httpd&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Verify the web interface ===&lt;br /&gt;
&lt;br /&gt;
You should be able to visit your web server in your browser, and be presented with RT’s login screen. You should be able to log in with username &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; and the password you set previously.&lt;br /&gt;
&lt;br /&gt;
If the web server returns a 502 Bad Gateway response, it&#039;s having trouble connecting to the RT FCGI server. Check the error logs for your web server:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 33%;&amp;quot;|nginx&lt;br /&gt;
! style=&amp;quot;width: 33%;&amp;quot;|Apache on Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 33%;&amp;quot;|httpd on Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;/var/log/nginx/error.log&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;/var/log/apache2/error.log&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;/var/log/httpd/error_log&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For all kinds of errors, you can check the logs for the RT FCGI server and its socket:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo journalctl --unit rt-server.\*&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s mail server ==&lt;br /&gt;
&lt;br /&gt;
RT both can both send and receive ticket updates via email. Unfortunately, there are too many variables to document a useful setup process here: getting this working usually requires creating DNS records, and coordinating with existing mail servers, which will be the main constraint on your setup. Instead this guide provides a brief overview of how the integration works, and where the connection points are that you likely need to work on.&lt;br /&gt;
&lt;br /&gt;
=== Sending Mail ===&lt;br /&gt;
&lt;br /&gt;
RT only knows how to send mail by passing it off to another program on the system. It cannot connect or authenticate directly to external mail servers. In the default configuration, RT runs the standard &amp;lt;code&amp;gt;sendmail&amp;lt;/code&amp;gt; command. There are [https://docs.bestpractical.com/rt/latest/RT_Config.html#Outgoing-mail configuration options to send mail through different commands] if you need.&lt;br /&gt;
&lt;br /&gt;
The most common setup is to install and configure a proper Mail Transfer Agent (MTA) like Postfix or Exim, and then configure it to send mail to the wider Internet as you need. This works well because the MTAs are robust and well-tested; they have flexible configuration to let you send mail out by relaying to other mail servers you specify with optional authentication; and most distributions install one by default anyway. The only hard part is configuring the MTA to send mail following your site’s policies.&lt;br /&gt;
&lt;br /&gt;
Other software is available that provides a slimmer version of the &amp;lt;code&amp;gt;sendmail&amp;lt;/code&amp;gt; command that connects to an external mail server for you, like msmtp. These programs are usually easier to configure than an MTA, but they often lose email permanently if they can’t connect to the external server at the time it’s sent. (MTAs keep email queued locally until they successfully deliver it to another server.)&lt;br /&gt;
&lt;br /&gt;
=== Receiving email ===&lt;br /&gt;
&lt;br /&gt;
RT installs a command called &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; that receives an email on standard input and posts it to RT’s REST web interface, where it gets saved in the database and added to a ticket. You need to arrange for a way to send incoming email to this command.&lt;br /&gt;
&lt;br /&gt;
The most common setup is to have an MTA on the same box as RT receive email directly, and then set up mail aliases that call this command when mail comes in. Example &amp;lt;code&amp;gt;/etc/aliases&amp;lt;/code&amp;gt; entries look like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rt: &amp;quot;|/opt/rt5/bin/rt-mailgate --queue general --action correspond --url https://rt.yourdomain.example.com/&amp;quot;&lt;br /&gt;
rt-comment: &amp;quot;|/opt/rt5/bin/rt-mailgate --queue general --action comment --url https://rt.yourdomain.example.com/&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
This works well because, again, you’re probably running an MTA anyway; and the MTA can hold and queue mail if it comes in while RT is down for any reason, giving you a buffer against downtime.&lt;br /&gt;
&lt;br /&gt;
Another common option is to periodically run a tool that fetches mail using a protocol like IMAP, like fetchmail or getmail, and passes it on to &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt;. This is less common because it requires setting up another tool to run, and securely storing another set of mail server credentials. But it is useful when local policy prevents the RT server from receiving email directly.&lt;br /&gt;
&lt;br /&gt;
This is much less common, but it might help to know that &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; doesn’t have to run on the same system as RT itself. It just needs to be able to connect to RT’s web interface. If you don’t have any other options, you can install the RT software on a different system that receives email, and configure &#039;&#039;that&#039;&#039; system to run &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; and pass it on to the RT server. To do that, just repeat the installation instructions above, skipping the steps about installing the database and web server.&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s background jobs ==&lt;br /&gt;
&lt;br /&gt;
Create a file &amp;lt;code&amp;gt;/etc/cron.d/rt&amp;lt;/code&amp;gt; with the following content. You may edit all of the time fields as you see fit. Refer to the crontab(5) man page for details about their definitions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Update the fulltext index with new ticket data&lt;br /&gt;
*/3 *   *   *   *   root    /opt/rt5/sbin/rt-fulltext-indexer&lt;br /&gt;
# Email out dashboards that users have subscribed to&lt;br /&gt;
0   *   *   *   *   root    /opt/rt5/sbin/rt-email-dashboards&lt;br /&gt;
# Clean old sessions from the database&lt;br /&gt;
10  3   *   *   *   root    /opt/rt5/sbin/rt-clean-sessions --older 8d&lt;br /&gt;
# Email out weekly digests for users who have requested it&lt;br /&gt;
50  4   *   *   Mon root    /opt/rt5/sbin/rt-email-digest -m weekly&lt;br /&gt;
# Email out daily digests for users who have requested it&lt;br /&gt;
50  5   *   *   *   root    /opt/rt5/sbin/rt-email-digest -m daily&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Set up RT ==&lt;br /&gt;
&lt;br /&gt;
If you’ve gotten this far, congratulations, your RT install is really done now. You can start setting up RT with users, groups, queues, and business logic. [[Main Page|Head back to the main page]] to start exploring those topics.&lt;/div&gt;</summary>
		<author><name>Brett</name></author>
	</entry>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=ManualInstallation&amp;diff=27080</id>
		<title>ManualInstallation</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=ManualInstallation&amp;diff=27080"/>
		<updated>2022-05-18T15:54:45Z</updated>

		<summary type="html">&lt;p&gt;Brett: remove service security options that interfere with calling suid/guid executables (e.g., for sendmail)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Prev: [[ManualRequirements]] — Up: [[UserManual]] — Next: [[ManualApacheConfig]]&lt;br /&gt;
&lt;br /&gt;
This guide walks you through installing RT from source on a modern, popular Linux distro. Specifically, that means a distribution based on Debian or Red Hat that’s been released since around 2020.&lt;br /&gt;
&lt;br /&gt;
This guide assumes:&lt;br /&gt;
&lt;br /&gt;
* You can install packages generally available in Debian/Ubuntu or Red Hat/Fedora/CentOS.&lt;br /&gt;
* You want to install RT, and all of its Perl dependencies, from source to get the latest versions. (This is a trade-off. It means the boundaries of your install will be very clear, but you won’t get security updates for RT or Perl modules from your distribution.)&lt;br /&gt;
* You are willing to install a couple of extra tools to manage the RT installation similarly to how you would in other packaging systems (like PyPI, npm, etc.).&lt;br /&gt;
* You are willing to do a relatively maximal install of RT, enabling all the options during installation and then setting what you need in the configuration. (You could save a little space and time by being pickier about your options, but then that complicates the guide and makes it harder to turn those options on later if you want.)&lt;br /&gt;
* You are using a regular user account on the Linux system that can get superuser privileges with sudo.&lt;br /&gt;
&lt;br /&gt;
== Install the base dependencies ==&lt;br /&gt;
&lt;br /&gt;
These are required by RT, either to run or to install the dependencies.&lt;br /&gt;
&lt;br /&gt;
=== Debian/Ubuntu ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo apt install autoconf build-essential cpanminus curl libexpat-dev libgd-dev libssl-dev libz-dev gnupg graphviz multiwatch openssl perl w3m&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Red Hat Enterprise Linux ===&lt;br /&gt;
&lt;br /&gt;
These instructions are for RHEL specifically. For RHEL-derived distributions like CentOS and Rocky, go to the next section.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;MAJDISTVER=&amp;quot;$(. /etc/os-release &amp;amp;&amp;amp; echo &amp;quot;${VERSION_ID%%.*}&amp;quot;)&amp;quot;&lt;br /&gt;
sudo subscription-manager repos --enable &amp;quot;codeready-builder-for-rhel-$MAJDISTVER-$(arch)-rpms&amp;quot;&lt;br /&gt;
sudo dnf install &amp;quot;https://dl.fedoraproject.org/pub/epel/epel-release-latest-$MAJDISTVER.noarch.rpm&amp;quot;&lt;br /&gt;
sudo dnf install patch tar which gcc gcc-c++ perl-core perl-App-cpanminus graphviz expat-devel gd-devel multiwatch openssl openssl-devel w3m&lt;br /&gt;
sudo sed -i~ &#039;/^SELINUX=/ c SELINUX=disabled&#039; /etc/selinux/config&lt;br /&gt;
sudo setenforce 0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Turning off SELinux enforcement is required on Red Hat-based distributions because, as of March 2022, nobody has written a policy for RT.)&lt;br /&gt;
&lt;br /&gt;
=== RHEL Community Distributions: Fedora/CentOS/Rocky ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo dnf install epel-release&lt;br /&gt;
sudo dnf install patch tar which gcc gcc-c++ perl-core perl-App-cpanminus graphviz expat-devel gd-devel multiwatch openssl openssl-devel w3m&lt;br /&gt;
sudo sed -i~ &#039;/^SELINUX=/ c SELINUX=disabled&#039; /etc/selinux/config&lt;br /&gt;
sudo setenforce 0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Turning off SELinux enforcement is required on Red Hat-based distributions because, as of March 2022, nobody has written a policy for RT.)&lt;br /&gt;
&lt;br /&gt;
== Install a database ==&lt;br /&gt;
&lt;br /&gt;
You need access to a database server. It can be remote, or you can install a database server alongside RT. RT supports a few different databases, but the best supported options are PostgreSQL and MariaDB.&lt;br /&gt;
&lt;br /&gt;
=== Installing and configuring the PostgreSQL server ===&lt;br /&gt;
&lt;br /&gt;
If you want to install a fresh PostgreSQL database server alongside RT:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install postgresql&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install postgresql-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In order to set up RT’s database, you will need a PostgreSQL account that can create databases and roles and be authenticated with a password. If you don’t have that, you can create it by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo createuser --createdb --createrole --login --pwprompt rt_admin&amp;lt;/pre&amp;gt;&lt;br /&gt;
Set the password when prompted. Record this; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
=== Enable password authentication in PostgreSQL ===&lt;br /&gt;
&lt;br /&gt;
You need to consider this step whether you install the database locally, or use an existing one already running. RT supports connecting to PostgreSQL a few different ways, but authenticating with a username and password is simplest, and this guide is written based on that. Not all PostgreSQL installations allow this authentication method by default. You need to review your &amp;lt;code&amp;gt;pg_hba.conf&amp;lt;/code&amp;gt; file located at:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;/etc/postgresql/VERSION/main/pg_hba.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;/var/lib/pgsql/VERSION/data/pg_hba.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Replace &amp;lt;code&amp;gt;VERSION&amp;lt;/code&amp;gt; with the version of your PostgreSQL database. Add these two lines &#039;&#039;&#039;above&#039;&#039;&#039; any other lines that start with &amp;lt;code&amp;gt;host&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;host  rt5  rt_user   all  md5&lt;br /&gt;
host  rt5  rt_admin  all  md5&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This configuration will let &amp;lt;code&amp;gt;rt_user&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;rt_admin&amp;lt;/code&amp;gt; authorize themselves for the &amp;lt;code&amp;gt;rt5&amp;lt;/code&amp;gt; database using an &amp;lt;code&amp;gt;md5&amp;lt;/code&amp;gt; crypted password over a network connection (possibly using the localhost loopback network). You might be able to further restrict some of these fields for improved security, but doing so is outside the scope of this install guide. Refer to [https://www.postgresql.org/docs/current/auth-pg-hba-conf.html the pg_hba.conf documentation] for more details.&lt;br /&gt;
&lt;br /&gt;
Save your changes and reload the database:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo systemctl reload postgresql&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Installing the PostgreSQL client libraries ===&lt;br /&gt;
&lt;br /&gt;
These are required for RT to be able to talk to any PostgreSQL server.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install libpq-dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install postgresql-devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Once this is done you can skip ahead to installing RT.&lt;br /&gt;
&lt;br /&gt;
=== Installing and configuring the MariaDB server ===&lt;br /&gt;
&lt;br /&gt;
If you want to install a fresh MariaDB database server alongside RT:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install mariadb-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install mariadb-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In order to set up RT’s database, you will need a MySQL superuser account. To stay consistent with PostgreSQL, I suggest setting a password for it. You can do that by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo mysql mysql&lt;br /&gt;
MariaDB [mysql]&amp;amp;gt; GRANT ALL PRIVILEGES ON rt5.* TO rt_admin@localhost IDENTIFIED BY &#039;YourPassphraseHere&#039; WITH GRANT OPTION;&amp;lt;/pre&amp;gt;&lt;br /&gt;
Record your passphrase; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
=== Adjust MariaDB’s max_allowed_packet setting ===&lt;br /&gt;
&lt;br /&gt;
You need to consider this step whether you install the database locally, or use an existing one already running. [https://mariadb.com/kb/en/server-system-variables/#max_allowed_packet MariaDB’s &amp;lt;code&amp;gt;max_allowed_packet&amp;lt;/code&amp;gt; setting] functionally limits the size of attachments in RT. The default is 16MiB, which is too small for most installations. You can ultimately choose any setting you’re comfortable with; 64MiB here should allow most requests without being too open.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;echo -e &#039;[server]\nmax_allowed_packet=64M&#039; | sudo tee /etc/mysql/conf.d/max_allowed_packet.cnf&lt;br /&gt;
sudo systemctl reload mariadb&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;echo -e &#039;[server]\nmax_allowed_packet=64M&#039; | sudo tee /etc/my.cnf.d/max_allowed_packet.cnf&lt;br /&gt;
sudo systemctl reload mariadb&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Installing the MariaDB client libraries ===&lt;br /&gt;
&lt;br /&gt;
These are required for RT to be able to talk to any MariaDB server.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install libmariadb-dev libmariadb-dev-compat&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install mariadb-devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Install RT ==&lt;br /&gt;
&lt;br /&gt;
=== Create an RT system group ===&lt;br /&gt;
&lt;br /&gt;
This group will be used throughout the install process to control access to sensitive files. Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo groupadd --system rt&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Get and unpack the RT source code ===&lt;br /&gt;
&lt;br /&gt;
Download the latest source code using the link on the [https://bestpractical.com/download-page RT download page], extract it using &amp;lt;code&amp;gt;tar -xf&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt; into the source code directory to run the rest of the commands in this section. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;curl -O https://download.bestpractical.com/pub/rt/release/rt-5.0.2.tar.gz&lt;br /&gt;
tar -xf rt-5.0.2.tar.gz&lt;br /&gt;
cd rt-5.0.2&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Pre-configure RT ===&lt;br /&gt;
&lt;br /&gt;
This command will detect some information about your system in order to install RT properly, and decide which set of dependencies to install. Here’s what the different parts of our command are doing:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;PERL=…&amp;lt;/code&amp;gt; configures RT to run under Perl with some options that load its dependencies from a dedicated directory. The &amp;lt;code&amp;gt;/opt/rt5&amp;lt;/code&amp;gt; part of this string should match your &amp;lt;code&amp;gt;prefix&amp;lt;/code&amp;gt; setting (see next item). If you know you want to use a specific Perl installed on your system, you can specify its full path instead of the plain &amp;lt;code&amp;gt;perl&amp;lt;/code&amp;gt; here.&lt;br /&gt;
* &amp;lt;code&amp;gt;--prefix=/opt/rt5&amp;lt;/code&amp;gt; sets the directory where RT will install all of its libraries, tools, and supporting files. You can choose another path if you like.&lt;br /&gt;
* &amp;lt;code&amp;gt;--with-db-type=TYPE&amp;lt;/code&amp;gt; - Replace &amp;lt;code&amp;gt;TYPE&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;Pg&amp;lt;/code&amp;gt; for PostgreSQL, or &amp;lt;code&amp;gt;mysql&amp;lt;/code&amp;gt; for MariaDB.&lt;br /&gt;
* &amp;lt;code&amp;gt;--with-web-group=rt&amp;lt;/code&amp;gt; installs RT using the dedicated group we created earlier.&lt;br /&gt;
* The rest of the options tell RT to install additional dependencies for optional features.&lt;br /&gt;
&lt;br /&gt;
Make sure you have &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt;ed into the RT source directory, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;PERL=&amp;quot;/usr/bin/env -S perl -I/opt/rt5/local/lib/perl5&amp;quot; ./configure --prefix=/opt/rt5 --with-db-type=TYPE --with-web-group=rt --with-attachment-store=disk --enable-externalauth --enable-gd --enable-graphviz --enable-gpg --enable-smime&amp;lt;/pre&amp;gt;&lt;br /&gt;
For more background, [https://docs.bestpractical.com/rt/latest/configure.html refer to the RT configure options documentation].&lt;br /&gt;
&lt;br /&gt;
=== Install RT and its Perl dependencies ===&lt;br /&gt;
&lt;br /&gt;
This command will download, build, and install all of the Perl modules necessary to run RT with the configuration you set above. Here’s what the different parts of the command are doing:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;make dirs&amp;lt;/code&amp;gt; creates RT&#039;s directory structure, so we can install dependencies inside it.&lt;br /&gt;
* &amp;lt;code&amp;gt;make fixdeps&amp;lt;/code&amp;gt; actually installs those dependencies.&lt;br /&gt;
* &amp;lt;code&amp;gt;RT_FIX_DEPS_CMD=…&amp;lt;/code&amp;gt; tells RT to use cpanminus to install dependencies (instead of the older, default &amp;lt;code&amp;gt;cpan&amp;lt;/code&amp;gt; command) inside RT&#039;s directory structure.&lt;br /&gt;
* &amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt; installs all of RT’s files under &amp;lt;code&amp;gt;/opt/rt5&amp;lt;/code&amp;gt; (or the prefix directory you set earlier). It will only run if &amp;lt;code&amp;gt;fixdeps&amp;lt;/code&amp;gt; succeeded.&lt;br /&gt;
&lt;br /&gt;
Make sure you have &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt;ed into the RT source directory, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo make dirs&lt;br /&gt;
make fixdeps RT_FIX_DEPS_CMD=&amp;quot;cpanm --sudo --local-lib-contained=/opt/rt5/local&amp;quot;&lt;br /&gt;
sudo make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
If it works, the command will eventually output a message that says “Congratulations. RT is now installed.” followed by instructions about configuring and setting up the database. We’ll do that next.&lt;br /&gt;
&lt;br /&gt;
=== Configure RT ===&lt;br /&gt;
&lt;br /&gt;
[https://docs.bestpractical.com/rt/latest/RT_Config.html RT has many configuration options.] You can put configuration options in the file &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/code&amp;gt;, or in individual files under &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.d/&amp;lt;/code&amp;gt;. Use an editor to save all the text below to &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/code&amp;gt; (you can just overwrite the existing file, or add this to the bottom of what’s there) and then fill in settings for your site everywhere the text &amp;lt;code&amp;gt;EDIT WITH&amp;lt;/code&amp;gt; appears.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Single-quote all values EXCEPT the special value `undef`&lt;br /&gt;
# that turns off a setting.&lt;br /&gt;
&lt;br /&gt;
# rtname appears in ticket email subjects. It needs to be globally unique,&lt;br /&gt;
# so use your organization&#039;s domain name.&lt;br /&gt;
Set($rtname, &#039;EDIT WITH yourdomain.example.com&#039;);&lt;br /&gt;
# Organization is used in the database for ticket links, etc. It also needs to&lt;br /&gt;
# be globally unique, so use your organization&#039;s domain name.&lt;br /&gt;
Set($Organization, &#039;EDIT WITH yourdomain.example.com&#039;);&lt;br /&gt;
# WebDomain is domain name of the RT web server. RT uses it to construct links&lt;br /&gt;
# and defend against CSRFs.&lt;br /&gt;
Set($WebDomain, &#039;EDIT WITH rt.yourdomain.example.com&#039;);&lt;br /&gt;
# WebPort is the port where the RT web server runs. Edit the number below if&lt;br /&gt;
# you&#039;re not using the standard HTTPS port.&lt;br /&gt;
Set($WebPort, &#039;443&#039;);&lt;br /&gt;
# WebPath is the path where the RT web server runs on your WebDomain.&lt;br /&gt;
# Edit the path below if you&#039;re using a specific path.&lt;br /&gt;
Set($WebPath, &#039;/&#039;);&lt;br /&gt;
&lt;br /&gt;
# DatabaseUser is the name of the database account RT uses to read and store&lt;br /&gt;
# data. &#039;rt_user&#039; is the default but you can change it if you like.&lt;br /&gt;
# DO NOT use the &#039;rt_admin&#039; superuser created in the instructions above.&lt;br /&gt;
Set($DatabaseUser, &#039;rt_user&#039;);&lt;br /&gt;
# DatabasePassword is the password for DatabaseUser.&lt;br /&gt;
Set($DatabasePassword, &#039;EDIT WITH SomePassphraseHere&#039;);&lt;br /&gt;
# DatabaseHost is the hostname of the database server RT should use.&lt;br /&gt;
# Change &#039;localhost&#039; if it lives on a different server.&lt;br /&gt;
Set($DatabaseHost, &#039;localhost&#039;);&lt;br /&gt;
# DatabasePort is the port number of the database server RT should use.&lt;br /&gt;
# `undef` means the default for that database. Change it if you&#039;re not&lt;br /&gt;
# using the standard port.&lt;br /&gt;
Set($DatabasePort, undef);&lt;br /&gt;
# DatabaseName is the name of RT&#039;s database hosted on DatabaseHost.&lt;br /&gt;
# &#039;rt5&#039; is the default but you can change it if you like.&lt;br /&gt;
Set($DatabaseName, &#039;rt5&#039;);&lt;br /&gt;
# DatabaseAdmin is the name of the user in the database used to perform&lt;br /&gt;
# major administrative tasks. Change &#039;rt_admin&#039; if you&#039;re using a user&lt;br /&gt;
# besides the one created in this guide.&lt;br /&gt;
Set($DatabaseAdmin, &#039;rt_admin&#039;);&lt;br /&gt;
&lt;br /&gt;
# RT can log to syslog, stderr, and/or a dedicated file.&lt;br /&gt;
# Log settings are used both by the primary server and by command line&lt;br /&gt;
# tools like rt-crontool, rt-ldapimport, etc.&lt;br /&gt;
# You set all of RT&#039;s $LogTo* paramaters to a standard log level: &#039;debug&#039;,&lt;br /&gt;
# &#039;info&#039;, &#039;notice&#039;, &#039;warning&#039;, &#039;error&#039;, &#039;critical&#039;, &#039;alert&#039;, or &#039;emergency&#039;.&lt;br /&gt;
# For a modern install, I recommend logging primarily to syslog, so it goes&lt;br /&gt;
# to journald where it&#039;s easy to query and automatically gets rotated.&lt;br /&gt;
Set($LogToSyslog, &#039;info&#039;);&lt;br /&gt;
&lt;br /&gt;
# When the RT server logs to stderr, that usually goes to your web server&#039;s&lt;br /&gt;
# error log. Command line tools log to their own stderr. Setting this to&lt;br /&gt;
# &#039;warning&#039; or &#039;error&#039; helps ensure you get notified if RT&#039;s cron jobs&lt;br /&gt;
# encounter problems.&lt;br /&gt;
Set($LogToSTDERR, &#039;warning&#039;);&lt;br /&gt;
&lt;br /&gt;
# Turn off optional features that require additional configuration.&lt;br /&gt;
# If you want to use these, refer to the RT_Config documentation for&lt;br /&gt;
# instructions on how to set them up.&lt;br /&gt;
Set(%GnuPG, &#039;Enable&#039; =&amp;gt; &#039;0&#039;);&lt;br /&gt;
Set(%SMIME, &#039;Enable&#039; =&amp;gt; &#039;0&#039;);&lt;br /&gt;
&lt;br /&gt;
# Perl expects to find this 1 at the end of the file.&lt;br /&gt;
1;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;RT_SiteConfig.pm&amp;lt;/code&amp;gt; is actually Perl code. RT runs the code directly to load the configuration. Any time you finish editing it, you can check that you didn’t make any syntax errors by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;perl -c /opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Set up RT’s database ===&lt;br /&gt;
&lt;br /&gt;
RT includes a tool to help you set up its database. By default, it connects to the database as an administrator to create the database and user that you configured in the previous step.&lt;br /&gt;
&lt;br /&gt;
(The instructions from &amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt; and RT’s README file tell you to run &amp;lt;code&amp;gt;make initialize-database&amp;lt;/code&amp;gt;. That just runs &amp;lt;code&amp;gt;rt-setup-database&amp;lt;/code&amp;gt; for you. Running the tool directly makes it easier to pass the options you need.)&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;--action=init&amp;lt;/code&amp;gt; tells the tool to create the user, the database, the tables inside it, and insert core data RT needs to function.&lt;br /&gt;
* &#039;&#039;&#039;If&#039;&#039;&#039; you are using an existing database server and the database adminstrator has already created the user account and database for RT, then you can add the &amp;lt;code&amp;gt;--skip-create&amp;lt;/code&amp;gt; option.&lt;br /&gt;
* &#039;&#039;&#039;If&#039;&#039;&#039; you have a less common database setup, this tool has additional options to give you finer-grained control over what steps are run and how. Refer to [https://docs.bestpractical.com/rt/latest/rt-setup-database.html the full rt-setup-database documentation] to learn more about those.&lt;br /&gt;
* The command reads files from RT’s &amp;lt;code&amp;gt;etc/&amp;lt;/code&amp;gt; directory by default, so the easiest way to run it is to &amp;lt;code&amp;gt;cd /opt/rt5&amp;lt;/code&amp;gt; first, and then it will find the necessary files automatically.&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /opt/rt5&lt;br /&gt;
sudo sbin/rt-setup-database --action=init&amp;lt;/pre&amp;gt;&lt;br /&gt;
Enter the password for your database administrator account when prompted.&lt;br /&gt;
&lt;br /&gt;
=== Set up fulltext indexing ===&lt;br /&gt;
&lt;br /&gt;
Fulltext indexing speeds up searches for ticket content, which makes RT a lot nicer to use.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;--noask&amp;lt;/code&amp;gt; uses the default names for the index, which will be fine for a new install and simplifies the setup.&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo /opt/rt5/sbin/rt-setup-fulltext-index --noask&amp;lt;/pre&amp;gt;&lt;br /&gt;
Enter the password for your database administrator account when prompted. The end of the process will output some RT configuration that looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;### EXAMPLE OUTPUT ONLY - Don&#039;t use this directly!&lt;br /&gt;
Set( %FullTextSearch,&lt;br /&gt;
    Enable     =&amp;gt; 1,&lt;br /&gt;
    Indexed    =&amp;gt; 1,&lt;br /&gt;
    # Additional output from rt-setup-fulltext-index should be here.&lt;br /&gt;
    # The configuration varies by database type.&lt;br /&gt;
);&amp;lt;/pre&amp;gt;&lt;br /&gt;
Copy the output generated when you run &amp;lt;code&amp;gt;rt-setup-fulltext-index&amp;lt;/code&amp;gt; and save it to the file &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.d/FulltextIndex.pm&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Set permissions ===&lt;br /&gt;
&lt;br /&gt;
All of RT’s configuration files should be readable by the user that runs the web server, and no other users, in order to protect sensitive information like the database password. RT provides a command to set permissions appropriately according to your distribution and configuration. &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt; to the directory where you extracted the RT source code, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd rt-5.0.2&lt;br /&gt;
sudo make fixperms&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Verify the installation ===&lt;br /&gt;
&lt;br /&gt;
If everything has gone well, then you should be able to set a password for RT’s &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; user. You’ll use this later to log in to the web interface and continue setting up your system. Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo /opt/rt5/sbin/rt-passwd root&amp;lt;/pre&amp;gt;&lt;br /&gt;
Set the password when prompted. Record this; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
== Set up RT FastCGI service ==&lt;br /&gt;
&lt;br /&gt;
=== Create the RT service ===&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo systemctl edit --force --full rt-server.service&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This opens an editor to define the RT service to systemd. Use the editor to add this text to the file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[Unit]&lt;br /&gt;
Description=RT FCGI server&lt;br /&gt;
&lt;br /&gt;
[Service]&lt;br /&gt;
# The --forks option is the number of RT servers to run in parallel.&lt;br /&gt;
# 3 should be good for most initial installs. You can increase this&lt;br /&gt;
# number later if needed for performance.&lt;br /&gt;
ExecStart=/usr/bin/multiwatch --forks=3 --signal=TERM -- /opt/rt5/sbin/rt-server.fcgi&lt;br /&gt;
StandardInput=socket&lt;br /&gt;
DynamicUser=true&lt;br /&gt;
SupplementaryGroups=rt&lt;br /&gt;
UMask=027&lt;br /&gt;
&lt;br /&gt;
CapabilityBoundingSet=&lt;br /&gt;
DevicePolicy=closed&lt;br /&gt;
PrivateMounts=true&lt;br /&gt;
PrivateNetwork=false&lt;br /&gt;
PrivateTmp=true&lt;br /&gt;
PrivateUsers=true&lt;br /&gt;
ProtectControlGroups=true&lt;br /&gt;
ProtectHome=true&lt;br /&gt;
ProtectSystem=full&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save the file and close your editor.&lt;br /&gt;
&lt;br /&gt;
=== Create the RT socket ===&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo systemctl edit --force --full rt-server.socket&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This opens an editor to define the RT socket to systemd. Use the editor to add this text to the file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[Unit]&lt;br /&gt;
Description=RT FCGI server socket&lt;br /&gt;
Wants=network.target&lt;br /&gt;
After=network.target&lt;br /&gt;
Before=apache2.service httpd.service nginx.service&lt;br /&gt;
&lt;br /&gt;
[Install]&lt;br /&gt;
WantedBy=sockets.target&lt;br /&gt;
&lt;br /&gt;
[Socket]&lt;br /&gt;
# ListenStream defines the address and port where the RT FastCGI server listens.&lt;br /&gt;
# This is NOT the web server itself, so don&#039;t make this port 80, 443, etc.&lt;br /&gt;
# You may edit this if you like, but note:&lt;br /&gt;
# Connections are unencrypted. You should only listen on a secure network&lt;br /&gt;
# interface.&lt;br /&gt;
# The server can only accept a single socket. You cannot specify more than&lt;br /&gt;
# one ListenStream address.&lt;br /&gt;
ListenStream=[::1]:5000&lt;br /&gt;
Accept=no&lt;br /&gt;
FreeBind=yes&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save the file and close your editor.&lt;br /&gt;
&lt;br /&gt;
=== Enable the RT socket ===&lt;br /&gt;
&lt;br /&gt;
Load the new services into RT, start the server socket, and enable it on future boots:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo systemctl daemon-reload&lt;br /&gt;
sudo systemctl enable --now rt-server.socket&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s web server ==&lt;br /&gt;
&lt;br /&gt;
Fully documenting how to set up a web server configured for your network with encryption is outside the scope of this guide. This page only highlights the configuration you need to pass web requests onto the RT FastCGI service.&lt;br /&gt;
&lt;br /&gt;
=== nginx ===&lt;br /&gt;
&lt;br /&gt;
Make sure you have the necessary packages installed:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install nginx&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install nginx&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In the &amp;lt;code&amp;gt;http server&amp;lt;/code&amp;gt; configuration blocks where you want to serve RT, add a configuration block like this, &#039;&#039;&#039;above&#039;&#039;&#039; any other &amp;lt;code&amp;gt;location&amp;lt;/code&amp;gt; blocks:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# The location path should match the WebPath in your RT site configuration.&lt;br /&gt;
location / {&lt;br /&gt;
  include /etc/nginx/fastcgi.conf;&lt;br /&gt;
  # SCRIPT_NAME should match RT&#039;s WebPath, without a trailing slash.&lt;br /&gt;
  # This means when WebPath is /, it&#039;s the empty string &amp;quot;&amp;quot;.&lt;br /&gt;
  fastcgi_param SCRIPT_NAME &amp;quot;&amp;quot;;&lt;br /&gt;
  # This network location should match the ListenStream in rt-server.socket.&lt;br /&gt;
  fastcgi_pass localhost:5000;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you&#039;re doing a fresh install, the default &amp;lt;code&amp;gt;http server&amp;lt;/code&amp;gt; configuration location varies by distribution:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|Edit &amp;lt;code&amp;gt;/etc/nginx/sites-available/default&amp;lt;/code&amp;gt;&lt;br /&gt;
|Add a new file &amp;lt;code&amp;gt;/etc/nginx/default.d/rt-server.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
After you’ve edited your configuration, load it by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo systemctl reload nginx&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once this is done you can skip ahead to Verify the web interface.&lt;br /&gt;
&lt;br /&gt;
=== Apache httpd ===&lt;br /&gt;
&lt;br /&gt;
Make sure you have the necessary packages installed, and the proxy_fcgi module enabled:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install apache2&lt;br /&gt;
sudo a2enmod proxy&lt;br /&gt;
sudo a2enmod proxy_fcgi&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install httpd&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In the &amp;lt;code&amp;gt;&amp;amp;lt;VirtualHost&amp;amp;gt;&amp;lt;/code&amp;gt; configuration blocks where you want to serve RT, add a configuration block like this, &#039;&#039;&#039;above&#039;&#039;&#039; any other &amp;lt;code&amp;gt;Alias&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;ProxyPass&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;ScriptAlias&amp;lt;/code&amp;gt; lines:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# SCRIPT_NAME should match RT&#039;s WebPath, without a trailing slash.&lt;br /&gt;
# This means when WebPath is /, it&#039;s the empty string &amp;quot;&amp;quot;.&lt;br /&gt;
ProxyFCGISetEnvIf true SCRIPT_NAME &amp;quot;&amp;quot;&lt;br /&gt;
# The location path in the first argument should match the WebPath in your&lt;br /&gt;
# RT site configuration.  The network location after fcgi:// should match&lt;br /&gt;
# the ListenStream in rt-server.socket.&lt;br /&gt;
ProxyPass / fcgi://localhost:5000/&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you&#039;re doing a fresh install, the default &amp;lt;code&amp;gt;&amp;amp;lt;VirtualHost&amp;amp;gt;&amp;lt;/code&amp;gt; configuration location varies by distribution and whether or not you&#039;re using HTTPS:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|With HTTPS: &amp;lt;code&amp;gt;/etc/apache2/sites-available/default-ssl.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
With plain HTTP: &amp;lt;code&amp;gt;/etc/apache2/sites-available/000-default.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
|With HTTPS: &amp;lt;code&amp;gt;/etc/httpd/conf.d/ssl.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
With plain HTTP: Write a new file &amp;lt;code&amp;gt;/etc/httpd/conf.d/vhost_RT.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
After you’ve edited your configuration, load it by running:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo systemctl reload apache2&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo systemctl reload httpd&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Verify the web interface ===&lt;br /&gt;
&lt;br /&gt;
You should be able to visit your web server in your browser, and be presented with RT’s login screen. You should be able to log in with username &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; and the password you set previously.&lt;br /&gt;
&lt;br /&gt;
If the web server returns a 502 Bad Gateway response, it&#039;s having trouble connecting to the RT FCGI server. Check the error logs for your web server:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 33%;&amp;quot;|nginx&lt;br /&gt;
! style=&amp;quot;width: 33%;&amp;quot;|Apache on Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 33%;&amp;quot;|httpd on Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;/var/log/nginx/error.log&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;/var/log/apache2/error.log&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;/var/log/httpd/error_log&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For all kinds of errors, you can check the logs for the RT FCGI server and its socket:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo journalctl --unit rt-server.\*&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s mail server ==&lt;br /&gt;
&lt;br /&gt;
RT both can both send and receive ticket updates via email. Unfortunately, there are too many variables to document a useful setup process here: getting this working usually requires creating DNS records, and coordinating with existing mail servers, which will be the main constraint on your setup. Instead this guide provides a brief overview of how the integration works, and where the connection points are that you likely need to work on.&lt;br /&gt;
&lt;br /&gt;
=== Sending Mail ===&lt;br /&gt;
&lt;br /&gt;
RT only knows how to send mail by passing it off to another program on the system. It cannot connect or authenticate directly to external mail servers. In the default configuration, RT runs the standard &amp;lt;code&amp;gt;sendmail&amp;lt;/code&amp;gt; command. There are [https://docs.bestpractical.com/rt/latest/RT_Config.html#Outgoing-mail configuration options to send mail through different commands] if you need.&lt;br /&gt;
&lt;br /&gt;
The most common setup is to install and configure a proper Mail Transfer Agent (MTA) like Postfix or Exim, and then configure it to send mail to the wider Internet as you need. This works well because the MTAs are robust and well-tested; they have flexible configuration to let you send mail out by relaying to other mail servers you specify with optional authentication; and most distributions install one by default anyway. The only hard part is configuring the MTA to send mail following your site’s policies.&lt;br /&gt;
&lt;br /&gt;
Other software is available that provides a slimmer version of the &amp;lt;code&amp;gt;sendmail&amp;lt;/code&amp;gt; command that connects to an external mail server for you, like ssmtp. These programs are usually easier to configure than an MTA, but they often lose email permanently if they can’t connect to the external server at the time it’s sent. (MTAs keep email queued locally until they successfully deliver it to another server.)&lt;br /&gt;
&lt;br /&gt;
=== Receiving email ===&lt;br /&gt;
&lt;br /&gt;
RT installs a command called &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; that receives an email on standard input and posts it to RT’s REST web interface, where it gets saved in the database and added to a ticket. You need to arrange for a way to send incoming email to this command.&lt;br /&gt;
&lt;br /&gt;
The most common setup is to have an MTA on the same box as RT receive email directly, and then set up mail aliases that call this command when mail comes in. Example &amp;lt;code&amp;gt;/etc/aliases&amp;lt;/code&amp;gt; entries look like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rt: &amp;quot;|/opt/rt5/bin/rt-mailgate --queue general --action correspond --url https://rt.yourdomain.example.com/&amp;quot;&lt;br /&gt;
rt-comment: &amp;quot;|/opt/rt5/bin/rt-mailgate --queue general --action comment --url https://rt.yourdomain.example.com/&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
This works well because, again, you’re probably running an MTA anyway; and the MTA can hold and queue mail if it comes in while RT is down for any reason, giving you a buffer against downtime.&lt;br /&gt;
&lt;br /&gt;
Another common option is to periodically run a tool that fetches mail using a protocol like IMAP, like fetchmail or getmail, and passes it on to &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt;. This is less common because it requires setting up another tool to run, and securely storing another set of mail server credentials. But it is useful when local policy prevents the RT server from receiving email directly.&lt;br /&gt;
&lt;br /&gt;
This is much less common, but it might help to know that &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; doesn’t have to run on the same system as RT itself. It just needs to be able to connect to RT’s web interface. If you don’t have any other options, you can install the RT software on a different system that receives email, and configure &#039;&#039;that&#039;&#039; system to run &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; and pass it on to the RT server. To do that, just repeat the installation instructions above, skipping the steps about installing the database and web server.&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s background jobs ==&lt;br /&gt;
&lt;br /&gt;
Create a file &amp;lt;code&amp;gt;/etc/cron.d/rt&amp;lt;/code&amp;gt; with the following content. You may edit all of the time fields as you see fit. Refer to the crontab(5) man page for details about their definitions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Update the fulltext index with new ticket data&lt;br /&gt;
*/3 *   *   *   *   root    /opt/rt5/sbin/rt-fulltext-indexer&lt;br /&gt;
# Email out dashboards that users have subscribed to&lt;br /&gt;
0   *   *   *   *   root    /opt/rt5/sbin/rt-email-dashboards&lt;br /&gt;
# Clean old sessions from the database&lt;br /&gt;
10  3   *   *   *   root    /opt/rt5/sbin/rt-clean-sessions --older 8d&lt;br /&gt;
# Email out weekly digests for users who have requested it&lt;br /&gt;
50  4   *   *   Mon root    /opt/rt5/sbin/rt-email-digest -m weekly&lt;br /&gt;
# Email out daily digests for users who have requested it&lt;br /&gt;
50  5   *   *   *   root    /opt/rt5/sbin/rt-email-digest -m daily&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Set up RT ==&lt;br /&gt;
&lt;br /&gt;
If you’ve gotten this far, congratulations, your RT install is really done now. You can start setting up RT with users, groups, queues, and business logic. [[Main Page|Head back to the main page]] to start exploring those topics.&lt;/div&gt;</summary>
		<author><name>Brett</name></author>
	</entry>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=ManualInstallation&amp;diff=27079</id>
		<title>ManualInstallation</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=ManualInstallation&amp;diff=27079"/>
		<updated>2022-05-11T02:30:03Z</updated>

		<summary type="html">&lt;p&gt;Brett: more correct comments about RT&amp;#039;s SCRIPT_NAME, httpd version&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Prev: [[ManualRequirements]] — Up: [[UserManual]] — Next: [[ManualApacheConfig]]&lt;br /&gt;
&lt;br /&gt;
This guide walks you through installing RT from source on a modern, popular Linux distro. Specifically, that means a distribution based on Debian or Red Hat that’s been released since around 2020.&lt;br /&gt;
&lt;br /&gt;
This guide assumes:&lt;br /&gt;
&lt;br /&gt;
* You can install packages generally available in Debian/Ubuntu or Red Hat/Fedora/CentOS.&lt;br /&gt;
* You want to install RT, and all of its Perl dependencies, from source to get the latest versions. (This is a trade-off. It means the boundaries of your install will be very clear, but you won’t get security updates for RT or Perl modules from your distribution.)&lt;br /&gt;
* You are willing to install a couple of extra tools to manage the RT installation similarly to how you would in other packaging systems (like PyPI, npm, etc.).&lt;br /&gt;
* You are willing to do a relatively maximal install of RT, enabling all the options during installation and then setting what you need in the configuration. (You could save a little space and time by being pickier about your options, but then that complicates the guide and makes it harder to turn those options on later if you want.)&lt;br /&gt;
* You are using a regular user account on the Linux system that can get superuser privileges with sudo.&lt;br /&gt;
&lt;br /&gt;
== Install the base dependencies ==&lt;br /&gt;
&lt;br /&gt;
These are required by RT, either to run or to install the dependencies.&lt;br /&gt;
&lt;br /&gt;
=== Debian/Ubuntu ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo apt install autoconf build-essential cpanminus curl libexpat-dev libgd-dev libssl-dev libz-dev gnupg graphviz multiwatch openssl perl w3m&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Red Hat Enterprise Linux ===&lt;br /&gt;
&lt;br /&gt;
These instructions are for RHEL specifically. For RHEL-derived distributions like CentOS and Rocky, go to the next section.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;MAJDISTVER=&amp;quot;$(. /etc/os-release &amp;amp;&amp;amp; echo &amp;quot;${VERSION_ID%%.*}&amp;quot;)&amp;quot;&lt;br /&gt;
sudo subscription-manager repos --enable &amp;quot;codeready-builder-for-rhel-$MAJDISTVER-$(arch)-rpms&amp;quot;&lt;br /&gt;
sudo dnf install &amp;quot;https://dl.fedoraproject.org/pub/epel/epel-release-latest-$MAJDISTVER.noarch.rpm&amp;quot;&lt;br /&gt;
sudo dnf install patch tar which gcc gcc-c++ perl-core perl-App-cpanminus graphviz expat-devel gd-devel multiwatch openssl openssl-devel w3m&lt;br /&gt;
sudo sed -i~ &#039;/^SELINUX=/ c SELINUX=disabled&#039; /etc/selinux/config&lt;br /&gt;
sudo setenforce 0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Turning off SELinux enforcement is required on Red Hat-based distributions because, as of March 2022, nobody has written a policy for RT.)&lt;br /&gt;
&lt;br /&gt;
=== RHEL Community Distributions: Fedora/CentOS/Rocky ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo dnf install epel-release&lt;br /&gt;
sudo dnf install patch tar which gcc gcc-c++ perl-core perl-App-cpanminus graphviz expat-devel gd-devel multiwatch openssl openssl-devel w3m&lt;br /&gt;
sudo sed -i~ &#039;/^SELINUX=/ c SELINUX=disabled&#039; /etc/selinux/config&lt;br /&gt;
sudo setenforce 0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Turning off SELinux enforcement is required on Red Hat-based distributions because, as of March 2022, nobody has written a policy for RT.)&lt;br /&gt;
&lt;br /&gt;
== Install a database ==&lt;br /&gt;
&lt;br /&gt;
You need access to a database server. It can be remote, or you can install a database server alongside RT. RT supports a few different databases, but the best supported options are PostgreSQL and MariaDB.&lt;br /&gt;
&lt;br /&gt;
=== Installing and configuring the PostgreSQL server ===&lt;br /&gt;
&lt;br /&gt;
If you want to install a fresh PostgreSQL database server alongside RT:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install postgresql&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install postgresql-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In order to set up RT’s database, you will need a PostgreSQL account that can create databases and roles and be authenticated with a password. If you don’t have that, you can create it by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo createuser --createdb --createrole --login --pwprompt rt_admin&amp;lt;/pre&amp;gt;&lt;br /&gt;
Set the password when prompted. Record this; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
=== Enable password authentication in PostgreSQL ===&lt;br /&gt;
&lt;br /&gt;
You need to consider this step whether you install the database locally, or use an existing one already running. RT supports connecting to PostgreSQL a few different ways, but authenticating with a username and password is simplest, and this guide is written based on that. Not all PostgreSQL installations allow this authentication method by default. You need to review your &amp;lt;code&amp;gt;pg_hba.conf&amp;lt;/code&amp;gt; file located at:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;/etc/postgresql/VERSION/main/pg_hba.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;/var/lib/pgsql/VERSION/data/pg_hba.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Replace &amp;lt;code&amp;gt;VERSION&amp;lt;/code&amp;gt; with the version of your PostgreSQL database. Add these two lines &#039;&#039;&#039;above&#039;&#039;&#039; any other lines that start with &amp;lt;code&amp;gt;host&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;host  rt5  rt_user   all  md5&lt;br /&gt;
host  rt5  rt_admin  all  md5&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This configuration will let &amp;lt;code&amp;gt;rt_user&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;rt_admin&amp;lt;/code&amp;gt; authorize themselves for the &amp;lt;code&amp;gt;rt5&amp;lt;/code&amp;gt; database using an &amp;lt;code&amp;gt;md5&amp;lt;/code&amp;gt; crypted password over a network connection (possibly using the localhost loopback network). You might be able to further restrict some of these fields for improved security, but doing so is outside the scope of this install guide. Refer to [https://www.postgresql.org/docs/current/auth-pg-hba-conf.html the pg_hba.conf documentation] for more details.&lt;br /&gt;
&lt;br /&gt;
Save your changes and reload the database:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo systemctl reload postgresql&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Installing the PostgreSQL client libraries ===&lt;br /&gt;
&lt;br /&gt;
These are required for RT to be able to talk to any PostgreSQL server.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install libpq-dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install postgresql-devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Once this is done you can skip ahead to installing RT.&lt;br /&gt;
&lt;br /&gt;
=== Installing and configuring the MariaDB server ===&lt;br /&gt;
&lt;br /&gt;
If you want to install a fresh MariaDB database server alongside RT:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install mariadb-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install mariadb-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In order to set up RT’s database, you will need a MySQL superuser account. To stay consistent with PostgreSQL, I suggest setting a password for it. You can do that by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo mysql mysql&lt;br /&gt;
MariaDB [mysql]&amp;amp;gt; GRANT ALL PRIVILEGES ON rt5.* TO rt_admin@localhost IDENTIFIED BY &#039;YourPassphraseHere&#039; WITH GRANT OPTION;&amp;lt;/pre&amp;gt;&lt;br /&gt;
Record your passphrase; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
=== Adjust MariaDB’s max_allowed_packet setting ===&lt;br /&gt;
&lt;br /&gt;
You need to consider this step whether you install the database locally, or use an existing one already running. [https://mariadb.com/kb/en/server-system-variables/#max_allowed_packet MariaDB’s &amp;lt;code&amp;gt;max_allowed_packet&amp;lt;/code&amp;gt; setting] functionally limits the size of attachments in RT. The default is 16MiB, which is too small for most installations. You can ultimately choose any setting you’re comfortable with; 64MiB here should allow most requests without being too open.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;echo -e &#039;[server]\nmax_allowed_packet=64M&#039; | sudo tee /etc/mysql/conf.d/max_allowed_packet.cnf&lt;br /&gt;
sudo systemctl reload mariadb&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;echo -e &#039;[server]\nmax_allowed_packet=64M&#039; | sudo tee /etc/my.cnf.d/max_allowed_packet.cnf&lt;br /&gt;
sudo systemctl reload mariadb&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Installing the MariaDB client libraries ===&lt;br /&gt;
&lt;br /&gt;
These are required for RT to be able to talk to any MariaDB server.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install libmariadb-dev libmariadb-dev-compat&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install mariadb-devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Install RT ==&lt;br /&gt;
&lt;br /&gt;
=== Create an RT system group ===&lt;br /&gt;
&lt;br /&gt;
This group will be used throughout the install process to control access to sensitive files. Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo groupadd --system rt&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Get and unpack the RT source code ===&lt;br /&gt;
&lt;br /&gt;
Download the latest source code using the link on the [https://bestpractical.com/download-page RT download page], extract it using &amp;lt;code&amp;gt;tar -xf&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt; into the source code directory to run the rest of the commands in this section. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;curl -O https://download.bestpractical.com/pub/rt/release/rt-5.0.2.tar.gz&lt;br /&gt;
tar -xf rt-5.0.2.tar.gz&lt;br /&gt;
cd rt-5.0.2&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Pre-configure RT ===&lt;br /&gt;
&lt;br /&gt;
This command will detect some information about your system in order to install RT properly, and decide which set of dependencies to install. Here’s what the different parts of our command are doing:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;PERL=…&amp;lt;/code&amp;gt; configures RT to run under Perl with some options that load its dependencies from a dedicated directory. The &amp;lt;code&amp;gt;/opt/rt5&amp;lt;/code&amp;gt; part of this string should match your &amp;lt;code&amp;gt;prefix&amp;lt;/code&amp;gt; setting (see next item). If you know you want to use a specific Perl installed on your system, you can specify its full path instead of the plain &amp;lt;code&amp;gt;perl&amp;lt;/code&amp;gt; here.&lt;br /&gt;
* &amp;lt;code&amp;gt;--prefix=/opt/rt5&amp;lt;/code&amp;gt; sets the directory where RT will install all of its libraries, tools, and supporting files. You can choose another path if you like.&lt;br /&gt;
* &amp;lt;code&amp;gt;--with-db-type=TYPE&amp;lt;/code&amp;gt; - Replace &amp;lt;code&amp;gt;TYPE&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;Pg&amp;lt;/code&amp;gt; for PostgreSQL, or &amp;lt;code&amp;gt;mysql&amp;lt;/code&amp;gt; for MariaDB.&lt;br /&gt;
* &amp;lt;code&amp;gt;--with-web-group=rt&amp;lt;/code&amp;gt; installs RT using the dedicated group we created earlier.&lt;br /&gt;
* The rest of the options tell RT to install additional dependencies for optional features.&lt;br /&gt;
&lt;br /&gt;
Make sure you have &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt;ed into the RT source directory, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;PERL=&amp;quot;/usr/bin/env -S perl -I/opt/rt5/local/lib/perl5&amp;quot; ./configure --prefix=/opt/rt5 --with-db-type=TYPE --with-web-group=rt --with-attachment-store=disk --enable-externalauth --enable-gd --enable-graphviz --enable-gpg --enable-smime&amp;lt;/pre&amp;gt;&lt;br /&gt;
For more background, [https://docs.bestpractical.com/rt/latest/configure.html refer to the RT configure options documentation].&lt;br /&gt;
&lt;br /&gt;
=== Install RT and its Perl dependencies ===&lt;br /&gt;
&lt;br /&gt;
This command will download, build, and install all of the Perl modules necessary to run RT with the configuration you set above. Here’s what the different parts of the command are doing:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;make dirs&amp;lt;/code&amp;gt; creates RT&#039;s directory structure, so we can install dependencies inside it.&lt;br /&gt;
* &amp;lt;code&amp;gt;make fixdeps&amp;lt;/code&amp;gt; actually installs those dependencies.&lt;br /&gt;
* &amp;lt;code&amp;gt;RT_FIX_DEPS_CMD=…&amp;lt;/code&amp;gt; tells RT to use cpanminus to install dependencies (instead of the older, default &amp;lt;code&amp;gt;cpan&amp;lt;/code&amp;gt; command) inside RT&#039;s directory structure.&lt;br /&gt;
* &amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt; installs all of RT’s files under &amp;lt;code&amp;gt;/opt/rt5&amp;lt;/code&amp;gt; (or the prefix directory you set earlier). It will only run if &amp;lt;code&amp;gt;fixdeps&amp;lt;/code&amp;gt; succeeded.&lt;br /&gt;
&lt;br /&gt;
Make sure you have &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt;ed into the RT source directory, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo make dirs&lt;br /&gt;
make fixdeps RT_FIX_DEPS_CMD=&amp;quot;cpanm --sudo --local-lib-contained=/opt/rt5/local&amp;quot;&lt;br /&gt;
sudo make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
If it works, the command will eventually output a message that says “Congratulations. RT is now installed.” followed by instructions about configuring and setting up the database. We’ll do that next.&lt;br /&gt;
&lt;br /&gt;
=== Configure RT ===&lt;br /&gt;
&lt;br /&gt;
[https://docs.bestpractical.com/rt/latest/RT_Config.html RT has many configuration options.] You can put configuration options in the file &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/code&amp;gt;, or in individual files under &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.d/&amp;lt;/code&amp;gt;. Use an editor to save all the text below to &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/code&amp;gt; (you can just overwrite the existing file, or add this to the bottom of what’s there) and then fill in settings for your site everywhere the text &amp;lt;code&amp;gt;EDIT WITH&amp;lt;/code&amp;gt; appears.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Single-quote all values EXCEPT the special value `undef`&lt;br /&gt;
# that turns off a setting.&lt;br /&gt;
&lt;br /&gt;
# rtname appears in ticket email subjects. It needs to be globally unique,&lt;br /&gt;
# so use your organization&#039;s domain name.&lt;br /&gt;
Set($rtname, &#039;EDIT WITH yourdomain.example.com&#039;);&lt;br /&gt;
# Organization is used in the database for ticket links, etc. It also needs to&lt;br /&gt;
# be globally unique, so use your organization&#039;s domain name.&lt;br /&gt;
Set($Organization, &#039;EDIT WITH yourdomain.example.com&#039;);&lt;br /&gt;
# WebDomain is domain name of the RT web server. RT uses it to construct links&lt;br /&gt;
# and defend against CSRFs.&lt;br /&gt;
Set($WebDomain, &#039;EDIT WITH rt.yourdomain.example.com&#039;);&lt;br /&gt;
# WebPort is the port where the RT web server runs. Edit the number below if&lt;br /&gt;
# you&#039;re not using the standard HTTPS port.&lt;br /&gt;
Set($WebPort, &#039;443&#039;);&lt;br /&gt;
# WebPath is the path where the RT web server runs on your WebDomain.&lt;br /&gt;
# Edit the path below if you&#039;re using a specific path.&lt;br /&gt;
Set($WebPath, &#039;/&#039;);&lt;br /&gt;
&lt;br /&gt;
# DatabaseUser is the name of the database account RT uses to read and store&lt;br /&gt;
# data. &#039;rt_user&#039; is the default but you can change it if you like.&lt;br /&gt;
# DO NOT use the &#039;rt_admin&#039; superuser created in the instructions above.&lt;br /&gt;
Set($DatabaseUser, &#039;rt_user&#039;);&lt;br /&gt;
# DatabasePassword is the password for DatabaseUser.&lt;br /&gt;
Set($DatabasePassword, &#039;EDIT WITH SomePassphraseHere&#039;);&lt;br /&gt;
# DatabaseHost is the hostname of the database server RT should use.&lt;br /&gt;
# Change &#039;localhost&#039; if it lives on a different server.&lt;br /&gt;
Set($DatabaseHost, &#039;localhost&#039;);&lt;br /&gt;
# DatabasePort is the port number of the database server RT should use.&lt;br /&gt;
# `undef` means the default for that database. Change it if you&#039;re not&lt;br /&gt;
# using the standard port.&lt;br /&gt;
Set($DatabasePort, undef);&lt;br /&gt;
# DatabaseName is the name of RT&#039;s database hosted on DatabaseHost.&lt;br /&gt;
# &#039;rt5&#039; is the default but you can change it if you like.&lt;br /&gt;
Set($DatabaseName, &#039;rt5&#039;);&lt;br /&gt;
# DatabaseAdmin is the name of the user in the database used to perform&lt;br /&gt;
# major administrative tasks. Change &#039;rt_admin&#039; if you&#039;re using a user&lt;br /&gt;
# besides the one created in this guide.&lt;br /&gt;
Set($DatabaseAdmin, &#039;rt_admin&#039;);&lt;br /&gt;
&lt;br /&gt;
# RT can log to syslog, stderr, and/or a dedicated file.&lt;br /&gt;
# Log settings are used both by the primary server and by command line&lt;br /&gt;
# tools like rt-crontool, rt-ldapimport, etc.&lt;br /&gt;
# You set all of RT&#039;s $LogTo* paramaters to a standard log level: &#039;debug&#039;,&lt;br /&gt;
# &#039;info&#039;, &#039;notice&#039;, &#039;warning&#039;, &#039;error&#039;, &#039;critical&#039;, &#039;alert&#039;, or &#039;emergency&#039;.&lt;br /&gt;
# For a modern install, I recommend logging primarily to syslog, so it goes&lt;br /&gt;
# to journald where it&#039;s easy to query and automatically gets rotated.&lt;br /&gt;
Set($LogToSyslog, &#039;info&#039;);&lt;br /&gt;
&lt;br /&gt;
# When the RT server logs to stderr, that usually goes to your web server&#039;s&lt;br /&gt;
# error log. Command line tools log to their own stderr. Setting this to&lt;br /&gt;
# &#039;warning&#039; or &#039;error&#039; helps ensure you get notified if RT&#039;s cron jobs&lt;br /&gt;
# encounter problems.&lt;br /&gt;
Set($LogToSTDERR, &#039;warning&#039;);&lt;br /&gt;
&lt;br /&gt;
# Turn off optional features that require additional configuration.&lt;br /&gt;
# If you want to use these, refer to the RT_Config documentation for&lt;br /&gt;
# instructions on how to set them up.&lt;br /&gt;
Set(%GnuPG, &#039;Enable&#039; =&amp;gt; &#039;0&#039;);&lt;br /&gt;
Set(%SMIME, &#039;Enable&#039; =&amp;gt; &#039;0&#039;);&lt;br /&gt;
&lt;br /&gt;
# Perl expects to find this 1 at the end of the file.&lt;br /&gt;
1;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;RT_SiteConfig.pm&amp;lt;/code&amp;gt; is actually Perl code. RT runs the code directly to load the configuration. Any time you finish editing it, you can check that you didn’t make any syntax errors by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;perl -c /opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Set up RT’s database ===&lt;br /&gt;
&lt;br /&gt;
RT includes a tool to help you set up its database. By default, it connects to the database as an administrator to create the database and user that you configured in the previous step.&lt;br /&gt;
&lt;br /&gt;
(The instructions from &amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt; and RT’s README file tell you to run &amp;lt;code&amp;gt;make initialize-database&amp;lt;/code&amp;gt;. That just runs &amp;lt;code&amp;gt;rt-setup-database&amp;lt;/code&amp;gt; for you. Running the tool directly makes it easier to pass the options you need.)&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;--action=init&amp;lt;/code&amp;gt; tells the tool to create the user, the database, the tables inside it, and insert core data RT needs to function.&lt;br /&gt;
* &#039;&#039;&#039;If&#039;&#039;&#039; you are using an existing database server and the database adminstrator has already created the user account and database for RT, then you can add the &amp;lt;code&amp;gt;--skip-create&amp;lt;/code&amp;gt; option.&lt;br /&gt;
* &#039;&#039;&#039;If&#039;&#039;&#039; you have a less common database setup, this tool has additional options to give you finer-grained control over what steps are run and how. Refer to [https://docs.bestpractical.com/rt/latest/rt-setup-database.html the full rt-setup-database documentation] to learn more about those.&lt;br /&gt;
* The command reads files from RT’s &amp;lt;code&amp;gt;etc/&amp;lt;/code&amp;gt; directory by default, so the easiest way to run it is to &amp;lt;code&amp;gt;cd /opt/rt5&amp;lt;/code&amp;gt; first, and then it will find the necessary files automatically.&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /opt/rt5&lt;br /&gt;
sudo sbin/rt-setup-database --action=init&amp;lt;/pre&amp;gt;&lt;br /&gt;
Enter the password for your database administrator account when prompted.&lt;br /&gt;
&lt;br /&gt;
=== Set up fulltext indexing ===&lt;br /&gt;
&lt;br /&gt;
Fulltext indexing speeds up searches for ticket content, which makes RT a lot nicer to use.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;--noask&amp;lt;/code&amp;gt; uses the default names for the index, which will be fine for a new install and simplifies the setup.&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo /opt/rt5/sbin/rt-setup-fulltext-index --noask&amp;lt;/pre&amp;gt;&lt;br /&gt;
Enter the password for your database administrator account when prompted. The end of the process will output some RT configuration that looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;### EXAMPLE OUTPUT ONLY - Don&#039;t use this directly!&lt;br /&gt;
Set( %FullTextSearch,&lt;br /&gt;
    Enable     =&amp;gt; 1,&lt;br /&gt;
    Indexed    =&amp;gt; 1,&lt;br /&gt;
    # Additional output from rt-setup-fulltext-index should be here.&lt;br /&gt;
    # The configuration varies by database type.&lt;br /&gt;
);&amp;lt;/pre&amp;gt;&lt;br /&gt;
Copy the output generated when you run &amp;lt;code&amp;gt;rt-setup-fulltext-index&amp;lt;/code&amp;gt; and save it to the file &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.d/FulltextIndex.pm&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Set permissions ===&lt;br /&gt;
&lt;br /&gt;
All of RT’s configuration files should be readable by the user that runs the web server, and no other users, in order to protect sensitive information like the database password. RT provides a command to set permissions appropriately according to your distribution and configuration. &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt; to the directory where you extracted the RT source code, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd rt-5.0.2&lt;br /&gt;
sudo make fixperms&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Verify the installation ===&lt;br /&gt;
&lt;br /&gt;
If everything has gone well, then you should be able to set a password for RT’s &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; user. You’ll use this later to log in to the web interface and continue setting up your system. Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo /opt/rt5/sbin/rt-passwd root&amp;lt;/pre&amp;gt;&lt;br /&gt;
Set the password when prompted. Record this; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
== Set up RT FastCGI service ==&lt;br /&gt;
&lt;br /&gt;
=== Create the RT service ===&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo systemctl edit --force --full rt-server.service&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This opens an editor to define the RT service to systemd. Use the editor to add this text to the file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[Unit]&lt;br /&gt;
Description=RT FCGI server&lt;br /&gt;
&lt;br /&gt;
[Service]&lt;br /&gt;
# The --forks option is the number of RT servers to run in parallel.&lt;br /&gt;
# 3 should be good for most initial installs. You can increase this&lt;br /&gt;
# number later if needed for performance.&lt;br /&gt;
ExecStart=/usr/bin/multiwatch --forks=3 --signal=TERM -- /opt/rt5/sbin/rt-server.fcgi&lt;br /&gt;
StandardInput=socket&lt;br /&gt;
DynamicUser=true&lt;br /&gt;
SupplementaryGroups=rt&lt;br /&gt;
UMask=027&lt;br /&gt;
# If you have RT plugins or customizations that write to other locations on&lt;br /&gt;
# the filesystem, add more ReadWritePaths lines as needed.&lt;br /&gt;
ReadWritePaths=/opt/rt5/var&lt;br /&gt;
&lt;br /&gt;
CapabilityBoundingSet=&lt;br /&gt;
DevicePolicy=closed&lt;br /&gt;
PrivateMounts=true&lt;br /&gt;
PrivateNetwork=false&lt;br /&gt;
PrivateTmp=true&lt;br /&gt;
PrivateUsers=true&lt;br /&gt;
ProtectControlGroups=true&lt;br /&gt;
ProtectHome=true&lt;br /&gt;
ProtectSystem=strict&lt;br /&gt;
NoNewPrivileges=true&lt;br /&gt;
LockPersonality=true&lt;br /&gt;
MemoryDenyWriteExecute=true&lt;br /&gt;
PrivateDevices=true&lt;br /&gt;
ProtectKernelModules=true&lt;br /&gt;
ProtectKernelTunables=true&lt;br /&gt;
RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6 AF_NETLINK&lt;br /&gt;
RestrictNamespaces=true&lt;br /&gt;
RestrictRealtime=true&lt;br /&gt;
SystemCallErrorNumber=EPERM&lt;br /&gt;
SystemCallFilter=@system-service&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save the file and close your editor.&lt;br /&gt;
&lt;br /&gt;
=== Create the RT socket ===&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo systemctl edit --force --full rt-server.socket&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This opens an editor to define the RT socket to systemd. Use the editor to add this text to the file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[Unit]&lt;br /&gt;
Description=RT FCGI server socket&lt;br /&gt;
Wants=network.target&lt;br /&gt;
After=network.target&lt;br /&gt;
Before=apache2.service httpd.service nginx.service&lt;br /&gt;
&lt;br /&gt;
[Install]&lt;br /&gt;
WantedBy=sockets.target&lt;br /&gt;
&lt;br /&gt;
[Socket]&lt;br /&gt;
# ListenStream defines the address and port where the RT FastCGI server listens.&lt;br /&gt;
# This is NOT the web server itself, so don&#039;t make this port 80, 443, etc.&lt;br /&gt;
# You may edit this if you like, but note:&lt;br /&gt;
# Connections are unencrypted. You should only listen on a secure network&lt;br /&gt;
# interface.&lt;br /&gt;
# The server can only accept a single socket. You cannot specify more than&lt;br /&gt;
# one ListenStream address.&lt;br /&gt;
ListenStream=[::1]:5000&lt;br /&gt;
Accept=no&lt;br /&gt;
FreeBind=yes&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save the file and close your editor.&lt;br /&gt;
&lt;br /&gt;
=== Enable the RT socket ===&lt;br /&gt;
&lt;br /&gt;
Load the new services into RT, start the server socket, and enable it on future boots:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo systemctl daemon-reload&lt;br /&gt;
sudo systemctl enable --now rt-server.socket&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s web server ==&lt;br /&gt;
&lt;br /&gt;
Fully documenting how to set up a web server configured for your network with encryption is outside the scope of this guide. This page only highlights the configuration you need to pass web requests onto the RT FastCGI service.&lt;br /&gt;
&lt;br /&gt;
=== nginx ===&lt;br /&gt;
&lt;br /&gt;
Make sure you have the necessary packages installed:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install nginx&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install nginx&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In the &amp;lt;code&amp;gt;http server&amp;lt;/code&amp;gt; configuration blocks where you want to serve RT, add a configuration block like this, &#039;&#039;&#039;above&#039;&#039;&#039; any other &amp;lt;code&amp;gt;location&amp;lt;/code&amp;gt; blocks:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# The location path should match the WebPath in your RT site configuration.&lt;br /&gt;
location / {&lt;br /&gt;
  include /etc/nginx/fastcgi.conf;&lt;br /&gt;
  # SCRIPT_NAME should match RT&#039;s WebPath, without a trailing slash.&lt;br /&gt;
  # This means when WebPath is /, it&#039;s the empty string &amp;quot;&amp;quot;.&lt;br /&gt;
  fastcgi_param SCRIPT_NAME &amp;quot;&amp;quot;;&lt;br /&gt;
  # This network location should match the ListenStream in rt-server.socket.&lt;br /&gt;
  fastcgi_pass localhost:5000;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you&#039;re doing a fresh install, the default &amp;lt;code&amp;gt;http server&amp;lt;/code&amp;gt; configuration location varies by distribution:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|Edit &amp;lt;code&amp;gt;/etc/nginx/sites-available/default&amp;lt;/code&amp;gt;&lt;br /&gt;
|Add a new file &amp;lt;code&amp;gt;/etc/nginx/default.d/rt-server.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
After you’ve edited your configuration, load it by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo systemctl reload nginx&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once this is done you can skip ahead to Verify the web interface.&lt;br /&gt;
&lt;br /&gt;
=== Apache httpd ===&lt;br /&gt;
&lt;br /&gt;
Make sure you have the necessary packages installed, and the proxy_fcgi module enabled:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install apache2&lt;br /&gt;
sudo a2enmod proxy&lt;br /&gt;
sudo a2enmod proxy_fcgi&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install httpd&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In the &amp;lt;code&amp;gt;&amp;amp;lt;VirtualHost&amp;amp;gt;&amp;lt;/code&amp;gt; configuration blocks where you want to serve RT, add a configuration block like this, &#039;&#039;&#039;above&#039;&#039;&#039; any other &amp;lt;code&amp;gt;Alias&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;ProxyPass&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;ScriptAlias&amp;lt;/code&amp;gt; lines:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# SCRIPT_NAME should match RT&#039;s WebPath, without a trailing slash.&lt;br /&gt;
# This means when WebPath is /, it&#039;s the empty string &amp;quot;&amp;quot;.&lt;br /&gt;
ProxyFCGISetEnvIf true SCRIPT_NAME &amp;quot;&amp;quot;&lt;br /&gt;
# The location path in the first argument should match the WebPath in your&lt;br /&gt;
# RT site configuration.  The network location after fcgi:// should match&lt;br /&gt;
# the ListenStream in rt-server.socket.&lt;br /&gt;
ProxyPass / fcgi://localhost:5000/&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you&#039;re doing a fresh install, the default &amp;lt;code&amp;gt;&amp;amp;lt;VirtualHost&amp;amp;gt;&amp;lt;/code&amp;gt; configuration location varies by distribution and whether or not you&#039;re using HTTPS:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|With HTTPS: &amp;lt;code&amp;gt;/etc/apache2/sites-available/default-ssl.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
With plain HTTP: &amp;lt;code&amp;gt;/etc/apache2/sites-available/000-default.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
|With HTTPS: &amp;lt;code&amp;gt;/etc/httpd/conf.d/ssl.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
With plain HTTP: Write a new file &amp;lt;code&amp;gt;/etc/httpd/conf.d/vhost_RT.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
After you’ve edited your configuration, load it by running:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo systemctl reload apache2&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo systemctl reload httpd&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Verify the web interface ===&lt;br /&gt;
&lt;br /&gt;
You should be able to visit your web server in your browser, and be presented with RT’s login screen. You should be able to log in with username &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; and the password you set previously.&lt;br /&gt;
&lt;br /&gt;
If the web server returns a 502 Bad Gateway response, it&#039;s having trouble connecting to the RT FCGI server. Check the error logs for your web server:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 33%;&amp;quot;|nginx&lt;br /&gt;
! style=&amp;quot;width: 33%;&amp;quot;|Apache on Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 33%;&amp;quot;|httpd on Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;/var/log/nginx/error.log&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;/var/log/apache2/error.log&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;/var/log/httpd/error_log&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For all kinds of errors, you can check the logs for the RT FCGI server and its socket:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo journalctl --unit rt-server.\*&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s mail server ==&lt;br /&gt;
&lt;br /&gt;
RT both can both send and receive ticket updates via email. Unfortunately, there are too many variables to document a useful setup process here: getting this working usually requires creating DNS records, and coordinating with existing mail servers, which will be the main constraint on your setup. Instead this guide provides a brief overview of how the integration works, and where the connection points are that you likely need to work on.&lt;br /&gt;
&lt;br /&gt;
=== Sending Mail ===&lt;br /&gt;
&lt;br /&gt;
RT only knows how to send mail by passing it off to another program on the system. It cannot connect or authenticate directly to external mail servers. In the default configuration, RT runs the standard &amp;lt;code&amp;gt;sendmail&amp;lt;/code&amp;gt; command. There are [https://docs.bestpractical.com/rt/latest/RT_Config.html#Outgoing-mail configuration options to send mail through different commands] if you need.&lt;br /&gt;
&lt;br /&gt;
The most common setup is to install and configure a proper Mail Transfer Agent (MTA) like Postfix or Exim, and then configure it to send mail to the wider Internet as you need. This works well because the MTAs are robust and well-tested; they have flexible configuration to let you send mail out by relaying to other mail servers you specify with optional authentication; and most distributions install one by default anyway. The only hard part is configuring the MTA to send mail following your site’s policies.&lt;br /&gt;
&lt;br /&gt;
Other software is available that provides a slimmer version of the &amp;lt;code&amp;gt;sendmail&amp;lt;/code&amp;gt; command that connects to an external mail server for you, like ssmtp. These programs are usually easier to configure than an MTA, but they often lose email permanently if they can’t connect to the external server at the time it’s sent. (MTAs keep email queued locally until they successfully deliver it to another server.)&lt;br /&gt;
&lt;br /&gt;
=== Receiving email ===&lt;br /&gt;
&lt;br /&gt;
RT installs a command called &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; that receives an email on standard input and posts it to RT’s REST web interface, where it gets saved in the database and added to a ticket. You need to arrange for a way to send incoming email to this command.&lt;br /&gt;
&lt;br /&gt;
The most common setup is to have an MTA on the same box as RT receive email directly, and then set up mail aliases that call this command when mail comes in. Example &amp;lt;code&amp;gt;/etc/aliases&amp;lt;/code&amp;gt; entries look like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rt: &amp;quot;|/opt/rt5/bin/rt-mailgate --queue general --action correspond --url https://rt.yourdomain.example.com/&amp;quot;&lt;br /&gt;
rt-comment: &amp;quot;|/opt/rt5/bin/rt-mailgate --queue general --action comment --url https://rt.yourdomain.example.com/&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
This works well because, again, you’re probably running an MTA anyway; and the MTA can hold and queue mail if it comes in while RT is down for any reason, giving you a buffer against downtime.&lt;br /&gt;
&lt;br /&gt;
Another common option is to periodically run a tool that fetches mail using a protocol like IMAP, like fetchmail or getmail, and passes it on to &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt;. This is less common because it requires setting up another tool to run, and securely storing another set of mail server credentials. But it is useful when local policy prevents the RT server from receiving email directly.&lt;br /&gt;
&lt;br /&gt;
This is much less common, but it might help to know that &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; doesn’t have to run on the same system as RT itself. It just needs to be able to connect to RT’s web interface. If you don’t have any other options, you can install the RT software on a different system that receives email, and configure &#039;&#039;that&#039;&#039; system to run &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; and pass it on to the RT server. To do that, just repeat the installation instructions above, skipping the steps about installing the database and web server.&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s background jobs ==&lt;br /&gt;
&lt;br /&gt;
Create a file &amp;lt;code&amp;gt;/etc/cron.d/rt&amp;lt;/code&amp;gt; with the following content. You may edit all of the time fields as you see fit. Refer to the crontab(5) man page for details about their definitions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Update the fulltext index with new ticket data&lt;br /&gt;
*/3 *   *   *   *   root    /opt/rt5/sbin/rt-fulltext-indexer&lt;br /&gt;
# Email out dashboards that users have subscribed to&lt;br /&gt;
0   *   *   *   *   root    /opt/rt5/sbin/rt-email-dashboards&lt;br /&gt;
# Clean old sessions from the database&lt;br /&gt;
10  3   *   *   *   root    /opt/rt5/sbin/rt-clean-sessions --older 8d&lt;br /&gt;
# Email out weekly digests for users who have requested it&lt;br /&gt;
50  4   *   *   Mon root    /opt/rt5/sbin/rt-email-digest -m weekly&lt;br /&gt;
# Email out daily digests for users who have requested it&lt;br /&gt;
50  5   *   *   *   root    /opt/rt5/sbin/rt-email-digest -m daily&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Set up RT ==&lt;br /&gt;
&lt;br /&gt;
If you’ve gotten this far, congratulations, your RT install is really done now. You can start setting up RT with users, groups, queues, and business logic. [[Main Page|Head back to the main page]] to start exploring those topics.&lt;/div&gt;</summary>
		<author><name>Brett</name></author>
	</entry>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=ManualInstallation&amp;diff=27078</id>
		<title>ManualInstallation</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=ManualInstallation&amp;diff=27078"/>
		<updated>2022-05-11T02:25:58Z</updated>

		<summary type="html">&lt;p&gt;Brett: more correct comments about RT&amp;#039;s SCRIPT_NAME&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Prev: [[ManualRequirements]] — Up: [[UserManual]] — Next: [[ManualApacheConfig]]&lt;br /&gt;
&lt;br /&gt;
This guide walks you through installing RT from source on a modern, popular Linux distro. Specifically, that means a distribution based on Debian or Red Hat that’s been released since around 2020.&lt;br /&gt;
&lt;br /&gt;
This guide assumes:&lt;br /&gt;
&lt;br /&gt;
* You can install packages generally available in Debian/Ubuntu or Red Hat/Fedora/CentOS.&lt;br /&gt;
* You want to install RT, and all of its Perl dependencies, from source to get the latest versions. (This is a trade-off. It means the boundaries of your install will be very clear, but you won’t get security updates for RT or Perl modules from your distribution.)&lt;br /&gt;
* You are willing to install a couple of extra tools to manage the RT installation similarly to how you would in other packaging systems (like PyPI, npm, etc.).&lt;br /&gt;
* You are willing to do a relatively maximal install of RT, enabling all the options during installation and then setting what you need in the configuration. (You could save a little space and time by being pickier about your options, but then that complicates the guide and makes it harder to turn those options on later if you want.)&lt;br /&gt;
* You are using a regular user account on the Linux system that can get superuser privileges with sudo.&lt;br /&gt;
&lt;br /&gt;
== Install the base dependencies ==&lt;br /&gt;
&lt;br /&gt;
These are required by RT, either to run or to install the dependencies.&lt;br /&gt;
&lt;br /&gt;
=== Debian/Ubuntu ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo apt install autoconf build-essential cpanminus curl libexpat-dev libgd-dev libssl-dev libz-dev gnupg graphviz multiwatch openssl perl w3m&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Red Hat Enterprise Linux ===&lt;br /&gt;
&lt;br /&gt;
These instructions are for RHEL specifically. For RHEL-derived distributions like CentOS and Rocky, go to the next section.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;MAJDISTVER=&amp;quot;$(. /etc/os-release &amp;amp;&amp;amp; echo &amp;quot;${VERSION_ID%%.*}&amp;quot;)&amp;quot;&lt;br /&gt;
sudo subscription-manager repos --enable &amp;quot;codeready-builder-for-rhel-$MAJDISTVER-$(arch)-rpms&amp;quot;&lt;br /&gt;
sudo dnf install &amp;quot;https://dl.fedoraproject.org/pub/epel/epel-release-latest-$MAJDISTVER.noarch.rpm&amp;quot;&lt;br /&gt;
sudo dnf install patch tar which gcc gcc-c++ perl-core perl-App-cpanminus graphviz expat-devel gd-devel multiwatch openssl openssl-devel w3m&lt;br /&gt;
sudo sed -i~ &#039;/^SELINUX=/ c SELINUX=disabled&#039; /etc/selinux/config&lt;br /&gt;
sudo setenforce 0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Turning off SELinux enforcement is required on Red Hat-based distributions because, as of March 2022, nobody has written a policy for RT.)&lt;br /&gt;
&lt;br /&gt;
=== RHEL Community Distributions: Fedora/CentOS/Rocky ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo dnf install epel-release&lt;br /&gt;
sudo dnf install patch tar which gcc gcc-c++ perl-core perl-App-cpanminus graphviz expat-devel gd-devel multiwatch openssl openssl-devel w3m&lt;br /&gt;
sudo sed -i~ &#039;/^SELINUX=/ c SELINUX=disabled&#039; /etc/selinux/config&lt;br /&gt;
sudo setenforce 0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Turning off SELinux enforcement is required on Red Hat-based distributions because, as of March 2022, nobody has written a policy for RT.)&lt;br /&gt;
&lt;br /&gt;
== Install a database ==&lt;br /&gt;
&lt;br /&gt;
You need access to a database server. It can be remote, or you can install a database server alongside RT. RT supports a few different databases, but the best supported options are PostgreSQL and MariaDB.&lt;br /&gt;
&lt;br /&gt;
=== Installing and configuring the PostgreSQL server ===&lt;br /&gt;
&lt;br /&gt;
If you want to install a fresh PostgreSQL database server alongside RT:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install postgresql&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install postgresql-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In order to set up RT’s database, you will need a PostgreSQL account that can create databases and roles and be authenticated with a password. If you don’t have that, you can create it by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo createuser --createdb --createrole --login --pwprompt rt_admin&amp;lt;/pre&amp;gt;&lt;br /&gt;
Set the password when prompted. Record this; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
=== Enable password authentication in PostgreSQL ===&lt;br /&gt;
&lt;br /&gt;
You need to consider this step whether you install the database locally, or use an existing one already running. RT supports connecting to PostgreSQL a few different ways, but authenticating with a username and password is simplest, and this guide is written based on that. Not all PostgreSQL installations allow this authentication method by default. You need to review your &amp;lt;code&amp;gt;pg_hba.conf&amp;lt;/code&amp;gt; file located at:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;/etc/postgresql/VERSION/main/pg_hba.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;/var/lib/pgsql/VERSION/data/pg_hba.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Replace &amp;lt;code&amp;gt;VERSION&amp;lt;/code&amp;gt; with the version of your PostgreSQL database. Add these two lines &#039;&#039;&#039;above&#039;&#039;&#039; any other lines that start with &amp;lt;code&amp;gt;host&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;host  rt5  rt_user   all  md5&lt;br /&gt;
host  rt5  rt_admin  all  md5&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This configuration will let &amp;lt;code&amp;gt;rt_user&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;rt_admin&amp;lt;/code&amp;gt; authorize themselves for the &amp;lt;code&amp;gt;rt5&amp;lt;/code&amp;gt; database using an &amp;lt;code&amp;gt;md5&amp;lt;/code&amp;gt; crypted password over a network connection (possibly using the localhost loopback network). You might be able to further restrict some of these fields for improved security, but doing so is outside the scope of this install guide. Refer to [https://www.postgresql.org/docs/current/auth-pg-hba-conf.html the pg_hba.conf documentation] for more details.&lt;br /&gt;
&lt;br /&gt;
Save your changes and reload the database:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo systemctl reload postgresql&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Installing the PostgreSQL client libraries ===&lt;br /&gt;
&lt;br /&gt;
These are required for RT to be able to talk to any PostgreSQL server.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install libpq-dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install postgresql-devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Once this is done you can skip ahead to installing RT.&lt;br /&gt;
&lt;br /&gt;
=== Installing and configuring the MariaDB server ===&lt;br /&gt;
&lt;br /&gt;
If you want to install a fresh MariaDB database server alongside RT:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install mariadb-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install mariadb-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In order to set up RT’s database, you will need a MySQL superuser account. To stay consistent with PostgreSQL, I suggest setting a password for it. You can do that by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo mysql mysql&lt;br /&gt;
MariaDB [mysql]&amp;amp;gt; GRANT ALL PRIVILEGES ON rt5.* TO rt_admin@localhost IDENTIFIED BY &#039;YourPassphraseHere&#039; WITH GRANT OPTION;&amp;lt;/pre&amp;gt;&lt;br /&gt;
Record your passphrase; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
=== Adjust MariaDB’s max_allowed_packet setting ===&lt;br /&gt;
&lt;br /&gt;
You need to consider this step whether you install the database locally, or use an existing one already running. [https://mariadb.com/kb/en/server-system-variables/#max_allowed_packet MariaDB’s &amp;lt;code&amp;gt;max_allowed_packet&amp;lt;/code&amp;gt; setting] functionally limits the size of attachments in RT. The default is 16MiB, which is too small for most installations. You can ultimately choose any setting you’re comfortable with; 64MiB here should allow most requests without being too open.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;echo -e &#039;[server]\nmax_allowed_packet=64M&#039; | sudo tee /etc/mysql/conf.d/max_allowed_packet.cnf&lt;br /&gt;
sudo systemctl reload mariadb&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;echo -e &#039;[server]\nmax_allowed_packet=64M&#039; | sudo tee /etc/my.cnf.d/max_allowed_packet.cnf&lt;br /&gt;
sudo systemctl reload mariadb&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Installing the MariaDB client libraries ===&lt;br /&gt;
&lt;br /&gt;
These are required for RT to be able to talk to any MariaDB server.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install libmariadb-dev libmariadb-dev-compat&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install mariadb-devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Install RT ==&lt;br /&gt;
&lt;br /&gt;
=== Create an RT system group ===&lt;br /&gt;
&lt;br /&gt;
This group will be used throughout the install process to control access to sensitive files. Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo groupadd --system rt&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Get and unpack the RT source code ===&lt;br /&gt;
&lt;br /&gt;
Download the latest source code using the link on the [https://bestpractical.com/download-page RT download page], extract it using &amp;lt;code&amp;gt;tar -xf&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt; into the source code directory to run the rest of the commands in this section. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;curl -O https://download.bestpractical.com/pub/rt/release/rt-5.0.2.tar.gz&lt;br /&gt;
tar -xf rt-5.0.2.tar.gz&lt;br /&gt;
cd rt-5.0.2&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Pre-configure RT ===&lt;br /&gt;
&lt;br /&gt;
This command will detect some information about your system in order to install RT properly, and decide which set of dependencies to install. Here’s what the different parts of our command are doing:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;PERL=…&amp;lt;/code&amp;gt; configures RT to run under Perl with some options that load its dependencies from a dedicated directory. The &amp;lt;code&amp;gt;/opt/rt5&amp;lt;/code&amp;gt; part of this string should match your &amp;lt;code&amp;gt;prefix&amp;lt;/code&amp;gt; setting (see next item). If you know you want to use a specific Perl installed on your system, you can specify its full path instead of the plain &amp;lt;code&amp;gt;perl&amp;lt;/code&amp;gt; here.&lt;br /&gt;
* &amp;lt;code&amp;gt;--prefix=/opt/rt5&amp;lt;/code&amp;gt; sets the directory where RT will install all of its libraries, tools, and supporting files. You can choose another path if you like.&lt;br /&gt;
* &amp;lt;code&amp;gt;--with-db-type=TYPE&amp;lt;/code&amp;gt; - Replace &amp;lt;code&amp;gt;TYPE&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;Pg&amp;lt;/code&amp;gt; for PostgreSQL, or &amp;lt;code&amp;gt;mysql&amp;lt;/code&amp;gt; for MariaDB.&lt;br /&gt;
* &amp;lt;code&amp;gt;--with-web-group=rt&amp;lt;/code&amp;gt; installs RT using the dedicated group we created earlier.&lt;br /&gt;
* The rest of the options tell RT to install additional dependencies for optional features.&lt;br /&gt;
&lt;br /&gt;
Make sure you have &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt;ed into the RT source directory, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;PERL=&amp;quot;/usr/bin/env -S perl -I/opt/rt5/local/lib/perl5&amp;quot; ./configure --prefix=/opt/rt5 --with-db-type=TYPE --with-web-group=rt --with-attachment-store=disk --enable-externalauth --enable-gd --enable-graphviz --enable-gpg --enable-smime&amp;lt;/pre&amp;gt;&lt;br /&gt;
For more background, [https://docs.bestpractical.com/rt/latest/configure.html refer to the RT configure options documentation].&lt;br /&gt;
&lt;br /&gt;
=== Install RT and its Perl dependencies ===&lt;br /&gt;
&lt;br /&gt;
This command will download, build, and install all of the Perl modules necessary to run RT with the configuration you set above. Here’s what the different parts of the command are doing:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;make dirs&amp;lt;/code&amp;gt; creates RT&#039;s directory structure, so we can install dependencies inside it.&lt;br /&gt;
* &amp;lt;code&amp;gt;make fixdeps&amp;lt;/code&amp;gt; actually installs those dependencies.&lt;br /&gt;
* &amp;lt;code&amp;gt;RT_FIX_DEPS_CMD=…&amp;lt;/code&amp;gt; tells RT to use cpanminus to install dependencies (instead of the older, default &amp;lt;code&amp;gt;cpan&amp;lt;/code&amp;gt; command) inside RT&#039;s directory structure.&lt;br /&gt;
* &amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt; installs all of RT’s files under &amp;lt;code&amp;gt;/opt/rt5&amp;lt;/code&amp;gt; (or the prefix directory you set earlier). It will only run if &amp;lt;code&amp;gt;fixdeps&amp;lt;/code&amp;gt; succeeded.&lt;br /&gt;
&lt;br /&gt;
Make sure you have &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt;ed into the RT source directory, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo make dirs&lt;br /&gt;
make fixdeps RT_FIX_DEPS_CMD=&amp;quot;cpanm --sudo --local-lib-contained=/opt/rt5/local&amp;quot;&lt;br /&gt;
sudo make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
If it works, the command will eventually output a message that says “Congratulations. RT is now installed.” followed by instructions about configuring and setting up the database. We’ll do that next.&lt;br /&gt;
&lt;br /&gt;
=== Configure RT ===&lt;br /&gt;
&lt;br /&gt;
[https://docs.bestpractical.com/rt/latest/RT_Config.html RT has many configuration options.] You can put configuration options in the file &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/code&amp;gt;, or in individual files under &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.d/&amp;lt;/code&amp;gt;. Use an editor to save all the text below to &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/code&amp;gt; (you can just overwrite the existing file, or add this to the bottom of what’s there) and then fill in settings for your site everywhere the text &amp;lt;code&amp;gt;EDIT WITH&amp;lt;/code&amp;gt; appears.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Single-quote all values EXCEPT the special value `undef`&lt;br /&gt;
# that turns off a setting.&lt;br /&gt;
&lt;br /&gt;
# rtname appears in ticket email subjects. It needs to be globally unique,&lt;br /&gt;
# so use your organization&#039;s domain name.&lt;br /&gt;
Set($rtname, &#039;EDIT WITH yourdomain.example.com&#039;);&lt;br /&gt;
# Organization is used in the database for ticket links, etc. It also needs to&lt;br /&gt;
# be globally unique, so use your organization&#039;s domain name.&lt;br /&gt;
Set($Organization, &#039;EDIT WITH yourdomain.example.com&#039;);&lt;br /&gt;
# WebDomain is domain name of the RT web server. RT uses it to construct links&lt;br /&gt;
# and defend against CSRFs.&lt;br /&gt;
Set($WebDomain, &#039;EDIT WITH rt.yourdomain.example.com&#039;);&lt;br /&gt;
# WebPort is the port where the RT web server runs. Edit the number below if&lt;br /&gt;
# you&#039;re not using the standard HTTPS port.&lt;br /&gt;
Set($WebPort, &#039;443&#039;);&lt;br /&gt;
# WebPath is the path where the RT web server runs on your WebDomain.&lt;br /&gt;
# Edit the path below if you&#039;re using a specific path.&lt;br /&gt;
Set($WebPath, &#039;/&#039;);&lt;br /&gt;
&lt;br /&gt;
# DatabaseUser is the name of the database account RT uses to read and store&lt;br /&gt;
# data. &#039;rt_user&#039; is the default but you can change it if you like.&lt;br /&gt;
# DO NOT use the &#039;rt_admin&#039; superuser created in the instructions above.&lt;br /&gt;
Set($DatabaseUser, &#039;rt_user&#039;);&lt;br /&gt;
# DatabasePassword is the password for DatabaseUser.&lt;br /&gt;
Set($DatabasePassword, &#039;EDIT WITH SomePassphraseHere&#039;);&lt;br /&gt;
# DatabaseHost is the hostname of the database server RT should use.&lt;br /&gt;
# Change &#039;localhost&#039; if it lives on a different server.&lt;br /&gt;
Set($DatabaseHost, &#039;localhost&#039;);&lt;br /&gt;
# DatabasePort is the port number of the database server RT should use.&lt;br /&gt;
# `undef` means the default for that database. Change it if you&#039;re not&lt;br /&gt;
# using the standard port.&lt;br /&gt;
Set($DatabasePort, undef);&lt;br /&gt;
# DatabaseName is the name of RT&#039;s database hosted on DatabaseHost.&lt;br /&gt;
# &#039;rt5&#039; is the default but you can change it if you like.&lt;br /&gt;
Set($DatabaseName, &#039;rt5&#039;);&lt;br /&gt;
# DatabaseAdmin is the name of the user in the database used to perform&lt;br /&gt;
# major administrative tasks. Change &#039;rt_admin&#039; if you&#039;re using a user&lt;br /&gt;
# besides the one created in this guide.&lt;br /&gt;
Set($DatabaseAdmin, &#039;rt_admin&#039;);&lt;br /&gt;
&lt;br /&gt;
# RT can log to syslog, stderr, and/or a dedicated file.&lt;br /&gt;
# Log settings are used both by the primary server and by command line&lt;br /&gt;
# tools like rt-crontool, rt-ldapimport, etc.&lt;br /&gt;
# You set all of RT&#039;s $LogTo* paramaters to a standard log level: &#039;debug&#039;,&lt;br /&gt;
# &#039;info&#039;, &#039;notice&#039;, &#039;warning&#039;, &#039;error&#039;, &#039;critical&#039;, &#039;alert&#039;, or &#039;emergency&#039;.&lt;br /&gt;
# For a modern install, I recommend logging primarily to syslog, so it goes&lt;br /&gt;
# to journald where it&#039;s easy to query and automatically gets rotated.&lt;br /&gt;
Set($LogToSyslog, &#039;info&#039;);&lt;br /&gt;
&lt;br /&gt;
# When the RT server logs to stderr, that usually goes to your web server&#039;s&lt;br /&gt;
# error log. Command line tools log to their own stderr. Setting this to&lt;br /&gt;
# &#039;warning&#039; or &#039;error&#039; helps ensure you get notified if RT&#039;s cron jobs&lt;br /&gt;
# encounter problems.&lt;br /&gt;
Set($LogToSTDERR, &#039;warning&#039;);&lt;br /&gt;
&lt;br /&gt;
# Turn off optional features that require additional configuration.&lt;br /&gt;
# If you want to use these, refer to the RT_Config documentation for&lt;br /&gt;
# instructions on how to set them up.&lt;br /&gt;
Set(%GnuPG, &#039;Enable&#039; =&amp;gt; &#039;0&#039;);&lt;br /&gt;
Set(%SMIME, &#039;Enable&#039; =&amp;gt; &#039;0&#039;);&lt;br /&gt;
&lt;br /&gt;
# Perl expects to find this 1 at the end of the file.&lt;br /&gt;
1;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;RT_SiteConfig.pm&amp;lt;/code&amp;gt; is actually Perl code. RT runs the code directly to load the configuration. Any time you finish editing it, you can check that you didn’t make any syntax errors by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;perl -c /opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Set up RT’s database ===&lt;br /&gt;
&lt;br /&gt;
RT includes a tool to help you set up its database. By default, it connects to the database as an administrator to create the database and user that you configured in the previous step.&lt;br /&gt;
&lt;br /&gt;
(The instructions from &amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt; and RT’s README file tell you to run &amp;lt;code&amp;gt;make initialize-database&amp;lt;/code&amp;gt;. That just runs &amp;lt;code&amp;gt;rt-setup-database&amp;lt;/code&amp;gt; for you. Running the tool directly makes it easier to pass the options you need.)&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;--action=init&amp;lt;/code&amp;gt; tells the tool to create the user, the database, the tables inside it, and insert core data RT needs to function.&lt;br /&gt;
* &#039;&#039;&#039;If&#039;&#039;&#039; you are using an existing database server and the database adminstrator has already created the user account and database for RT, then you can add the &amp;lt;code&amp;gt;--skip-create&amp;lt;/code&amp;gt; option.&lt;br /&gt;
* &#039;&#039;&#039;If&#039;&#039;&#039; you have a less common database setup, this tool has additional options to give you finer-grained control over what steps are run and how. Refer to [https://docs.bestpractical.com/rt/latest/rt-setup-database.html the full rt-setup-database documentation] to learn more about those.&lt;br /&gt;
* The command reads files from RT’s &amp;lt;code&amp;gt;etc/&amp;lt;/code&amp;gt; directory by default, so the easiest way to run it is to &amp;lt;code&amp;gt;cd /opt/rt5&amp;lt;/code&amp;gt; first, and then it will find the necessary files automatically.&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /opt/rt5&lt;br /&gt;
sudo sbin/rt-setup-database --action=init&amp;lt;/pre&amp;gt;&lt;br /&gt;
Enter the password for your database administrator account when prompted.&lt;br /&gt;
&lt;br /&gt;
=== Set up fulltext indexing ===&lt;br /&gt;
&lt;br /&gt;
Fulltext indexing speeds up searches for ticket content, which makes RT a lot nicer to use.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;--noask&amp;lt;/code&amp;gt; uses the default names for the index, which will be fine for a new install and simplifies the setup.&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo /opt/rt5/sbin/rt-setup-fulltext-index --noask&amp;lt;/pre&amp;gt;&lt;br /&gt;
Enter the password for your database administrator account when prompted. The end of the process will output some RT configuration that looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;### EXAMPLE OUTPUT ONLY - Don&#039;t use this directly!&lt;br /&gt;
Set( %FullTextSearch,&lt;br /&gt;
    Enable     =&amp;gt; 1,&lt;br /&gt;
    Indexed    =&amp;gt; 1,&lt;br /&gt;
    # Additional output from rt-setup-fulltext-index should be here.&lt;br /&gt;
    # The configuration varies by database type.&lt;br /&gt;
);&amp;lt;/pre&amp;gt;&lt;br /&gt;
Copy the output generated when you run &amp;lt;code&amp;gt;rt-setup-fulltext-index&amp;lt;/code&amp;gt; and save it to the file &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.d/FulltextIndex.pm&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Set permissions ===&lt;br /&gt;
&lt;br /&gt;
All of RT’s configuration files should be readable by the user that runs the web server, and no other users, in order to protect sensitive information like the database password. RT provides a command to set permissions appropriately according to your distribution and configuration. &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt; to the directory where you extracted the RT source code, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd rt-5.0.2&lt;br /&gt;
sudo make fixperms&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Verify the installation ===&lt;br /&gt;
&lt;br /&gt;
If everything has gone well, then you should be able to set a password for RT’s &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; user. You’ll use this later to log in to the web interface and continue setting up your system. Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo /opt/rt5/sbin/rt-passwd root&amp;lt;/pre&amp;gt;&lt;br /&gt;
Set the password when prompted. Record this; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
== Set up RT FastCGI service ==&lt;br /&gt;
&lt;br /&gt;
=== Create the RT service ===&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo systemctl edit --force --full rt-server.service&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This opens an editor to define the RT service to systemd. Use the editor to add this text to the file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[Unit]&lt;br /&gt;
Description=RT FCGI server&lt;br /&gt;
&lt;br /&gt;
[Service]&lt;br /&gt;
# The --forks option is the number of RT servers to run in parallel.&lt;br /&gt;
# 3 should be good for most initial installs. You can increase this&lt;br /&gt;
# number later if needed for performance.&lt;br /&gt;
ExecStart=/usr/bin/multiwatch --forks=3 --signal=TERM -- /opt/rt5/sbin/rt-server.fcgi&lt;br /&gt;
StandardInput=socket&lt;br /&gt;
DynamicUser=true&lt;br /&gt;
SupplementaryGroups=rt&lt;br /&gt;
UMask=027&lt;br /&gt;
# If you have RT plugins or customizations that write to other locations on&lt;br /&gt;
# the filesystem, add more ReadWritePaths lines as needed.&lt;br /&gt;
ReadWritePaths=/opt/rt5/var&lt;br /&gt;
&lt;br /&gt;
CapabilityBoundingSet=&lt;br /&gt;
DevicePolicy=closed&lt;br /&gt;
PrivateMounts=true&lt;br /&gt;
PrivateNetwork=false&lt;br /&gt;
PrivateTmp=true&lt;br /&gt;
PrivateUsers=true&lt;br /&gt;
ProtectControlGroups=true&lt;br /&gt;
ProtectHome=true&lt;br /&gt;
ProtectSystem=strict&lt;br /&gt;
NoNewPrivileges=true&lt;br /&gt;
LockPersonality=true&lt;br /&gt;
MemoryDenyWriteExecute=true&lt;br /&gt;
PrivateDevices=true&lt;br /&gt;
ProtectKernelModules=true&lt;br /&gt;
ProtectKernelTunables=true&lt;br /&gt;
RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6 AF_NETLINK&lt;br /&gt;
RestrictNamespaces=true&lt;br /&gt;
RestrictRealtime=true&lt;br /&gt;
SystemCallErrorNumber=EPERM&lt;br /&gt;
SystemCallFilter=@system-service&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save the file and close your editor.&lt;br /&gt;
&lt;br /&gt;
=== Create the RT socket ===&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo systemctl edit --force --full rt-server.socket&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This opens an editor to define the RT socket to systemd. Use the editor to add this text to the file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[Unit]&lt;br /&gt;
Description=RT FCGI server socket&lt;br /&gt;
Wants=network.target&lt;br /&gt;
After=network.target&lt;br /&gt;
Before=apache2.service httpd.service nginx.service&lt;br /&gt;
&lt;br /&gt;
[Install]&lt;br /&gt;
WantedBy=sockets.target&lt;br /&gt;
&lt;br /&gt;
[Socket]&lt;br /&gt;
# ListenStream defines the address and port where the RT FastCGI server listens.&lt;br /&gt;
# This is NOT the web server itself, so don&#039;t make this port 80, 443, etc.&lt;br /&gt;
# You may edit this if you like, but note:&lt;br /&gt;
# Connections are unencrypted. You should only listen on a secure network&lt;br /&gt;
# interface.&lt;br /&gt;
# The server can only accept a single socket. You cannot specify more than&lt;br /&gt;
# one ListenStream address.&lt;br /&gt;
ListenStream=[::1]:5000&lt;br /&gt;
Accept=no&lt;br /&gt;
FreeBind=yes&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save the file and close your editor.&lt;br /&gt;
&lt;br /&gt;
=== Enable the RT socket ===&lt;br /&gt;
&lt;br /&gt;
Load the new services into RT, start the server socket, and enable it on future boots:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo systemctl daemon-reload&lt;br /&gt;
sudo systemctl enable --now rt-server.socket&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s web server ==&lt;br /&gt;
&lt;br /&gt;
Fully documenting how to set up a web server configured for your network with encryption is outside the scope of this guide. This page only highlights the configuration you need to pass web requests onto the RT FastCGI service.&lt;br /&gt;
&lt;br /&gt;
=== nginx ===&lt;br /&gt;
&lt;br /&gt;
Make sure you have the necessary packages installed:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install nginx&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install nginx&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In the &amp;lt;code&amp;gt;http server&amp;lt;/code&amp;gt; configuration blocks where you want to serve RT, add a configuration block like this, &#039;&#039;&#039;above&#039;&#039;&#039; any other &amp;lt;code&amp;gt;location&amp;lt;/code&amp;gt; blocks:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# The location path should match the WebPath in your RT site configuration.&lt;br /&gt;
location / {&lt;br /&gt;
  include /etc/nginx/fastcgi.conf;&lt;br /&gt;
  # SCRIPT_NAME should match RT&#039;s WebPath, without a trailing slash.&lt;br /&gt;
  # This means when WebPath is /, it&#039;s the empty string &amp;quot;&amp;quot;.&lt;br /&gt;
  fastcgi_param SCRIPT_NAME &amp;quot;&amp;quot;;&lt;br /&gt;
  # This network location should match the ListenStream in rt-server.socket.&lt;br /&gt;
  fastcgi_pass localhost:5000;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you&#039;re doing a fresh install, the default &amp;lt;code&amp;gt;http server&amp;lt;/code&amp;gt; configuration location varies by distribution:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|Edit &amp;lt;code&amp;gt;/etc/nginx/sites-available/default&amp;lt;/code&amp;gt;&lt;br /&gt;
|Add a new file &amp;lt;code&amp;gt;/etc/nginx/default.d/rt-server.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
After you’ve edited your configuration, load it by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo systemctl reload nginx&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once this is done you can skip ahead to Verify the web interface.&lt;br /&gt;
&lt;br /&gt;
=== Apache httpd ===&lt;br /&gt;
&lt;br /&gt;
Make sure you have the necessary packages installed, and the proxy_fcgi module enabled:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install apache2&lt;br /&gt;
sudo a2enmod proxy&lt;br /&gt;
sudo a2enmod proxy_fcgi&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install httpd&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In the &amp;lt;code&amp;gt;&amp;amp;lt;VirtualHost&amp;amp;gt;&amp;lt;/code&amp;gt; configuration blocks where you want to serve RT, add a configuration block like this, &#039;&#039;&#039;above&#039;&#039;&#039; any other &amp;lt;code&amp;gt;Alias&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;ProxyPass&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;ScriptAlias&amp;lt;/code&amp;gt; lines:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# RT requires an empty SCRIPT_NAME to serve static files.&lt;br /&gt;
ProxyFCGISetEnvIf true SCRIPT_NAME&lt;br /&gt;
# The location path in the first argument should match the WebPath in your&lt;br /&gt;
# RT site configuration.  The network location after fcgi:// should match&lt;br /&gt;
# the ListenStream in rt-server.socket.&lt;br /&gt;
ProxyPass / fcgi://localhost:5000/&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you&#039;re doing a fresh install, the default &amp;lt;code&amp;gt;&amp;amp;lt;VirtualHost&amp;amp;gt;&amp;lt;/code&amp;gt; configuration location varies by distribution and whether or not you&#039;re using HTTPS:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|With HTTPS: &amp;lt;code&amp;gt;/etc/apache2/sites-available/default-ssl.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
With plain HTTP: &amp;lt;code&amp;gt;/etc/apache2/sites-available/000-default.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
|With HTTPS: &amp;lt;code&amp;gt;/etc/httpd/conf.d/ssl.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
With plain HTTP: Write a new file &amp;lt;code&amp;gt;/etc/httpd/conf.d/vhost_RT.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
After you’ve edited your configuration, load it by running:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo systemctl reload apache2&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo systemctl reload httpd&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Verify the web interface ===&lt;br /&gt;
&lt;br /&gt;
You should be able to visit your web server in your browser, and be presented with RT’s login screen. You should be able to log in with username &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; and the password you set previously.&lt;br /&gt;
&lt;br /&gt;
If the web server returns a 502 Bad Gateway response, it&#039;s having trouble connecting to the RT FCGI server. Check the error logs for your web server:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 33%;&amp;quot;|nginx&lt;br /&gt;
! style=&amp;quot;width: 33%;&amp;quot;|Apache on Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 33%;&amp;quot;|httpd on Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;/var/log/nginx/error.log&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;/var/log/apache2/error.log&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;/var/log/httpd/error_log&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For all kinds of errors, you can check the logs for the RT FCGI server and its socket:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo journalctl --unit rt-server.\*&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s mail server ==&lt;br /&gt;
&lt;br /&gt;
RT both can both send and receive ticket updates via email. Unfortunately, there are too many variables to document a useful setup process here: getting this working usually requires creating DNS records, and coordinating with existing mail servers, which will be the main constraint on your setup. Instead this guide provides a brief overview of how the integration works, and where the connection points are that you likely need to work on.&lt;br /&gt;
&lt;br /&gt;
=== Sending Mail ===&lt;br /&gt;
&lt;br /&gt;
RT only knows how to send mail by passing it off to another program on the system. It cannot connect or authenticate directly to external mail servers. In the default configuration, RT runs the standard &amp;lt;code&amp;gt;sendmail&amp;lt;/code&amp;gt; command. There are [https://docs.bestpractical.com/rt/latest/RT_Config.html#Outgoing-mail configuration options to send mail through different commands] if you need.&lt;br /&gt;
&lt;br /&gt;
The most common setup is to install and configure a proper Mail Transfer Agent (MTA) like Postfix or Exim, and then configure it to send mail to the wider Internet as you need. This works well because the MTAs are robust and well-tested; they have flexible configuration to let you send mail out by relaying to other mail servers you specify with optional authentication; and most distributions install one by default anyway. The only hard part is configuring the MTA to send mail following your site’s policies.&lt;br /&gt;
&lt;br /&gt;
Other software is available that provides a slimmer version of the &amp;lt;code&amp;gt;sendmail&amp;lt;/code&amp;gt; command that connects to an external mail server for you, like ssmtp. These programs are usually easier to configure than an MTA, but they often lose email permanently if they can’t connect to the external server at the time it’s sent. (MTAs keep email queued locally until they successfully deliver it to another server.)&lt;br /&gt;
&lt;br /&gt;
=== Receiving email ===&lt;br /&gt;
&lt;br /&gt;
RT installs a command called &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; that receives an email on standard input and posts it to RT’s REST web interface, where it gets saved in the database and added to a ticket. You need to arrange for a way to send incoming email to this command.&lt;br /&gt;
&lt;br /&gt;
The most common setup is to have an MTA on the same box as RT receive email directly, and then set up mail aliases that call this command when mail comes in. Example &amp;lt;code&amp;gt;/etc/aliases&amp;lt;/code&amp;gt; entries look like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rt: &amp;quot;|/opt/rt5/bin/rt-mailgate --queue general --action correspond --url https://rt.yourdomain.example.com/&amp;quot;&lt;br /&gt;
rt-comment: &amp;quot;|/opt/rt5/bin/rt-mailgate --queue general --action comment --url https://rt.yourdomain.example.com/&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
This works well because, again, you’re probably running an MTA anyway; and the MTA can hold and queue mail if it comes in while RT is down for any reason, giving you a buffer against downtime.&lt;br /&gt;
&lt;br /&gt;
Another common option is to periodically run a tool that fetches mail using a protocol like IMAP, like fetchmail or getmail, and passes it on to &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt;. This is less common because it requires setting up another tool to run, and securely storing another set of mail server credentials. But it is useful when local policy prevents the RT server from receiving email directly.&lt;br /&gt;
&lt;br /&gt;
This is much less common, but it might help to know that &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; doesn’t have to run on the same system as RT itself. It just needs to be able to connect to RT’s web interface. If you don’t have any other options, you can install the RT software on a different system that receives email, and configure &#039;&#039;that&#039;&#039; system to run &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; and pass it on to the RT server. To do that, just repeat the installation instructions above, skipping the steps about installing the database and web server.&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s background jobs ==&lt;br /&gt;
&lt;br /&gt;
Create a file &amp;lt;code&amp;gt;/etc/cron.d/rt&amp;lt;/code&amp;gt; with the following content. You may edit all of the time fields as you see fit. Refer to the crontab(5) man page for details about their definitions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Update the fulltext index with new ticket data&lt;br /&gt;
*/3 *   *   *   *   root    /opt/rt5/sbin/rt-fulltext-indexer&lt;br /&gt;
# Email out dashboards that users have subscribed to&lt;br /&gt;
0   *   *   *   *   root    /opt/rt5/sbin/rt-email-dashboards&lt;br /&gt;
# Clean old sessions from the database&lt;br /&gt;
10  3   *   *   *   root    /opt/rt5/sbin/rt-clean-sessions --older 8d&lt;br /&gt;
# Email out weekly digests for users who have requested it&lt;br /&gt;
50  4   *   *   Mon root    /opt/rt5/sbin/rt-email-digest -m weekly&lt;br /&gt;
# Email out daily digests for users who have requested it&lt;br /&gt;
50  5   *   *   *   root    /opt/rt5/sbin/rt-email-digest -m daily&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Set up RT ==&lt;br /&gt;
&lt;br /&gt;
If you’ve gotten this far, congratulations, your RT install is really done now. You can start setting up RT with users, groups, queues, and business logic. [[Main Page|Head back to the main page]] to start exploring those topics.&lt;/div&gt;</summary>
		<author><name>Brett</name></author>
	</entry>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=ManualInstallation&amp;diff=27077</id>
		<title>ManualInstallation</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=ManualInstallation&amp;diff=27077"/>
		<updated>2022-05-02T19:28:11Z</updated>

		<summary type="html">&lt;p&gt;Brett: update to deploy the RT FCGI server separately&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Prev: [[ManualRequirements]] — Up: [[UserManual]] — Next: [[ManualApacheConfig]]&lt;br /&gt;
&lt;br /&gt;
This guide walks you through installing RT from source on a modern, popular Linux distro. Specifically, that means a distribution based on Debian or Red Hat that’s been released since around 2020.&lt;br /&gt;
&lt;br /&gt;
This guide assumes:&lt;br /&gt;
&lt;br /&gt;
* You can install packages generally available in Debian/Ubuntu or Red Hat/Fedora/CentOS.&lt;br /&gt;
* You want to install RT, and all of its Perl dependencies, from source to get the latest versions. (This is a trade-off. It means the boundaries of your install will be very clear, but you won’t get security updates for RT or Perl modules from your distribution.)&lt;br /&gt;
* You are willing to install a couple of extra tools to manage the RT installation similarly to how you would in other packaging systems (like PyPI, npm, etc.).&lt;br /&gt;
* You are willing to do a relatively maximal install of RT, enabling all the options during installation and then setting what you need in the configuration. (You could save a little space and time by being pickier about your options, but then that complicates the guide and makes it harder to turn those options on later if you want.)&lt;br /&gt;
* You are using a regular user account on the Linux system that can get superuser privileges with sudo.&lt;br /&gt;
&lt;br /&gt;
== Install the base dependencies ==&lt;br /&gt;
&lt;br /&gt;
These are required by RT, either to run or to install the dependencies.&lt;br /&gt;
&lt;br /&gt;
=== Debian/Ubuntu ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo apt install autoconf build-essential cpanminus curl libexpat-dev libgd-dev libssl-dev libz-dev gnupg graphviz multiwatch openssl perl w3m&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Red Hat Enterprise Linux ===&lt;br /&gt;
&lt;br /&gt;
These instructions are for RHEL specifically. For RHEL-derived distributions like CentOS and Rocky, go to the next section.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;MAJDISTVER=&amp;quot;$(. /etc/os-release &amp;amp;&amp;amp; echo &amp;quot;${VERSION_ID%%.*}&amp;quot;)&amp;quot;&lt;br /&gt;
sudo subscription-manager repos --enable &amp;quot;codeready-builder-for-rhel-$MAJDISTVER-$(arch)-rpms&amp;quot;&lt;br /&gt;
sudo dnf install &amp;quot;https://dl.fedoraproject.org/pub/epel/epel-release-latest-$MAJDISTVER.noarch.rpm&amp;quot;&lt;br /&gt;
sudo dnf install patch tar which gcc gcc-c++ perl-core perl-App-cpanminus graphviz expat-devel gd-devel multiwatch openssl openssl-devel w3m&lt;br /&gt;
sudo sed -i~ &#039;/^SELINUX=/ c SELINUX=disabled&#039; /etc/selinux/config&lt;br /&gt;
sudo setenforce 0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Turning off SELinux enforcement is required on Red Hat-based distributions because, as of March 2022, nobody has written a policy for RT.)&lt;br /&gt;
&lt;br /&gt;
=== RHEL Community Distributions: Fedora/CentOS/Rocky ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo dnf install epel-release&lt;br /&gt;
sudo dnf install patch tar which gcc gcc-c++ perl-core perl-App-cpanminus graphviz expat-devel gd-devel multiwatch openssl openssl-devel w3m&lt;br /&gt;
sudo sed -i~ &#039;/^SELINUX=/ c SELINUX=disabled&#039; /etc/selinux/config&lt;br /&gt;
sudo setenforce 0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Turning off SELinux enforcement is required on Red Hat-based distributions because, as of March 2022, nobody has written a policy for RT.)&lt;br /&gt;
&lt;br /&gt;
== Install a database ==&lt;br /&gt;
&lt;br /&gt;
You need access to a database server. It can be remote, or you can install a database server alongside RT. RT supports a few different databases, but the best supported options are PostgreSQL and MariaDB.&lt;br /&gt;
&lt;br /&gt;
=== Installing and configuring the PostgreSQL server ===&lt;br /&gt;
&lt;br /&gt;
If you want to install a fresh PostgreSQL database server alongside RT:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install postgresql&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install postgresql-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In order to set up RT’s database, you will need a PostgreSQL account that can create databases and roles and be authenticated with a password. If you don’t have that, you can create it by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo createuser --createdb --createrole --login --pwprompt rt_admin&amp;lt;/pre&amp;gt;&lt;br /&gt;
Set the password when prompted. Record this; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
=== Enable password authentication in PostgreSQL ===&lt;br /&gt;
&lt;br /&gt;
You need to consider this step whether you install the database locally, or use an existing one already running. RT supports connecting to PostgreSQL a few different ways, but authenticating with a username and password is simplest, and this guide is written based on that. Not all PostgreSQL installations allow this authentication method by default. You need to review your &amp;lt;code&amp;gt;pg_hba.conf&amp;lt;/code&amp;gt; file located at:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;/etc/postgresql/VERSION/main/pg_hba.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;/var/lib/pgsql/VERSION/data/pg_hba.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Replace &amp;lt;code&amp;gt;VERSION&amp;lt;/code&amp;gt; with the version of your PostgreSQL database. Add these two lines &#039;&#039;&#039;above&#039;&#039;&#039; any other lines that start with &amp;lt;code&amp;gt;host&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;host  rt5  rt_user   all  md5&lt;br /&gt;
host  rt5  rt_admin  all  md5&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This configuration will let &amp;lt;code&amp;gt;rt_user&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;rt_admin&amp;lt;/code&amp;gt; authorize themselves for the &amp;lt;code&amp;gt;rt5&amp;lt;/code&amp;gt; database using an &amp;lt;code&amp;gt;md5&amp;lt;/code&amp;gt; crypted password over a network connection (possibly using the localhost loopback network). You might be able to further restrict some of these fields for improved security, but doing so is outside the scope of this install guide. Refer to [https://www.postgresql.org/docs/current/auth-pg-hba-conf.html the pg_hba.conf documentation] for more details.&lt;br /&gt;
&lt;br /&gt;
Save your changes and reload the database:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo systemctl reload postgresql&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Installing the PostgreSQL client libraries ===&lt;br /&gt;
&lt;br /&gt;
These are required for RT to be able to talk to any PostgreSQL server.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install libpq-dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install postgresql-devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Once this is done you can skip ahead to installing RT.&lt;br /&gt;
&lt;br /&gt;
=== Installing and configuring the MariaDB server ===&lt;br /&gt;
&lt;br /&gt;
If you want to install a fresh MariaDB database server alongside RT:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install mariadb-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install mariadb-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In order to set up RT’s database, you will need a MySQL superuser account. To stay consistent with PostgreSQL, I suggest setting a password for it. You can do that by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo mysql mysql&lt;br /&gt;
MariaDB [mysql]&amp;amp;gt; GRANT ALL PRIVILEGES ON rt5.* TO rt_admin@localhost IDENTIFIED BY &#039;YourPassphraseHere&#039; WITH GRANT OPTION;&amp;lt;/pre&amp;gt;&lt;br /&gt;
Record your passphrase; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
=== Adjust MariaDB’s max_allowed_packet setting ===&lt;br /&gt;
&lt;br /&gt;
You need to consider this step whether you install the database locally, or use an existing one already running. [https://mariadb.com/kb/en/server-system-variables/#max_allowed_packet MariaDB’s &amp;lt;code&amp;gt;max_allowed_packet&amp;lt;/code&amp;gt; setting] functionally limits the size of attachments in RT. The default is 16MiB, which is too small for most installations. You can ultimately choose any setting you’re comfortable with; 64MiB here should allow most requests without being too open.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;echo -e &#039;[server]\nmax_allowed_packet=64M&#039; | sudo tee /etc/mysql/conf.d/max_allowed_packet.cnf&lt;br /&gt;
sudo systemctl reload mariadb&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;echo -e &#039;[server]\nmax_allowed_packet=64M&#039; | sudo tee /etc/my.cnf.d/max_allowed_packet.cnf&lt;br /&gt;
sudo systemctl reload mariadb&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Installing the MariaDB client libraries ===&lt;br /&gt;
&lt;br /&gt;
These are required for RT to be able to talk to any MariaDB server.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install libmariadb-dev libmariadb-dev-compat&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install mariadb-devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Install RT ==&lt;br /&gt;
&lt;br /&gt;
=== Create an RT system group ===&lt;br /&gt;
&lt;br /&gt;
This group will be used throughout the install process to control access to sensitive files. Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo groupadd --system rt&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Get and unpack the RT source code ===&lt;br /&gt;
&lt;br /&gt;
Download the latest source code using the link on the [https://bestpractical.com/download-page RT download page], extract it using &amp;lt;code&amp;gt;tar -xf&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt; into the source code directory to run the rest of the commands in this section. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;curl -O https://download.bestpractical.com/pub/rt/release/rt-5.0.2.tar.gz&lt;br /&gt;
tar -xf rt-5.0.2.tar.gz&lt;br /&gt;
cd rt-5.0.2&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Pre-configure RT ===&lt;br /&gt;
&lt;br /&gt;
This command will detect some information about your system in order to install RT properly, and decide which set of dependencies to install. Here’s what the different parts of our command are doing:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;PERL=…&amp;lt;/code&amp;gt; configures RT to run under Perl with some options that load its dependencies from a dedicated directory. The &amp;lt;code&amp;gt;/opt/rt5&amp;lt;/code&amp;gt; part of this string should match your &amp;lt;code&amp;gt;prefix&amp;lt;/code&amp;gt; setting (see next item). If you know you want to use a specific Perl installed on your system, you can specify its full path instead of the plain &amp;lt;code&amp;gt;perl&amp;lt;/code&amp;gt; here.&lt;br /&gt;
* &amp;lt;code&amp;gt;--prefix=/opt/rt5&amp;lt;/code&amp;gt; sets the directory where RT will install all of its libraries, tools, and supporting files. You can choose another path if you like.&lt;br /&gt;
* &amp;lt;code&amp;gt;--with-db-type=TYPE&amp;lt;/code&amp;gt; - Replace &amp;lt;code&amp;gt;TYPE&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;Pg&amp;lt;/code&amp;gt; for PostgreSQL, or &amp;lt;code&amp;gt;mysql&amp;lt;/code&amp;gt; for MariaDB.&lt;br /&gt;
* &amp;lt;code&amp;gt;--with-web-group=rt&amp;lt;/code&amp;gt; installs RT using the dedicated group we created earlier.&lt;br /&gt;
* The rest of the options tell RT to install additional dependencies for optional features.&lt;br /&gt;
&lt;br /&gt;
Make sure you have &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt;ed into the RT source directory, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;PERL=&amp;quot;/usr/bin/env -S perl -I/opt/rt5/local/lib/perl5&amp;quot; ./configure --prefix=/opt/rt5 --with-db-type=TYPE --with-web-group=rt --with-attachment-store=disk --enable-externalauth --enable-gd --enable-graphviz --enable-gpg --enable-smime&amp;lt;/pre&amp;gt;&lt;br /&gt;
For more background, [https://docs.bestpractical.com/rt/latest/configure.html refer to the RT configure options documentation].&lt;br /&gt;
&lt;br /&gt;
=== Install RT and its Perl dependencies ===&lt;br /&gt;
&lt;br /&gt;
This command will download, build, and install all of the Perl modules necessary to run RT with the configuration you set above. Here’s what the different parts of the command are doing:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;make dirs&amp;lt;/code&amp;gt; creates RT&#039;s directory structure, so we can install dependencies inside it.&lt;br /&gt;
* &amp;lt;code&amp;gt;make fixdeps&amp;lt;/code&amp;gt; actually installs those dependencies.&lt;br /&gt;
* &amp;lt;code&amp;gt;RT_FIX_DEPS_CMD=…&amp;lt;/code&amp;gt; tells RT to use cpanminus to install dependencies (instead of the older, default &amp;lt;code&amp;gt;cpan&amp;lt;/code&amp;gt; command) inside RT&#039;s directory structure.&lt;br /&gt;
* &amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt; installs all of RT’s files under &amp;lt;code&amp;gt;/opt/rt5&amp;lt;/code&amp;gt; (or the prefix directory you set earlier). It will only run if &amp;lt;code&amp;gt;fixdeps&amp;lt;/code&amp;gt; succeeded.&lt;br /&gt;
&lt;br /&gt;
Make sure you have &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt;ed into the RT source directory, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo make dirs&lt;br /&gt;
make fixdeps RT_FIX_DEPS_CMD=&amp;quot;cpanm --sudo --local-lib-contained=/opt/rt5/local&amp;quot;&lt;br /&gt;
sudo make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
If it works, the command will eventually output a message that says “Congratulations. RT is now installed.” followed by instructions about configuring and setting up the database. We’ll do that next.&lt;br /&gt;
&lt;br /&gt;
=== Configure RT ===&lt;br /&gt;
&lt;br /&gt;
[https://docs.bestpractical.com/rt/latest/RT_Config.html RT has many configuration options.] You can put configuration options in the file &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/code&amp;gt;, or in individual files under &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.d/&amp;lt;/code&amp;gt;. Use an editor to save all the text below to &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/code&amp;gt; (you can just overwrite the existing file, or add this to the bottom of what’s there) and then fill in settings for your site everywhere the text &amp;lt;code&amp;gt;EDIT WITH&amp;lt;/code&amp;gt; appears.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Single-quote all values EXCEPT the special value `undef`&lt;br /&gt;
# that turns off a setting.&lt;br /&gt;
&lt;br /&gt;
# rtname appears in ticket email subjects. It needs to be globally unique,&lt;br /&gt;
# so use your organization&#039;s domain name.&lt;br /&gt;
Set($rtname, &#039;EDIT WITH yourdomain.example.com&#039;);&lt;br /&gt;
# Organization is used in the database for ticket links, etc. It also needs to&lt;br /&gt;
# be globally unique, so use your organization&#039;s domain name.&lt;br /&gt;
Set($Organization, &#039;EDIT WITH yourdomain.example.com&#039;);&lt;br /&gt;
# WebDomain is domain name of the RT web server. RT uses it to construct links&lt;br /&gt;
# and defend against CSRFs.&lt;br /&gt;
Set($WebDomain, &#039;EDIT WITH rt.yourdomain.example.com&#039;);&lt;br /&gt;
# WebPort is the port where the RT web server runs. Edit the number below if&lt;br /&gt;
# you&#039;re not using the standard HTTPS port.&lt;br /&gt;
Set($WebPort, &#039;443&#039;);&lt;br /&gt;
# WebPath is the path where the RT web server runs on your WebDomain.&lt;br /&gt;
# Edit the path below if you&#039;re using a specific path.&lt;br /&gt;
Set($WebPath, &#039;/&#039;);&lt;br /&gt;
&lt;br /&gt;
# DatabaseUser is the name of the database account RT uses to read and store&lt;br /&gt;
# data. &#039;rt_user&#039; is the default but you can change it if you like.&lt;br /&gt;
# DO NOT use the &#039;rt_admin&#039; superuser created in the instructions above.&lt;br /&gt;
Set($DatabaseUser, &#039;rt_user&#039;);&lt;br /&gt;
# DatabasePassword is the password for DatabaseUser.&lt;br /&gt;
Set($DatabasePassword, &#039;EDIT WITH SomePassphraseHere&#039;);&lt;br /&gt;
# DatabaseHost is the hostname of the database server RT should use.&lt;br /&gt;
# Change &#039;localhost&#039; if it lives on a different server.&lt;br /&gt;
Set($DatabaseHost, &#039;localhost&#039;);&lt;br /&gt;
# DatabasePort is the port number of the database server RT should use.&lt;br /&gt;
# `undef` means the default for that database. Change it if you&#039;re not&lt;br /&gt;
# using the standard port.&lt;br /&gt;
Set($DatabasePort, undef);&lt;br /&gt;
# DatabaseName is the name of RT&#039;s database hosted on DatabaseHost.&lt;br /&gt;
# &#039;rt5&#039; is the default but you can change it if you like.&lt;br /&gt;
Set($DatabaseName, &#039;rt5&#039;);&lt;br /&gt;
# DatabaseAdmin is the name of the user in the database used to perform&lt;br /&gt;
# major administrative tasks. Change &#039;rt_admin&#039; if you&#039;re using a user&lt;br /&gt;
# besides the one created in this guide.&lt;br /&gt;
Set($DatabaseAdmin, &#039;rt_admin&#039;);&lt;br /&gt;
&lt;br /&gt;
# RT can log to syslog, stderr, and/or a dedicated file.&lt;br /&gt;
# Log settings are used both by the primary server and by command line&lt;br /&gt;
# tools like rt-crontool, rt-ldapimport, etc.&lt;br /&gt;
# You set all of RT&#039;s $LogTo* paramaters to a standard log level: &#039;debug&#039;,&lt;br /&gt;
# &#039;info&#039;, &#039;notice&#039;, &#039;warning&#039;, &#039;error&#039;, &#039;critical&#039;, &#039;alert&#039;, or &#039;emergency&#039;.&lt;br /&gt;
# For a modern install, I recommend logging primarily to syslog, so it goes&lt;br /&gt;
# to journald where it&#039;s easy to query and automatically gets rotated.&lt;br /&gt;
Set($LogToSyslog, &#039;info&#039;);&lt;br /&gt;
&lt;br /&gt;
# When the RT server logs to stderr, that usually goes to your web server&#039;s&lt;br /&gt;
# error log. Command line tools log to their own stderr. Setting this to&lt;br /&gt;
# &#039;warning&#039; or &#039;error&#039; helps ensure you get notified if RT&#039;s cron jobs&lt;br /&gt;
# encounter problems.&lt;br /&gt;
Set($LogToSTDERR, &#039;warning&#039;);&lt;br /&gt;
&lt;br /&gt;
# Turn off optional features that require additional configuration.&lt;br /&gt;
# If you want to use these, refer to the RT_Config documentation for&lt;br /&gt;
# instructions on how to set them up.&lt;br /&gt;
Set(%GnuPG, &#039;Enable&#039; =&amp;gt; &#039;0&#039;);&lt;br /&gt;
Set(%SMIME, &#039;Enable&#039; =&amp;gt; &#039;0&#039;);&lt;br /&gt;
&lt;br /&gt;
# Perl expects to find this 1 at the end of the file.&lt;br /&gt;
1;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;RT_SiteConfig.pm&amp;lt;/code&amp;gt; is actually Perl code. RT runs the code directly to load the configuration. Any time you finish editing it, you can check that you didn’t make any syntax errors by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;perl -c /opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Set up RT’s database ===&lt;br /&gt;
&lt;br /&gt;
RT includes a tool to help you set up its database. By default, it connects to the database as an administrator to create the database and user that you configured in the previous step.&lt;br /&gt;
&lt;br /&gt;
(The instructions from &amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt; and RT’s README file tell you to run &amp;lt;code&amp;gt;make initialize-database&amp;lt;/code&amp;gt;. That just runs &amp;lt;code&amp;gt;rt-setup-database&amp;lt;/code&amp;gt; for you. Running the tool directly makes it easier to pass the options you need.)&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;--action=init&amp;lt;/code&amp;gt; tells the tool to create the user, the database, the tables inside it, and insert core data RT needs to function.&lt;br /&gt;
* &#039;&#039;&#039;If&#039;&#039;&#039; you are using an existing database server and the database adminstrator has already created the user account and database for RT, then you can add the &amp;lt;code&amp;gt;--skip-create&amp;lt;/code&amp;gt; option.&lt;br /&gt;
* &#039;&#039;&#039;If&#039;&#039;&#039; you have a less common database setup, this tool has additional options to give you finer-grained control over what steps are run and how. Refer to [https://docs.bestpractical.com/rt/latest/rt-setup-database.html the full rt-setup-database documentation] to learn more about those.&lt;br /&gt;
* The command reads files from RT’s &amp;lt;code&amp;gt;etc/&amp;lt;/code&amp;gt; directory by default, so the easiest way to run it is to &amp;lt;code&amp;gt;cd /opt/rt5&amp;lt;/code&amp;gt; first, and then it will find the necessary files automatically.&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /opt/rt5&lt;br /&gt;
sudo sbin/rt-setup-database --action=init&amp;lt;/pre&amp;gt;&lt;br /&gt;
Enter the password for your database administrator account when prompted.&lt;br /&gt;
&lt;br /&gt;
=== Set up fulltext indexing ===&lt;br /&gt;
&lt;br /&gt;
Fulltext indexing speeds up searches for ticket content, which makes RT a lot nicer to use.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;--noask&amp;lt;/code&amp;gt; uses the default names for the index, which will be fine for a new install and simplifies the setup.&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo /opt/rt5/sbin/rt-setup-fulltext-index --noask&amp;lt;/pre&amp;gt;&lt;br /&gt;
Enter the password for your database administrator account when prompted. The end of the process will output some RT configuration that looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;### EXAMPLE OUTPUT ONLY - Don&#039;t use this directly!&lt;br /&gt;
Set( %FullTextSearch,&lt;br /&gt;
    Enable     =&amp;gt; 1,&lt;br /&gt;
    Indexed    =&amp;gt; 1,&lt;br /&gt;
    # Additional output from rt-setup-fulltext-index should be here.&lt;br /&gt;
    # The configuration varies by database type.&lt;br /&gt;
);&amp;lt;/pre&amp;gt;&lt;br /&gt;
Copy the output generated when you run &amp;lt;code&amp;gt;rt-setup-fulltext-index&amp;lt;/code&amp;gt; and save it to the file &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.d/FulltextIndex.pm&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Set permissions ===&lt;br /&gt;
&lt;br /&gt;
All of RT’s configuration files should be readable by the user that runs the web server, and no other users, in order to protect sensitive information like the database password. RT provides a command to set permissions appropriately according to your distribution and configuration. &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt; to the directory where you extracted the RT source code, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd rt-5.0.2&lt;br /&gt;
sudo make fixperms&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Verify the installation ===&lt;br /&gt;
&lt;br /&gt;
If everything has gone well, then you should be able to set a password for RT’s &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; user. You’ll use this later to log in to the web interface and continue setting up your system. Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo /opt/rt5/sbin/rt-passwd root&amp;lt;/pre&amp;gt;&lt;br /&gt;
Set the password when prompted. Record this; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
== Set up RT FastCGI service ==&lt;br /&gt;
&lt;br /&gt;
=== Create the RT service ===&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo systemctl edit --force --full rt-server.service&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This opens an editor to define the RT service to systemd. Use the editor to add this text to the file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[Unit]&lt;br /&gt;
Description=RT FCGI server&lt;br /&gt;
&lt;br /&gt;
[Service]&lt;br /&gt;
# The --forks option is the number of RT servers to run in parallel.&lt;br /&gt;
# 3 should be good for most initial installs. You can increase this&lt;br /&gt;
# number later if needed for performance.&lt;br /&gt;
ExecStart=/usr/bin/multiwatch --forks=3 --signal=TERM -- /opt/rt5/sbin/rt-server.fcgi&lt;br /&gt;
StandardInput=socket&lt;br /&gt;
DynamicUser=true&lt;br /&gt;
SupplementaryGroups=rt&lt;br /&gt;
UMask=027&lt;br /&gt;
# If you have RT plugins or customizations that write to other locations on&lt;br /&gt;
# the filesystem, add more ReadWritePaths lines as needed.&lt;br /&gt;
ReadWritePaths=/opt/rt5/var&lt;br /&gt;
&lt;br /&gt;
CapabilityBoundingSet=&lt;br /&gt;
DevicePolicy=closed&lt;br /&gt;
PrivateMounts=true&lt;br /&gt;
PrivateNetwork=false&lt;br /&gt;
PrivateTmp=true&lt;br /&gt;
PrivateUsers=true&lt;br /&gt;
ProtectControlGroups=true&lt;br /&gt;
ProtectHome=true&lt;br /&gt;
ProtectSystem=strict&lt;br /&gt;
NoNewPrivileges=true&lt;br /&gt;
LockPersonality=true&lt;br /&gt;
MemoryDenyWriteExecute=true&lt;br /&gt;
PrivateDevices=true&lt;br /&gt;
ProtectKernelModules=true&lt;br /&gt;
ProtectKernelTunables=true&lt;br /&gt;
RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6 AF_NETLINK&lt;br /&gt;
RestrictNamespaces=true&lt;br /&gt;
RestrictRealtime=true&lt;br /&gt;
SystemCallErrorNumber=EPERM&lt;br /&gt;
SystemCallFilter=@system-service&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save the file and close your editor.&lt;br /&gt;
&lt;br /&gt;
=== Create the RT socket ===&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo systemctl edit --force --full rt-server.socket&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This opens an editor to define the RT socket to systemd. Use the editor to add this text to the file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[Unit]&lt;br /&gt;
Description=RT FCGI server socket&lt;br /&gt;
Wants=network.target&lt;br /&gt;
After=network.target&lt;br /&gt;
Before=apache2.service httpd.service nginx.service&lt;br /&gt;
&lt;br /&gt;
[Install]&lt;br /&gt;
WantedBy=sockets.target&lt;br /&gt;
&lt;br /&gt;
[Socket]&lt;br /&gt;
# ListenStream defines the address and port where the RT FastCGI server listens.&lt;br /&gt;
# This is NOT the web server itself, so don&#039;t make this port 80, 443, etc.&lt;br /&gt;
# You may edit this if you like, but note:&lt;br /&gt;
# Connections are unencrypted. You should only listen on a secure network&lt;br /&gt;
# interface.&lt;br /&gt;
# The server can only accept a single socket. You cannot specify more than&lt;br /&gt;
# one ListenStream address.&lt;br /&gt;
ListenStream=[::1]:5000&lt;br /&gt;
Accept=no&lt;br /&gt;
FreeBind=yes&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save the file and close your editor.&lt;br /&gt;
&lt;br /&gt;
=== Enable the RT socket ===&lt;br /&gt;
&lt;br /&gt;
Load the new services into RT, start the server socket, and enable it on future boots:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo systemctl daemon-reload&lt;br /&gt;
sudo systemctl enable --now rt-server.socket&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s web server ==&lt;br /&gt;
&lt;br /&gt;
Fully documenting how to set up a web server configured for your network with encryption is outside the scope of this guide. This page only highlights the configuration you need to pass web requests onto the RT FastCGI service.&lt;br /&gt;
&lt;br /&gt;
=== nginx ===&lt;br /&gt;
&lt;br /&gt;
Make sure you have the necessary packages installed:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install nginx&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install nginx&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In the &amp;lt;code&amp;gt;http server&amp;lt;/code&amp;gt; configuration blocks where you want to serve RT, add a configuration block like this, &#039;&#039;&#039;above&#039;&#039;&#039; any other &amp;lt;code&amp;gt;location&amp;lt;/code&amp;gt; blocks:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# The location path should match the WebPath in your RT site configuration.&lt;br /&gt;
location / {&lt;br /&gt;
  include /etc/nginx/fastcgi.conf;&lt;br /&gt;
  # RT requires an empty SCRIPT_NAME to serve static files.&lt;br /&gt;
  fastcgi_param SCRIPT_NAME &amp;quot;&amp;quot;;&lt;br /&gt;
  # This network location should match the ListenStream in rt-server.socket.&lt;br /&gt;
  fastcgi_pass localhost:5000;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you&#039;re doing a fresh install, the default &amp;lt;code&amp;gt;http server&amp;lt;/code&amp;gt; configuration location varies by distribution:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|Edit &amp;lt;code&amp;gt;/etc/nginx/sites-available/default&amp;lt;/code&amp;gt;&lt;br /&gt;
|Add a new file &amp;lt;code&amp;gt;/etc/nginx/default.d/rt-server.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
After you’ve edited your configuration, load it by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo systemctl reload nginx&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once this is done you can skip ahead to Verify the web interface.&lt;br /&gt;
&lt;br /&gt;
=== Apache httpd ===&lt;br /&gt;
&lt;br /&gt;
Make sure you have the necessary packages installed, and the proxy_fcgi module enabled:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install apache2&lt;br /&gt;
sudo a2enmod proxy&lt;br /&gt;
sudo a2enmod proxy_fcgi&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install httpd&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In the &amp;lt;code&amp;gt;&amp;amp;lt;VirtualHost&amp;amp;gt;&amp;lt;/code&amp;gt; configuration blocks where you want to serve RT, add a configuration block like this, &#039;&#039;&#039;above&#039;&#039;&#039; any other &amp;lt;code&amp;gt;Alias&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;ProxyPass&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;ScriptAlias&amp;lt;/code&amp;gt; lines:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# RT requires an empty SCRIPT_NAME to serve static files.&lt;br /&gt;
ProxyFCGISetEnvIf true SCRIPT_NAME&lt;br /&gt;
# The location path in the first argument should match the WebPath in your&lt;br /&gt;
# RT site configuration.  The network location after fcgi:// should match&lt;br /&gt;
# the ListenStream in rt-server.socket.&lt;br /&gt;
ProxyPass / fcgi://localhost:5000/&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you&#039;re doing a fresh install, the default &amp;lt;code&amp;gt;&amp;amp;lt;VirtualHost&amp;amp;gt;&amp;lt;/code&amp;gt; configuration location varies by distribution and whether or not you&#039;re using HTTPS:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|With HTTPS: &amp;lt;code&amp;gt;/etc/apache2/sites-available/default-ssl.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
With plain HTTP: &amp;lt;code&amp;gt;/etc/apache2/sites-available/000-default.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
|With HTTPS: &amp;lt;code&amp;gt;/etc/httpd/conf.d/ssl.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
With plain HTTP: Write a new file &amp;lt;code&amp;gt;/etc/httpd/conf.d/vhost_RT.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
After you’ve edited your configuration, load it by running:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo systemctl reload apache2&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo systemctl reload httpd&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Verify the web interface ===&lt;br /&gt;
&lt;br /&gt;
You should be able to visit your web server in your browser, and be presented with RT’s login screen. You should be able to log in with username &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; and the password you set previously.&lt;br /&gt;
&lt;br /&gt;
If the web server returns a 502 Bad Gateway response, it&#039;s having trouble connecting to the RT FCGI server. Check the error logs for your web server:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 33%;&amp;quot;|nginx&lt;br /&gt;
! style=&amp;quot;width: 33%;&amp;quot;|Apache on Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 33%;&amp;quot;|httpd on Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;/var/log/nginx/error.log&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;/var/log/apache2/error.log&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;/var/log/httpd/error_log&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For all kinds of errors, you can check the logs for the RT FCGI server and its socket:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo journalctl --unit rt-server.\*&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s mail server ==&lt;br /&gt;
&lt;br /&gt;
RT both can both send and receive ticket updates via email. Unfortunately, there are too many variables to document a useful setup process here: getting this working usually requires creating DNS records, and coordinating with existing mail servers, which will be the main constraint on your setup. Instead this guide provides a brief overview of how the integration works, and where the connection points are that you likely need to work on.&lt;br /&gt;
&lt;br /&gt;
=== Sending Mail ===&lt;br /&gt;
&lt;br /&gt;
RT only knows how to send mail by passing it off to another program on the system. It cannot connect or authenticate directly to external mail servers. In the default configuration, RT runs the standard &amp;lt;code&amp;gt;sendmail&amp;lt;/code&amp;gt; command. There are [https://docs.bestpractical.com/rt/latest/RT_Config.html#Outgoing-mail configuration options to send mail through different commands] if you need.&lt;br /&gt;
&lt;br /&gt;
The most common setup is to install and configure a proper Mail Transfer Agent (MTA) like Postfix or Exim, and then configure it to send mail to the wider Internet as you need. This works well because the MTAs are robust and well-tested; they have flexible configuration to let you send mail out by relaying to other mail servers you specify with optional authentication; and most distributions install one by default anyway. The only hard part is configuring the MTA to send mail following your site’s policies.&lt;br /&gt;
&lt;br /&gt;
Other software is available that provides a slimmer version of the &amp;lt;code&amp;gt;sendmail&amp;lt;/code&amp;gt; command that connects to an external mail server for you, like ssmtp. These programs are usually easier to configure than an MTA, but they often lose email permanently if they can’t connect to the external server at the time it’s sent. (MTAs keep email queued locally until they successfully deliver it to another server.)&lt;br /&gt;
&lt;br /&gt;
=== Receiving email ===&lt;br /&gt;
&lt;br /&gt;
RT installs a command called &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; that receives an email on standard input and posts it to RT’s REST web interface, where it gets saved in the database and added to a ticket. You need to arrange for a way to send incoming email to this command.&lt;br /&gt;
&lt;br /&gt;
The most common setup is to have an MTA on the same box as RT receive email directly, and then set up mail aliases that call this command when mail comes in. Example &amp;lt;code&amp;gt;/etc/aliases&amp;lt;/code&amp;gt; entries look like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rt: &amp;quot;|/opt/rt5/bin/rt-mailgate --queue general --action correspond --url https://rt.yourdomain.example.com/&amp;quot;&lt;br /&gt;
rt-comment: &amp;quot;|/opt/rt5/bin/rt-mailgate --queue general --action comment --url https://rt.yourdomain.example.com/&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
This works well because, again, you’re probably running an MTA anyway; and the MTA can hold and queue mail if it comes in while RT is down for any reason, giving you a buffer against downtime.&lt;br /&gt;
&lt;br /&gt;
Another common option is to periodically run a tool that fetches mail using a protocol like IMAP, like fetchmail or getmail, and passes it on to &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt;. This is less common because it requires setting up another tool to run, and securely storing another set of mail server credentials. But it is useful when local policy prevents the RT server from receiving email directly.&lt;br /&gt;
&lt;br /&gt;
This is much less common, but it might help to know that &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; doesn’t have to run on the same system as RT itself. It just needs to be able to connect to RT’s web interface. If you don’t have any other options, you can install the RT software on a different system that receives email, and configure &#039;&#039;that&#039;&#039; system to run &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; and pass it on to the RT server. To do that, just repeat the installation instructions above, skipping the steps about installing the database and web server.&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s background jobs ==&lt;br /&gt;
&lt;br /&gt;
Create a file &amp;lt;code&amp;gt;/etc/cron.d/rt&amp;lt;/code&amp;gt; with the following content. You may edit all of the time fields as you see fit. Refer to the crontab(5) man page for details about their definitions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Update the fulltext index with new ticket data&lt;br /&gt;
*/3 *   *   *   *   root    /opt/rt5/sbin/rt-fulltext-indexer&lt;br /&gt;
# Email out dashboards that users have subscribed to&lt;br /&gt;
0   *   *   *   *   root    /opt/rt5/sbin/rt-email-dashboards&lt;br /&gt;
# Clean old sessions from the database&lt;br /&gt;
10  3   *   *   *   root    /opt/rt5/sbin/rt-clean-sessions --older 8d&lt;br /&gt;
# Email out weekly digests for users who have requested it&lt;br /&gt;
50  4   *   *   Mon root    /opt/rt5/sbin/rt-email-digest -m weekly&lt;br /&gt;
# Email out daily digests for users who have requested it&lt;br /&gt;
50  5   *   *   *   root    /opt/rt5/sbin/rt-email-digest -m daily&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Set up RT ==&lt;br /&gt;
&lt;br /&gt;
If you’ve gotten this far, congratulations, your RT install is really done now. You can start setting up RT with users, groups, queues, and business logic. [[Main Page|Head back to the main page]] to start exploring those topics.&lt;/div&gt;</summary>
		<author><name>Brett</name></author>
	</entry>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=ManualInstallation&amp;diff=27076</id>
		<title>ManualInstallation</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=ManualInstallation&amp;diff=27076"/>
		<updated>2022-03-25T14:27:01Z</updated>

		<summary type="html">&lt;p&gt;Brett: clean up httpd config a little&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Prev: [[ManualRequirements]] — Up: [[UserManual]] — Next: [[ManualApacheConfig]]&lt;br /&gt;
&lt;br /&gt;
This guide walks you through installing RT from source on a modern, popular Linux distro. Specifically, that means a distribution based on Debian or Red Hat that’s been released since around 2020.&lt;br /&gt;
&lt;br /&gt;
This guide assumes:&lt;br /&gt;
&lt;br /&gt;
* You can install packages generally available in Debian/Ubuntu or Red Hat/Fedora/CentOS.&lt;br /&gt;
* You want to install RT, and all of its Perl dependencies, from source to get the latest versions. (This is a trade-off. It means the boundaries of your install will be very clear, but you won’t get security updates for RT or Perl modules from your distribution.)&lt;br /&gt;
* You are willing to install a couple of extra tools to manage the RT installation similarly to how you would in other packaging systems (like PyPI, npm, etc.).&lt;br /&gt;
* You are willing to do a relatively maximal install of RT, enabling all the options during installation and then setting what you need in the configuration. (You could save a little space and time by being pickier about your options, but then that complicates the guide and makes it harder to turn those options on later if you want.)&lt;br /&gt;
* You are using a regular user account on the Linux system that can get superuser privileges with sudo.&lt;br /&gt;
&lt;br /&gt;
== Install the base dependencies ==&lt;br /&gt;
&lt;br /&gt;
These are required by RT, either to run or to install the dependencies.&lt;br /&gt;
&lt;br /&gt;
=== Debian/Ubuntu ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo apt install autoconf build-essential cpanminus curl libexpat-dev libgd-dev libssl-dev libz-dev gnupg graphviz openssl perl w3m&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Red Hat Enterprise Linux ===&lt;br /&gt;
&lt;br /&gt;
These instructions are for RHEL specifically. For RHEL-derived distributions like CentOS and Rocky, go to the next section.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;MAJDISTVER=&amp;quot;$(. /etc/os-release &amp;amp;&amp;amp; echo &amp;quot;${VERSION_ID%%.*}&amp;quot;)&amp;quot;&lt;br /&gt;
sudo subscription-manager repos --enable &amp;quot;codeready-builder-for-rhel-$MAJDISTVER-$(arch)-rpms&amp;quot;&lt;br /&gt;
sudo dnf install &amp;quot;https://dl.fedoraproject.org/pub/epel/epel-release-latest-$MAJDISTVER.noarch.rpm&amp;quot;&lt;br /&gt;
sudo dnf install patch tar which gcc gcc-c++ perl-core perl-App-cpanminus graphviz expat-devel gd-devel openssl openssl-devel w3m&lt;br /&gt;
sudo sed -i~ &#039;/^SELINUX=/ c SELINUX=disabled&#039; /etc/selinux/config&lt;br /&gt;
sudo setenforce 0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Turning off SELinux enforcement is required on Red Hat-based distributions because, as of March 2022, nobody has written a policy for RT.)&lt;br /&gt;
&lt;br /&gt;
=== RHEL Community Distributions: Fedora/CentOS/Rocky ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo dnf install epel-release&lt;br /&gt;
sudo dnf install patch tar which gcc gcc-c++ perl-core perl-App-cpanminus graphviz expat-devel gd-devel openssl openssl-devel w3m&lt;br /&gt;
sudo sed -i~ &#039;/^SELINUX=/ c SELINUX=disabled&#039; /etc/selinux/config&lt;br /&gt;
sudo setenforce 0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Turning off SELinux enforcement is required on Red Hat-based distributions because, as of March 2022, nobody has written a policy for RT.)&lt;br /&gt;
&lt;br /&gt;
== Install a database ==&lt;br /&gt;
&lt;br /&gt;
You need access to a database server. It can be remote, or you can install a database server alongside RT. RT supports a few different databases, but the best supported options are PostgreSQL and MariaDB.&lt;br /&gt;
&lt;br /&gt;
=== Installing and configuring the PostgreSQL server ===&lt;br /&gt;
&lt;br /&gt;
If you want to install a fresh PostgreSQL database server alongside RT:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install postgresql&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install postgresql-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In order to set up RT’s database, you will need a PostgreSQL account that can create databases and roles and be authenticated with a password. If you don’t have that, you can create it by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo createuser --createdb --createrole --login --pwprompt rt_admin&amp;lt;/pre&amp;gt;&lt;br /&gt;
Set the password when prompted. Record this; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
=== Enable password authentication in PostgreSQL ===&lt;br /&gt;
&lt;br /&gt;
You need to consider this step whether you install the database locally, or use an existing one already running. RT supports connecting to PostgreSQL a few different ways, but authenticating with a username and password is simplest, and this guide is written based on that. Not all PostgreSQL installations allow this authentication method by default. You need to review your &amp;lt;code&amp;gt;pg_hba.conf&amp;lt;/code&amp;gt; file located at:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;/etc/postgresql/VERSION/main/pg_hba.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;/var/lib/pgsql/VERSION/data/pg_hba.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Replace &amp;lt;code&amp;gt;VERSION&amp;lt;/code&amp;gt; with the version of your PostgreSQL database. Add these two lines &#039;&#039;&#039;above&#039;&#039;&#039; any other lines that start with &amp;lt;code&amp;gt;host&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;host  rt5  rt_user   all  md5&lt;br /&gt;
host  rt5  rt_admin  all  md5&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This configuration will let &amp;lt;code&amp;gt;rt_user&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;rt_admin&amp;lt;/code&amp;gt; authorize themselves for the &amp;lt;code&amp;gt;rt5&amp;lt;/code&amp;gt; database using an &amp;lt;code&amp;gt;md5&amp;lt;/code&amp;gt; crypted password over a network connection (possibly using the localhost loopback network). You might be able to further restrict some of these fields for improved security, but doing so is outside the scope of this install guide. Refer to [https://www.postgresql.org/docs/current/auth-pg-hba-conf.html the pg_hba.conf documentation] for more details.&lt;br /&gt;
&lt;br /&gt;
Save your changes and reload the database:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo systemctl reload postgresql&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Installing the PostgreSQL client libraries ===&lt;br /&gt;
&lt;br /&gt;
These are required for RT to be able to talk to any PostgreSQL server.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install libpq-dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install postgresql-devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Once this is done you can skip ahead to installing a web server.&lt;br /&gt;
&lt;br /&gt;
=== Installing and configuring the MariaDB server ===&lt;br /&gt;
&lt;br /&gt;
If you want to install a fresh MariaDB database server alongside RT:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install mariadb-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install mariadb-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In order to set up RT’s database, you will need a MySQL superuser account. To stay consistent with PostgreSQL, I suggest setting a password for it. You can do that by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo mysql mysql&lt;br /&gt;
MariaDB [mysql]&amp;amp;gt; GRANT ALL PRIVILEGES ON rt5.* TO rt_admin@localhost IDENTIFIED BY &#039;YourPassphraseHere&#039; WITH GRANT OPTION;&amp;lt;/pre&amp;gt;&lt;br /&gt;
Record your passphrase; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
=== Adjust MariaDB’s max_allowed_packet setting ===&lt;br /&gt;
&lt;br /&gt;
You need to consider this step whether you install the database locally, or use an existing one already running. [https://mariadb.com/kb/en/server-system-variables/#max_allowed_packet MariaDB’s &amp;lt;code&amp;gt;max_allowed_packet&amp;lt;/code&amp;gt; setting] functionally limits the size of attachments in RT. The default is 16MiB, which is too small for most installations. You can ultimately choose any setting you’re comfortable with; 64MiB here should allow most requests without being too open.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;echo -e &#039;[server]\nmax_allowed_packet=64M&#039; | sudo tee /etc/mysql/conf.d/max_allowed_packet.cnf&lt;br /&gt;
sudo systemctl reload mariadb&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;echo -e &#039;[server]\nmax_allowed_packet=64M&#039; | sudo tee /etc/my.cnf.d/max_allowed_packet.cnf&lt;br /&gt;
sudo systemctl reload mariadb&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Installing the MariaDB client libraries ===&lt;br /&gt;
&lt;br /&gt;
These are required for RT to be able to talk to any MariaDB server.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install libmariadb-dev libmariadb-dev-compat&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install mariadb-devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Install a web server with FastCGI ==&lt;br /&gt;
&lt;br /&gt;
FastCGI is the best way to host RT’s web interface today. Installing the web server before RT makes the installation process simpler, because RT will be able to automatically some details about your web server like what user it runs as.&lt;br /&gt;
&lt;br /&gt;
=== Installing Apache ===&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install apache2 libapache2-mod-fcgid&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install httpd mod_fcgid mod_ssl&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ### Installing nginx --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Install RT ==&lt;br /&gt;
&lt;br /&gt;
=== Get and unpack the RT source code ===&lt;br /&gt;
&lt;br /&gt;
Download the latest source code using the link on the [https://bestpractical.com/download-page RT download page], extract it using &amp;lt;code&amp;gt;tar -xf&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt; into the source code directory to run the rest of the commands in this section. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;curl -O https://download.bestpractical.com/pub/rt/release/rt-5.0.2.tar.gz&lt;br /&gt;
tar -xf rt-5.0.2.tar.gz&lt;br /&gt;
cd rt-5.0.2&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Pre-configure RT ===&lt;br /&gt;
&lt;br /&gt;
This command will detect some information about your system in order to install RT properly, and decide which set of dependencies to install. Here’s what the different parts of our command are doing:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;PERL=…&amp;lt;/code&amp;gt; configures RT to run under Perl with some options that load its dependencies from a dedicated directory. The &amp;lt;code&amp;gt;/opt/rt5&amp;lt;/code&amp;gt; part of this string should match your &amp;lt;code&amp;gt;prefix&amp;lt;/code&amp;gt; setting (see next item). If you know you want to use a specific Perl installed on your system, you can specify its full path instead of the plain &amp;lt;code&amp;gt;perl&amp;lt;/code&amp;gt; here.&lt;br /&gt;
* &amp;lt;code&amp;gt;--prefix=/opt/rt5&amp;lt;/code&amp;gt; sets the directory where RT will install all of its libraries, tools, and supporting files. You can choose another path if you like.&lt;br /&gt;
* &amp;lt;code&amp;gt;--with-db-type=TYPE&amp;lt;/code&amp;gt; - Replace &amp;lt;code&amp;gt;TYPE&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;Pg&amp;lt;/code&amp;gt; for PostgreSQL, or &amp;lt;code&amp;gt;mysql&amp;lt;/code&amp;gt; for MariaDB.&lt;br /&gt;
* The rest of the options tell RT to install additional dependencies for optional features.&lt;br /&gt;
&lt;br /&gt;
Make sure you have &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt;ed into the RT source directory, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;PERL=&amp;quot;/usr/bin/env -S perl -I/opt/rt5/local/lib/perl5&amp;quot; ./configure --prefix=/opt/rt5 --with-db-type=TYPE --with-attachment-store=disk --enable-externalauth --enable-gd --enable-graphviz --enable-gpg --enable-smime&amp;lt;/pre&amp;gt;&lt;br /&gt;
For more background, [https://docs.bestpractical.com/rt/latest/configure.html refer to the RT configure options documentation].&lt;br /&gt;
&lt;br /&gt;
=== Install RT and its Perl dependencies ===&lt;br /&gt;
&lt;br /&gt;
This command will download, build, and install all of the Perl modules necessary to run RT with the configuration you set above. Here’s what the different parts of the command are doing:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;make dirs&amp;lt;/code&amp;gt; creates RT&#039;s directory structure, so we can install dependencies inside it.&lt;br /&gt;
* &amp;lt;code&amp;gt;make fixdeps&amp;lt;/code&amp;gt; actually installs those dependencies.&lt;br /&gt;
* &amp;lt;code&amp;gt;RT_FIX_DEPS_CMD=…&amp;lt;/code&amp;gt; tells RT to use cpanminus to install dependencies (instead of the older, default &amp;lt;code&amp;gt;cpan&amp;lt;/code&amp;gt; command) inside RT&#039;s directory structure.&lt;br /&gt;
* &amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt; installs all of RT’s files under &amp;lt;code&amp;gt;/opt/rt5&amp;lt;/code&amp;gt; (or the prefix directory you set earlier). It will only run if &amp;lt;code&amp;gt;fixdeps&amp;lt;/code&amp;gt; succeeded.&lt;br /&gt;
&lt;br /&gt;
Make sure you have &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt;ed into the RT source directory, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo make dirs&lt;br /&gt;
make fixdeps RT_FIX_DEPS_CMD=&amp;quot;cpanm --sudo --local-lib-contained=/opt/rt5/local&amp;quot;&lt;br /&gt;
sudo make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
If it works, the command will eventually output a message that says “Congratulations. RT is now installed.” followed by instructions about configuring and setting up the database. We’ll do that next.&lt;br /&gt;
&lt;br /&gt;
=== Configure RT ===&lt;br /&gt;
&lt;br /&gt;
[https://docs.bestpractical.com/rt/latest/RT_Config.html RT has many configuration options.] You can put configuration options in the file &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/code&amp;gt;, or in individual files under &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.d/&amp;lt;/code&amp;gt;. Use an editor to save all the text below to &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/code&amp;gt; (you can just overwrite the existing file, or add this to the bottom of what’s there) and then fill in settings for your site everywhere the text &amp;lt;code&amp;gt;EDIT WITH&amp;lt;/code&amp;gt; appears.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Single-quote all values EXCEPT the special value `undef`&lt;br /&gt;
# that turns off a setting.&lt;br /&gt;
&lt;br /&gt;
# rtname appears in ticket email subjects. It needs to be globally unique,&lt;br /&gt;
# so use your organization&#039;s domain name.&lt;br /&gt;
Set($rtname, &#039;EDIT WITH yourdomain.example.com&#039;);&lt;br /&gt;
# Organization is used in the database for ticket links, etc. It also needs to&lt;br /&gt;
# be globally unique, so use your organization&#039;s domain name.&lt;br /&gt;
Set($Organization, &#039;EDIT WITH yourdomain.example.com&#039;);&lt;br /&gt;
# WebDomain is domain name of the RT web server. RT uses it to construct links&lt;br /&gt;
# and defend against CSRFs.&lt;br /&gt;
Set($WebDomain, &#039;EDIT WITH rt.yourdomain.example.com&#039;);&lt;br /&gt;
# WebPort is the port where the RT web server runs. Edit the number below if&lt;br /&gt;
# you&#039;re not using the standard HTTPS port.&lt;br /&gt;
Set($WebPort, &#039;443&#039;);&lt;br /&gt;
&lt;br /&gt;
# DatabaseUser is the name of the database account RT uses to read and store&lt;br /&gt;
# data. &#039;rt_user&#039; is the default but you can change it if you like.&lt;br /&gt;
# DO NOT use the &#039;rt_admin&#039; superuser created in the instructions above.&lt;br /&gt;
Set($DatabaseUser, &#039;rt_user&#039;);&lt;br /&gt;
# DatabasePassword is the password for DatabaseUser.&lt;br /&gt;
Set($DatabasePassword, &#039;EDIT WITH SomePassphraseHere&#039;);&lt;br /&gt;
# DatabaseHost is the hostname of the database server RT should use.&lt;br /&gt;
# Change &#039;localhost&#039; if it lives on a different server.&lt;br /&gt;
Set($DatabaseHost, &#039;localhost&#039;);&lt;br /&gt;
# DatabasePort is the port number of the database server RT should use.&lt;br /&gt;
# `undef` means the default for that database. Change it if you&#039;re not&lt;br /&gt;
# using the standard port.&lt;br /&gt;
Set($DatabasePort, undef);&lt;br /&gt;
# DatabaseName is the name of RT&#039;s database hosted on DatabaseHost.&lt;br /&gt;
# &#039;rt5&#039; is the default but you can change it if you like.&lt;br /&gt;
Set($DatabaseName, &#039;rt5&#039;);&lt;br /&gt;
# DatabaseAdmin is the name of the user in the database used to perform&lt;br /&gt;
# major administrative tasks. Change &#039;rt_admin&#039; if you&#039;re using a user&lt;br /&gt;
# besides the one created in this guide.&lt;br /&gt;
Set($DatabaseAdmin, &#039;rt_admin&#039;);&lt;br /&gt;
&lt;br /&gt;
# RT can log to syslog, stderr, and/or a dedicated file.&lt;br /&gt;
# Log settings are used both by the primary server and by command line&lt;br /&gt;
# tools like rt-crontool, rt-ldapimport, etc.&lt;br /&gt;
# You set all of RT&#039;s $LogTo* paramaters to a standard log level: &#039;debug&#039;,&lt;br /&gt;
# &#039;info&#039;, &#039;notice&#039;, &#039;warning&#039;, &#039;error&#039;, &#039;critical&#039;, &#039;alert&#039;, or &#039;emergency&#039;.&lt;br /&gt;
# For a modern install, I recommend logging primarily to syslog, so it goes&lt;br /&gt;
# to journald where it&#039;s easy to query and automatically gets rotated.&lt;br /&gt;
Set($LogToSyslog, &#039;info&#039;);&lt;br /&gt;
&lt;br /&gt;
# When the RT server logs to stderr, that usually goes to your web server&#039;s&lt;br /&gt;
# error log. Command line tools log to their own stderr. Setting this to&lt;br /&gt;
# &#039;warning&#039; or &#039;error&#039; helps ensure you get notified if RT&#039;s cron jobs&lt;br /&gt;
# encounter problems.&lt;br /&gt;
Set($LogToSTDERR, &#039;warning&#039;);&lt;br /&gt;
&lt;br /&gt;
# Turn off optional features that require additional configuration.&lt;br /&gt;
# If you want to use these, refer to the RT_Config documentation for&lt;br /&gt;
# instructions on how to set them up.&lt;br /&gt;
Set(%GnuPG, &#039;Enable&#039; =&amp;gt; &#039;0&#039;);&lt;br /&gt;
Set(%SMIME, &#039;Enable&#039; =&amp;gt; &#039;0&#039;);&lt;br /&gt;
&lt;br /&gt;
# Perl expects to find this 1 at the end of the file.&lt;br /&gt;
1;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;RT_SiteConfig.pm&amp;lt;/code&amp;gt; is actually Perl code. RT runs the code directly to load the configuration. Any time you finish editing it, you can check that you didn’t make any syntax errors by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;perl -c /opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Set up RT’s database ===&lt;br /&gt;
&lt;br /&gt;
RT includes a tool to help you set up its database. By default, it connects to the database as an administrator to create the database and user that you configured in the previous step.&lt;br /&gt;
&lt;br /&gt;
(The instructions from &amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt; and RT’s README file tell you to run &amp;lt;code&amp;gt;make initialize-database&amp;lt;/code&amp;gt;. That just runs &amp;lt;code&amp;gt;rt-setup-database&amp;lt;/code&amp;gt; for you. Running the tool directly makes it easier to pass the options you need.)&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;--action=init&amp;lt;/code&amp;gt; tells the tool to create the user, the database, the tables inside it, and insert core data RT needs to function.&lt;br /&gt;
* &#039;&#039;&#039;If&#039;&#039;&#039; you are using an existing database server and the database adminstrator has already created the user account and database for RT, then you can add the &amp;lt;code&amp;gt;--skip-create&amp;lt;/code&amp;gt; option.&lt;br /&gt;
* &#039;&#039;&#039;If&#039;&#039;&#039; you have a less common database setup, this tool has additional options to give you finer-grained control over what steps are run and how. Refer to [https://docs.bestpractical.com/rt/latest/rt-setup-database.html the full rt-setup-database documentation] to learn more about those.&lt;br /&gt;
* The command reads files from RT’s &amp;lt;code&amp;gt;etc/&amp;lt;/code&amp;gt; directory by default, so the easiest way to run it is to &amp;lt;code&amp;gt;cd /opt/rt5&amp;lt;/code&amp;gt; first, and then it will find the necessary files automatically.&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /opt/rt5&lt;br /&gt;
sudo sbin/rt-setup-database --action=init&amp;lt;/pre&amp;gt;&lt;br /&gt;
Enter the password for your database administrator account when prompted.&lt;br /&gt;
&lt;br /&gt;
=== Set up fulltext indexing ===&lt;br /&gt;
&lt;br /&gt;
Fulltext indexing speeds up searches for ticket content, which makes RT a lot nicer to use.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;--noask&amp;lt;/code&amp;gt; uses the default names for the index, which will be fine for a new install and simplifies the setup.&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo /opt/rt5/sbin/rt-setup-fulltext-index --noask&amp;lt;/pre&amp;gt;&lt;br /&gt;
Enter the password for your database administrator account when prompted. The end of the process will output some RT configuration that looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;### EXAMPLE OUTPUT ONLY - Don&#039;t use this directly!&lt;br /&gt;
Set( %FullTextSearch,&lt;br /&gt;
    Enable     =&amp;gt; 1,&lt;br /&gt;
    Indexed    =&amp;gt; 1,&lt;br /&gt;
    # Additional output from rt-setup-fulltext-index should be here.&lt;br /&gt;
    # The configuration varies by database type.&lt;br /&gt;
);&amp;lt;/pre&amp;gt;&lt;br /&gt;
Copy the output generated when you run &amp;lt;code&amp;gt;rt-setup-fulltext-index&amp;lt;/code&amp;gt; and save it to the file &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.d/FulltextIndex.pm&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Set permissions ===&lt;br /&gt;
&lt;br /&gt;
All of RT’s configuration files should be readable by the user that runs the web server, and no other users, in order to protect sensitive information like the database password. RT provides a command to set permissions appropriately according to your distribution and configuration. &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt; to the directory where you extracted the RT source code, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd rt-5.0.2&lt;br /&gt;
sudo make fixperms&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Verify the installation ===&lt;br /&gt;
&lt;br /&gt;
If everything has gone well, then you should be able to set a password for RT’s &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; user. You’ll use this later to log in to the web interface and continue setting up your system. Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo /opt/rt5/sbin/rt-passwd root&amp;lt;/pre&amp;gt;&lt;br /&gt;
Set the password when prompted. Record this; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s web server ==&lt;br /&gt;
&lt;br /&gt;
=== Configure Apache modules ===&lt;br /&gt;
&lt;br /&gt;
You will need to have the following modules enabled in Apache to run RT. You should already have these installed if you followed the instructions above.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;alias&amp;lt;/code&amp;gt; (required to map URLs to RT)&lt;br /&gt;
* &amp;lt;code&amp;gt;fcgid&amp;lt;/code&amp;gt; (required for Apache to talk to RT)&lt;br /&gt;
* &amp;lt;code&amp;gt;mpm_prefork&amp;lt;/code&amp;gt; (Apache requires you to select an MPM. RT is designed to work with the prefork module.)&lt;br /&gt;
* &amp;lt;code&amp;gt;ssl&amp;lt;/code&amp;gt; (required to serve HTTPS; optional otherwise)&lt;br /&gt;
&lt;br /&gt;
Enable them following these instructions:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo a2dismod mpm_event&lt;br /&gt;
sudo a2enmod fcgid&lt;br /&gt;
sudo a2enmod mpm_prefork&lt;br /&gt;
sudo a2enmod ssl&amp;lt;/pre&amp;gt;&lt;br /&gt;
| &amp;lt;pre&amp;gt;echo LoadModule mpm_prefork_module modules/mod_mpm_prefork.so | sudo tee /etc/httpd/conf.modules.d/00-mpm.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Disable default VirtualHosts (optional) ===&lt;br /&gt;
&lt;br /&gt;
If this web server is dedicated to RT, then you should disable the VirtualHosts that are included with the stock configuration. Run:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo a2dissite 000-default&lt;br /&gt;
sudo a2dissite default-ssl&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo sed -i~ &#039;/^&amp;lt;VirtualHost\b/ , /^&amp;lt;\/VirtualHost\b/ d&#039; /etc/httpd/conf.d/ssl.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Configure an Apache VirtualHost ===&lt;br /&gt;
&lt;br /&gt;
Create a file at the following location. You can change the &amp;lt;code&amp;gt;RT&amp;lt;/code&amp;gt; part of the filename if you like, but the file must exist in this directory and have a &amp;lt;code&amp;gt;.conf&amp;lt;/code&amp;gt; suffix.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;/etc/apache2/sites-available/RT.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
Then after you create the file, run: &amp;lt;code&amp;gt;sudo a2ensite RT&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;/etc/httpd/conf.d/vhost_RT.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
(This filename needs to come after &amp;lt;code&amp;gt;ssl.conf&amp;lt;/code&amp;gt; in the directory listing.)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Use an editor to save all the text below to the new &amp;lt;code&amp;gt;RT.conf&amp;lt;/code&amp;gt; and then fill in settings for your site everywhere the text &amp;lt;code&amp;gt;EDIT WITH&amp;lt;/code&amp;gt; appears.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### Primary RT VirtualHost&lt;br /&gt;
# You can change both the bind address and/or the port here as required.&lt;br /&gt;
# This default will listen for HTTPS connections on all interfaces.&lt;br /&gt;
&amp;lt;VirtualHost *:443&amp;gt;&lt;br /&gt;
  # EDIT HERE with the domain name of the web server.&lt;br /&gt;
  ServerName rt.yourdomain.example.com&lt;br /&gt;
  &amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
    SSLEngine on&lt;br /&gt;
    # These specify the paths to the SSL certificate and private key Apache&lt;br /&gt;
    # should use. These example paths are common for Let&#039;s Encrypt. If you&lt;br /&gt;
    # don&#039;t use Let&#039;s Encrypt, the standard location for these files is under&lt;br /&gt;
    # (Debian/Ubuntu) /etc/ssl&lt;br /&gt;
    # (Red Hat/Fedora/CentOS) /etc/pki/tls&lt;br /&gt;
    # EDIT HERE with the appropriate paths for your server&lt;br /&gt;
    SSLCertificateFile /etc/letsencrypt/live/example.com/fullchain.pem&lt;br /&gt;
    SSLCertificateKeyFile /etc/letsencrypt/live/example.com/privkey.pem&lt;br /&gt;
  &amp;lt;/IfModule&amp;gt;&lt;br /&gt;
  &amp;lt;Location /&amp;gt;&lt;br /&gt;
    Require all granted&lt;br /&gt;
  &amp;lt;/Location&amp;gt;&lt;br /&gt;
  AddDefaultCharset UTF-8&lt;br /&gt;
  AddHandler fcgid-script fcgi&lt;br /&gt;
  DocumentRoot /opt/rt5/share/html&lt;br /&gt;
  ScriptAlias / /opt/rt5/sbin/rt-server.fcgi/&lt;br /&gt;
  # The default mod_fcgid timeout is 40 seconds.&lt;br /&gt;
  # We increase it here to allow for large ticket searches, etc.&lt;br /&gt;
  FcgidIOTimeout 200&lt;br /&gt;
  # mod_fcgid only allows 128KiB requests by default. This is too small for users&lt;br /&gt;
  # to upload files to RT. You can ultimately choose any setting you&#039;re&lt;br /&gt;
  # comfortable with; 70MiB here should allow most requests without being too&lt;br /&gt;
  # open.&lt;br /&gt;
  FcgidMaxRequestLen 73400320&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
### End primary RT VirtualHost&lt;br /&gt;
&lt;br /&gt;
### Optional HTTPS Redirect VirtualHost&lt;br /&gt;
# Most modern servers support HTTPS and want all web traffic to go through it.&lt;br /&gt;
# This VirtualHost redirects normal HTTP traffic to HTTPS.&lt;br /&gt;
# You can delete this whole section if you don&#039;t want or need this.&lt;br /&gt;
&amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
  # You can change both the bind address and/or the port here as required.&lt;br /&gt;
  # This default will listen for HTTP connections on all interfaces.&lt;br /&gt;
  &amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
    SSLEngine off&lt;br /&gt;
    # EDIT HERE both lines below with the domain name of your web server.&lt;br /&gt;
    ServerName rt.yourdomain.example.com&lt;br /&gt;
    Redirect permanent / https://rt.yourdomain.example.com/&lt;br /&gt;
  &amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/IfModule&amp;gt;&lt;br /&gt;
### End optional HTTPS Redirect VirtualHost&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
After you’ve edited the file, load the configuration with:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo systemctl reload apache2&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo systemctl reload httpd&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If this command reports an error, double-check the configuration file for typos, especially in option names, file paths, and the&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;amp;lt;Section&amp;amp;gt;&amp;lt;/code&amp;gt; pairs. Edit again and reload the configuration until it succeeds without output.&lt;br /&gt;
&lt;br /&gt;
=== Verify the web interface ===&lt;br /&gt;
&lt;br /&gt;
You should be able to visit your web server in your browser, and be presented with RT’s login screen. You should be able to log in with username &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; and the password you set previously.&lt;br /&gt;
&lt;br /&gt;
If you run into trouble, the first place to look for more information is by reading Apache’s error log:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo less /var/log/apache2/error.log&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo less /var/log/httpd/error.log&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s mail server ==&lt;br /&gt;
&lt;br /&gt;
RT both can both send and receive ticket updates via email. Unfortunately, there are too many variables to document a useful setup process here: getting this working usually requires creating DNS records, and coordinating with existing mail servers, which will be the main constraint on your setup. Instead this guide provides a brief overview of how the integration works, and where the connection points are that you likely need to work on.&lt;br /&gt;
&lt;br /&gt;
=== Sending Mail ===&lt;br /&gt;
&lt;br /&gt;
RT only knows how to send mail by passing it off to another program on the system. It cannot connect or authenticate directly to external mail servers. In the default configuration, RT runs the standard &amp;lt;code&amp;gt;sendmail&amp;lt;/code&amp;gt; command. There are [https://docs.bestpractical.com/rt/latest/RT_Config.html#Outgoing-mail configuration options to send mail through different commands] if you need.&lt;br /&gt;
&lt;br /&gt;
The most common setup is to install and configure a proper Mail Transfer Agent (MTA) like Postfix or Exim, and then configure it to send mail to the wider Internet as you need. This works well because the MTAs are robust and well-tested; they have flexible configuration to let you send mail out by relaying to other mail servers you specify with optional authentication; and most distributions install one by default anyway. The only hard part is configuring the MTA to send mail following your site’s policies.&lt;br /&gt;
&lt;br /&gt;
Other software is available that provides a slimmer version of the &amp;lt;code&amp;gt;sendmail&amp;lt;/code&amp;gt; command that connects to an external mail server for you, like ssmtp. These programs are usually easier to configure than an MTA, but they often lose email permanently if they can’t connect to the external server at the time it’s sent. (MTAs keep email queued locally until they successfully deliver it to another server.)&lt;br /&gt;
&lt;br /&gt;
=== Receiving email ===&lt;br /&gt;
&lt;br /&gt;
RT installs a command called &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; that receives an email on standard input and posts it to RT’s REST web interface, where it gets saved in the database and added to a ticket. You need to arrange for a way to send incoming email to this command.&lt;br /&gt;
&lt;br /&gt;
The most common setup is to have an MTA on the same box as RT receive email directly, and then set up mail aliases that call this command when mail comes in. Example &amp;lt;code&amp;gt;/etc/aliases&amp;lt;/code&amp;gt; entries look like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rt: &amp;quot;|/opt/rt5/bin/rt-mailgate --queue general --action correspond --url https://rt.yourdomain.example.com/&amp;quot;&lt;br /&gt;
rt-comment: &amp;quot;|/opt/rt5/bin/rt-mailgate --queue general --action comment --url https://rt.yourdomain.example.com/&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
This works well because, again, you’re probably running an MTA anyway; and the MTA can hold and queue mail if it comes in while RT is down for any reason, giving you a buffer against downtime.&lt;br /&gt;
&lt;br /&gt;
Another common option is to periodically run a tool that fetches mail using a protocol like IMAP, like fetchmail or getmail, and passes it on to &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt;. This is less common because it requires setting up another tool to run, and securely storing another set of mail server credentials. But it is useful when local policy prevents the RT server from receiving email directly.&lt;br /&gt;
&lt;br /&gt;
This is much less common, but it might help to know that &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; doesn’t have to run on the same system as RT itself. It just needs to be able to connect to RT’s web interface. If you don’t have any other options, you can install the RT software on a different system that receives email, and configure &#039;&#039;that&#039;&#039; system to run &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; and pass it on to the RT server. To do that, just repeat the installation instructions above, skipping the steps about installing the database and web server.&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s background jobs ==&lt;br /&gt;
&lt;br /&gt;
Create a file &amp;lt;code&amp;gt;/etc/cron.d/rt&amp;lt;/code&amp;gt; with the following content. You may edit all of the time fields as you see fit. Refer to the crontab(5) man page for details about their definitions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Update the fulltext index with new ticket data&lt;br /&gt;
*/3 *   *   *   *   root    /opt/rt5/sbin/rt-fulltext-indexer&lt;br /&gt;
# Email out dashboards that users have subscribed to&lt;br /&gt;
0   *   *   *   *   root    /opt/rt5/sbin/rt-email-dashboards&lt;br /&gt;
# Clean old sessions from the database&lt;br /&gt;
10  3   *   *   *   root    /opt/rt5/sbin/rt-clean-sessions --older 8d&lt;br /&gt;
# Email out weekly digests for users who have requested it&lt;br /&gt;
50  4   *   *   Mon root    /opt/rt5/sbin/rt-email-digest -m weekly&lt;br /&gt;
# Email out daily digests for users who have requested it&lt;br /&gt;
50  5   *   *   *   root    /opt/rt5/sbin/rt-email-digest -m daily&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
You can run all these jobs as the same user that runs your web server, rather than root. Run:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo sed -i &#039;s/\broot\b/www-data/&#039; /etc/cron.d/rt&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo sed -i &#039;s/\broot\b/apache/&#039; /etc/cron.d/rt&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Set up RT ==&lt;br /&gt;
&lt;br /&gt;
If you’ve gotten this far, congratulations, your RT install is really done now. You can start setting up RT with users, groups, queues, and business logic. [[Main Page|Head back to the main page]] to start exploring those topics.&lt;/div&gt;</summary>
		<author><name>Brett</name></author>
	</entry>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=ManualInstallation&amp;diff=27075</id>
		<title>ManualInstallation</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=ManualInstallation&amp;diff=27075"/>
		<updated>2022-03-24T16:10:57Z</updated>

		<summary type="html">&lt;p&gt;Brett: revert back to recommending w3m, with instructions for how to enable it on different RH distros&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Prev: [[ManualRequirements]] — Up: [[UserManual]] — Next: [[ManualApacheConfig]]&lt;br /&gt;
&lt;br /&gt;
This guide walks you through installing RT from source on a modern, popular Linux distro. Specifically, that means a distribution based on Debian or Red Hat that’s been released since around 2020.&lt;br /&gt;
&lt;br /&gt;
This guide assumes:&lt;br /&gt;
&lt;br /&gt;
* You can install packages generally available in Debian/Ubuntu or Red Hat/Fedora/CentOS.&lt;br /&gt;
* You want to install RT, and all of its Perl dependencies, from source to get the latest versions. (This is a trade-off. It means the boundaries of your install will be very clear, but you won’t get security updates for RT or Perl modules from your distribution.)&lt;br /&gt;
* You are willing to install a couple of extra tools to manage the RT installation similarly to how you would in other packaging systems (like PyPI, npm, etc.).&lt;br /&gt;
* You are willing to do a relatively maximal install of RT, enabling all the options during installation and then setting what you need in the configuration. (You could save a little space and time by being pickier about your options, but then that complicates the guide and makes it harder to turn those options on later if you want.)&lt;br /&gt;
* You are using a regular user account on the Linux system that can get superuser privileges with sudo.&lt;br /&gt;
&lt;br /&gt;
== Install the base dependencies ==&lt;br /&gt;
&lt;br /&gt;
These are required by RT, either to run or to install the dependencies.&lt;br /&gt;
&lt;br /&gt;
=== Debian/Ubuntu ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo apt install autoconf build-essential cpanminus curl libexpat-dev libgd-dev libssl-dev libz-dev gnupg graphviz openssl perl w3m&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Red Hat Enterprise Linux ===&lt;br /&gt;
&lt;br /&gt;
These instructions are for RHEL specifically. For RHEL-derived distributions like CentOS and Rocky, go to the next section.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;MAJDISTVER=&amp;quot;$(. /etc/os-release &amp;amp;&amp;amp; echo &amp;quot;${VERSION_ID%%.*}&amp;quot;)&amp;quot;&lt;br /&gt;
sudo subscription-manager repos --enable &amp;quot;codeready-builder-for-rhel-$MAJDISTVER-$(arch)-rpms&amp;quot;&lt;br /&gt;
sudo dnf install &amp;quot;https://dl.fedoraproject.org/pub/epel/epel-release-latest-$MAJDISTVER.noarch.rpm&amp;quot;&lt;br /&gt;
sudo dnf install patch tar which gcc gcc-c++ perl-core perl-App-cpanminus graphviz expat-devel gd-devel openssl openssl-devel w3m&lt;br /&gt;
sudo sed -i~ &#039;/^SELINUX=/ c SELINUX=disabled&#039; /etc/selinux/config&lt;br /&gt;
sudo setenforce 0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Turning off SELinux enforcement is required on Red Hat-based distributions because, as of March 2022, nobody has written a policy for RT.)&lt;br /&gt;
&lt;br /&gt;
=== RHEL Community Distributions: Fedora/CentOS/Rocky ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo dnf install epel-release&lt;br /&gt;
sudo dnf install patch tar which gcc gcc-c++ perl-core perl-App-cpanminus graphviz expat-devel gd-devel openssl openssl-devel w3m&lt;br /&gt;
sudo sed -i~ &#039;/^SELINUX=/ c SELINUX=disabled&#039; /etc/selinux/config&lt;br /&gt;
sudo setenforce 0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Turning off SELinux enforcement is required on Red Hat-based distributions because, as of March 2022, nobody has written a policy for RT.)&lt;br /&gt;
&lt;br /&gt;
== Install a database ==&lt;br /&gt;
&lt;br /&gt;
You need access to a database server. It can be remote, or you can install a database server alongside RT. RT supports a few different databases, but the best supported options are PostgreSQL and MariaDB.&lt;br /&gt;
&lt;br /&gt;
=== Installing and configuring the PostgreSQL server ===&lt;br /&gt;
&lt;br /&gt;
If you want to install a fresh PostgreSQL database server alongside RT:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install postgresql&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install postgresql-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In order to set up RT’s database, you will need a PostgreSQL account that can create databases and roles and be authenticated with a password. If you don’t have that, you can create it by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo createuser --createdb --createrole --login --pwprompt rt_admin&amp;lt;/pre&amp;gt;&lt;br /&gt;
Set the password when prompted. Record this; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
=== Enable password authentication in PostgreSQL ===&lt;br /&gt;
&lt;br /&gt;
You need to consider this step whether you install the database locally, or use an existing one already running. RT supports connecting to PostgreSQL a few different ways, but authenticating with a username and password is simplest, and this guide is written based on that. Not all PostgreSQL installations allow this authentication method by default. You need to review your &amp;lt;code&amp;gt;pg_hba.conf&amp;lt;/code&amp;gt; file located at:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;/etc/postgresql/VERSION/main/pg_hba.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;/var/lib/pgsql/VERSION/data/pg_hba.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Replace &amp;lt;code&amp;gt;VERSION&amp;lt;/code&amp;gt; with the version of your PostgreSQL database. Add these two lines &#039;&#039;&#039;above&#039;&#039;&#039; any other lines that start with &amp;lt;code&amp;gt;host&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;host  rt5  rt_user   all  md5&lt;br /&gt;
host  rt5  rt_admin  all  md5&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This configuration will let &amp;lt;code&amp;gt;rt_user&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;rt_admin&amp;lt;/code&amp;gt; authorize themselves for the &amp;lt;code&amp;gt;rt5&amp;lt;/code&amp;gt; database using an &amp;lt;code&amp;gt;md5&amp;lt;/code&amp;gt; crypted password over a network connection (possibly using the localhost loopback network). You might be able to further restrict some of these fields for improved security, but doing so is outside the scope of this install guide. Refer to [https://www.postgresql.org/docs/current/auth-pg-hba-conf.html the pg_hba.conf documentation] for more details.&lt;br /&gt;
&lt;br /&gt;
Save your changes and reload the database:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo systemctl reload postgresql&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Installing the PostgreSQL client libraries ===&lt;br /&gt;
&lt;br /&gt;
These are required for RT to be able to talk to any PostgreSQL server.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install libpq-dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install postgresql-devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Once this is done you can skip ahead to installing a web server.&lt;br /&gt;
&lt;br /&gt;
=== Installing and configuring the MariaDB server ===&lt;br /&gt;
&lt;br /&gt;
If you want to install a fresh MariaDB database server alongside RT:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install mariadb-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install mariadb-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In order to set up RT’s database, you will need a MySQL superuser account. To stay consistent with PostgreSQL, I suggest setting a password for it. You can do that by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo mysql mysql&lt;br /&gt;
MariaDB [mysql]&amp;amp;gt; GRANT ALL PRIVILEGES ON rt5.* TO rt_admin@localhost IDENTIFIED BY &#039;YourPassphraseHere&#039; WITH GRANT OPTION;&amp;lt;/pre&amp;gt;&lt;br /&gt;
Record your passphrase; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
=== Adjust MariaDB’s max_allowed_packet setting ===&lt;br /&gt;
&lt;br /&gt;
You need to consider this step whether you install the database locally, or use an existing one already running. [https://mariadb.com/kb/en/server-system-variables/#max_allowed_packet MariaDB’s &amp;lt;code&amp;gt;max_allowed_packet&amp;lt;/code&amp;gt; setting] functionally limits the size of attachments in RT. The default is 16MiB, which is too small for most installations. You can ultimately choose any setting you’re comfortable with; 64MiB here should allow most requests without being too open.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;echo -e &#039;[server]\nmax_allowed_packet=64M&#039; | sudo tee /etc/mysql/conf.d/max_allowed_packet.cnf&lt;br /&gt;
sudo systemctl reload mariadb&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;echo -e &#039;[server]\nmax_allowed_packet=64M&#039; | sudo tee /etc/my.cnf.d/max_allowed_packet.cnf&lt;br /&gt;
sudo systemctl reload mariadb&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Installing the MariaDB client libraries ===&lt;br /&gt;
&lt;br /&gt;
These are required for RT to be able to talk to any MariaDB server.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install libmariadb-dev libmariadb-dev-compat&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install mariadb-devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Install a web server with FastCGI ==&lt;br /&gt;
&lt;br /&gt;
FastCGI is the best way to host RT’s web interface today. Installing the web server before RT makes the installation process simpler, because RT will be able to automatically some details about your web server like what user it runs as.&lt;br /&gt;
&lt;br /&gt;
=== Installing Apache ===&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install apache2 libapache2-mod-fcgid&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install httpd mod_fcgid mod_ssl&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ### Installing nginx --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Install RT ==&lt;br /&gt;
&lt;br /&gt;
=== Get and unpack the RT source code ===&lt;br /&gt;
&lt;br /&gt;
Download the latest source code using the link on the [https://bestpractical.com/download-page RT download page], extract it using &amp;lt;code&amp;gt;tar -xf&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt; into the source code directory to run the rest of the commands in this section. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;curl -O https://download.bestpractical.com/pub/rt/release/rt-5.0.2.tar.gz&lt;br /&gt;
tar -xf rt-5.0.2.tar.gz&lt;br /&gt;
cd rt-5.0.2&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Pre-configure RT ===&lt;br /&gt;
&lt;br /&gt;
This command will detect some information about your system in order to install RT properly, and decide which set of dependencies to install. Here’s what the different parts of our command are doing:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;PERL=…&amp;lt;/code&amp;gt; configures RT to run under Perl with some options that load its dependencies from a dedicated directory. The &amp;lt;code&amp;gt;/opt/rt5&amp;lt;/code&amp;gt; part of this string should match your &amp;lt;code&amp;gt;prefix&amp;lt;/code&amp;gt; setting (see next item). If you know you want to use a specific Perl installed on your system, you can specify its full path instead of the plain &amp;lt;code&amp;gt;perl&amp;lt;/code&amp;gt; here.&lt;br /&gt;
* &amp;lt;code&amp;gt;--prefix=/opt/rt5&amp;lt;/code&amp;gt; sets the directory where RT will install all of its libraries, tools, and supporting files. You can choose another path if you like.&lt;br /&gt;
* &amp;lt;code&amp;gt;--with-db-type=TYPE&amp;lt;/code&amp;gt; - Replace &amp;lt;code&amp;gt;TYPE&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;Pg&amp;lt;/code&amp;gt; for PostgreSQL, or &amp;lt;code&amp;gt;mysql&amp;lt;/code&amp;gt; for MariaDB.&lt;br /&gt;
* The rest of the options tell RT to install additional dependencies for optional features.&lt;br /&gt;
&lt;br /&gt;
Make sure you have &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt;ed into the RT source directory, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;PERL=&amp;quot;/usr/bin/env -S perl -I/opt/rt5/local/lib/perl5&amp;quot; ./configure --prefix=/opt/rt5 --with-db-type=TYPE --with-attachment-store=disk --enable-externalauth --enable-gd --enable-graphviz --enable-gpg --enable-smime&amp;lt;/pre&amp;gt;&lt;br /&gt;
For more background, [https://docs.bestpractical.com/rt/latest/configure.html refer to the RT configure options documentation].&lt;br /&gt;
&lt;br /&gt;
=== Install RT and its Perl dependencies ===&lt;br /&gt;
&lt;br /&gt;
This command will download, build, and install all of the Perl modules necessary to run RT with the configuration you set above. Here’s what the different parts of the command are doing:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;make dirs&amp;lt;/code&amp;gt; creates RT&#039;s directory structure, so we can install dependencies inside it.&lt;br /&gt;
* &amp;lt;code&amp;gt;make fixdeps&amp;lt;/code&amp;gt; actually installs those dependencies.&lt;br /&gt;
* &amp;lt;code&amp;gt;RT_FIX_DEPS_CMD=…&amp;lt;/code&amp;gt; tells RT to use cpanminus to install dependencies (instead of the older, default &amp;lt;code&amp;gt;cpan&amp;lt;/code&amp;gt; command) inside RT&#039;s directory structure.&lt;br /&gt;
* &amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt; installs all of RT’s files under &amp;lt;code&amp;gt;/opt/rt5&amp;lt;/code&amp;gt; (or the prefix directory you set earlier). It will only run if &amp;lt;code&amp;gt;fixdeps&amp;lt;/code&amp;gt; succeeded.&lt;br /&gt;
&lt;br /&gt;
Make sure you have &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt;ed into the RT source directory, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo make dirs&lt;br /&gt;
make fixdeps RT_FIX_DEPS_CMD=&amp;quot;cpanm --sudo --local-lib-contained=/opt/rt5/local&amp;quot;&lt;br /&gt;
sudo make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
If it works, the command will eventually output a message that says “Congratulations. RT is now installed.” followed by instructions about configuring and setting up the database. We’ll do that next.&lt;br /&gt;
&lt;br /&gt;
=== Configure RT ===&lt;br /&gt;
&lt;br /&gt;
[https://docs.bestpractical.com/rt/latest/RT_Config.html RT has many configuration options.] You can put configuration options in the file &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/code&amp;gt;, or in individual files under &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.d/&amp;lt;/code&amp;gt;. Use an editor to save all the text below to &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/code&amp;gt; (you can just overwrite the existing file, or add this to the bottom of what’s there) and then fill in settings for your site everywhere the text &amp;lt;code&amp;gt;EDIT WITH&amp;lt;/code&amp;gt; appears.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Single-quote all values EXCEPT the special value `undef`&lt;br /&gt;
# that turns off a setting.&lt;br /&gt;
&lt;br /&gt;
# rtname appears in ticket email subjects. It needs to be globally unique,&lt;br /&gt;
# so use your organization&#039;s domain name.&lt;br /&gt;
Set($rtname, &#039;EDIT WITH yourdomain.example.com&#039;);&lt;br /&gt;
# Organization is used in the database for ticket links, etc. It also needs to&lt;br /&gt;
# be globally unique, so use your organization&#039;s domain name.&lt;br /&gt;
Set($Organization, &#039;EDIT WITH yourdomain.example.com&#039;);&lt;br /&gt;
# WebDomain is domain name of the RT web server. RT uses it to construct links&lt;br /&gt;
# and defend against CSRFs.&lt;br /&gt;
Set($WebDomain, &#039;EDIT WITH rt.yourdomain.example.com&#039;);&lt;br /&gt;
# WebPort is the port where the RT web server runs. Edit the number below if&lt;br /&gt;
# you&#039;re not using the standard HTTPS port.&lt;br /&gt;
Set($WebPort, &#039;443&#039;);&lt;br /&gt;
&lt;br /&gt;
# DatabaseUser is the name of the database account RT uses to read and store&lt;br /&gt;
# data. &#039;rt_user&#039; is the default but you can change it if you like.&lt;br /&gt;
# DO NOT use the &#039;rt_admin&#039; superuser created in the instructions above.&lt;br /&gt;
Set($DatabaseUser, &#039;rt_user&#039;);&lt;br /&gt;
# DatabasePassword is the password for DatabaseUser.&lt;br /&gt;
Set($DatabasePassword, &#039;EDIT WITH SomePassphraseHere&#039;);&lt;br /&gt;
# DatabaseHost is the hostname of the database server RT should use.&lt;br /&gt;
# Change &#039;localhost&#039; if it lives on a different server.&lt;br /&gt;
Set($DatabaseHost, &#039;localhost&#039;);&lt;br /&gt;
# DatabasePort is the port number of the database server RT should use.&lt;br /&gt;
# `undef` means the default for that database. Change it if you&#039;re not&lt;br /&gt;
# using the standard port.&lt;br /&gt;
Set($DatabasePort, undef);&lt;br /&gt;
# DatabaseName is the name of RT&#039;s database hosted on DatabaseHost.&lt;br /&gt;
# &#039;rt5&#039; is the default but you can change it if you like.&lt;br /&gt;
Set($DatabaseName, &#039;rt5&#039;);&lt;br /&gt;
# DatabaseAdmin is the name of the user in the database used to perform&lt;br /&gt;
# major administrative tasks. Change &#039;rt_admin&#039; if you&#039;re using a user&lt;br /&gt;
# besides the one created in this guide.&lt;br /&gt;
Set($DatabaseAdmin, &#039;rt_admin&#039;);&lt;br /&gt;
&lt;br /&gt;
# RT can log to syslog, stderr, and/or a dedicated file.&lt;br /&gt;
# Log settings are used both by the primary server and by command line&lt;br /&gt;
# tools like rt-crontool, rt-ldapimport, etc.&lt;br /&gt;
# You set all of RT&#039;s $LogTo* paramaters to a standard log level: &#039;debug&#039;,&lt;br /&gt;
# &#039;info&#039;, &#039;notice&#039;, &#039;warning&#039;, &#039;error&#039;, &#039;critical&#039;, &#039;alert&#039;, or &#039;emergency&#039;.&lt;br /&gt;
# For a modern install, I recommend logging primarily to syslog, so it goes&lt;br /&gt;
# to journald where it&#039;s easy to query and automatically gets rotated.&lt;br /&gt;
Set($LogToSyslog, &#039;info&#039;);&lt;br /&gt;
&lt;br /&gt;
# When the RT server logs to stderr, that usually goes to your web server&#039;s&lt;br /&gt;
# error log. Command line tools log to their own stderr. Setting this to&lt;br /&gt;
# &#039;warning&#039; or &#039;error&#039; helps ensure you get notified if RT&#039;s cron jobs&lt;br /&gt;
# encounter problems.&lt;br /&gt;
Set($LogToSTDERR, &#039;warning&#039;);&lt;br /&gt;
&lt;br /&gt;
# Turn off optional features that require additional configuration.&lt;br /&gt;
# If you want to use these, refer to the RT_Config documentation for&lt;br /&gt;
# instructions on how to set them up.&lt;br /&gt;
Set(%GnuPG, &#039;Enable&#039; =&amp;gt; &#039;0&#039;);&lt;br /&gt;
Set(%SMIME, &#039;Enable&#039; =&amp;gt; &#039;0&#039;);&lt;br /&gt;
&lt;br /&gt;
# Perl expects to find this 1 at the end of the file.&lt;br /&gt;
1;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;RT_SiteConfig.pm&amp;lt;/code&amp;gt; is actually Perl code. RT runs the code directly to load the configuration. Any time you finish editing it, you can check that you didn’t make any syntax errors by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;perl -c /opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Set up RT’s database ===&lt;br /&gt;
&lt;br /&gt;
RT includes a tool to help you set up its database. By default, it connects to the database as an administrator to create the database and user that you configured in the previous step.&lt;br /&gt;
&lt;br /&gt;
(The instructions from &amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt; and RT’s README file tell you to run &amp;lt;code&amp;gt;make initialize-database&amp;lt;/code&amp;gt;. That just runs &amp;lt;code&amp;gt;rt-setup-database&amp;lt;/code&amp;gt; for you. Running the tool directly makes it easier to pass the options you need.)&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;--action=init&amp;lt;/code&amp;gt; tells the tool to create the user, the database, the tables inside it, and insert core data RT needs to function.&lt;br /&gt;
* &#039;&#039;&#039;If&#039;&#039;&#039; you are using an existing database server and the database adminstrator has already created the user account and database for RT, then you can add the &amp;lt;code&amp;gt;--skip-create&amp;lt;/code&amp;gt; option.&lt;br /&gt;
* &#039;&#039;&#039;If&#039;&#039;&#039; you have a less common database setup, this tool has additional options to give you finer-grained control over what steps are run and how. Refer to [https://docs.bestpractical.com/rt/latest/rt-setup-database.html the full rt-setup-database documentation] to learn more about those.&lt;br /&gt;
* The command reads files from RT’s &amp;lt;code&amp;gt;etc/&amp;lt;/code&amp;gt; directory by default, so the easiest way to run it is to &amp;lt;code&amp;gt;cd /opt/rt5&amp;lt;/code&amp;gt; first, and then it will find the necessary files automatically.&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /opt/rt5&lt;br /&gt;
sudo sbin/rt-setup-database --action=init&amp;lt;/pre&amp;gt;&lt;br /&gt;
Enter the password for your database administrator account when prompted.&lt;br /&gt;
&lt;br /&gt;
=== Set up fulltext indexing ===&lt;br /&gt;
&lt;br /&gt;
Fulltext indexing speeds up searches for ticket content, which makes RT a lot nicer to use.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;--noask&amp;lt;/code&amp;gt; uses the default names for the index, which will be fine for a new install and simplifies the setup.&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo /opt/rt5/sbin/rt-setup-fulltext-index --noask&amp;lt;/pre&amp;gt;&lt;br /&gt;
Enter the password for your database administrator account when prompted. The end of the process will output some RT configuration that looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;### EXAMPLE OUTPUT ONLY - Don&#039;t use this directly!&lt;br /&gt;
Set( %FullTextSearch,&lt;br /&gt;
    Enable     =&amp;gt; 1,&lt;br /&gt;
    Indexed    =&amp;gt; 1,&lt;br /&gt;
    # Additional output from rt-setup-fulltext-index should be here.&lt;br /&gt;
    # The configuration varies by database type.&lt;br /&gt;
);&amp;lt;/pre&amp;gt;&lt;br /&gt;
Copy the output generated when you run &amp;lt;code&amp;gt;rt-setup-fulltext-index&amp;lt;/code&amp;gt; and save it to the file &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.d/FulltextIndex.pm&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Set permissions ===&lt;br /&gt;
&lt;br /&gt;
All of RT’s configuration files should be readable by the user that runs the web server, and no other users, in order to protect sensitive information like the database password. RT provides a command to set permissions appropriately according to your distribution and configuration. &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt; to the directory where you extracted the RT source code, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd rt-5.0.2&lt;br /&gt;
sudo make fixperms&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Verify the installation ===&lt;br /&gt;
&lt;br /&gt;
If everything has gone well, then you should be able to set a password for RT’s &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; user. You’ll use this later to log in to the web interface and continue setting up your system. Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo /opt/rt5/sbin/rt-passwd root&amp;lt;/pre&amp;gt;&lt;br /&gt;
Set the password when prompted. Record this; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s web server ==&lt;br /&gt;
&lt;br /&gt;
=== Configure Apache modules ===&lt;br /&gt;
&lt;br /&gt;
You will need to have the following modules enabled in Apache to run RT. You should already have these installed if you followed the instructions above.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;alias&amp;lt;/code&amp;gt; (required to map URLs to RT)&lt;br /&gt;
* &amp;lt;code&amp;gt;fcgid&amp;lt;/code&amp;gt; (required for Apache to talk to RT)&lt;br /&gt;
* &amp;lt;code&amp;gt;mpm_prefork&amp;lt;/code&amp;gt; (Apache requires you to select an MPM. RT is designed to work with the prefork module.)&lt;br /&gt;
* &amp;lt;code&amp;gt;ssl&amp;lt;/code&amp;gt; (required to serve HTTPS; optional otherwise)&lt;br /&gt;
&lt;br /&gt;
Enable them following these instructions:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo a2dismod mpm_event&lt;br /&gt;
sudo a2enmod fcgid&lt;br /&gt;
sudo a2enmod mpm_prefork&lt;br /&gt;
sudo a2enmod ssl&amp;lt;/pre&amp;gt;&lt;br /&gt;
| &amp;lt;pre&amp;gt;echo LoadModule mpm_prefork_module modules/mod_mpm_prefork.so | sudo tee /etc/httpd/conf.modules.d/00-mpm.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Disable default VirtualHosts (optional) ===&lt;br /&gt;
&lt;br /&gt;
If this web server is dedicated to RT, then you should disable the VirtualHosts that are included with the stock configuration. Run:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo a2dissite 000-default&lt;br /&gt;
sudo a2dissite default-ssl&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo sed -i~ &#039;/^&amp;lt;VirtualHost\b/ , /^&amp;lt;\/VirtualHost\b/ d&#039; /etc/httpd/conf.d/ssl.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Configure an Apache VirtualHost ===&lt;br /&gt;
&lt;br /&gt;
Create a file at the following location. You can change the &amp;lt;code&amp;gt;RT&amp;lt;/code&amp;gt; part of the filename if you like, but the file must exist in this directory and have a &amp;lt;code&amp;gt;.conf&amp;lt;/code&amp;gt; suffix.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;/etc/apache2/sites-available/RT.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
Then after you create the file, run: &amp;lt;code&amp;gt;sudo a2ensite RT&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;/etc/httpd/conf.d/vhost_RT.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
(This filename needs to come after &amp;lt;code&amp;gt;ssl.conf&amp;lt;/code&amp;gt; in the directory listing.)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Use an editor to save all the text below to the new &amp;lt;code&amp;gt;RT.conf&amp;lt;/code&amp;gt; and then fill in settings for your site everywhere the text &amp;lt;code&amp;gt;EDIT WITH&amp;lt;/code&amp;gt; appears.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### Primary RT VirtualHost&lt;br /&gt;
# You can change both the bind address and/or the port here as required.&lt;br /&gt;
# This default will listen for HTTPS connections on all interfaces.&lt;br /&gt;
&amp;lt;VirtualHost *:443&amp;gt;&lt;br /&gt;
  # EDIT HERE with the domain name of the web server.&lt;br /&gt;
  ServerName rt.yourdomain.example.com&lt;br /&gt;
  &amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
    SSLEngine on&lt;br /&gt;
    # These specify the paths to the SSL certificate and private key Apache&lt;br /&gt;
    # should use. These example paths are common for Let&#039;s Encrypt. If you&lt;br /&gt;
    # don&#039;t use Let&#039;s Encrypt, the standard location for these files is under&lt;br /&gt;
    # (Debian/Ubuntu) /etc/ssl&lt;br /&gt;
    # (Red Hat/Fedora/CentOS) /etc/pki/tls&lt;br /&gt;
    # EDIT HERE with the appropriate paths for your server&lt;br /&gt;
    SSLCertificateFile /etc/letsencrypt/live/example.com/fullchain.pem&lt;br /&gt;
    SSLCertificateKeyFile /etc/letsencrypt/live/example.com/privkey.pem&lt;br /&gt;
  &amp;lt;/IfModule&amp;gt;&lt;br /&gt;
  &amp;lt;Location /&amp;gt;&lt;br /&gt;
    Require all granted&lt;br /&gt;
    Options +ExecCGI&lt;br /&gt;
    AddHandler fcgid-script fcgi&lt;br /&gt;
  &amp;lt;/Location&amp;gt;&lt;br /&gt;
  AddDefaultCharset UTF-8&lt;br /&gt;
  DocumentRoot /opt/rt5/share/html&lt;br /&gt;
  ScriptAlias / /opt/rt5/sbin/rt-server.fcgi/&lt;br /&gt;
  # The default mod_fcgid timeout is 40 seconds.&lt;br /&gt;
  # We increase it here to allow for large ticket searches, etc.&lt;br /&gt;
  FcgidIOTimeout 200&lt;br /&gt;
  # mod_fcgid only allows 128KiB requests by default. This is too small for users&lt;br /&gt;
  # to upload files to RT. You can ultimately choose any setting you&#039;re&lt;br /&gt;
  # comfortable with; 70MiB here should allow most requests without being too&lt;br /&gt;
  # open.&lt;br /&gt;
  FcgidMaxRequestLen 73400320&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
### End primary RT VirtualHost&lt;br /&gt;
&lt;br /&gt;
### Optional HTTPS Redirect VirtualHost&lt;br /&gt;
# Most modern servers support HTTPS and want all web traffic to go through it.&lt;br /&gt;
# This VirtualHost redirects normal HTTP traffic to HTTPS.&lt;br /&gt;
# You can delete this whole section if you don&#039;t want or need this.&lt;br /&gt;
&amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
  # You can change both the bind address and/or the port here as required.&lt;br /&gt;
  # This default will listen for HTTP connections on all interfaces.&lt;br /&gt;
  &amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
    SSLEngine off&lt;br /&gt;
    # EDIT HERE both lines below with the domain name of your web server.&lt;br /&gt;
    ServerName rt.yourdomain.example.com&lt;br /&gt;
    Redirect permanent / https://rt.yourdomain.example.com/&lt;br /&gt;
  &amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/IfModule&amp;gt;&lt;br /&gt;
### End optional HTTPS Redirect VirtualHost&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
After you’ve edited the file, load the configuration with:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo systemctl reload apache2&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo systemctl reload httpd&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If this command reports an error, double-check the configuration file for typos, especially in option names, file paths, and the&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;amp;lt;Section&amp;amp;gt;&amp;lt;/code&amp;gt; pairs. Edit again and reload the configuration until it succeeds without output.&lt;br /&gt;
&lt;br /&gt;
=== Verify the web interface ===&lt;br /&gt;
&lt;br /&gt;
You should be able to visit your web server in your browser, and be presented with RT’s login screen. You should be able to log in with username &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; and the password you set previously.&lt;br /&gt;
&lt;br /&gt;
If you run into trouble, the first place to look for more information is by reading Apache’s error log:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo less /var/log/apache2/error.log&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo less /var/log/httpd/error.log&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s mail server ==&lt;br /&gt;
&lt;br /&gt;
RT both can both send and receive ticket updates via email. Unfortunately, there are too many variables to document a useful setup process here: getting this working usually requires creating DNS records, and coordinating with existing mail servers, which will be the main constraint on your setup. Instead this guide provides a brief overview of how the integration works, and where the connection points are that you likely need to work on.&lt;br /&gt;
&lt;br /&gt;
=== Sending Mail ===&lt;br /&gt;
&lt;br /&gt;
RT only knows how to send mail by passing it off to another program on the system. It cannot connect or authenticate directly to external mail servers. In the default configuration, RT runs the standard &amp;lt;code&amp;gt;sendmail&amp;lt;/code&amp;gt; command. There are [https://docs.bestpractical.com/rt/latest/RT_Config.html#Outgoing-mail configuration options to send mail through different commands] if you need.&lt;br /&gt;
&lt;br /&gt;
The most common setup is to install and configure a proper Mail Transfer Agent (MTA) like Postfix or Exim, and then configure it to send mail to the wider Internet as you need. This works well because the MTAs are robust and well-tested; they have flexible configuration to let you send mail out by relaying to other mail servers you specify with optional authentication; and most distributions install one by default anyway. The only hard part is configuring the MTA to send mail following your site’s policies.&lt;br /&gt;
&lt;br /&gt;
Other software is available that provides a slimmer version of the &amp;lt;code&amp;gt;sendmail&amp;lt;/code&amp;gt; command that connects to an external mail server for you, like ssmtp. These programs are usually easier to configure than an MTA, but they often lose email permanently if they can’t connect to the external server at the time it’s sent. (MTAs keep email queued locally until they successfully deliver it to another server.)&lt;br /&gt;
&lt;br /&gt;
=== Receiving email ===&lt;br /&gt;
&lt;br /&gt;
RT installs a command called &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; that receives an email on standard input and posts it to RT’s REST web interface, where it gets saved in the database and added to a ticket. You need to arrange for a way to send incoming email to this command.&lt;br /&gt;
&lt;br /&gt;
The most common setup is to have an MTA on the same box as RT receive email directly, and then set up mail aliases that call this command when mail comes in. Example &amp;lt;code&amp;gt;/etc/aliases&amp;lt;/code&amp;gt; entries look like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rt: &amp;quot;|/opt/rt5/bin/rt-mailgate --queue general --action correspond --url https://rt.yourdomain.example.com/&amp;quot;&lt;br /&gt;
rt-comment: &amp;quot;|/opt/rt5/bin/rt-mailgate --queue general --action comment --url https://rt.yourdomain.example.com/&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
This works well because, again, you’re probably running an MTA anyway; and the MTA can hold and queue mail if it comes in while RT is down for any reason, giving you a buffer against downtime.&lt;br /&gt;
&lt;br /&gt;
Another common option is to periodically run a tool that fetches mail using a protocol like IMAP, like fetchmail or getmail, and passes it on to &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt;. This is less common because it requires setting up another tool to run, and securely storing another set of mail server credentials. But it is useful when local policy prevents the RT server from receiving email directly.&lt;br /&gt;
&lt;br /&gt;
This is much less common, but it might help to know that &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; doesn’t have to run on the same system as RT itself. It just needs to be able to connect to RT’s web interface. If you don’t have any other options, you can install the RT software on a different system that receives email, and configure &#039;&#039;that&#039;&#039; system to run &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; and pass it on to the RT server. To do that, just repeat the installation instructions above, skipping the steps about installing the database and web server.&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s background jobs ==&lt;br /&gt;
&lt;br /&gt;
Create a file &amp;lt;code&amp;gt;/etc/cron.d/rt&amp;lt;/code&amp;gt; with the following content. You may edit all of the time fields as you see fit. Refer to the crontab(5) man page for details about their definitions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Update the fulltext index with new ticket data&lt;br /&gt;
*/3 *   *   *   *   root    /opt/rt5/sbin/rt-fulltext-indexer&lt;br /&gt;
# Email out dashboards that users have subscribed to&lt;br /&gt;
0   *   *   *   *   root    /opt/rt5/sbin/rt-email-dashboards&lt;br /&gt;
# Clean old sessions from the database&lt;br /&gt;
10  3   *   *   *   root    /opt/rt5/sbin/rt-clean-sessions --older 8d&lt;br /&gt;
# Email out weekly digests for users who have requested it&lt;br /&gt;
50  4   *   *   Mon root    /opt/rt5/sbin/rt-email-digest -m weekly&lt;br /&gt;
# Email out daily digests for users who have requested it&lt;br /&gt;
50  5   *   *   *   root    /opt/rt5/sbin/rt-email-digest -m daily&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
You can run all these jobs as the same user that runs your web server, rather than root. Run:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo sed -i &#039;s/\broot\b/www-data/&#039; /etc/cron.d/rt&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo sed -i &#039;s/\broot\b/apache/&#039; /etc/cron.d/rt&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Set up RT ==&lt;br /&gt;
&lt;br /&gt;
If you’ve gotten this far, congratulations, your RT install is really done now. You can start setting up RT with users, groups, queues, and business logic. [[Main Page|Head back to the main page]] to start exploring those topics.&lt;/div&gt;</summary>
		<author><name>Brett</name></author>
	</entry>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=ManualInstallation&amp;diff=27074</id>
		<title>ManualInstallation</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=ManualInstallation&amp;diff=27074"/>
		<updated>2022-03-24T16:06:10Z</updated>

		<summary type="html">&lt;p&gt;Brett: add instructions to disable SELinux permanently&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Prev: [[ManualRequirements]] — Up: [[UserManual]] — Next: [[ManualApacheConfig]]&lt;br /&gt;
&lt;br /&gt;
This guide walks you through installing RT from source on a modern, popular Linux distro. Specifically, that means a distribution based on Debian or Red Hat that’s been released since around 2020.&lt;br /&gt;
&lt;br /&gt;
This guide assumes:&lt;br /&gt;
&lt;br /&gt;
* You can install packages generally available in Debian/Ubuntu or Red Hat/Fedora/CentOS.&lt;br /&gt;
* You want to install RT, and all of its Perl dependencies, from source to get the latest versions. (This is a trade-off. It means the boundaries of your install will be very clear, but you won’t get security updates for RT or Perl modules from your distribution.)&lt;br /&gt;
* You are willing to install a couple of extra tools to manage the RT installation similarly to how you would in other packaging systems (like PyPI, npm, etc.).&lt;br /&gt;
* You are willing to do a relatively maximal install of RT, enabling all the options during installation and then setting what you need in the configuration. (You could save a little space and time by being pickier about your options, but then that complicates the guide and makes it harder to turn those options on later if you want.)&lt;br /&gt;
* You are using a regular user account on the Linux system that can get superuser privileges with sudo.&lt;br /&gt;
&lt;br /&gt;
== Install the base dependencies ==&lt;br /&gt;
&lt;br /&gt;
These are required by RT, either to run or to install the dependencies.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install autoconf build-essential cpanminus curl libexpat-dev libgd-dev libssl-dev libz-dev gnupg graphviz lynx openssl perl&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf config-manager --set-enabled powertools&lt;br /&gt;
sudo dnf install patch tar which gcc gcc-c++ perl-core perl-App-cpanminus graphviz expat-devel gd-devel lynx openssl openssl-devel&lt;br /&gt;
sudo sed -i~ &#039;/^SELINUX=/ c SELINUX=disabled&#039; /etc/selinux/config&lt;br /&gt;
sudo setenforce 0&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
(Turning off SELinux enforcement is required on Red Hat-based distributions because, as of March 2022, nobody has written a policy for RT.)&lt;br /&gt;
&lt;br /&gt;
== Install a database ==&lt;br /&gt;
&lt;br /&gt;
You need access to a database server. It can be remote, or you can install a database server alongside RT. RT supports a few different databases, but the best supported options are PostgreSQL and MariaDB.&lt;br /&gt;
&lt;br /&gt;
=== Installing and configuring the PostgreSQL server ===&lt;br /&gt;
&lt;br /&gt;
If you want to install a fresh PostgreSQL database server alongside RT:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install postgresql&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install postgresql-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In order to set up RT’s database, you will need a PostgreSQL account that can create databases and roles and be authenticated with a password. If you don’t have that, you can create it by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo createuser --createdb --createrole --login --pwprompt rt_admin&amp;lt;/pre&amp;gt;&lt;br /&gt;
Set the password when prompted. Record this; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
=== Enable password authentication in PostgreSQL ===&lt;br /&gt;
&lt;br /&gt;
You need to consider this step whether you install the database locally, or use an existing one already running. RT supports connecting to PostgreSQL a few different ways, but authenticating with a username and password is simplest, and this guide is written based on that. Not all PostgreSQL installations allow this authentication method by default. You need to review your &amp;lt;code&amp;gt;pg_hba.conf&amp;lt;/code&amp;gt; file located at:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;/etc/postgresql/VERSION/main/pg_hba.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;/var/lib/pgsql/VERSION/data/pg_hba.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Replace &amp;lt;code&amp;gt;VERSION&amp;lt;/code&amp;gt; with the version of your PostgreSQL database. Add these two lines &#039;&#039;&#039;above&#039;&#039;&#039; any other lines that start with &amp;lt;code&amp;gt;host&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;host  rt5  rt_user   all  md5&lt;br /&gt;
host  rt5  rt_admin  all  md5&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This configuration will let &amp;lt;code&amp;gt;rt_user&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;rt_admin&amp;lt;/code&amp;gt; authorize themselves for the &amp;lt;code&amp;gt;rt5&amp;lt;/code&amp;gt; database using an &amp;lt;code&amp;gt;md5&amp;lt;/code&amp;gt; crypted password over a network connection (possibly using the localhost loopback network). You might be able to further restrict some of these fields for improved security, but doing so is outside the scope of this install guide. Refer to [https://www.postgresql.org/docs/current/auth-pg-hba-conf.html the pg_hba.conf documentation] for more details.&lt;br /&gt;
&lt;br /&gt;
Save your changes and reload the database:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo systemctl reload postgresql&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Installing the PostgreSQL client libraries ===&lt;br /&gt;
&lt;br /&gt;
These are required for RT to be able to talk to any PostgreSQL server.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install libpq-dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install postgresql-devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Once this is done you can skip ahead to installing a web server.&lt;br /&gt;
&lt;br /&gt;
=== Installing and configuring the MariaDB server ===&lt;br /&gt;
&lt;br /&gt;
If you want to install a fresh MariaDB database server alongside RT:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install mariadb-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install mariadb-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In order to set up RT’s database, you will need a MySQL superuser account. To stay consistent with PostgreSQL, I suggest setting a password for it. You can do that by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo mysql mysql&lt;br /&gt;
MariaDB [mysql]&amp;amp;gt; GRANT ALL PRIVILEGES ON rt5.* TO rt_admin@localhost IDENTIFIED BY &#039;YourPassphraseHere&#039; WITH GRANT OPTION;&amp;lt;/pre&amp;gt;&lt;br /&gt;
Record your passphrase; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
=== Adjust MariaDB’s max_allowed_packet setting ===&lt;br /&gt;
&lt;br /&gt;
You need to consider this step whether you install the database locally, or use an existing one already running. [https://mariadb.com/kb/en/server-system-variables/#max_allowed_packet MariaDB’s &amp;lt;code&amp;gt;max_allowed_packet&amp;lt;/code&amp;gt; setting] functionally limits the size of attachments in RT. The default is 16MiB, which is too small for most installations. You can ultimately choose any setting you’re comfortable with; 64MiB here should allow most requests without being too open.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;echo -e &#039;[server]\nmax_allowed_packet=64M&#039; | sudo tee /etc/mysql/conf.d/max_allowed_packet.cnf&lt;br /&gt;
sudo systemctl reload mariadb&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;echo -e &#039;[server]\nmax_allowed_packet=64M&#039; | sudo tee /etc/my.cnf.d/max_allowed_packet.cnf&lt;br /&gt;
sudo systemctl reload mariadb&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Installing the MariaDB client libraries ===&lt;br /&gt;
&lt;br /&gt;
These are required for RT to be able to talk to any MariaDB server.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install libmariadb-dev libmariadb-dev-compat&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install mariadb-devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Install a web server with FastCGI ==&lt;br /&gt;
&lt;br /&gt;
FastCGI is the best way to host RT’s web interface today. Installing the web server before RT makes the installation process simpler, because RT will be able to automatically some details about your web server like what user it runs as.&lt;br /&gt;
&lt;br /&gt;
=== Installing Apache ===&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install apache2 libapache2-mod-fcgid&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install httpd mod_fcgid mod_ssl&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ### Installing nginx --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Install RT ==&lt;br /&gt;
&lt;br /&gt;
=== Get and unpack the RT source code ===&lt;br /&gt;
&lt;br /&gt;
Download the latest source code using the link on the [https://bestpractical.com/download-page RT download page], extract it using &amp;lt;code&amp;gt;tar -xf&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt; into the source code directory to run the rest of the commands in this section. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;curl -O https://download.bestpractical.com/pub/rt/release/rt-5.0.2.tar.gz&lt;br /&gt;
tar -xf rt-5.0.2.tar.gz&lt;br /&gt;
cd rt-5.0.2&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Pre-configure RT ===&lt;br /&gt;
&lt;br /&gt;
This command will detect some information about your system in order to install RT properly, and decide which set of dependencies to install. Here’s what the different parts of our command are doing:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;PERL=…&amp;lt;/code&amp;gt; configures RT to run under Perl with some options that load its dependencies from a dedicated directory. The &amp;lt;code&amp;gt;/opt/rt5&amp;lt;/code&amp;gt; part of this string should match your &amp;lt;code&amp;gt;prefix&amp;lt;/code&amp;gt; setting (see next item). If you know you want to use a specific Perl installed on your system, you can specify its full path instead of the plain &amp;lt;code&amp;gt;perl&amp;lt;/code&amp;gt; here.&lt;br /&gt;
* &amp;lt;code&amp;gt;--prefix=/opt/rt5&amp;lt;/code&amp;gt; sets the directory where RT will install all of its libraries, tools, and supporting files. You can choose another path if you like.&lt;br /&gt;
* &amp;lt;code&amp;gt;--with-db-type=TYPE&amp;lt;/code&amp;gt; - Replace &amp;lt;code&amp;gt;TYPE&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;Pg&amp;lt;/code&amp;gt; for PostgreSQL, or &amp;lt;code&amp;gt;mysql&amp;lt;/code&amp;gt; for MariaDB.&lt;br /&gt;
* The rest of the options tell RT to install additional dependencies for optional features.&lt;br /&gt;
&lt;br /&gt;
Make sure you have &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt;ed into the RT source directory, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;PERL=&amp;quot;/usr/bin/env -S perl -I/opt/rt5/local/lib/perl5&amp;quot; ./configure --prefix=/opt/rt5 --with-db-type=TYPE --with-attachment-store=disk --enable-externalauth --enable-gd --enable-graphviz --enable-gpg --enable-smime&amp;lt;/pre&amp;gt;&lt;br /&gt;
For more background, [https://docs.bestpractical.com/rt/latest/configure.html refer to the RT configure options documentation].&lt;br /&gt;
&lt;br /&gt;
=== Install RT and its Perl dependencies ===&lt;br /&gt;
&lt;br /&gt;
This command will download, build, and install all of the Perl modules necessary to run RT with the configuration you set above. Here’s what the different parts of the command are doing:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;make dirs&amp;lt;/code&amp;gt; creates RT&#039;s directory structure, so we can install dependencies inside it.&lt;br /&gt;
* &amp;lt;code&amp;gt;make fixdeps&amp;lt;/code&amp;gt; actually installs those dependencies.&lt;br /&gt;
* &amp;lt;code&amp;gt;RT_FIX_DEPS_CMD=…&amp;lt;/code&amp;gt; tells RT to use cpanminus to install dependencies (instead of the older, default &amp;lt;code&amp;gt;cpan&amp;lt;/code&amp;gt; command) inside RT&#039;s directory structure.&lt;br /&gt;
* &amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt; installs all of RT’s files under &amp;lt;code&amp;gt;/opt/rt5&amp;lt;/code&amp;gt; (or the prefix directory you set earlier). It will only run if &amp;lt;code&amp;gt;fixdeps&amp;lt;/code&amp;gt; succeeded.&lt;br /&gt;
&lt;br /&gt;
Make sure you have &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt;ed into the RT source directory, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo make dirs&lt;br /&gt;
make fixdeps RT_FIX_DEPS_CMD=&amp;quot;cpanm --sudo --local-lib-contained=/opt/rt5/local&amp;quot;&lt;br /&gt;
sudo make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
If it works, the command will eventually output a message that says “Congratulations. RT is now installed.” followed by instructions about configuring and setting up the database. We’ll do that next.&lt;br /&gt;
&lt;br /&gt;
=== Configure RT ===&lt;br /&gt;
&lt;br /&gt;
[https://docs.bestpractical.com/rt/latest/RT_Config.html RT has many configuration options.] You can put configuration options in the file &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/code&amp;gt;, or in individual files under &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.d/&amp;lt;/code&amp;gt;. Use an editor to save all the text below to &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/code&amp;gt; (you can just overwrite the existing file, or add this to the bottom of what’s there) and then fill in settings for your site everywhere the text &amp;lt;code&amp;gt;EDIT WITH&amp;lt;/code&amp;gt; appears.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Single-quote all values EXCEPT the special value `undef`&lt;br /&gt;
# that turns off a setting.&lt;br /&gt;
&lt;br /&gt;
# rtname appears in ticket email subjects. It needs to be globally unique,&lt;br /&gt;
# so use your organization&#039;s domain name.&lt;br /&gt;
Set($rtname, &#039;EDIT WITH yourdomain.example.com&#039;);&lt;br /&gt;
# Organization is used in the database for ticket links, etc. It also needs to&lt;br /&gt;
# be globally unique, so use your organization&#039;s domain name.&lt;br /&gt;
Set($Organization, &#039;EDIT WITH yourdomain.example.com&#039;);&lt;br /&gt;
# WebDomain is domain name of the RT web server. RT uses it to construct links&lt;br /&gt;
# and defend against CSRFs.&lt;br /&gt;
Set($WebDomain, &#039;EDIT WITH rt.yourdomain.example.com&#039;);&lt;br /&gt;
# WebPort is the port where the RT web server runs. Edit the number below if&lt;br /&gt;
# you&#039;re not using the standard HTTPS port.&lt;br /&gt;
Set($WebPort, &#039;443&#039;);&lt;br /&gt;
&lt;br /&gt;
# DatabaseUser is the name of the database account RT uses to read and store&lt;br /&gt;
# data. &#039;rt_user&#039; is the default but you can change it if you like.&lt;br /&gt;
# DO NOT use the &#039;rt_admin&#039; superuser created in the instructions above.&lt;br /&gt;
Set($DatabaseUser, &#039;rt_user&#039;);&lt;br /&gt;
# DatabasePassword is the password for DatabaseUser.&lt;br /&gt;
Set($DatabasePassword, &#039;EDIT WITH SomePassphraseHere&#039;);&lt;br /&gt;
# DatabaseHost is the hostname of the database server RT should use.&lt;br /&gt;
# Change &#039;localhost&#039; if it lives on a different server.&lt;br /&gt;
Set($DatabaseHost, &#039;localhost&#039;);&lt;br /&gt;
# DatabasePort is the port number of the database server RT should use.&lt;br /&gt;
# `undef` means the default for that database. Change it if you&#039;re not&lt;br /&gt;
# using the standard port.&lt;br /&gt;
Set($DatabasePort, undef);&lt;br /&gt;
# DatabaseName is the name of RT&#039;s database hosted on DatabaseHost.&lt;br /&gt;
# &#039;rt5&#039; is the default but you can change it if you like.&lt;br /&gt;
Set($DatabaseName, &#039;rt5&#039;);&lt;br /&gt;
# DatabaseAdmin is the name of the user in the database used to perform&lt;br /&gt;
# major administrative tasks. Change &#039;rt_admin&#039; if you&#039;re using a user&lt;br /&gt;
# besides the one created in this guide.&lt;br /&gt;
Set($DatabaseAdmin, &#039;rt_admin&#039;);&lt;br /&gt;
&lt;br /&gt;
# RT can log to syslog, stderr, and/or a dedicated file.&lt;br /&gt;
# Log settings are used both by the primary server and by command line&lt;br /&gt;
# tools like rt-crontool, rt-ldapimport, etc.&lt;br /&gt;
# You set all of RT&#039;s $LogTo* paramaters to a standard log level: &#039;debug&#039;,&lt;br /&gt;
# &#039;info&#039;, &#039;notice&#039;, &#039;warning&#039;, &#039;error&#039;, &#039;critical&#039;, &#039;alert&#039;, or &#039;emergency&#039;.&lt;br /&gt;
# For a modern install, I recommend logging primarily to syslog, so it goes&lt;br /&gt;
# to journald where it&#039;s easy to query and automatically gets rotated.&lt;br /&gt;
Set($LogToSyslog, &#039;info&#039;);&lt;br /&gt;
&lt;br /&gt;
# When the RT server logs to stderr, that usually goes to your web server&#039;s&lt;br /&gt;
# error log. Command line tools log to their own stderr. Setting this to&lt;br /&gt;
# &#039;warning&#039; or &#039;error&#039; helps ensure you get notified if RT&#039;s cron jobs&lt;br /&gt;
# encounter problems.&lt;br /&gt;
Set($LogToSTDERR, &#039;warning&#039;);&lt;br /&gt;
&lt;br /&gt;
# Turn off optional features that require additional configuration.&lt;br /&gt;
# If you want to use these, refer to the RT_Config documentation for&lt;br /&gt;
# instructions on how to set them up.&lt;br /&gt;
Set(%GnuPG, &#039;Enable&#039; =&amp;gt; &#039;0&#039;);&lt;br /&gt;
Set(%SMIME, &#039;Enable&#039; =&amp;gt; &#039;0&#039;);&lt;br /&gt;
&lt;br /&gt;
# Perl expects to find this 1 at the end of the file.&lt;br /&gt;
1;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;RT_SiteConfig.pm&amp;lt;/code&amp;gt; is actually Perl code. RT runs the code directly to load the configuration. Any time you finish editing it, you can check that you didn’t make any syntax errors by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;perl -c /opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Set up RT’s database ===&lt;br /&gt;
&lt;br /&gt;
RT includes a tool to help you set up its database. By default, it connects to the database as an administrator to create the database and user that you configured in the previous step.&lt;br /&gt;
&lt;br /&gt;
(The instructions from &amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt; and RT’s README file tell you to run &amp;lt;code&amp;gt;make initialize-database&amp;lt;/code&amp;gt;. That just runs &amp;lt;code&amp;gt;rt-setup-database&amp;lt;/code&amp;gt; for you. Running the tool directly makes it easier to pass the options you need.)&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;--action=init&amp;lt;/code&amp;gt; tells the tool to create the user, the database, the tables inside it, and insert core data RT needs to function.&lt;br /&gt;
* &#039;&#039;&#039;If&#039;&#039;&#039; you are using an existing database server and the database adminstrator has already created the user account and database for RT, then you can add the &amp;lt;code&amp;gt;--skip-create&amp;lt;/code&amp;gt; option.&lt;br /&gt;
* &#039;&#039;&#039;If&#039;&#039;&#039; you have a less common database setup, this tool has additional options to give you finer-grained control over what steps are run and how. Refer to [https://docs.bestpractical.com/rt/latest/rt-setup-database.html the full rt-setup-database documentation] to learn more about those.&lt;br /&gt;
* The command reads files from RT’s &amp;lt;code&amp;gt;etc/&amp;lt;/code&amp;gt; directory by default, so the easiest way to run it is to &amp;lt;code&amp;gt;cd /opt/rt5&amp;lt;/code&amp;gt; first, and then it will find the necessary files automatically.&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /opt/rt5&lt;br /&gt;
sudo sbin/rt-setup-database --action=init&amp;lt;/pre&amp;gt;&lt;br /&gt;
Enter the password for your database administrator account when prompted.&lt;br /&gt;
&lt;br /&gt;
=== Set up fulltext indexing ===&lt;br /&gt;
&lt;br /&gt;
Fulltext indexing speeds up searches for ticket content, which makes RT a lot nicer to use.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;--noask&amp;lt;/code&amp;gt; uses the default names for the index, which will be fine for a new install and simplifies the setup.&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo /opt/rt5/sbin/rt-setup-fulltext-index --noask&amp;lt;/pre&amp;gt;&lt;br /&gt;
Enter the password for your database administrator account when prompted. The end of the process will output some RT configuration that looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;### EXAMPLE OUTPUT ONLY - Don&#039;t use this directly!&lt;br /&gt;
Set( %FullTextSearch,&lt;br /&gt;
    Enable     =&amp;gt; 1,&lt;br /&gt;
    Indexed    =&amp;gt; 1,&lt;br /&gt;
    # Additional output from rt-setup-fulltext-index should be here.&lt;br /&gt;
    # The configuration varies by database type.&lt;br /&gt;
);&amp;lt;/pre&amp;gt;&lt;br /&gt;
Copy the output generated when you run &amp;lt;code&amp;gt;rt-setup-fulltext-index&amp;lt;/code&amp;gt; and save it to the file &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.d/FulltextIndex.pm&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Set permissions ===&lt;br /&gt;
&lt;br /&gt;
All of RT’s configuration files should be readable by the user that runs the web server, and no other users, in order to protect sensitive information like the database password. RT provides a command to set permissions appropriately according to your distribution and configuration. &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt; to the directory where you extracted the RT source code, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd rt-5.0.2&lt;br /&gt;
sudo make fixperms&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Verify the installation ===&lt;br /&gt;
&lt;br /&gt;
If everything has gone well, then you should be able to set a password for RT’s &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; user. You’ll use this later to log in to the web interface and continue setting up your system. Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo /opt/rt5/sbin/rt-passwd root&amp;lt;/pre&amp;gt;&lt;br /&gt;
Set the password when prompted. Record this; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s web server ==&lt;br /&gt;
&lt;br /&gt;
=== Configure Apache modules ===&lt;br /&gt;
&lt;br /&gt;
You will need to have the following modules enabled in Apache to run RT. You should already have these installed if you followed the instructions above.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;alias&amp;lt;/code&amp;gt; (required to map URLs to RT)&lt;br /&gt;
* &amp;lt;code&amp;gt;fcgid&amp;lt;/code&amp;gt; (required for Apache to talk to RT)&lt;br /&gt;
* &amp;lt;code&amp;gt;mpm_prefork&amp;lt;/code&amp;gt; (Apache requires you to select an MPM. RT is designed to work with the prefork module.)&lt;br /&gt;
* &amp;lt;code&amp;gt;ssl&amp;lt;/code&amp;gt; (required to serve HTTPS; optional otherwise)&lt;br /&gt;
&lt;br /&gt;
Enable them following these instructions:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo a2dismod mpm_event&lt;br /&gt;
sudo a2enmod fcgid&lt;br /&gt;
sudo a2enmod mpm_prefork&lt;br /&gt;
sudo a2enmod ssl&amp;lt;/pre&amp;gt;&lt;br /&gt;
| &amp;lt;pre&amp;gt;echo LoadModule mpm_prefork_module modules/mod_mpm_prefork.so | sudo tee /etc/httpd/conf.modules.d/00-mpm.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Disable default VirtualHosts (optional) ===&lt;br /&gt;
&lt;br /&gt;
If this web server is dedicated to RT, then you should disable the VirtualHosts that are included with the stock configuration. Run:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo a2dissite 000-default&lt;br /&gt;
sudo a2dissite default-ssl&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo sed -i~ &#039;/^&amp;lt;VirtualHost\b/ , /^&amp;lt;\/VirtualHost\b/ d&#039; /etc/httpd/conf.d/ssl.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Configure an Apache VirtualHost ===&lt;br /&gt;
&lt;br /&gt;
Create a file at the following location. You can change the &amp;lt;code&amp;gt;RT&amp;lt;/code&amp;gt; part of the filename if you like, but the file must exist in this directory and have a &amp;lt;code&amp;gt;.conf&amp;lt;/code&amp;gt; suffix.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;/etc/apache2/sites-available/RT.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
Then after you create the file, run: &amp;lt;code&amp;gt;sudo a2ensite RT&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;/etc/httpd/conf.d/vhost_RT.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
(This filename needs to come after &amp;lt;code&amp;gt;ssl.conf&amp;lt;/code&amp;gt; in the directory listing.)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Use an editor to save all the text below to the new &amp;lt;code&amp;gt;RT.conf&amp;lt;/code&amp;gt; and then fill in settings for your site everywhere the text &amp;lt;code&amp;gt;EDIT WITH&amp;lt;/code&amp;gt; appears.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### Primary RT VirtualHost&lt;br /&gt;
# You can change both the bind address and/or the port here as required.&lt;br /&gt;
# This default will listen for HTTPS connections on all interfaces.&lt;br /&gt;
&amp;lt;VirtualHost *:443&amp;gt;&lt;br /&gt;
  # EDIT HERE with the domain name of the web server.&lt;br /&gt;
  ServerName rt.yourdomain.example.com&lt;br /&gt;
  &amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
    SSLEngine on&lt;br /&gt;
    # These specify the paths to the SSL certificate and private key Apache&lt;br /&gt;
    # should use. These example paths are common for Let&#039;s Encrypt. If you&lt;br /&gt;
    # don&#039;t use Let&#039;s Encrypt, the standard location for these files is under&lt;br /&gt;
    # (Debian/Ubuntu) /etc/ssl&lt;br /&gt;
    # (Red Hat/Fedora/CentOS) /etc/pki/tls&lt;br /&gt;
    # EDIT HERE with the appropriate paths for your server&lt;br /&gt;
    SSLCertificateFile /etc/letsencrypt/live/example.com/fullchain.pem&lt;br /&gt;
    SSLCertificateKeyFile /etc/letsencrypt/live/example.com/privkey.pem&lt;br /&gt;
  &amp;lt;/IfModule&amp;gt;&lt;br /&gt;
  &amp;lt;Location /&amp;gt;&lt;br /&gt;
    Require all granted&lt;br /&gt;
    Options +ExecCGI&lt;br /&gt;
    AddHandler fcgid-script fcgi&lt;br /&gt;
  &amp;lt;/Location&amp;gt;&lt;br /&gt;
  AddDefaultCharset UTF-8&lt;br /&gt;
  DocumentRoot /opt/rt5/share/html&lt;br /&gt;
  ScriptAlias / /opt/rt5/sbin/rt-server.fcgi/&lt;br /&gt;
  # The default mod_fcgid timeout is 40 seconds.&lt;br /&gt;
  # We increase it here to allow for large ticket searches, etc.&lt;br /&gt;
  FcgidIOTimeout 200&lt;br /&gt;
  # mod_fcgid only allows 128KiB requests by default. This is too small for users&lt;br /&gt;
  # to upload files to RT. You can ultimately choose any setting you&#039;re&lt;br /&gt;
  # comfortable with; 70MiB here should allow most requests without being too&lt;br /&gt;
  # open.&lt;br /&gt;
  FcgidMaxRequestLen 73400320&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
### End primary RT VirtualHost&lt;br /&gt;
&lt;br /&gt;
### Optional HTTPS Redirect VirtualHost&lt;br /&gt;
# Most modern servers support HTTPS and want all web traffic to go through it.&lt;br /&gt;
# This VirtualHost redirects normal HTTP traffic to HTTPS.&lt;br /&gt;
# You can delete this whole section if you don&#039;t want or need this.&lt;br /&gt;
&amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
  # You can change both the bind address and/or the port here as required.&lt;br /&gt;
  # This default will listen for HTTP connections on all interfaces.&lt;br /&gt;
  &amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
    SSLEngine off&lt;br /&gt;
    # EDIT HERE both lines below with the domain name of your web server.&lt;br /&gt;
    ServerName rt.yourdomain.example.com&lt;br /&gt;
    Redirect permanent / https://rt.yourdomain.example.com/&lt;br /&gt;
  &amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/IfModule&amp;gt;&lt;br /&gt;
### End optional HTTPS Redirect VirtualHost&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
After you’ve edited the file, load the configuration with:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo systemctl reload apache2&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo systemctl reload httpd&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If this command reports an error, double-check the configuration file for typos, especially in option names, file paths, and the&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;amp;lt;Section&amp;amp;gt;&amp;lt;/code&amp;gt; pairs. Edit again and reload the configuration until it succeeds without output.&lt;br /&gt;
&lt;br /&gt;
=== Verify the web interface ===&lt;br /&gt;
&lt;br /&gt;
You should be able to visit your web server in your browser, and be presented with RT’s login screen. You should be able to log in with username &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; and the password you set previously.&lt;br /&gt;
&lt;br /&gt;
If you run into trouble, the first place to look for more information is by reading Apache’s error log:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo less /var/log/apache2/error.log&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo less /var/log/httpd/error.log&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s mail server ==&lt;br /&gt;
&lt;br /&gt;
RT both can both send and receive ticket updates via email. Unfortunately, there are too many variables to document a useful setup process here: getting this working usually requires creating DNS records, and coordinating with existing mail servers, which will be the main constraint on your setup. Instead this guide provides a brief overview of how the integration works, and where the connection points are that you likely need to work on.&lt;br /&gt;
&lt;br /&gt;
=== Sending Mail ===&lt;br /&gt;
&lt;br /&gt;
RT only knows how to send mail by passing it off to another program on the system. It cannot connect or authenticate directly to external mail servers. In the default configuration, RT runs the standard &amp;lt;code&amp;gt;sendmail&amp;lt;/code&amp;gt; command. There are [https://docs.bestpractical.com/rt/latest/RT_Config.html#Outgoing-mail configuration options to send mail through different commands] if you need.&lt;br /&gt;
&lt;br /&gt;
The most common setup is to install and configure a proper Mail Transfer Agent (MTA) like Postfix or Exim, and then configure it to send mail to the wider Internet as you need. This works well because the MTAs are robust and well-tested; they have flexible configuration to let you send mail out by relaying to other mail servers you specify with optional authentication; and most distributions install one by default anyway. The only hard part is configuring the MTA to send mail following your site’s policies.&lt;br /&gt;
&lt;br /&gt;
Other software is available that provides a slimmer version of the &amp;lt;code&amp;gt;sendmail&amp;lt;/code&amp;gt; command that connects to an external mail server for you, like ssmtp. These programs are usually easier to configure than an MTA, but they often lose email permanently if they can’t connect to the external server at the time it’s sent. (MTAs keep email queued locally until they successfully deliver it to another server.)&lt;br /&gt;
&lt;br /&gt;
=== Receiving email ===&lt;br /&gt;
&lt;br /&gt;
RT installs a command called &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; that receives an email on standard input and posts it to RT’s REST web interface, where it gets saved in the database and added to a ticket. You need to arrange for a way to send incoming email to this command.&lt;br /&gt;
&lt;br /&gt;
The most common setup is to have an MTA on the same box as RT receive email directly, and then set up mail aliases that call this command when mail comes in. Example &amp;lt;code&amp;gt;/etc/aliases&amp;lt;/code&amp;gt; entries look like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rt: &amp;quot;|/opt/rt5/bin/rt-mailgate --queue general --action correspond --url https://rt.yourdomain.example.com/&amp;quot;&lt;br /&gt;
rt-comment: &amp;quot;|/opt/rt5/bin/rt-mailgate --queue general --action comment --url https://rt.yourdomain.example.com/&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
This works well because, again, you’re probably running an MTA anyway; and the MTA can hold and queue mail if it comes in while RT is down for any reason, giving you a buffer against downtime.&lt;br /&gt;
&lt;br /&gt;
Another common option is to periodically run a tool that fetches mail using a protocol like IMAP, like fetchmail or getmail, and passes it on to &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt;. This is less common because it requires setting up another tool to run, and securely storing another set of mail server credentials. But it is useful when local policy prevents the RT server from receiving email directly.&lt;br /&gt;
&lt;br /&gt;
This is much less common, but it might help to know that &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; doesn’t have to run on the same system as RT itself. It just needs to be able to connect to RT’s web interface. If you don’t have any other options, you can install the RT software on a different system that receives email, and configure &#039;&#039;that&#039;&#039; system to run &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; and pass it on to the RT server. To do that, just repeat the installation instructions above, skipping the steps about installing the database and web server.&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s background jobs ==&lt;br /&gt;
&lt;br /&gt;
Create a file &amp;lt;code&amp;gt;/etc/cron.d/rt&amp;lt;/code&amp;gt; with the following content. You may edit all of the time fields as you see fit. Refer to the crontab(5) man page for details about their definitions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Update the fulltext index with new ticket data&lt;br /&gt;
*/3 *   *   *   *   root    /opt/rt5/sbin/rt-fulltext-indexer&lt;br /&gt;
# Email out dashboards that users have subscribed to&lt;br /&gt;
0   *   *   *   *   root    /opt/rt5/sbin/rt-email-dashboards&lt;br /&gt;
# Clean old sessions from the database&lt;br /&gt;
10  3   *   *   *   root    /opt/rt5/sbin/rt-clean-sessions --older 8d&lt;br /&gt;
# Email out weekly digests for users who have requested it&lt;br /&gt;
50  4   *   *   Mon root    /opt/rt5/sbin/rt-email-digest -m weekly&lt;br /&gt;
# Email out daily digests for users who have requested it&lt;br /&gt;
50  5   *   *   *   root    /opt/rt5/sbin/rt-email-digest -m daily&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
You can run all these jobs as the same user that runs your web server, rather than root. Run:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo sed -i &#039;s/\broot\b/www-data/&#039; /etc/cron.d/rt&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo sed -i &#039;s/\broot\b/apache/&#039; /etc/cron.d/rt&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Set up RT ==&lt;br /&gt;
&lt;br /&gt;
If you’ve gotten this far, congratulations, your RT install is really done now. You can start setting up RT with users, groups, queues, and business logic. [[Main Page|Head back to the main page]] to start exploring those topics.&lt;/div&gt;</summary>
		<author><name>Brett</name></author>
	</entry>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=ManualInstallation&amp;diff=27073</id>
		<title>ManualInstallation</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=ManualInstallation&amp;diff=27073"/>
		<updated>2022-03-10T18:06:39Z</updated>

		<summary type="html">&lt;p&gt;Brett: narrow max_allowed_packet section&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Prev: [[ManualRequirements]] — Up: [[UserManual]] — Next: [[ManualApacheConfig]]&lt;br /&gt;
&lt;br /&gt;
This guide walks you through installing RT from source on a modern, popular Linux distro. Specifically, that means a distribution based on Debian or Red Hat that’s been released since around 2020.&lt;br /&gt;
&lt;br /&gt;
This guide assumes:&lt;br /&gt;
&lt;br /&gt;
* You can install packages generally available in Debian/Ubuntu or Red Hat/Fedora/CentOS.&lt;br /&gt;
* You want to install RT, and all of its Perl dependencies, from source to get the latest versions. (This is a trade-off. It means the boundaries of your install will be very clear, but you won’t get security updates for RT or Perl modules from your distribution.)&lt;br /&gt;
* You are willing to install a couple of extra tools to manage the RT installation similarly to how you would in other packaging systems (like PyPI, npm, etc.).&lt;br /&gt;
* You are willing to do a relatively maximal install of RT, enabling all the options during installation and then setting what you need in the configuration. (You could save a little space and time by being pickier about your options, but then that complicates the guide and makes it harder to turn those options on later if you want.)&lt;br /&gt;
* You are using a regular user account on the Linux system that can get superuser privileges with sudo.&lt;br /&gt;
&lt;br /&gt;
== Install the base dependencies ==&lt;br /&gt;
&lt;br /&gt;
These are required by RT, either to run or to install the dependencies.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install autoconf build-essential cpanminus curl libexpat-dev libgd-dev libssl-dev libz-dev gnupg graphviz lynx openssl perl&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf config-manager --set-enabled powertools&lt;br /&gt;
sudo dnf install patch tar which gcc gcc-c++ perl-core perl-App-cpanminus graphviz expat-devel gd-devel lynx openssl openssl-devel&lt;br /&gt;
sudo setenforce 0&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
(Turning off SELinux enforcement is required on Red Hat-based distributions because, as of October 2021, nobody has written a policy for RT.)&lt;br /&gt;
&lt;br /&gt;
== Install a database ==&lt;br /&gt;
&lt;br /&gt;
You need access to a database server. It can be remote, or you can install a database server alongside RT. RT supports a few different databases, but the best supported options are PostgreSQL and MariaDB.&lt;br /&gt;
&lt;br /&gt;
=== Installing and configuring the PostgreSQL server ===&lt;br /&gt;
&lt;br /&gt;
If you want to install a fresh PostgreSQL database server alongside RT:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install postgresql&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install postgresql-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In order to set up RT’s database, you will need a PostgreSQL account that can create databases and roles and be authenticated with a password. If you don’t have that, you can create it by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo createuser --createdb --createrole --login --pwprompt rt_admin&amp;lt;/pre&amp;gt;&lt;br /&gt;
Set the password when prompted. Record this; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
=== Enable password authentication in PostgreSQL ===&lt;br /&gt;
&lt;br /&gt;
You need to consider this step whether you install the database locally, or use an existing one already running. RT supports connecting to PostgreSQL a few different ways, but authenticating with a username and password is simplest, and this guide is written based on that. Not all PostgreSQL installations allow this authentication method by default. You need to review your &amp;lt;code&amp;gt;pg_hba.conf&amp;lt;/code&amp;gt; file located at:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;/etc/postgresql/VERSION/main/pg_hba.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;/var/lib/pgsql/VERSION/data/pg_hba.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Replace &amp;lt;code&amp;gt;VERSION&amp;lt;/code&amp;gt; with the version of your PostgreSQL database. Add these two lines &#039;&#039;&#039;above&#039;&#039;&#039; any other lines that start with &amp;lt;code&amp;gt;host&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;host  rt5  rt_user   all  md5&lt;br /&gt;
host  rt5  rt_admin  all  md5&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This configuration will let &amp;lt;code&amp;gt;rt_user&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;rt_admin&amp;lt;/code&amp;gt; authorize themselves for the &amp;lt;code&amp;gt;rt5&amp;lt;/code&amp;gt; database using an &amp;lt;code&amp;gt;md5&amp;lt;/code&amp;gt; crypted password over a network connection (possibly using the localhost loopback network). You might be able to further restrict some of these fields for improved security, but doing so is outside the scope of this install guide. Refer to [https://www.postgresql.org/docs/current/auth-pg-hba-conf.html the pg_hba.conf documentation] for more details.&lt;br /&gt;
&lt;br /&gt;
Save your changes and reload the database:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo systemctl reload postgresql&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Installing the PostgreSQL client libraries ===&lt;br /&gt;
&lt;br /&gt;
These are required for RT to be able to talk to any PostgreSQL server.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install libpq-dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install postgresql-devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Once this is done you can skip ahead to installing a web server.&lt;br /&gt;
&lt;br /&gt;
=== Installing and configuring the MariaDB server ===&lt;br /&gt;
&lt;br /&gt;
If you want to install a fresh MariaDB database server alongside RT:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install mariadb-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install mariadb-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In order to set up RT’s database, you will need a MySQL superuser account. To stay consistent with PostgreSQL, I suggest setting a password for it. You can do that by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo mysql mysql&lt;br /&gt;
MariaDB [mysql]&amp;amp;gt; GRANT ALL PRIVILEGES ON rt5.* TO rt_admin@localhost IDENTIFIED BY &#039;YourPassphraseHere&#039; WITH GRANT OPTION;&amp;lt;/pre&amp;gt;&lt;br /&gt;
Record your passphrase; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
=== Adjust MariaDB’s max_allowed_packet setting ===&lt;br /&gt;
&lt;br /&gt;
You need to consider this step whether you install the database locally, or use an existing one already running. [https://mariadb.com/kb/en/server-system-variables/#max_allowed_packet MariaDB’s &amp;lt;code&amp;gt;max_allowed_packet&amp;lt;/code&amp;gt; setting] functionally limits the size of attachments in RT. The default is 16MiB, which is too small for most installations. You can ultimately choose any setting you’re comfortable with; 64MiB here should allow most requests without being too open.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;echo -e &#039;[server]\nmax_allowed_packet=64M&#039; | sudo tee /etc/mysql/conf.d/max_allowed_packet.cnf&lt;br /&gt;
sudo systemctl reload mariadb&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;echo -e &#039;[server]\nmax_allowed_packet=64M&#039; | sudo tee /etc/my.cnf.d/max_allowed_packet.cnf&lt;br /&gt;
sudo systemctl reload mariadb&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Installing the MariaDB client libraries ===&lt;br /&gt;
&lt;br /&gt;
These are required for RT to be able to talk to any MariaDB server.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install libmariadb-dev libmariadb-dev-compat&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install mariadb-devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Install a web server with FastCGI ==&lt;br /&gt;
&lt;br /&gt;
FastCGI is the best way to host RT’s web interface today. Installing the web server before RT makes the installation process simpler, because RT will be able to automatically some details about your web server like what user it runs as.&lt;br /&gt;
&lt;br /&gt;
=== Installing Apache ===&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install apache2 libapache2-mod-fcgid&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install httpd mod_fcgid mod_ssl&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ### Installing nginx --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Install RT ==&lt;br /&gt;
&lt;br /&gt;
=== Get and unpack the RT source code ===&lt;br /&gt;
&lt;br /&gt;
Download the latest source code using the link on the [https://bestpractical.com/download-page RT download page], extract it using &amp;lt;code&amp;gt;tar -xf&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt; into the source code directory to run the rest of the commands in this section. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;curl -O https://download.bestpractical.com/pub/rt/release/rt-5.0.2.tar.gz&lt;br /&gt;
tar -xf rt-5.0.2.tar.gz&lt;br /&gt;
cd rt-5.0.2&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Pre-configure RT ===&lt;br /&gt;
&lt;br /&gt;
This command will detect some information about your system in order to install RT properly, and decide which set of dependencies to install. Here’s what the different parts of our command are doing:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;PERL=…&amp;lt;/code&amp;gt; configures RT to run under Perl with some options that load its dependencies from a dedicated directory. The &amp;lt;code&amp;gt;/opt/rt5&amp;lt;/code&amp;gt; part of this string should match your &amp;lt;code&amp;gt;prefix&amp;lt;/code&amp;gt; setting (see next item). If you know you want to use a specific Perl installed on your system, you can specify its full path instead of the plain &amp;lt;code&amp;gt;perl&amp;lt;/code&amp;gt; here.&lt;br /&gt;
* &amp;lt;code&amp;gt;--prefix=/opt/rt5&amp;lt;/code&amp;gt; sets the directory where RT will install all of its libraries, tools, and supporting files. You can choose another path if you like.&lt;br /&gt;
* &amp;lt;code&amp;gt;--with-db-type=TYPE&amp;lt;/code&amp;gt; - Replace &amp;lt;code&amp;gt;TYPE&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;Pg&amp;lt;/code&amp;gt; for PostgreSQL, or &amp;lt;code&amp;gt;mysql&amp;lt;/code&amp;gt; for MariaDB.&lt;br /&gt;
* The rest of the options tell RT to install additional dependencies for optional features.&lt;br /&gt;
&lt;br /&gt;
Make sure you have &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt;ed into the RT source directory, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;PERL=&amp;quot;/usr/bin/env -S perl -I/opt/rt5/local/lib/perl5&amp;quot; ./configure --prefix=/opt/rt5 --with-db-type=TYPE --with-attachment-store=disk --enable-externalauth --enable-gd --enable-graphviz --enable-gpg --enable-smime&amp;lt;/pre&amp;gt;&lt;br /&gt;
For more background, [https://docs.bestpractical.com/rt/latest/configure.html refer to the RT configure options documentation].&lt;br /&gt;
&lt;br /&gt;
=== Install RT and its Perl dependencies ===&lt;br /&gt;
&lt;br /&gt;
This command will download, build, and install all of the Perl modules necessary to run RT with the configuration you set above. Here’s what the different parts of the command are doing:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;make dirs&amp;lt;/code&amp;gt; creates RT&#039;s directory structure, so we can install dependencies inside it.&lt;br /&gt;
* &amp;lt;code&amp;gt;make fixdeps&amp;lt;/code&amp;gt; actually installs those dependencies.&lt;br /&gt;
* &amp;lt;code&amp;gt;RT_FIX_DEPS_CMD=…&amp;lt;/code&amp;gt; tells RT to use cpanminus to install dependencies (instead of the older, default &amp;lt;code&amp;gt;cpan&amp;lt;/code&amp;gt; command) inside RT&#039;s directory structure.&lt;br /&gt;
* &amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt; installs all of RT’s files under &amp;lt;code&amp;gt;/opt/rt5&amp;lt;/code&amp;gt; (or the prefix directory you set earlier). It will only run if &amp;lt;code&amp;gt;fixdeps&amp;lt;/code&amp;gt; succeeded.&lt;br /&gt;
&lt;br /&gt;
Make sure you have &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt;ed into the RT source directory, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo make dirs&lt;br /&gt;
make fixdeps RT_FIX_DEPS_CMD=&amp;quot;cpanm --sudo --local-lib-contained=/opt/rt5/local&amp;quot;&lt;br /&gt;
sudo make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
If it works, the command will eventually output a message that says “Congratulations. RT is now installed.” followed by instructions about configuring and setting up the database. We’ll do that next.&lt;br /&gt;
&lt;br /&gt;
=== Configure RT ===&lt;br /&gt;
&lt;br /&gt;
[https://docs.bestpractical.com/rt/latest/RT_Config.html RT has many configuration options.] You can put configuration options in the file &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/code&amp;gt;, or in individual files under &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.d/&amp;lt;/code&amp;gt;. Use an editor to save all the text below to &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/code&amp;gt; (you can just overwrite the existing file, or add this to the bottom of what’s there) and then fill in settings for your site everywhere the text &amp;lt;code&amp;gt;EDIT WITH&amp;lt;/code&amp;gt; appears.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Single-quote all values EXCEPT the special value `undef`&lt;br /&gt;
# that turns off a setting.&lt;br /&gt;
&lt;br /&gt;
# rtname appears in ticket email subjects. It needs to be globally unique,&lt;br /&gt;
# so use your organization&#039;s domain name.&lt;br /&gt;
Set($rtname, &#039;EDIT WITH yourdomain.example.com&#039;);&lt;br /&gt;
# Organization is used in the database for ticket links, etc. It also needs to&lt;br /&gt;
# be globally unique, so use your organization&#039;s domain name.&lt;br /&gt;
Set($Organization, &#039;EDIT WITH yourdomain.example.com&#039;);&lt;br /&gt;
# WebDomain is domain name of the RT web server. RT uses it to construct links&lt;br /&gt;
# and defend against CSRFs.&lt;br /&gt;
Set($WebDomain, &#039;EDIT WITH rt.yourdomain.example.com&#039;);&lt;br /&gt;
# WebPort is the port where the RT web server runs. Edit the number below if&lt;br /&gt;
# you&#039;re not using the standard HTTPS port.&lt;br /&gt;
Set($WebPort, &#039;443&#039;);&lt;br /&gt;
&lt;br /&gt;
# DatabaseUser is the name of the database account RT uses to read and store&lt;br /&gt;
# data. &#039;rt_user&#039; is the default but you can change it if you like.&lt;br /&gt;
# DO NOT use the &#039;rt_admin&#039; superuser created in the instructions above.&lt;br /&gt;
Set($DatabaseUser, &#039;rt_user&#039;);&lt;br /&gt;
# DatabasePassword is the password for DatabaseUser.&lt;br /&gt;
Set($DatabasePassword, &#039;EDIT WITH SomePassphraseHere&#039;);&lt;br /&gt;
# DatabaseHost is the hostname of the database server RT should use.&lt;br /&gt;
# Change &#039;localhost&#039; if it lives on a different server.&lt;br /&gt;
Set($DatabaseHost, &#039;localhost&#039;);&lt;br /&gt;
# DatabasePort is the port number of the database server RT should use.&lt;br /&gt;
# `undef` means the default for that database. Change it if you&#039;re not&lt;br /&gt;
# using the standard port.&lt;br /&gt;
Set($DatabasePort, undef);&lt;br /&gt;
# DatabaseName is the name of RT&#039;s database hosted on DatabaseHost.&lt;br /&gt;
# &#039;rt5&#039; is the default but you can change it if you like.&lt;br /&gt;
Set($DatabaseName, &#039;rt5&#039;);&lt;br /&gt;
# DatabaseAdmin is the name of the user in the database used to perform&lt;br /&gt;
# major administrative tasks. Change &#039;rt_admin&#039; if you&#039;re using a user&lt;br /&gt;
# besides the one created in this guide.&lt;br /&gt;
Set($DatabaseAdmin, &#039;rt_admin&#039;);&lt;br /&gt;
&lt;br /&gt;
# RT can log to syslog, stderr, and/or a dedicated file.&lt;br /&gt;
# Log settings are used both by the primary server and by command line&lt;br /&gt;
# tools like rt-crontool, rt-ldapimport, etc.&lt;br /&gt;
# You set all of RT&#039;s $LogTo* paramaters to a standard log level: &#039;debug&#039;,&lt;br /&gt;
# &#039;info&#039;, &#039;notice&#039;, &#039;warning&#039;, &#039;error&#039;, &#039;critical&#039;, &#039;alert&#039;, or &#039;emergency&#039;.&lt;br /&gt;
# For a modern install, I recommend logging primarily to syslog, so it goes&lt;br /&gt;
# to journald where it&#039;s easy to query and automatically gets rotated.&lt;br /&gt;
Set($LogToSyslog, &#039;info&#039;);&lt;br /&gt;
&lt;br /&gt;
# When the RT server logs to stderr, that usually goes to your web server&#039;s&lt;br /&gt;
# error log. Command line tools log to their own stderr. Setting this to&lt;br /&gt;
# &#039;warning&#039; or &#039;error&#039; helps ensure you get notified if RT&#039;s cron jobs&lt;br /&gt;
# encounter problems.&lt;br /&gt;
Set($LogToSTDERR, &#039;warning&#039;);&lt;br /&gt;
&lt;br /&gt;
# Turn off optional features that require additional configuration.&lt;br /&gt;
# If you want to use these, refer to the RT_Config documentation for&lt;br /&gt;
# instructions on how to set them up.&lt;br /&gt;
Set(%GnuPG, &#039;Enable&#039; =&amp;gt; &#039;0&#039;);&lt;br /&gt;
Set(%SMIME, &#039;Enable&#039; =&amp;gt; &#039;0&#039;);&lt;br /&gt;
&lt;br /&gt;
# Perl expects to find this 1 at the end of the file.&lt;br /&gt;
1;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;RT_SiteConfig.pm&amp;lt;/code&amp;gt; is actually Perl code. RT runs the code directly to load the configuration. Any time you finish editing it, you can check that you didn’t make any syntax errors by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;perl -c /opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Set up RT’s database ===&lt;br /&gt;
&lt;br /&gt;
RT includes a tool to help you set up its database. By default, it connects to the database as an administrator to create the database and user that you configured in the previous step.&lt;br /&gt;
&lt;br /&gt;
(The instructions from &amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt; and RT’s README file tell you to run &amp;lt;code&amp;gt;make initialize-database&amp;lt;/code&amp;gt;. That just runs &amp;lt;code&amp;gt;rt-setup-database&amp;lt;/code&amp;gt; for you. Running the tool directly makes it easier to pass the options you need.)&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;--action=init&amp;lt;/code&amp;gt; tells the tool to create the user, the database, the tables inside it, and insert core data RT needs to function.&lt;br /&gt;
* &#039;&#039;&#039;If&#039;&#039;&#039; you are using an existing database server and the database adminstrator has already created the user account and database for RT, then you can add the &amp;lt;code&amp;gt;--skip-create&amp;lt;/code&amp;gt; option.&lt;br /&gt;
* &#039;&#039;&#039;If&#039;&#039;&#039; you have a less common database setup, this tool has additional options to give you finer-grained control over what steps are run and how. Refer to [https://docs.bestpractical.com/rt/latest/rt-setup-database.html the full rt-setup-database documentation] to learn more about those.&lt;br /&gt;
* The command reads files from RT’s &amp;lt;code&amp;gt;etc/&amp;lt;/code&amp;gt; directory by default, so the easiest way to run it is to &amp;lt;code&amp;gt;cd /opt/rt5&amp;lt;/code&amp;gt; first, and then it will find the necessary files automatically.&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /opt/rt5&lt;br /&gt;
sudo sbin/rt-setup-database --action=init&amp;lt;/pre&amp;gt;&lt;br /&gt;
Enter the password for your database administrator account when prompted.&lt;br /&gt;
&lt;br /&gt;
=== Set up fulltext indexing ===&lt;br /&gt;
&lt;br /&gt;
Fulltext indexing speeds up searches for ticket content, which makes RT a lot nicer to use.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;--noask&amp;lt;/code&amp;gt; uses the default names for the index, which will be fine for a new install and simplifies the setup.&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo /opt/rt5/sbin/rt-setup-fulltext-index --noask&amp;lt;/pre&amp;gt;&lt;br /&gt;
Enter the password for your database administrator account when prompted. The end of the process will output some RT configuration that looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;### EXAMPLE OUTPUT ONLY - Don&#039;t use this directly!&lt;br /&gt;
Set( %FullTextSearch,&lt;br /&gt;
    Enable     =&amp;gt; 1,&lt;br /&gt;
    Indexed    =&amp;gt; 1,&lt;br /&gt;
    # Additional output from rt-setup-fulltext-index should be here.&lt;br /&gt;
    # The configuration varies by database type.&lt;br /&gt;
);&amp;lt;/pre&amp;gt;&lt;br /&gt;
Copy the output generated when you run &amp;lt;code&amp;gt;rt-setup-fulltext-index&amp;lt;/code&amp;gt; and save it to the file &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.d/FulltextIndex.pm&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Set permissions ===&lt;br /&gt;
&lt;br /&gt;
All of RT’s configuration files should be readable by the user that runs the web server, and no other users, in order to protect sensitive information like the database password. RT provides a command to set permissions appropriately according to your distribution and configuration. &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt; to the directory where you extracted the RT source code, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd rt-5.0.2&lt;br /&gt;
sudo make fixperms&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Verify the installation ===&lt;br /&gt;
&lt;br /&gt;
If everything has gone well, then you should be able to set a password for RT’s &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; user. You’ll use this later to log in to the web interface and continue setting up your system. Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo /opt/rt5/sbin/rt-passwd root&amp;lt;/pre&amp;gt;&lt;br /&gt;
Set the password when prompted. Record this; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s web server ==&lt;br /&gt;
&lt;br /&gt;
=== Configure Apache modules ===&lt;br /&gt;
&lt;br /&gt;
You will need to have the following modules enabled in Apache to run RT. You should already have these installed if you followed the instructions above.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;alias&amp;lt;/code&amp;gt; (required to map URLs to RT)&lt;br /&gt;
* &amp;lt;code&amp;gt;fcgid&amp;lt;/code&amp;gt; (required for Apache to talk to RT)&lt;br /&gt;
* &amp;lt;code&amp;gt;mpm_prefork&amp;lt;/code&amp;gt; (Apache requires you to select an MPM. RT is designed to work with the prefork module.)&lt;br /&gt;
* &amp;lt;code&amp;gt;ssl&amp;lt;/code&amp;gt; (required to serve HTTPS; optional otherwise)&lt;br /&gt;
&lt;br /&gt;
Enable them following these instructions:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo a2dismod mpm_event&lt;br /&gt;
sudo a2enmod fcgid&lt;br /&gt;
sudo a2enmod mpm_prefork&lt;br /&gt;
sudo a2enmod ssl&amp;lt;/pre&amp;gt;&lt;br /&gt;
| &amp;lt;pre&amp;gt;echo LoadModule mpm_prefork_module modules/mod_mpm_prefork.so | sudo tee /etc/httpd/conf.modules.d/00-mpm.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Disable default VirtualHosts (optional) ===&lt;br /&gt;
&lt;br /&gt;
If this web server is dedicated to RT, then you should disable the VirtualHosts that are included with the stock configuration. Run:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo a2dissite 000-default&lt;br /&gt;
sudo a2dissite default-ssl&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo sed -i~ &#039;/^&amp;lt;VirtualHost\b/ , /^&amp;lt;\/VirtualHost\b/ d&#039; /etc/httpd/conf.d/ssl.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Configure an Apache VirtualHost ===&lt;br /&gt;
&lt;br /&gt;
Create a file at the following location. You can change the &amp;lt;code&amp;gt;RT&amp;lt;/code&amp;gt; part of the filename if you like, but the file must exist in this directory and have a &amp;lt;code&amp;gt;.conf&amp;lt;/code&amp;gt; suffix.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;/etc/apache2/sites-available/RT.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
Then after you create the file, run: &amp;lt;code&amp;gt;sudo a2ensite RT&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;/etc/httpd/conf.d/vhost_RT.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
(This filename needs to come after &amp;lt;code&amp;gt;ssl.conf&amp;lt;/code&amp;gt; in the directory listing.)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Use an editor to save all the text below to the new &amp;lt;code&amp;gt;RT.conf&amp;lt;/code&amp;gt; and then fill in settings for your site everywhere the text &amp;lt;code&amp;gt;EDIT WITH&amp;lt;/code&amp;gt; appears.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### Primary RT VirtualHost&lt;br /&gt;
# You can change both the bind address and/or the port here as required.&lt;br /&gt;
# This default will listen for HTTPS connections on all interfaces.&lt;br /&gt;
&amp;lt;VirtualHost *:443&amp;gt;&lt;br /&gt;
  # EDIT HERE with the domain name of the web server.&lt;br /&gt;
  ServerName rt.yourdomain.example.com&lt;br /&gt;
  &amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
    SSLEngine on&lt;br /&gt;
    # These specify the paths to the SSL certificate and private key Apache&lt;br /&gt;
    # should use. These example paths are common for Let&#039;s Encrypt. If you&lt;br /&gt;
    # don&#039;t use Let&#039;s Encrypt, the standard location for these files is under&lt;br /&gt;
    # (Debian/Ubuntu) /etc/ssl&lt;br /&gt;
    # (Red Hat/Fedora/CentOS) /etc/pki/tls&lt;br /&gt;
    # EDIT HERE with the appropriate paths for your server&lt;br /&gt;
    SSLCertificateFile /etc/letsencrypt/live/example.com/fullchain.pem&lt;br /&gt;
    SSLCertificateKeyFile /etc/letsencrypt/live/example.com/privkey.pem&lt;br /&gt;
  &amp;lt;/IfModule&amp;gt;&lt;br /&gt;
  &amp;lt;Location /&amp;gt;&lt;br /&gt;
    Require all granted&lt;br /&gt;
    Options +ExecCGI&lt;br /&gt;
    AddHandler fcgid-script fcgi&lt;br /&gt;
  &amp;lt;/Location&amp;gt;&lt;br /&gt;
  AddDefaultCharset UTF-8&lt;br /&gt;
  DocumentRoot /opt/rt5/share/html&lt;br /&gt;
  ScriptAlias / /opt/rt5/sbin/rt-server.fcgi/&lt;br /&gt;
  # The default mod_fcgid timeout is 40 seconds.&lt;br /&gt;
  # We increase it here to allow for large ticket searches, etc.&lt;br /&gt;
  FcgidIOTimeout 200&lt;br /&gt;
  # mod_fcgid only allows 128KiB requests by default. This is too small for users&lt;br /&gt;
  # to upload files to RT. You can ultimately choose any setting you&#039;re&lt;br /&gt;
  # comfortable with; 70MiB here should allow most requests without being too&lt;br /&gt;
  # open.&lt;br /&gt;
  FcgidMaxRequestLen 73400320&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
### End primary RT VirtualHost&lt;br /&gt;
&lt;br /&gt;
### Optional HTTPS Redirect VirtualHost&lt;br /&gt;
# Most modern servers support HTTPS and want all web traffic to go through it.&lt;br /&gt;
# This VirtualHost redirects normal HTTP traffic to HTTPS.&lt;br /&gt;
# You can delete this whole section if you don&#039;t want or need this.&lt;br /&gt;
&amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
  # You can change both the bind address and/or the port here as required.&lt;br /&gt;
  # This default will listen for HTTP connections on all interfaces.&lt;br /&gt;
  &amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
    SSLEngine off&lt;br /&gt;
    # EDIT HERE both lines below with the domain name of your web server.&lt;br /&gt;
    ServerName rt.yourdomain.example.com&lt;br /&gt;
    Redirect permanent / https://rt.yourdomain.example.com/&lt;br /&gt;
  &amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/IfModule&amp;gt;&lt;br /&gt;
### End optional HTTPS Redirect VirtualHost&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
After you’ve edited the file, load the configuration with:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo systemctl reload apache2&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo systemctl reload httpd&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If this command reports an error, double-check the configuration file for typos, especially in option names, file paths, and the&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;amp;lt;Section&amp;amp;gt;&amp;lt;/code&amp;gt; pairs. Edit again and reload the configuration until it succeeds without output.&lt;br /&gt;
&lt;br /&gt;
=== Verify the web interface ===&lt;br /&gt;
&lt;br /&gt;
You should be able to visit your web server in your browser, and be presented with RT’s login screen. You should be able to log in with username &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; and the password you set previously.&lt;br /&gt;
&lt;br /&gt;
If you run into trouble, the first place to look for more information is by reading Apache’s error log:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo less /var/log/apache2/error.log&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo less /var/log/httpd/error.log&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s mail server ==&lt;br /&gt;
&lt;br /&gt;
RT both can both send and receive ticket updates via email. Unfortunately, there are too many variables to document a useful setup process here: getting this working usually requires creating DNS records, and coordinating with existing mail servers, which will be the main constraint on your setup. Instead this guide provides a brief overview of how the integration works, and where the connection points are that you likely need to work on.&lt;br /&gt;
&lt;br /&gt;
=== Sending Mail ===&lt;br /&gt;
&lt;br /&gt;
RT only knows how to send mail by passing it off to another program on the system. It cannot connect or authenticate directly to external mail servers. In the default configuration, RT runs the standard &amp;lt;code&amp;gt;sendmail&amp;lt;/code&amp;gt; command. There are [https://docs.bestpractical.com/rt/latest/RT_Config.html#Outgoing-mail configuration options to send mail through different commands] if you need.&lt;br /&gt;
&lt;br /&gt;
The most common setup is to install and configure a proper Mail Transfer Agent (MTA) like Postfix or Exim, and then configure it to send mail to the wider Internet as you need. This works well because the MTAs are robust and well-tested; they have flexible configuration to let you send mail out by relaying to other mail servers you specify with optional authentication; and most distributions install one by default anyway. The only hard part is configuring the MTA to send mail following your site’s policies.&lt;br /&gt;
&lt;br /&gt;
Other software is available that provides a slimmer version of the &amp;lt;code&amp;gt;sendmail&amp;lt;/code&amp;gt; command that connects to an external mail server for you, like ssmtp. These programs are usually easier to configure than an MTA, but they often lose email permanently if they can’t connect to the external server at the time it’s sent. (MTAs keep email queued locally until they successfully deliver it to another server.)&lt;br /&gt;
&lt;br /&gt;
=== Receiving email ===&lt;br /&gt;
&lt;br /&gt;
RT installs a command called &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; that receives an email on standard input and posts it to RT’s REST web interface, where it gets saved in the database and added to a ticket. You need to arrange for a way to send incoming email to this command.&lt;br /&gt;
&lt;br /&gt;
The most common setup is to have an MTA on the same box as RT receive email directly, and then set up mail aliases that call this command when mail comes in. Example &amp;lt;code&amp;gt;/etc/aliases&amp;lt;/code&amp;gt; entries look like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rt: &amp;quot;|/opt/rt5/bin/rt-mailgate --queue general --action correspond --url https://rt.yourdomain.example.com/&amp;quot;&lt;br /&gt;
rt-comment: &amp;quot;|/opt/rt5/bin/rt-mailgate --queue general --action comment --url https://rt.yourdomain.example.com/&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
This works well because, again, you’re probably running an MTA anyway; and the MTA can hold and queue mail if it comes in while RT is down for any reason, giving you a buffer against downtime.&lt;br /&gt;
&lt;br /&gt;
Another common option is to periodically run a tool that fetches mail using a protocol like IMAP, like fetchmail or getmail, and passes it on to &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt;. This is less common because it requires setting up another tool to run, and securely storing another set of mail server credentials. But it is useful when local policy prevents the RT server from receiving email directly.&lt;br /&gt;
&lt;br /&gt;
This is much less common, but it might help to know that &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; doesn’t have to run on the same system as RT itself. It just needs to be able to connect to RT’s web interface. If you don’t have any other options, you can install the RT software on a different system that receives email, and configure &#039;&#039;that&#039;&#039; system to run &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; and pass it on to the RT server. To do that, just repeat the installation instructions above, skipping the steps about installing the database and web server.&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s background jobs ==&lt;br /&gt;
&lt;br /&gt;
Create a file &amp;lt;code&amp;gt;/etc/cron.d/rt&amp;lt;/code&amp;gt; with the following content. You may edit all of the time fields as you see fit. Refer to the crontab(5) man page for details about their definitions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Update the fulltext index with new ticket data&lt;br /&gt;
*/3 *   *   *   *   root    /opt/rt5/sbin/rt-fulltext-indexer&lt;br /&gt;
# Email out dashboards that users have subscribed to&lt;br /&gt;
0   *   *   *   *   root    /opt/rt5/sbin/rt-email-dashboards&lt;br /&gt;
# Clean old sessions from the database&lt;br /&gt;
10  3   *   *   *   root    /opt/rt5/sbin/rt-clean-sessions --older 8d&lt;br /&gt;
# Email out weekly digests for users who have requested it&lt;br /&gt;
50  4   *   *   Mon root    /opt/rt5/sbin/rt-email-digest -m weekly&lt;br /&gt;
# Email out daily digests for users who have requested it&lt;br /&gt;
50  5   *   *   *   root    /opt/rt5/sbin/rt-email-digest -m daily&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
You can run all these jobs as the same user that runs your web server, rather than root. Run:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo sed -i &#039;s/\broot\b/www-data/&#039; /etc/cron.d/rt&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo sed -i &#039;s/\broot\b/apache/&#039; /etc/cron.d/rt&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Set up RT ==&lt;br /&gt;
&lt;br /&gt;
If you’ve gotten this far, congratulations, your RT install is really done now. You can start setting up RT with users, groups, queues, and business logic. [[Main Page|Head back to the main page]] to start exploring those topics.&lt;/div&gt;</summary>
		<author><name>Brett</name></author>
	</entry>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=ManualInstallation&amp;diff=27072</id>
		<title>ManualInstallation</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=ManualInstallation&amp;diff=27072"/>
		<updated>2022-03-04T19:26:08Z</updated>

		<summary type="html">&lt;p&gt;Brett: reorganize to simplify flow&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Prev: [[ManualRequirements]] — Up: [[UserManual]] — Next: [[ManualApacheConfig]]&lt;br /&gt;
&lt;br /&gt;
This guide walks you through installing RT from source on a modern, popular Linux distro. Specifically, that means a distribution based on Debian or Red Hat that’s been released since around 2020.&lt;br /&gt;
&lt;br /&gt;
This guide assumes:&lt;br /&gt;
&lt;br /&gt;
* You can install packages generally available in Debian/Ubuntu or Red Hat/Fedora/CentOS.&lt;br /&gt;
* You want to install RT, and all of its Perl dependencies, from source to get the latest versions. (This is a trade-off. It means the boundaries of your install will be very clear, but you won’t get security updates for RT or Perl modules from your distribution.)&lt;br /&gt;
* You are willing to install a couple of extra tools to manage the RT installation similarly to how you would in other packaging systems (like PyPI, npm, etc.).&lt;br /&gt;
* You are willing to do a relatively maximal install of RT, enabling all the options during installation and then setting what you need in the configuration. (You could save a little space and time by being pickier about your options, but then that complicates the guide and makes it harder to turn those options on later if you want.)&lt;br /&gt;
* You are using a regular user account on the Linux system that can get superuser privileges with sudo.&lt;br /&gt;
&lt;br /&gt;
== Install the base dependencies ==&lt;br /&gt;
&lt;br /&gt;
These are required by RT, either to run or to install the dependencies.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install autoconf build-essential cpanminus curl libexpat-dev libgd-dev libssl-dev libz-dev gnupg graphviz lynx openssl perl&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf config-manager --set-enabled powertools&lt;br /&gt;
sudo dnf install patch tar which gcc gcc-c++ perl-core perl-App-cpanminus graphviz expat-devel gd-devel lynx openssl openssl-devel&lt;br /&gt;
sudo setenforce 0&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
(Turning off SELinux enforcement is required on Red Hat-based distributions because, as of October 2021, nobody has written a policy for RT.)&lt;br /&gt;
&lt;br /&gt;
== Install a database ==&lt;br /&gt;
&lt;br /&gt;
You need access to a database server. It can be remote, or you can install a database server alongside RT. RT supports a few different databases, but the best supported options are PostgreSQL and MariaDB.&lt;br /&gt;
&lt;br /&gt;
=== Installing and configuring the PostgreSQL server ===&lt;br /&gt;
&lt;br /&gt;
If you want to install a fresh PostgreSQL database server alongside RT:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install postgresql&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install postgresql-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In order to set up RT’s database, you will need a PostgreSQL account that can create databases and roles and be authenticated with a password. If you don’t have that, you can create it by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo createuser --createdb --createrole --login --pwprompt rt_admin&amp;lt;/pre&amp;gt;&lt;br /&gt;
Set the password when prompted. Record this; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
=== Enable password authentication in PostgreSQL ===&lt;br /&gt;
&lt;br /&gt;
You need to consider this step whether you install the database locally, or use an existing one already running. RT supports connecting to PostgreSQL a few different ways, but authenticating with a username and password is simplest, and this guide is written based on that. Not all PostgreSQL installations allow this authentication method by default. You need to review your &amp;lt;code&amp;gt;pg_hba.conf&amp;lt;/code&amp;gt; file located at:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;/etc/postgresql/VERSION/main/pg_hba.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;/var/lib/pgsql/VERSION/data/pg_hba.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Replace &amp;lt;code&amp;gt;VERSION&amp;lt;/code&amp;gt; with the version of your PostgreSQL database. Add these two lines &#039;&#039;&#039;above&#039;&#039;&#039; any other lines that start with &amp;lt;code&amp;gt;host&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;host  rt5  rt_user   all  md5&lt;br /&gt;
host  rt5  rt_admin  all  md5&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This configuration will let &amp;lt;code&amp;gt;rt_user&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;rt_admin&amp;lt;/code&amp;gt; authorize themselves for the &amp;lt;code&amp;gt;rt5&amp;lt;/code&amp;gt; database using an &amp;lt;code&amp;gt;md5&amp;lt;/code&amp;gt; crypted password over a network connection (possibly using the localhost loopback network). You might be able to further restrict some of these fields for improved security, but doing so is outside the scope of this install guide. Refer to [https://www.postgresql.org/docs/current/auth-pg-hba-conf.html the pg_hba.conf documentation] for more details.&lt;br /&gt;
&lt;br /&gt;
Save your changes and reload the database:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo systemctl reload postgresql&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Installing the PostgreSQL client libraries ===&lt;br /&gt;
&lt;br /&gt;
These are required for RT to be able to talk to any PostgreSQL server.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install libpq-dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install postgresql-devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Once this is done you can skip ahead to installing a web server.&lt;br /&gt;
&lt;br /&gt;
=== Installing and configuring the MariaDB server ===&lt;br /&gt;
&lt;br /&gt;
If you want to install a fresh MariaDB database server alongside RT:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install mariadb-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install mariadb-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In order to set up RT’s database, you will need a MySQL superuser account. To stay consistent with PostgreSQL, I suggest setting a password for it. You can do that by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo mysql mysql&lt;br /&gt;
MariaDB [mysql]&amp;amp;gt; GRANT ALL PRIVILEGES ON rt5.* TO rt_admin@localhost IDENTIFIED BY &#039;YourPassphraseHere&#039; WITH GRANT OPTION;&amp;lt;/pre&amp;gt;&lt;br /&gt;
Record your passphrase; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
=== Adjust MariaDB’s max_allowed_packet setting ===&lt;br /&gt;
&lt;br /&gt;
You need to consider this step whether you install the database locally, or use an existing one already running. [https://mariadb.com/kb/en/server-system-variables/#max_allowed_packet MariaDB’s &amp;lt;code&amp;gt;max_allowed_packet&amp;lt;/code&amp;gt; setting] functionally limits the size of attachments in RT. The default is 16MiB, which is too small for most installations. You can ultimately choose any setting you’re comfortable with; 64MiB here should allow most requests without being too open.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;echo -e &#039;[client-server]\nmax_allowed_packet=64M\n&#039; | sudo tee /etc/mysql/conf.d/max_allowed_packet.cnf&lt;br /&gt;
sudo systemctl reload mariadb&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;echo -e &#039;[client-server]\nmax_allowed_packet=64M\n&#039; | sudo tee /etc/my.cnf.d/max_allowed_packet.cnf&lt;br /&gt;
sudo systemctl reload mariadb&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Installing the MariaDB client libraries ===&lt;br /&gt;
&lt;br /&gt;
These are required for RT to be able to talk to any MariaDB server.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install libmariadb-dev libmariadb-dev-compat&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install mariadb-devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Install a web server with FastCGI ==&lt;br /&gt;
&lt;br /&gt;
FastCGI is the best way to host RT’s web interface today. Installing the web server before RT makes the installation process simpler, because RT will be able to automatically some details about your web server like what user it runs as.&lt;br /&gt;
&lt;br /&gt;
=== Installing Apache ===&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install apache2 libapache2-mod-fcgid&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install httpd mod_fcgid mod_ssl&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ### Installing nginx --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Install RT ==&lt;br /&gt;
&lt;br /&gt;
=== Get and unpack the RT source code ===&lt;br /&gt;
&lt;br /&gt;
Download the latest source code using the link on the [https://bestpractical.com/download-page RT download page], extract it using &amp;lt;code&amp;gt;tar -xf&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt; into the source code directory to run the rest of the commands in this section. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;curl -O https://download.bestpractical.com/pub/rt/release/rt-5.0.2.tar.gz&lt;br /&gt;
tar -xf rt-5.0.2.tar.gz&lt;br /&gt;
cd rt-5.0.2&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Pre-configure RT ===&lt;br /&gt;
&lt;br /&gt;
This command will detect some information about your system in order to install RT properly, and decide which set of dependencies to install. Here’s what the different parts of our command are doing:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;PERL=…&amp;lt;/code&amp;gt; configures RT to run under Perl with some options that load its dependencies from a dedicated directory. The &amp;lt;code&amp;gt;/opt/rt5&amp;lt;/code&amp;gt; part of this string should match your &amp;lt;code&amp;gt;prefix&amp;lt;/code&amp;gt; setting (see next item). If you know you want to use a specific Perl installed on your system, you can specify its full path instead of the plain &amp;lt;code&amp;gt;perl&amp;lt;/code&amp;gt; here.&lt;br /&gt;
* &amp;lt;code&amp;gt;--prefix=/opt/rt5&amp;lt;/code&amp;gt; sets the directory where RT will install all of its libraries, tools, and supporting files. You can choose another path if you like.&lt;br /&gt;
* &amp;lt;code&amp;gt;--with-db-type=TYPE&amp;lt;/code&amp;gt; - Replace &amp;lt;code&amp;gt;TYPE&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;Pg&amp;lt;/code&amp;gt; for PostgreSQL, or &amp;lt;code&amp;gt;mysql&amp;lt;/code&amp;gt; for MariaDB.&lt;br /&gt;
* The rest of the options tell RT to install additional dependencies for optional features.&lt;br /&gt;
&lt;br /&gt;
Make sure you have &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt;ed into the RT source directory, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;PERL=&amp;quot;/usr/bin/env -S perl -I/opt/rt5/local/lib/perl5&amp;quot; ./configure --prefix=/opt/rt5 --with-db-type=TYPE --with-attachment-store=disk --enable-externalauth --enable-gd --enable-graphviz --enable-gpg --enable-smime&amp;lt;/pre&amp;gt;&lt;br /&gt;
For more background, [https://docs.bestpractical.com/rt/latest/configure.html refer to the RT configure options documentation].&lt;br /&gt;
&lt;br /&gt;
=== Install RT and its Perl dependencies ===&lt;br /&gt;
&lt;br /&gt;
This command will download, build, and install all of the Perl modules necessary to run RT with the configuration you set above. Here’s what the different parts of the command are doing:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;make dirs&amp;lt;/code&amp;gt; creates RT&#039;s directory structure, so we can install dependencies inside it.&lt;br /&gt;
* &amp;lt;code&amp;gt;make fixdeps&amp;lt;/code&amp;gt; actually installs those dependencies.&lt;br /&gt;
* &amp;lt;code&amp;gt;RT_FIX_DEPS_CMD=…&amp;lt;/code&amp;gt; tells RT to use cpanminus to install dependencies (instead of the older, default &amp;lt;code&amp;gt;cpan&amp;lt;/code&amp;gt; command) inside RT&#039;s directory structure.&lt;br /&gt;
* &amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt; installs all of RT’s files under &amp;lt;code&amp;gt;/opt/rt5&amp;lt;/code&amp;gt; (or the prefix directory you set earlier). It will only run if &amp;lt;code&amp;gt;fixdeps&amp;lt;/code&amp;gt; succeeded.&lt;br /&gt;
&lt;br /&gt;
Make sure you have &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt;ed into the RT source directory, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo make dirs&lt;br /&gt;
make fixdeps RT_FIX_DEPS_CMD=&amp;quot;cpanm --sudo --local-lib-contained=/opt/rt5/local&amp;quot;&lt;br /&gt;
sudo make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
If it works, the command will eventually output a message that says “Congratulations. RT is now installed.” followed by instructions about configuring and setting up the database. We’ll do that next.&lt;br /&gt;
&lt;br /&gt;
=== Configure RT ===&lt;br /&gt;
&lt;br /&gt;
[https://docs.bestpractical.com/rt/latest/RT_Config.html RT has many configuration options.] You can put configuration options in the file &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/code&amp;gt;, or in individual files under &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.d/&amp;lt;/code&amp;gt;. Use an editor to save all the text below to &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/code&amp;gt; (you can just overwrite the existing file, or add this to the bottom of what’s there) and then fill in settings for your site everywhere the text &amp;lt;code&amp;gt;EDIT WITH&amp;lt;/code&amp;gt; appears.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Single-quote all values EXCEPT the special value `undef`&lt;br /&gt;
# that turns off a setting.&lt;br /&gt;
&lt;br /&gt;
# rtname appears in ticket email subjects. It needs to be globally unique,&lt;br /&gt;
# so use your organization&#039;s domain name.&lt;br /&gt;
Set($rtname, &#039;EDIT WITH yourdomain.example.com&#039;);&lt;br /&gt;
# Organization is used in the database for ticket links, etc. It also needs to&lt;br /&gt;
# be globally unique, so use your organization&#039;s domain name.&lt;br /&gt;
Set($Organization, &#039;EDIT WITH yourdomain.example.com&#039;);&lt;br /&gt;
# WebDomain is domain name of the RT web server. RT uses it to construct links&lt;br /&gt;
# and defend against CSRFs.&lt;br /&gt;
Set($WebDomain, &#039;EDIT WITH rt.yourdomain.example.com&#039;);&lt;br /&gt;
# WebPort is the port where the RT web server runs. Edit the number below if&lt;br /&gt;
# you&#039;re not using the standard HTTPS port.&lt;br /&gt;
Set($WebPort, &#039;443&#039;);&lt;br /&gt;
&lt;br /&gt;
# DatabaseUser is the name of the database account RT uses to read and store&lt;br /&gt;
# data. &#039;rt_user&#039; is the default but you can change it if you like.&lt;br /&gt;
# DO NOT use the &#039;rt_admin&#039; superuser created in the instructions above.&lt;br /&gt;
Set($DatabaseUser, &#039;rt_user&#039;);&lt;br /&gt;
# DatabasePassword is the password for DatabaseUser.&lt;br /&gt;
Set($DatabasePassword, &#039;EDIT WITH SomePassphraseHere&#039;);&lt;br /&gt;
# DatabaseHost is the hostname of the database server RT should use.&lt;br /&gt;
# Change &#039;localhost&#039; if it lives on a different server.&lt;br /&gt;
Set($DatabaseHost, &#039;localhost&#039;);&lt;br /&gt;
# DatabasePort is the port number of the database server RT should use.&lt;br /&gt;
# `undef` means the default for that database. Change it if you&#039;re not&lt;br /&gt;
# using the standard port.&lt;br /&gt;
Set($DatabasePort, undef);&lt;br /&gt;
# DatabaseName is the name of RT&#039;s database hosted on DatabaseHost.&lt;br /&gt;
# &#039;rt5&#039; is the default but you can change it if you like.&lt;br /&gt;
Set($DatabaseName, &#039;rt5&#039;);&lt;br /&gt;
# DatabaseAdmin is the name of the user in the database used to perform&lt;br /&gt;
# major administrative tasks. Change &#039;rt_admin&#039; if you&#039;re using a user&lt;br /&gt;
# besides the one created in this guide.&lt;br /&gt;
Set($DatabaseAdmin, &#039;rt_admin&#039;);&lt;br /&gt;
&lt;br /&gt;
# RT can log to syslog, stderr, and/or a dedicated file.&lt;br /&gt;
# Log settings are used both by the primary server and by command line&lt;br /&gt;
# tools like rt-crontool, rt-ldapimport, etc.&lt;br /&gt;
# You set all of RT&#039;s $LogTo* paramaters to a standard log level: &#039;debug&#039;,&lt;br /&gt;
# &#039;info&#039;, &#039;notice&#039;, &#039;warning&#039;, &#039;error&#039;, &#039;critical&#039;, &#039;alert&#039;, or &#039;emergency&#039;.&lt;br /&gt;
# For a modern install, I recommend logging primarily to syslog, so it goes&lt;br /&gt;
# to journald where it&#039;s easy to query and automatically gets rotated.&lt;br /&gt;
Set($LogToSyslog, &#039;info&#039;);&lt;br /&gt;
&lt;br /&gt;
# When the RT server logs to stderr, that usually goes to your web server&#039;s&lt;br /&gt;
# error log. Command line tools log to their own stderr. Setting this to&lt;br /&gt;
# &#039;warning&#039; or &#039;error&#039; helps ensure you get notified if RT&#039;s cron jobs&lt;br /&gt;
# encounter problems.&lt;br /&gt;
Set($LogToSTDERR, &#039;warning&#039;);&lt;br /&gt;
&lt;br /&gt;
# Turn off optional features that require additional configuration.&lt;br /&gt;
# If you want to use these, refer to the RT_Config documentation for&lt;br /&gt;
# instructions on how to set them up.&lt;br /&gt;
Set(%GnuPG, &#039;Enable&#039; =&amp;gt; &#039;0&#039;);&lt;br /&gt;
Set(%SMIME, &#039;Enable&#039; =&amp;gt; &#039;0&#039;);&lt;br /&gt;
&lt;br /&gt;
# Perl expects to find this 1 at the end of the file.&lt;br /&gt;
1;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;RT_SiteConfig.pm&amp;lt;/code&amp;gt; is actually Perl code. RT runs the code directly to load the configuration. Any time you finish editing it, you can check that you didn’t make any syntax errors by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;perl -c /opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Set up RT’s database ===&lt;br /&gt;
&lt;br /&gt;
RT includes a tool to help you set up its database. By default, it connects to the database as an administrator to create the database and user that you configured in the previous step.&lt;br /&gt;
&lt;br /&gt;
(The instructions from &amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt; and RT’s README file tell you to run &amp;lt;code&amp;gt;make initialize-database&amp;lt;/code&amp;gt;. That just runs &amp;lt;code&amp;gt;rt-setup-database&amp;lt;/code&amp;gt; for you. Running the tool directly makes it easier to pass the options you need.)&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;--action=init&amp;lt;/code&amp;gt; tells the tool to create the user, the database, the tables inside it, and insert core data RT needs to function.&lt;br /&gt;
* &#039;&#039;&#039;If&#039;&#039;&#039; you are using an existing database server and the database adminstrator has already created the user account and database for RT, then you can add the &amp;lt;code&amp;gt;--skip-create&amp;lt;/code&amp;gt; option.&lt;br /&gt;
* &#039;&#039;&#039;If&#039;&#039;&#039; you have a less common database setup, this tool has additional options to give you finer-grained control over what steps are run and how. Refer to [https://docs.bestpractical.com/rt/latest/rt-setup-database.html the full rt-setup-database documentation] to learn more about those.&lt;br /&gt;
* The command reads files from RT’s &amp;lt;code&amp;gt;etc/&amp;lt;/code&amp;gt; directory by default, so the easiest way to run it is to &amp;lt;code&amp;gt;cd /opt/rt5&amp;lt;/code&amp;gt; first, and then it will find the necessary files automatically.&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /opt/rt5&lt;br /&gt;
sudo sbin/rt-setup-database --action=init&amp;lt;/pre&amp;gt;&lt;br /&gt;
Enter the password for your database administrator account when prompted.&lt;br /&gt;
&lt;br /&gt;
=== Set up fulltext indexing ===&lt;br /&gt;
&lt;br /&gt;
Fulltext indexing speeds up searches for ticket content, which makes RT a lot nicer to use.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;--noask&amp;lt;/code&amp;gt; uses the default names for the index, which will be fine for a new install and simplifies the setup.&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo /opt/rt5/sbin/rt-setup-fulltext-index --noask&amp;lt;/pre&amp;gt;&lt;br /&gt;
Enter the password for your database administrator account when prompted. The end of the process will output some RT configuration that looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;### EXAMPLE OUTPUT ONLY - Don&#039;t use this directly!&lt;br /&gt;
Set( %FullTextSearch,&lt;br /&gt;
    Enable     =&amp;gt; 1,&lt;br /&gt;
    Indexed    =&amp;gt; 1,&lt;br /&gt;
    # Additional output from rt-setup-fulltext-index should be here.&lt;br /&gt;
    # The configuration varies by database type.&lt;br /&gt;
);&amp;lt;/pre&amp;gt;&lt;br /&gt;
Copy the output generated when you run &amp;lt;code&amp;gt;rt-setup-fulltext-index&amp;lt;/code&amp;gt; and save it to the file &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.d/FulltextIndex.pm&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Set permissions ===&lt;br /&gt;
&lt;br /&gt;
All of RT’s configuration files should be readable by the user that runs the web server, and no other users, in order to protect sensitive information like the database password. RT provides a command to set permissions appropriately according to your distribution and configuration. &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt; to the directory where you extracted the RT source code, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd rt-5.0.2&lt;br /&gt;
sudo make fixperms&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Verify the installation ===&lt;br /&gt;
&lt;br /&gt;
If everything has gone well, then you should be able to set a password for RT’s &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; user. You’ll use this later to log in to the web interface and continue setting up your system. Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo /opt/rt5/sbin/rt-passwd root&amp;lt;/pre&amp;gt;&lt;br /&gt;
Set the password when prompted. Record this; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s web server ==&lt;br /&gt;
&lt;br /&gt;
=== Configure Apache modules ===&lt;br /&gt;
&lt;br /&gt;
You will need to have the following modules enabled in Apache to run RT. You should already have these installed if you followed the instructions above.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;alias&amp;lt;/code&amp;gt; (required to map URLs to RT)&lt;br /&gt;
* &amp;lt;code&amp;gt;fcgid&amp;lt;/code&amp;gt; (required for Apache to talk to RT)&lt;br /&gt;
* &amp;lt;code&amp;gt;mpm_prefork&amp;lt;/code&amp;gt; (Apache requires you to select an MPM. RT is designed to work with the prefork module.)&lt;br /&gt;
* &amp;lt;code&amp;gt;ssl&amp;lt;/code&amp;gt; (required to serve HTTPS; optional otherwise)&lt;br /&gt;
&lt;br /&gt;
Enable them following these instructions:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo a2dismod mpm_event&lt;br /&gt;
sudo a2enmod fcgid&lt;br /&gt;
sudo a2enmod mpm_prefork&lt;br /&gt;
sudo a2enmod ssl&amp;lt;/pre&amp;gt;&lt;br /&gt;
| &amp;lt;pre&amp;gt;echo LoadModule mpm_prefork_module modules/mod_mpm_prefork.so | sudo tee /etc/httpd/conf.modules.d/00-mpm.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Disable default VirtualHosts (optional) ===&lt;br /&gt;
&lt;br /&gt;
If this web server is dedicated to RT, then you should disable the VirtualHosts that are included with the stock configuration. Run:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo a2dissite 000-default&lt;br /&gt;
sudo a2dissite default-ssl&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo sed -i~ &#039;/^&amp;lt;VirtualHost\b/ , /^&amp;lt;\/VirtualHost\b/ d&#039; /etc/httpd/conf.d/ssl.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Configure an Apache VirtualHost ===&lt;br /&gt;
&lt;br /&gt;
Create a file at the following location. You can change the &amp;lt;code&amp;gt;RT&amp;lt;/code&amp;gt; part of the filename if you like, but the file must exist in this directory and have a &amp;lt;code&amp;gt;.conf&amp;lt;/code&amp;gt; suffix.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;/etc/apache2/sites-available/RT.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
Then after you create the file, run: &amp;lt;code&amp;gt;sudo a2ensite RT&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;/etc/httpd/conf.d/vhost_RT.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
(This filename needs to come after &amp;lt;code&amp;gt;ssl.conf&amp;lt;/code&amp;gt; in the directory listing.)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Use an editor to save all the text below to the new &amp;lt;code&amp;gt;RT.conf&amp;lt;/code&amp;gt; and then fill in settings for your site everywhere the text &amp;lt;code&amp;gt;EDIT WITH&amp;lt;/code&amp;gt; appears.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### Primary RT VirtualHost&lt;br /&gt;
# You can change both the bind address and/or the port here as required.&lt;br /&gt;
# This default will listen for HTTPS connections on all interfaces.&lt;br /&gt;
&amp;lt;VirtualHost *:443&amp;gt;&lt;br /&gt;
  # EDIT HERE with the domain name of the web server.&lt;br /&gt;
  ServerName rt.yourdomain.example.com&lt;br /&gt;
  &amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
    SSLEngine on&lt;br /&gt;
    # These specify the paths to the SSL certificate and private key Apache&lt;br /&gt;
    # should use. These example paths are common for Let&#039;s Encrypt. If you&lt;br /&gt;
    # don&#039;t use Let&#039;s Encrypt, the standard location for these files is under&lt;br /&gt;
    # (Debian/Ubuntu) /etc/ssl&lt;br /&gt;
    # (Red Hat/Fedora/CentOS) /etc/pki/tls&lt;br /&gt;
    # EDIT HERE with the appropriate paths for your server&lt;br /&gt;
    SSLCertificateFile /etc/letsencrypt/live/example.com/fullchain.pem&lt;br /&gt;
    SSLCertificateKeyFile /etc/letsencrypt/live/example.com/privkey.pem&lt;br /&gt;
  &amp;lt;/IfModule&amp;gt;&lt;br /&gt;
  &amp;lt;Location /&amp;gt;&lt;br /&gt;
    Require all granted&lt;br /&gt;
    Options +ExecCGI&lt;br /&gt;
    AddHandler fcgid-script fcgi&lt;br /&gt;
  &amp;lt;/Location&amp;gt;&lt;br /&gt;
  AddDefaultCharset UTF-8&lt;br /&gt;
  DocumentRoot /opt/rt5/share/html&lt;br /&gt;
  ScriptAlias / /opt/rt5/sbin/rt-server.fcgi/&lt;br /&gt;
  # The default mod_fcgid timeout is 40 seconds.&lt;br /&gt;
  # We increase it here to allow for large ticket searches, etc.&lt;br /&gt;
  FcgidIOTimeout 200&lt;br /&gt;
  # mod_fcgid only allows 128KiB requests by default. This is too small for users&lt;br /&gt;
  # to upload files to RT. You can ultimately choose any setting you&#039;re&lt;br /&gt;
  # comfortable with; 70MiB here should allow most requests without being too&lt;br /&gt;
  # open.&lt;br /&gt;
  FcgidMaxRequestLen 73400320&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
### End primary RT VirtualHost&lt;br /&gt;
&lt;br /&gt;
### Optional HTTPS Redirect VirtualHost&lt;br /&gt;
# Most modern servers support HTTPS and want all web traffic to go through it.&lt;br /&gt;
# This VirtualHost redirects normal HTTP traffic to HTTPS.&lt;br /&gt;
# You can delete this whole section if you don&#039;t want or need this.&lt;br /&gt;
&amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
  # You can change both the bind address and/or the port here as required.&lt;br /&gt;
  # This default will listen for HTTP connections on all interfaces.&lt;br /&gt;
  &amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
    SSLEngine off&lt;br /&gt;
    # EDIT HERE both lines below with the domain name of your web server.&lt;br /&gt;
    ServerName rt.yourdomain.example.com&lt;br /&gt;
    Redirect permanent / https://rt.yourdomain.example.com/&lt;br /&gt;
  &amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/IfModule&amp;gt;&lt;br /&gt;
### End optional HTTPS Redirect VirtualHost&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
After you’ve edited the file, load the configuration with:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo systemctl reload apache2&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo systemctl reload httpd&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If this command reports an error, double-check the configuration file for typos, especially in option names, file paths, and the&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;amp;lt;Section&amp;amp;gt;&amp;lt;/code&amp;gt; pairs. Edit again and reload the configuration until it succeeds without output.&lt;br /&gt;
&lt;br /&gt;
=== Verify the web interface ===&lt;br /&gt;
&lt;br /&gt;
You should be able to visit your web server in your browser, and be presented with RT’s login screen. You should be able to log in with username &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; and the password you set previously.&lt;br /&gt;
&lt;br /&gt;
If you run into trouble, the first place to look for more information is by reading Apache’s error log:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo less /var/log/apache2/error.log&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo less /var/log/httpd/error.log&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s mail server ==&lt;br /&gt;
&lt;br /&gt;
RT both can both send and receive ticket updates via email. Unfortunately, there are too many variables to document a useful setup process here: getting this working usually requires creating DNS records, and coordinating with existing mail servers, which will be the main constraint on your setup. Instead this guide provides a brief overview of how the integration works, and where the connection points are that you likely need to work on.&lt;br /&gt;
&lt;br /&gt;
=== Sending Mail ===&lt;br /&gt;
&lt;br /&gt;
RT only knows how to send mail by passing it off to another program on the system. It cannot connect or authenticate directly to external mail servers. In the default configuration, RT runs the standard &amp;lt;code&amp;gt;sendmail&amp;lt;/code&amp;gt; command. There are [https://docs.bestpractical.com/rt/latest/RT_Config.html#Outgoing-mail configuration options to send mail through different commands] if you need.&lt;br /&gt;
&lt;br /&gt;
The most common setup is to install and configure a proper Mail Transfer Agent (MTA) like Postfix or Exim, and then configure it to send mail to the wider Internet as you need. This works well because the MTAs are robust and well-tested; they have flexible configuration to let you send mail out by relaying to other mail servers you specify with optional authentication; and most distributions install one by default anyway. The only hard part is configuring the MTA to send mail following your site’s policies.&lt;br /&gt;
&lt;br /&gt;
Other software is available that provides a slimmer version of the &amp;lt;code&amp;gt;sendmail&amp;lt;/code&amp;gt; command that connects to an external mail server for you, like ssmtp. These programs are usually easier to configure than an MTA, but they often lose email permanently if they can’t connect to the external server at the time it’s sent. (MTAs keep email queued locally until they successfully deliver it to another server.)&lt;br /&gt;
&lt;br /&gt;
=== Receiving email ===&lt;br /&gt;
&lt;br /&gt;
RT installs a command called &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; that receives an email on standard input and posts it to RT’s REST web interface, where it gets saved in the database and added to a ticket. You need to arrange for a way to send incoming email to this command.&lt;br /&gt;
&lt;br /&gt;
The most common setup is to have an MTA on the same box as RT receive email directly, and then set up mail aliases that call this command when mail comes in. Example &amp;lt;code&amp;gt;/etc/aliases&amp;lt;/code&amp;gt; entries look like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rt: &amp;quot;|/opt/rt5/bin/rt-mailgate --queue general --action correspond --url https://rt.yourdomain.example.com/&amp;quot;&lt;br /&gt;
rt-comment: &amp;quot;|/opt/rt5/bin/rt-mailgate --queue general --action comment --url https://rt.yourdomain.example.com/&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
This works well because, again, you’re probably running an MTA anyway; and the MTA can hold and queue mail if it comes in while RT is down for any reason, giving you a buffer against downtime.&lt;br /&gt;
&lt;br /&gt;
Another common option is to periodically run a tool that fetches mail using a protocol like IMAP, like fetchmail or getmail, and passes it on to &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt;. This is less common because it requires setting up another tool to run, and securely storing another set of mail server credentials. But it is useful when local policy prevents the RT server from receiving email directly.&lt;br /&gt;
&lt;br /&gt;
This is much less common, but it might help to know that &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; doesn’t have to run on the same system as RT itself. It just needs to be able to connect to RT’s web interface. If you don’t have any other options, you can install the RT software on a different system that receives email, and configure &#039;&#039;that&#039;&#039; system to run &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; and pass it on to the RT server. To do that, just repeat the installation instructions above, skipping the steps about installing the database and web server.&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s background jobs ==&lt;br /&gt;
&lt;br /&gt;
Create a file &amp;lt;code&amp;gt;/etc/cron.d/rt&amp;lt;/code&amp;gt; with the following content. You may edit all of the time fields as you see fit. Refer to the crontab(5) man page for details about their definitions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Update the fulltext index with new ticket data&lt;br /&gt;
*/3 *   *   *   *   root    /opt/rt5/sbin/rt-fulltext-indexer&lt;br /&gt;
# Email out dashboards that users have subscribed to&lt;br /&gt;
0   *   *   *   *   root    /opt/rt5/sbin/rt-email-dashboards&lt;br /&gt;
# Clean old sessions from the database&lt;br /&gt;
10  3   *   *   *   root    /opt/rt5/sbin/rt-clean-sessions --older 8d&lt;br /&gt;
# Email out weekly digests for users who have requested it&lt;br /&gt;
50  4   *   *   Mon root    /opt/rt5/sbin/rt-email-digest -m weekly&lt;br /&gt;
# Email out daily digests for users who have requested it&lt;br /&gt;
50  5   *   *   *   root    /opt/rt5/sbin/rt-email-digest -m daily&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
You can run all these jobs as the same user that runs your web server, rather than root. Run:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo sed -i &#039;s/\broot\b/www-data/&#039; /etc/cron.d/rt&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo sed -i &#039;s/\broot\b/apache/&#039; /etc/cron.d/rt&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Set up RT ==&lt;br /&gt;
&lt;br /&gt;
If you’ve gotten this far, congratulations, your RT install is really done now. You can start setting up RT with users, groups, queues, and business logic. [[Main Page|Head back to the main page]] to start exploring those topics.&lt;/div&gt;</summary>
		<author><name>Brett</name></author>
	</entry>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=ManualInstallation&amp;diff=27071</id>
		<title>ManualInstallation</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=ManualInstallation&amp;diff=27071"/>
		<updated>2022-03-04T19:15:00Z</updated>

		<summary type="html">&lt;p&gt;Brett: configure with `env -S perl -I` instead of setting PERL5LIB&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Prev: [[ManualRequirements]] — Up: [[UserManual]] — Next: [[ManualApacheConfig]]&lt;br /&gt;
&lt;br /&gt;
This guide walks you through installing RT from source on a modern, popular Linux distro. Specifically, that means a distribution based on Debian or Red Hat that’s been released since around 2020.&lt;br /&gt;
&lt;br /&gt;
This guide assumes:&lt;br /&gt;
&lt;br /&gt;
* You can install packages generally available in Debian/Ubuntu or Red Hat/Fedora/CentOS.&lt;br /&gt;
* You want to install RT, and all of its Perl dependencies, from source to get the latest versions. (This is a trade-off. It means the boundaries of your install will be very clear, but you won’t get security updates for RT or Perl modules from your distribution.)&lt;br /&gt;
* You are willing to install a couple of extra tools to manage the RT installation similarly to how you would in other packaging systems (like PyPI, npm, etc.).&lt;br /&gt;
* You are willing to do a relatively maximal install of RT, enabling all the options during installation and then setting what you need in the configuration. (You could save a little space and time by being pickier about your options, but then that complicates the guide and makes it harder to turn those options on later if you want.)&lt;br /&gt;
* You are using a regular user account on the Linux system that can get superuser privileges with sudo.&lt;br /&gt;
&lt;br /&gt;
== Install the base dependencies ==&lt;br /&gt;
&lt;br /&gt;
These are required by RT, either to run or to install the dependencies.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install autoconf build-essential cpanminus curl libexpat-dev libgd-dev libssl-dev libz-dev gnupg graphviz lynx openssl perl&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf config-manager --set-enabled powertools&lt;br /&gt;
sudo dnf install patch tar which gcc gcc-c++ perl-core perl-App-cpanminus graphviz expat-devel gd-devel lynx openssl openssl-devel&lt;br /&gt;
sudo setenforce 0&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
(Turning off SELinux enforcement is required on Red Hat-based distributions because, as of October 2021, nobody has written a policy for RT.)&lt;br /&gt;
&lt;br /&gt;
== Install a database ==&lt;br /&gt;
&lt;br /&gt;
You need access to a database server. It can be remote, or you can install a database server alongside RT. RT supports a few different databases, but the best supported options are PostgreSQL and MariaDB.&lt;br /&gt;
&lt;br /&gt;
=== Installing and configuring the PostgreSQL server ===&lt;br /&gt;
&lt;br /&gt;
If you want to install a fresh PostgreSQL database server alongside RT:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install postgresql&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install postgresql-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In order to set up RT’s database, you will need a PostgreSQL account that can create databases and roles and be authenticated with a password. If you don’t have that, you can create it by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo createuser --createdb --createrole --login --pwprompt rt_admin&amp;lt;/pre&amp;gt;&lt;br /&gt;
Set the password when prompted. Record this; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
=== Enable password authentication in PostgreSQL ===&lt;br /&gt;
&lt;br /&gt;
You need to consider this step whether you install the database locally, or use an existing one already running. RT supports connecting to PostgreSQL a few different ways, but authenticating with a username and password is simplest, and this guide is written based on that. Not all PostgreSQL installations allow this authentication method by default. You need to review your &amp;lt;code&amp;gt;pg_hba.conf&amp;lt;/code&amp;gt; file located at:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;/etc/postgresql/VERSION/main/pg_hba.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;/var/lib/pgsql/VERSION/data/pg_hba.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Replace &amp;lt;code&amp;gt;VERSION&amp;lt;/code&amp;gt; with the version of your PostgreSQL database. Add these two lines &#039;&#039;&#039;above&#039;&#039;&#039; any other lines that start with &amp;lt;code&amp;gt;host&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;host  rt5  rt_user   all  md5&lt;br /&gt;
host  rt5  rt_admin  all  md5&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This configuration will let &amp;lt;code&amp;gt;rt_user&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;rt_admin&amp;lt;/code&amp;gt; authorize themselves for the &amp;lt;code&amp;gt;rt5&amp;lt;/code&amp;gt; database using an &amp;lt;code&amp;gt;md5&amp;lt;/code&amp;gt; crypted password over a network connection (possibly using the localhost loopback network). You might be able to further restrict some of these fields for improved security, but doing so is outside the scope of this install guide. Refer to [https://www.postgresql.org/docs/current/auth-pg-hba-conf.html the pg_hba.conf documentation] for more details.&lt;br /&gt;
&lt;br /&gt;
Save your changes and reload the database:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo systemctl reload postgresql&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Installing the PostgreSQL client libraries ===&lt;br /&gt;
&lt;br /&gt;
These are required for RT to be able to talk to any PostgreSQL server.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install libpq-dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install postgresql-devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Once this is done you can skip ahead to installing a web server.&lt;br /&gt;
&lt;br /&gt;
=== Installing and configuring the MariaDB server ===&lt;br /&gt;
&lt;br /&gt;
If you want to install a fresh MariaDB database server alongside RT:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install mariadb-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install mariadb-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In order to set up RT’s database, you will need a MySQL superuser account. To stay consistent with PostgreSQL, I suggest setting a password for it. You can do that by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo mysql mysql&lt;br /&gt;
MariaDB [mysql]&amp;amp;gt; GRANT ALL PRIVILEGES ON rt5.* TO rt_admin@localhost IDENTIFIED BY &#039;YourPassphraseHere&#039; WITH GRANT OPTION;&amp;lt;/pre&amp;gt;&lt;br /&gt;
Record your passphrase; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
=== Adjust MariaDB’s max_allowed_packet setting ===&lt;br /&gt;
&lt;br /&gt;
You need to consider this step whether you install the database locally, or use an existing one already running. [https://mariadb.com/kb/en/server-system-variables/#max_allowed_packet MariaDB’s &amp;lt;code&amp;gt;max_allowed_packet&amp;lt;/code&amp;gt; setting] functionally limits the size of attachments in RT. The default is 16MiB, which is too small for most installations. You can ultimately choose any setting you’re comfortable with; 64MiB here should allow most requests without being too open.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;echo -e &#039;[client-server]\nmax_allowed_packet=64M\n&#039; | sudo tee /etc/mysql/conf.d/max_allowed_packet.cnf&lt;br /&gt;
sudo systemctl reload mariadb&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;echo -e &#039;[client-server]\nmax_allowed_packet=64M\n&#039; | sudo tee /etc/my.cnf.d/max_allowed_packet.cnf&lt;br /&gt;
sudo systemctl reload mariadb&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Installing the MariaDB client libraries ===&lt;br /&gt;
&lt;br /&gt;
These are required for RT to be able to talk to any MariaDB server.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install libmariadb-dev libmariadb-dev-compat&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install mariadb-devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Install a web server with FastCGI ==&lt;br /&gt;
&lt;br /&gt;
FastCGI is the best way to host RT’s web interface today. Installing the web server before RT makes the installation process simpler, because RT will be able to automatically some details about your web server like what user it runs as.&lt;br /&gt;
&lt;br /&gt;
=== Installing Apache ===&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install apache2 libapache2-mod-fcgid&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install httpd mod_fcgid mod_ssl&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ### Installing nginx --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Install RT ==&lt;br /&gt;
&lt;br /&gt;
=== Get and unpack the RT source code ===&lt;br /&gt;
&lt;br /&gt;
Download the latest source code using the link on the [https://bestpractical.com/download-page RT download page], extract it using &amp;lt;code&amp;gt;tar -xf&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt; into the source code directory to run the rest of the commands in this section. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;curl -O https://download.bestpractical.com/pub/rt/release/rt-5.0.2.tar.gz&lt;br /&gt;
tar -xf rt-5.0.2.tar.gz&lt;br /&gt;
cd rt-5.0.2&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Pre-configure RT ===&lt;br /&gt;
&lt;br /&gt;
This command will detect some information about your system in order to install RT properly, and decide which set of dependencies to install. Here’s what the different parts of our command are doing:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;PERL=…&amp;lt;/code&amp;gt; configures RT to run under Perl with some options that load its dependencies from a dedicated directory. The &amp;lt;code&amp;gt;/opt/rt5&amp;lt;/code&amp;gt; part of this string should match your &amp;lt;code&amp;gt;prefix&amp;lt;/code&amp;gt; setting (see below). If you know you want to use a specific Perl installed on your system, you can specify its full path instead of the plain &amp;lt;code&amp;gt;perl&amp;lt;/code&amp;gt; here.&lt;br /&gt;
* &amp;lt;code&amp;gt;--with-db-type=TYPE&amp;lt;/code&amp;gt; - Replace &amp;lt;code&amp;gt;TYPE&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;Pg&amp;lt;/code&amp;gt; for PostgreSQL, or &amp;lt;code&amp;gt;mysql&amp;lt;/code&amp;gt; for MariaDB.&lt;br /&gt;
* &amp;lt;code&amp;gt;--prefix=/opt/rt5&amp;lt;/code&amp;gt; sets the directory where RT will install all of its libraries, tools, and supporting files. You can choose another path if you like.&lt;br /&gt;
* The rest of the options tell RT to install additional dependencies for optional features.&lt;br /&gt;
&lt;br /&gt;
Make sure you have &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt;ed into the RT source directory, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;PERL=&amp;quot;/usr/bin/env -S perl -I/opt/rt5/local/lib/perl5&amp;quot; ./configure --with-db-type=TYPE --prefix=/opt/rt5 --with-attachment-store=disk --enable-externalauth --enable-gd --enable-graphviz --enable-gpg --enable-smime&amp;lt;/pre&amp;gt;&lt;br /&gt;
For more background, [https://docs.bestpractical.com/rt/latest/configure.html refer to the RT configure options documentation].&lt;br /&gt;
&lt;br /&gt;
=== Install RT and its Perl dependencies ===&lt;br /&gt;
&lt;br /&gt;
This command will download, build, and install all of the Perl modules necessary to run RT with the configuration you set above. Here’s what the different parts of the command are doing:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;make dirs&amp;lt;/code&amp;gt; creates RT&#039;s directory structure, so we can install dependencies inside it.&lt;br /&gt;
* &amp;lt;code&amp;gt;make fixdeps&amp;lt;/code&amp;gt; actually installs those dependencies.&lt;br /&gt;
* &amp;lt;code&amp;gt;RT_FIX_DEPS_CMD=…&amp;lt;/code&amp;gt; tells RT to use cpanminus to install dependencies (instead of the older, default &amp;lt;code&amp;gt;cpan&amp;lt;/code&amp;gt; command) inside RT&#039;s directory structure.&lt;br /&gt;
* &amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt; installs all of RT’s files under &amp;lt;code&amp;gt;/opt/rt5&amp;lt;/code&amp;gt; (or the prefix directory you set earlier). It will only run if &amp;lt;code&amp;gt;fixdeps&amp;lt;/code&amp;gt; succeeded.&lt;br /&gt;
&lt;br /&gt;
Make sure you have &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt;ed into the RT source directory, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo make dirs&lt;br /&gt;
make fixdeps RT_FIX_DEPS_CMD=&amp;quot;cpanm --sudo --local-lib-contained=/opt/rt5/local&amp;quot;&lt;br /&gt;
sudo make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
If it works, the command will eventually output a message that says “Congratulations. RT is now installed.” followed by instructions about configuring and setting up the database. We’ll do that next.&lt;br /&gt;
&lt;br /&gt;
=== Configure RT ===&lt;br /&gt;
&lt;br /&gt;
[https://docs.bestpractical.com/rt/latest/RT_Config.html RT has many configuration options.] You can put configuration options in the file &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/code&amp;gt;, or in individual files under &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.d/&amp;lt;/code&amp;gt;. Use an editor to save all the text below to &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/code&amp;gt; (you can just overwrite the existing file, or add this to the bottom of what’s there) and then fill in settings for your site everywhere the text &amp;lt;code&amp;gt;EDIT WITH&amp;lt;/code&amp;gt; appears.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Single-quote all values EXCEPT the special value `undef`&lt;br /&gt;
# that turns off a setting.&lt;br /&gt;
&lt;br /&gt;
# rtname appears in ticket email subjects. It needs to be globally unique,&lt;br /&gt;
# so use your organization&#039;s domain name.&lt;br /&gt;
Set($rtname, &#039;EDIT WITH yourdomain.example.com&#039;);&lt;br /&gt;
# Organization is used in the database for ticket links, etc. It also needs to&lt;br /&gt;
# be globally unique, so use your organization&#039;s domain name.&lt;br /&gt;
Set($Organization, &#039;EDIT WITH yourdomain.example.com&#039;);&lt;br /&gt;
# WebDomain is domain name of the RT web server. RT uses it to construct links&lt;br /&gt;
# and defend against CSRFs.&lt;br /&gt;
Set($WebDomain, &#039;EDIT WITH rt.yourdomain.example.com&#039;);&lt;br /&gt;
# WebPort is the port where the RT web server runs. Edit the number below if&lt;br /&gt;
# you&#039;re not using the standard HTTPS port.&lt;br /&gt;
Set($WebPort, &#039;443&#039;);&lt;br /&gt;
&lt;br /&gt;
# DatabaseUser is the name of the database account RT uses to read and store&lt;br /&gt;
# data. &#039;rt_user&#039; is the default but you can change it if you like.&lt;br /&gt;
# DO NOT use the &#039;rt_admin&#039; superuser created in the instructions above.&lt;br /&gt;
Set($DatabaseUser, &#039;rt_user&#039;);&lt;br /&gt;
# DatabasePassword is the password for DatabaseUser.&lt;br /&gt;
Set($DatabasePassword, &#039;EDIT WITH SomePassphraseHere&#039;);&lt;br /&gt;
# DatabaseHost is the hostname of the database server RT should use.&lt;br /&gt;
# Change &#039;localhost&#039; if it lives on a different server.&lt;br /&gt;
Set($DatabaseHost, &#039;localhost&#039;);&lt;br /&gt;
# DatabasePort is the port number of the database server RT should use.&lt;br /&gt;
# `undef` means the default for that database. Change it if you&#039;re not&lt;br /&gt;
# using the standard port.&lt;br /&gt;
Set($DatabasePort, undef);&lt;br /&gt;
# DatabaseName is the name of RT&#039;s database hosted on DatabaseHost.&lt;br /&gt;
# &#039;rt5&#039; is the default but you can change it if you like.&lt;br /&gt;
Set($DatabaseName, &#039;rt5&#039;);&lt;br /&gt;
# DatabaseAdmin is the name of the user in the database used to perform&lt;br /&gt;
# major administrative tasks. Change &#039;rt_admin&#039; if you&#039;re using a user&lt;br /&gt;
# besides the one created in this guide.&lt;br /&gt;
Set($DatabaseAdmin, &#039;rt_admin&#039;);&lt;br /&gt;
&lt;br /&gt;
# RT can log to syslog, stderr, and/or a dedicated file.&lt;br /&gt;
# Log settings are used both by the primary server and by command line&lt;br /&gt;
# tools like rt-crontool, rt-ldapimport, etc.&lt;br /&gt;
# You set all of RT&#039;s $LogTo* paramaters to a standard log level: &#039;debug&#039;,&lt;br /&gt;
# &#039;info&#039;, &#039;notice&#039;, &#039;warning&#039;, &#039;error&#039;, &#039;critical&#039;, &#039;alert&#039;, or &#039;emergency&#039;.&lt;br /&gt;
# For a modern install, I recommend logging primarily to syslog, so it goes&lt;br /&gt;
# to journald where it&#039;s easy to query and automatically gets rotated.&lt;br /&gt;
Set($LogToSyslog, &#039;info&#039;);&lt;br /&gt;
&lt;br /&gt;
# When the RT server logs to stderr, that usually goes to your web server&#039;s&lt;br /&gt;
# error log. Command line tools log to their own stderr. Setting this to&lt;br /&gt;
# &#039;warning&#039; or &#039;error&#039; helps ensure you get notified if RT&#039;s cron jobs&lt;br /&gt;
# encounter problems.&lt;br /&gt;
Set($LogToSTDERR, &#039;warning&#039;);&lt;br /&gt;
&lt;br /&gt;
# Turn off optional features that require additional configuration.&lt;br /&gt;
# If you want to use these, refer to the RT_Config documentation for&lt;br /&gt;
# instructions on how to set them up.&lt;br /&gt;
Set(%GnuPG, &#039;Enable&#039; =&amp;gt; &#039;0&#039;);&lt;br /&gt;
Set(%SMIME, &#039;Enable&#039; =&amp;gt; &#039;0&#039;);&lt;br /&gt;
&lt;br /&gt;
# Perl expects to find this 1 at the end of the file.&lt;br /&gt;
1;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;RT_SiteConfig.pm&amp;lt;/code&amp;gt; is actually Perl code. RT runs the code directly to load the configuration. Any time you finish editing it, you can check that you didn’t make any syntax errors by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;perl -c /opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Set up RT’s database ===&lt;br /&gt;
&lt;br /&gt;
RT includes a tool to help you set up its database. By default, it connects to the database as an administrator to create the database and user that you configured in the previous step.&lt;br /&gt;
&lt;br /&gt;
(The instructions from &amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt; and RT’s README file tell you to run &amp;lt;code&amp;gt;make initialize-database&amp;lt;/code&amp;gt;. That just runs &amp;lt;code&amp;gt;rt-setup-database&amp;lt;/code&amp;gt; for you. Running the tool directly makes it easier to pass the options you need.)&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;--action=init&amp;lt;/code&amp;gt; tells the tool to create the user, the database, the tables inside it, and insert core data RT needs to function.&lt;br /&gt;
* &#039;&#039;&#039;If&#039;&#039;&#039; you are using an existing database server and the database adminstrator has already created the user account and database for RT, then you can add the &amp;lt;code&amp;gt;--skip-create&amp;lt;/code&amp;gt; option.&lt;br /&gt;
* &#039;&#039;&#039;If&#039;&#039;&#039; you have a less common database setup, this tool has additional options to give you finer-grained control over what steps are run and how. Refer to [https://docs.bestpractical.com/rt/latest/rt-setup-database.html the full rt-setup-database documentation] to learn more about those.&lt;br /&gt;
* The command reads files from RT’s &amp;lt;code&amp;gt;etc/&amp;lt;/code&amp;gt; directory by default, so the easiest way to run it is to &amp;lt;code&amp;gt;cd /opt/rt5&amp;lt;/code&amp;gt; first, and then it will find the necessary files automatically.&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /opt/rt5&lt;br /&gt;
sudo sbin/rt-setup-database --action=init&amp;lt;/pre&amp;gt;&lt;br /&gt;
Enter the password for your database administrator account when prompted.&lt;br /&gt;
&lt;br /&gt;
=== Set up fulltext indexing ===&lt;br /&gt;
&lt;br /&gt;
Fulltext indexing speeds up searches for ticket content, which makes RT a lot nicer to use.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;--noask&amp;lt;/code&amp;gt; uses the default names for the index, which will be fine for a new install and simplifies the setup.&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo /opt/rt5/sbin/rt-setup-fulltext-index --noask&amp;lt;/pre&amp;gt;&lt;br /&gt;
Enter the password for your database administrator account when prompted. The end of the process will output some RT configuration that looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;### EXAMPLE OUTPUT ONLY - Don&#039;t use this directly!&lt;br /&gt;
Set( %FullTextSearch,&lt;br /&gt;
    Enable     =&amp;gt; 1,&lt;br /&gt;
    Indexed    =&amp;gt; 1,&lt;br /&gt;
    # Additional output from rt-setup-fulltext-index should be here.&lt;br /&gt;
    # The configuration varies by database type.&lt;br /&gt;
);&amp;lt;/pre&amp;gt;&lt;br /&gt;
Copy the output generated when you run &amp;lt;code&amp;gt;rt-setup-fulltext-index&amp;lt;/code&amp;gt; and save it to the file &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.d/FulltextIndex.pm&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Set permissions ===&lt;br /&gt;
&lt;br /&gt;
All of RT’s configuration files should be readable by the user that runs the web server, and no other users, in order to protect sensitive information like the database password. RT provides a command to set permissions appropriately according to your distribution and configuration. &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt; to the directory where you extracted the RT source code, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd rt-5.0.2&lt;br /&gt;
sudo make fixperms&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Verify the installation ===&lt;br /&gt;
&lt;br /&gt;
If everything has gone well, then you should be able to set a password for RT’s &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; user. You’ll use this later to log in to the web interface and continue setting up your system. Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo /opt/rt5/sbin/rt-passwd root&amp;lt;/pre&amp;gt;&lt;br /&gt;
Set the password when prompted. Record this; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s web server ==&lt;br /&gt;
&lt;br /&gt;
=== Configure Apache modules ===&lt;br /&gt;
&lt;br /&gt;
You will need to have the following modules enabled in Apache to run RT. You should already have these installed if you followed the instructions above.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;alias&amp;lt;/code&amp;gt; (required to map URLs to RT)&lt;br /&gt;
* &amp;lt;code&amp;gt;fcgid&amp;lt;/code&amp;gt; (required for Apache to talk to RT)&lt;br /&gt;
* &amp;lt;code&amp;gt;mpm_prefork&amp;lt;/code&amp;gt; (Apache requires you to select an MPM. RT is designed to work with the prefork module.)&lt;br /&gt;
* &amp;lt;code&amp;gt;ssl&amp;lt;/code&amp;gt; (required to serve HTTPS; optional otherwise)&lt;br /&gt;
&lt;br /&gt;
Enable them following these instructions:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo a2dismod mpm_event&lt;br /&gt;
sudo a2enmod fcgid&lt;br /&gt;
sudo a2enmod mpm_prefork&lt;br /&gt;
sudo a2enmod ssl&amp;lt;/pre&amp;gt;&lt;br /&gt;
| &amp;lt;pre&amp;gt;echo LoadModule mpm_prefork_module modules/mod_mpm_prefork.so | sudo tee /etc/httpd/conf.modules.d/00-mpm.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Disable default VirtualHosts (optional) ===&lt;br /&gt;
&lt;br /&gt;
If this web server is dedicated to RT, then you should disable the VirtualHosts that are included with the stock configuration. Run:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo a2dissite 000-default&lt;br /&gt;
sudo a2dissite default-ssl&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo sed -i~ &#039;/^&amp;lt;VirtualHost\b/ , /^&amp;lt;\/VirtualHost\b/ d&#039; /etc/httpd/conf.d/ssl.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Configure an Apache VirtualHost ===&lt;br /&gt;
&lt;br /&gt;
Create a file at the following location. You can change the &amp;lt;code&amp;gt;RT&amp;lt;/code&amp;gt; part of the filename if you like, but the file must exist in this directory and have a &amp;lt;code&amp;gt;.conf&amp;lt;/code&amp;gt; suffix.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;/etc/apache2/sites-available/RT.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
Then after you create the file, run: &amp;lt;code&amp;gt;sudo a2ensite RT&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;/etc/httpd/conf.d/vhost_RT.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
(This filename needs to come after &amp;lt;code&amp;gt;ssl.conf&amp;lt;/code&amp;gt; in the directory listing.)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Use an editor to save all the text below to the new &amp;lt;code&amp;gt;RT.conf&amp;lt;/code&amp;gt; and then fill in settings for your site everywhere the text &amp;lt;code&amp;gt;EDIT WITH&amp;lt;/code&amp;gt; appears.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### Primary RT VirtualHost&lt;br /&gt;
# You can change both the bind address and/or the port here as required.&lt;br /&gt;
# This default will listen for HTTPS connections on all interfaces.&lt;br /&gt;
&amp;lt;VirtualHost *:443&amp;gt;&lt;br /&gt;
  # EDIT HERE with the domain name of the web server.&lt;br /&gt;
  ServerName rt.yourdomain.example.com&lt;br /&gt;
  &amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
    SSLEngine on&lt;br /&gt;
    # These specify the paths to the SSL certificate and private key Apache&lt;br /&gt;
    # should use. These example paths are common for Let&#039;s Encrypt. If you&lt;br /&gt;
    # don&#039;t use Let&#039;s Encrypt, the standard location for these files is under&lt;br /&gt;
    # (Debian/Ubuntu) /etc/ssl&lt;br /&gt;
    # (Red Hat/Fedora/CentOS) /etc/pki/tls&lt;br /&gt;
    # EDIT HERE with the appropriate paths for your server&lt;br /&gt;
    SSLCertificateFile /etc/letsencrypt/live/example.com/fullchain.pem&lt;br /&gt;
    SSLCertificateKeyFile /etc/letsencrypt/live/example.com/privkey.pem&lt;br /&gt;
  &amp;lt;/IfModule&amp;gt;&lt;br /&gt;
  &amp;lt;Location /&amp;gt;&lt;br /&gt;
    Require all granted&lt;br /&gt;
    Options +ExecCGI&lt;br /&gt;
    AddHandler fcgid-script fcgi&lt;br /&gt;
  &amp;lt;/Location&amp;gt;&lt;br /&gt;
  AddDefaultCharset UTF-8&lt;br /&gt;
  DocumentRoot /opt/rt5/share/html&lt;br /&gt;
  ScriptAlias / /opt/rt5/sbin/rt-server.fcgi/&lt;br /&gt;
  # The default mod_fcgid timeout is 40 seconds.&lt;br /&gt;
  # We increase it here to allow for large ticket searches, etc.&lt;br /&gt;
  FcgidIOTimeout 200&lt;br /&gt;
  # mod_fcgid only allows 128KiB requests by default. This is too small for users&lt;br /&gt;
  # to upload files to RT. You can ultimately choose any setting you&#039;re&lt;br /&gt;
  # comfortable with; 70MiB here should allow most requests without being too&lt;br /&gt;
  # open.&lt;br /&gt;
  FcgidMaxRequestLen 73400320&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
### End primary RT VirtualHost&lt;br /&gt;
&lt;br /&gt;
### Optional HTTPS Redirect VirtualHost&lt;br /&gt;
# Most modern servers support HTTPS and want all web traffic to go through it.&lt;br /&gt;
# This VirtualHost redirects normal HTTP traffic to HTTPS.&lt;br /&gt;
# You can delete this whole section if you don&#039;t want or need this.&lt;br /&gt;
&amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
  # You can change both the bind address and/or the port here as required.&lt;br /&gt;
  # This default will listen for HTTP connections on all interfaces.&lt;br /&gt;
  &amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
    SSLEngine off&lt;br /&gt;
    # EDIT HERE both lines below with the domain name of your web server.&lt;br /&gt;
    ServerName rt.yourdomain.example.com&lt;br /&gt;
    Redirect permanent / https://rt.yourdomain.example.com/&lt;br /&gt;
  &amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/IfModule&amp;gt;&lt;br /&gt;
### End optional HTTPS Redirect VirtualHost&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
After you’ve edited the file, load the configuration with:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo systemctl reload apache2&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo systemctl reload httpd&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If this command reports an error, double-check the configuration file for typos, especially in option names, file paths, and the&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;amp;lt;Section&amp;amp;gt;&amp;lt;/code&amp;gt; pairs. Edit again and reload the configuration until it succeeds without output.&lt;br /&gt;
&lt;br /&gt;
=== Verify the web interface ===&lt;br /&gt;
&lt;br /&gt;
You should be able to visit your web server in your browser, and be presented with RT’s login screen. You should be able to log in with username &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; and the password you set previously.&lt;br /&gt;
&lt;br /&gt;
If you run into trouble, the first place to look for more information is by reading Apache’s error log:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo less /var/log/apache2/error.log&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo less /var/log/httpd/error.log&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s mail server ==&lt;br /&gt;
&lt;br /&gt;
RT both can both send and receive ticket updates via email. Unfortunately, there are too many variables to document a useful setup process here: getting this working usually requires creating DNS records, and coordinating with existing mail servers, which will be the main constraint on your setup. Instead this guide provides a brief overview of how the integration works, and where the connection points are that you likely need to work on.&lt;br /&gt;
&lt;br /&gt;
=== Sending Mail ===&lt;br /&gt;
&lt;br /&gt;
RT only knows how to send mail by passing it off to another program on the system. It cannot connect or authenticate directly to external mail servers. In the default configuration, RT runs the standard &amp;lt;code&amp;gt;sendmail&amp;lt;/code&amp;gt; command. There are [https://docs.bestpractical.com/rt/latest/RT_Config.html#Outgoing-mail configuration options to send mail through different commands] if you need.&lt;br /&gt;
&lt;br /&gt;
The most common setup is to install and configure a proper Mail Transfer Agent (MTA) like Postfix or Exim, and then configure it to send mail to the wider Internet as you need. This works well because the MTAs are robust and well-tested; they have flexible configuration to let you send mail out by relaying to other mail servers you specify with optional authentication; and most distributions install one by default anyway. The only hard part is configuring the MTA to send mail following your site’s policies.&lt;br /&gt;
&lt;br /&gt;
Other software is available that provides a slimmer version of the &amp;lt;code&amp;gt;sendmail&amp;lt;/code&amp;gt; command that connects to an external mail server for you, like ssmtp. These programs are usually easier to configure than an MTA, but they often lose email permanently if they can’t connect to the external server at the time it’s sent. (MTAs keep email queued locally until they successfully deliver it to another server.)&lt;br /&gt;
&lt;br /&gt;
=== Receiving email ===&lt;br /&gt;
&lt;br /&gt;
RT installs a command called &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; that receives an email on standard input and posts it to RT’s REST web interface, where it gets saved in the database and added to a ticket. You need to arrange for a way to send incoming email to this command.&lt;br /&gt;
&lt;br /&gt;
The most common setup is to have an MTA on the same box as RT receive email directly, and then set up mail aliases that call this command when mail comes in. Example &amp;lt;code&amp;gt;/etc/aliases&amp;lt;/code&amp;gt; entries look like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rt: &amp;quot;|/opt/rt5/bin/rt-mailgate --queue general --action correspond --url https://rt.yourdomain.example.com/&amp;quot;&lt;br /&gt;
rt-comment: &amp;quot;|/opt/rt5/bin/rt-mailgate --queue general --action comment --url https://rt.yourdomain.example.com/&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
This works well because, again, you’re probably running an MTA anyway; and the MTA can hold and queue mail if it comes in while RT is down for any reason, giving you a buffer against downtime.&lt;br /&gt;
&lt;br /&gt;
Another common option is to periodically run a tool that fetches mail using a protocol like IMAP, like fetchmail or getmail, and passes it on to &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt;. This is less common because it requires setting up another tool to run, and securely storing another set of mail server credentials. But it is useful when local policy prevents the RT server from receiving email directly.&lt;br /&gt;
&lt;br /&gt;
This is much less common, but it might help to know that &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; doesn’t have to run on the same system as RT itself. It just needs to be able to connect to RT’s web interface. If you don’t have any other options, you can install the RT software on a different system that receives email, and configure &#039;&#039;that&#039;&#039; system to run &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; and pass it on to the RT server. To do that, just repeat the installation instructions above, skipping the steps about installing the database and web server.&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s background jobs ==&lt;br /&gt;
&lt;br /&gt;
Create a file &amp;lt;code&amp;gt;/etc/cron.d/rt&amp;lt;/code&amp;gt; with the following content. You may edit all of the time fields as you see fit. Refer to the crontab(5) man page for details about their definitions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Update the fulltext index with new ticket data&lt;br /&gt;
*/3 *   *   *   *   root    /opt/rt5/sbin/rt-fulltext-indexer&lt;br /&gt;
# Email out dashboards that users have subscribed to&lt;br /&gt;
0   *   *   *   *   root    /opt/rt5/sbin/rt-email-dashboards&lt;br /&gt;
# Clean old sessions from the database&lt;br /&gt;
10  3   *   *   *   root    /opt/rt5/sbin/rt-clean-sessions --older 8d&lt;br /&gt;
# Email out weekly digests for users who have requested it&lt;br /&gt;
50  4   *   *   Mon root    /opt/rt5/sbin/rt-email-digest -m weekly&lt;br /&gt;
# Email out daily digests for users who have requested it&lt;br /&gt;
50  5   *   *   *   root    /opt/rt5/sbin/rt-email-digest -m daily&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
You can run all these jobs as the same user that runs your web server, rather than root. Run:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo sed -i &#039;s/\broot\b/www-data/&#039; /etc/cron.d/rt&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo sed -i &#039;s/\broot\b/apache/&#039; /etc/cron.d/rt&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Set up RT ==&lt;br /&gt;
&lt;br /&gt;
If you’ve gotten this far, congratulations, your RT install is really done now. You can start setting up RT with users, groups, queues, and business logic. [[Main Page|Head back to the main page]] to start exploring those topics.&lt;/div&gt;</summary>
		<author><name>Brett</name></author>
	</entry>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=ManualInstallation&amp;diff=27070</id>
		<title>ManualInstallation</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=ManualInstallation&amp;diff=27070"/>
		<updated>2022-03-03T21:41:46Z</updated>

		<summary type="html">&lt;p&gt;Brett: remove unsupported quotes from PERL_CPANM_OPT&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Prev: [[ManualRequirements]] — Up: [[UserManual]] — Next: [[ManualApacheConfig]]&lt;br /&gt;
&lt;br /&gt;
This guide walks you through installing RT from source on a modern, popular Linux distro. Specifically, that means a distribution based on Debian or Red Hat that’s been released since around 2020.&lt;br /&gt;
&lt;br /&gt;
This guide assumes:&lt;br /&gt;
&lt;br /&gt;
* You can install packages generally available in Debian/Ubuntu or Red Hat/Fedora/CentOS.&lt;br /&gt;
* You want to install RT, and all of its Perl dependencies, from source to get the latest versions. (This is a trade-off. It means the boundaries of your install will be very clear, but you won’t get security updates for RT or Perl modules from your distribution.)&lt;br /&gt;
* You are willing to install a couple of extra tools to manage the RT installation similarly to how you would in other packaging systems (like PyPI, npm, etc.).&lt;br /&gt;
* You are willing to do a relatively maximal install of RT, enabling all the options during installation and then setting what you need in the configuration. (You could save a little space and time by being pickier about your options, but then that complicates the guide and makes it harder to turn those options on later if you want.)&lt;br /&gt;
* You are using a regular user account on the Linux system that can get superuser privileges with sudo.&lt;br /&gt;
&lt;br /&gt;
== Install the base dependencies ==&lt;br /&gt;
&lt;br /&gt;
These are required by RT, either to run or to install the dependencies.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install autoconf build-essential cpanminus curl libexpat-dev libgd-dev libssl-dev libz-dev gnupg graphviz lynx openssl perl&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf config-manager --set-enabled powertools&lt;br /&gt;
sudo dnf install patch tar which gcc gcc-c++ perl-core perl-App-cpanminus graphviz expat-devel gd-devel lynx openssl openssl-devel&lt;br /&gt;
sudo setenforce 0&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
(Turning off SELinux enforcement is required on Red Hat-based distributions because, as of October 2021, nobody has written a policy for RT.)&lt;br /&gt;
&lt;br /&gt;
== Install a database ==&lt;br /&gt;
&lt;br /&gt;
You need access to a database server. It can be remote, or you can install a database server alongside RT. RT supports a few different databases, but the best supported options are PostgreSQL and MariaDB.&lt;br /&gt;
&lt;br /&gt;
=== Installing and configuring the PostgreSQL server ===&lt;br /&gt;
&lt;br /&gt;
If you want to install a fresh PostgreSQL database server alongside RT:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install postgresql&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install postgresql-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In order to set up RT’s database, you will need a PostgreSQL account that can create databases and roles and be authenticated with a password. If you don’t have that, you can create it by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo createuser --createdb --createrole --login --pwprompt rt_admin&amp;lt;/pre&amp;gt;&lt;br /&gt;
Set the password when prompted. Record this; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
=== Enable password authentication in PostgreSQL ===&lt;br /&gt;
&lt;br /&gt;
You need to consider this step whether you install the database locally, or use an existing one already running. RT supports connecting to PostgreSQL a few different ways, but authenticating with a username and password is simplest, and this guide is written based on that. Not all PostgreSQL installations allow this authentication method by default. You need to review your &amp;lt;code&amp;gt;pg_hba.conf&amp;lt;/code&amp;gt; file located at:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;/etc/postgresql/VERSION/main/pg_hba.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;/var/lib/pgsql/VERSION/data/pg_hba.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Replace &amp;lt;code&amp;gt;VERSION&amp;lt;/code&amp;gt; with the version of your PostgreSQL database. Add these two lines &#039;&#039;&#039;above&#039;&#039;&#039; any other lines that start with &amp;lt;code&amp;gt;host&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;host  rt5  rt_user   all  md5&lt;br /&gt;
host  rt5  rt_admin  all  md5&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This configuration will let &amp;lt;code&amp;gt;rt_user&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;rt_admin&amp;lt;/code&amp;gt; authorize themselves for the &amp;lt;code&amp;gt;rt5&amp;lt;/code&amp;gt; database using an &amp;lt;code&amp;gt;md5&amp;lt;/code&amp;gt; crypted password over a network connection (possibly using the localhost loopback network). You might be able to further restrict some of these fields for improved security, but doing so is outside the scope of this install guide. Refer to [https://www.postgresql.org/docs/current/auth-pg-hba-conf.html the pg_hba.conf documentation] for more details.&lt;br /&gt;
&lt;br /&gt;
Save your changes and reload the database:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo systemctl reload postgresql&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Installing the PostgreSQL client libraries ===&lt;br /&gt;
&lt;br /&gt;
These are required for RT to be able to talk to any PostgreSQL server.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install libpq-dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install postgresql-devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Once this is done you can skip ahead to installing a web server.&lt;br /&gt;
&lt;br /&gt;
=== Installing and configuring the MariaDB server ===&lt;br /&gt;
&lt;br /&gt;
If you want to install a fresh MariaDB database server alongside RT:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install mariadb-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install mariadb-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In order to set up RT’s database, you will need a MySQL superuser account. To stay consistent with PostgreSQL, I suggest setting a password for it. You can do that by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo mysql mysql&lt;br /&gt;
MariaDB [mysql]&amp;amp;gt; GRANT ALL PRIVILEGES ON rt5.* TO rt_admin@localhost IDENTIFIED BY &#039;YourPassphraseHere&#039; WITH GRANT OPTION;&amp;lt;/pre&amp;gt;&lt;br /&gt;
Record your passphrase; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
=== Adjust MariaDB’s max_allowed_packet setting ===&lt;br /&gt;
&lt;br /&gt;
You need to consider this step whether you install the database locally, or use an existing one already running. [https://mariadb.com/kb/en/server-system-variables/#max_allowed_packet MariaDB’s &amp;lt;code&amp;gt;max_allowed_packet&amp;lt;/code&amp;gt; setting] functionally limits the size of attachments in RT. The default is 16MiB, which is too small for most installations. You can ultimately choose any setting you’re comfortable with; 64MiB here should allow most requests without being too open.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;echo -e &#039;[client-server]\nmax_allowed_packet=64M\n&#039; | sudo tee /etc/mysql/conf.d/max_allowed_packet.cnf&lt;br /&gt;
sudo systemctl reload mariadb&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;echo -e &#039;[client-server]\nmax_allowed_packet=64M\n&#039; | sudo tee /etc/my.cnf.d/max_allowed_packet.cnf&lt;br /&gt;
sudo systemctl reload mariadb&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Installing the MariaDB client libraries ===&lt;br /&gt;
&lt;br /&gt;
These are required for RT to be able to talk to any MariaDB server.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install libmariadb-dev libmariadb-dev-compat&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install mariadb-devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Install a web server with FastCGI ==&lt;br /&gt;
&lt;br /&gt;
FastCGI is the best way to host RT’s web interface today. Installing the web server before RT makes the installation process simpler, because RT will be able to automatically some details about your web server like what user it runs as.&lt;br /&gt;
&lt;br /&gt;
=== Installing Apache ===&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install apache2 libapache2-mod-fcgid&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install httpd mod_fcgid mod_ssl&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ### Installing nginx --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Install RT ==&lt;br /&gt;
&lt;br /&gt;
=== Get and unpack the RT source code ===&lt;br /&gt;
&lt;br /&gt;
Download the latest source code using the link on the [https://bestpractical.com/download-page RT download page], extract it using &amp;lt;code&amp;gt;tar -xf&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt; into the source code directory to run the rest of the commands in this section. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;curl -O https://download.bestpractical.com/pub/rt/release/rt-5.0.2.tar.gz&lt;br /&gt;
tar -xf rt-5.0.2.tar.gz&lt;br /&gt;
cd rt-5.0.2&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Pre-configure RT ===&lt;br /&gt;
&lt;br /&gt;
This command will detect some information about your system in order to install RT properly, and decide which set of dependencies to install. Here’s what the different parts of our command are doing:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;--with-db-type=TYPE&amp;lt;/code&amp;gt; - Replace &amp;lt;code&amp;gt;TYPE&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;Pg&amp;lt;/code&amp;gt; for PostgreSQL, or &amp;lt;code&amp;gt;mysql&amp;lt;/code&amp;gt; for MariaDB.&lt;br /&gt;
* &amp;lt;code&amp;gt;--prefix=/opt/rt5&amp;lt;/code&amp;gt; sets the directory where RT will install all of its libraries, tools, and supporting files. You can choose another path if you like.&lt;br /&gt;
* The rest of the options tell RT to install additional dependencies for optional features.&lt;br /&gt;
&lt;br /&gt;
Make sure you have &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt;ed into the RT source directory, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;./configure --with-db-type=TYPE --prefix=/opt/rt5 --with-attachment-store=disk --enable-externalauth --enable-gd --enable-graphviz --enable-gpg --enable-smime&amp;lt;/pre&amp;gt;&lt;br /&gt;
For more background, [https://docs.bestpractical.com/rt/latest/configure.html refer to the RT configure options documentation].&lt;br /&gt;
&lt;br /&gt;
=== Set up RT&#039;s install environment ===&lt;br /&gt;
&lt;br /&gt;
These steps set things up so we can install RT&#039;s Perl dependencies alongside RT itself. Make sure you have &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt;ed into the RT source directory, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo make dirs&lt;br /&gt;
sudo ln -s . /opt/rt5/local/lib/perl5&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next we write an environment file that configures Perl tools, including RT itself, to load and install libraries under the RT install directory. Use an editor to save all the text below to &amp;lt;code&amp;gt;/opt/rt5/RT.env&amp;lt;/code&amp;gt;. If you&#039;re using a different installation prefix, you should edit the line that sets &amp;lt;code&amp;gt;RTHOME&amp;lt;/code&amp;gt; to the directory you chose. Otherwise, you shouldn&#039;t need to make any changes to this file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# RT.env&lt;br /&gt;
# When you want to do maintenance on RT (like installing or upgrading&lt;br /&gt;
# dependencies or plugins), load this file in your shell by running:&lt;br /&gt;
#   . /opt/rt5/RT.env&lt;br /&gt;
# This will set the necessary environment variables to load and&lt;br /&gt;
# install Perl modules under the RT installation directory.&lt;br /&gt;
export RTHOME=&amp;quot;/opt/rt5&amp;quot;&lt;br /&gt;
export PERL5LIB=&amp;quot;$RTHOME/local/lib${PERL5LIB:+:$PERL5LIB}&amp;quot;&lt;br /&gt;
export PERL_CPANM_OPT=&amp;quot;${PERL_CPANM_OPT:+$PERL_CPANM_OPT }--sudo --local-lib-contained=$RTHOME/local&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Install RT and its Perl dependencies ===&lt;br /&gt;
&lt;br /&gt;
This command will download, build, and install all of the Perl modules necessary to run RT with the configuration you set above. Here’s what the different parts of the command are doing:&lt;br /&gt;
&lt;br /&gt;
* First we load the environment we set up in the last step, to install dependencies in RT&#039;s install directories.&lt;br /&gt;
* &amp;lt;code&amp;gt;make fixdeps&amp;lt;/code&amp;gt; actually installs those dependencies.&lt;br /&gt;
* &amp;lt;code&amp;gt;RT_FIX_DEPS_CMD=cpanm&amp;lt;/code&amp;gt; tells RT to use cpanminus to install dependencies (instead of the older, default &amp;lt;code&amp;gt;cpan&amp;lt;/code&amp;gt; command).&lt;br /&gt;
* &amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt; installs all of RT’s files under &amp;lt;code&amp;gt;/opt/rt5&amp;lt;/code&amp;gt; (or the prefix directory you set earlier). It will only run if &amp;lt;code&amp;gt;fixdeps&amp;lt;/code&amp;gt; installed all the necessary libraries under &amp;lt;code&amp;gt;PERL5LIB&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Make sure you have &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt;ed into the RT source directory, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;. /opt/rt5/RT.env&lt;br /&gt;
make fixdeps RT_FIX_DEPS_CMD=cpanm&lt;br /&gt;
sudo make install PERL5LIB=&amp;quot;$PERL5LIB&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
If it works, the command will eventually output a message that says “Congratulations. RT is now installed.” followed by instructions about configuring and setting up the database. We’ll do that next.&lt;br /&gt;
&lt;br /&gt;
=== Configure RT ===&lt;br /&gt;
&lt;br /&gt;
[https://docs.bestpractical.com/rt/latest/RT_Config.html RT has many configuration options.] You can put configuration options in the file &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/code&amp;gt;, or in individual files under &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.d/&amp;lt;/code&amp;gt;. Use an editor to save all the text below to &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/code&amp;gt; (you can just overwrite the existing file, or add this to the bottom of what’s there) and then fill in settings for your site everywhere the text &amp;lt;code&amp;gt;EDIT WITH&amp;lt;/code&amp;gt; appears.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Single-quote all values EXCEPT the special value `undef`&lt;br /&gt;
# that turns off a setting.&lt;br /&gt;
&lt;br /&gt;
# rtname appears in ticket email subjects. It needs to be globally unique,&lt;br /&gt;
# so use your organization&#039;s domain name.&lt;br /&gt;
Set($rtname, &#039;EDIT WITH yourdomain.example.com&#039;);&lt;br /&gt;
# Organization is used in the database for ticket links, etc. It also needs to&lt;br /&gt;
# be globally unique, so use your organization&#039;s domain name.&lt;br /&gt;
Set($Organization, &#039;EDIT WITH yourdomain.example.com&#039;);&lt;br /&gt;
# WebDomain is domain name of the RT web server. RT uses it to construct links&lt;br /&gt;
# and defend against CSRFs.&lt;br /&gt;
Set($WebDomain, &#039;EDIT WITH rt.yourdomain.example.com&#039;);&lt;br /&gt;
# WebPort is the port where the RT web server runs. Edit the number below if&lt;br /&gt;
# you&#039;re not using the standard HTTPS port.&lt;br /&gt;
Set($WebPort, &#039;443&#039;);&lt;br /&gt;
&lt;br /&gt;
# DatabaseUser is the name of the database account RT uses to read and store&lt;br /&gt;
# data. &#039;rt_user&#039; is the default but you can change it if you like.&lt;br /&gt;
# DO NOT use the &#039;rt_admin&#039; superuser created in the instructions above.&lt;br /&gt;
Set($DatabaseUser, &#039;rt_user&#039;);&lt;br /&gt;
# DatabasePassword is the password for DatabaseUser.&lt;br /&gt;
Set($DatabasePassword, &#039;EDIT WITH SomePassphraseHere&#039;);&lt;br /&gt;
# DatabaseHost is the hostname of the database server RT should use.&lt;br /&gt;
# Change &#039;localhost&#039; if it lives on a different server.&lt;br /&gt;
Set($DatabaseHost, &#039;localhost&#039;);&lt;br /&gt;
# DatabasePort is the port number of the database server RT should use.&lt;br /&gt;
# `undef` means the default for that database. Change it if you&#039;re not&lt;br /&gt;
# using the standard port.&lt;br /&gt;
Set($DatabasePort, undef);&lt;br /&gt;
# DatabaseName is the name of RT&#039;s database hosted on DatabaseHost.&lt;br /&gt;
# &#039;rt5&#039; is the default but you can change it if you like.&lt;br /&gt;
Set($DatabaseName, &#039;rt5&#039;);&lt;br /&gt;
# DatabaseAdmin is the name of the user in the database used to perform&lt;br /&gt;
# major administrative tasks. Change &#039;rt_admin&#039; if you&#039;re using a user&lt;br /&gt;
# besides the one created in this guide.&lt;br /&gt;
Set($DatabaseAdmin, &#039;rt_admin&#039;);&lt;br /&gt;
&lt;br /&gt;
# RT can log to syslog, stderr, and/or a dedicated file.&lt;br /&gt;
# Log settings are used both by the primary server and by command line&lt;br /&gt;
# tools like rt-crontool, rt-ldapimport, etc.&lt;br /&gt;
# You set all of RT&#039;s $LogTo* paramaters to a standard log level: &#039;debug&#039;,&lt;br /&gt;
# &#039;info&#039;, &#039;notice&#039;, &#039;warning&#039;, &#039;error&#039;, &#039;critical&#039;, &#039;alert&#039;, or &#039;emergency&#039;.&lt;br /&gt;
# For a modern install, I recommend logging primarily to syslog, so it goes&lt;br /&gt;
# to journald where it&#039;s easy to query and automatically gets rotated.&lt;br /&gt;
Set($LogToSyslog, &#039;info&#039;);&lt;br /&gt;
&lt;br /&gt;
# When the RT server logs to stderr, that usually goes to your web server&#039;s&lt;br /&gt;
# error log. Command line tools log to their own stderr. Setting this to&lt;br /&gt;
# &#039;warning&#039; or &#039;error&#039; helps ensure you get notified if RT&#039;s cron jobs&lt;br /&gt;
# encounter problems.&lt;br /&gt;
Set($LogToSTDERR, &#039;warning&#039;);&lt;br /&gt;
&lt;br /&gt;
# Turn off optional features that require additional configuration.&lt;br /&gt;
# If you want to use these, refer to the RT_Config documentation for&lt;br /&gt;
# instructions on how to set them up.&lt;br /&gt;
Set(%GnuPG, &#039;Enable&#039; =&amp;gt; &#039;0&#039;);&lt;br /&gt;
Set(%SMIME, &#039;Enable&#039; =&amp;gt; &#039;0&#039;);&lt;br /&gt;
&lt;br /&gt;
# Perl expects to find this 1 at the end of the file.&lt;br /&gt;
1;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;RT_SiteConfig.pm&amp;lt;/code&amp;gt; is actually Perl code. RT runs the code directly to load the configuration. Any time you finish editing it, you can check that you didn’t make any syntax errors by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;perl -c /opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Set up RT’s database ===&lt;br /&gt;
&lt;br /&gt;
RT includes a tool to help you set up its database. By default, it connects to the database as an administrator to create the database and user that you configured in the previous step.&lt;br /&gt;
&lt;br /&gt;
(The instructions from &amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt; and RT’s README file tell you to run &amp;lt;code&amp;gt;make initialize-database&amp;lt;/code&amp;gt;. That just runs &amp;lt;code&amp;gt;rt-setup-database&amp;lt;/code&amp;gt; for you. Running the tool directly makes it easier to pass the options you need.)&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;--action=init&amp;lt;/code&amp;gt; tells the tool to create the user, the database, the tables inside it, and insert core data RT needs to function.&lt;br /&gt;
* &#039;&#039;&#039;If&#039;&#039;&#039; you are using an existing database server and the database adminstrator has already created the user account and database for RT, then you can add the &amp;lt;code&amp;gt;--skip-create&amp;lt;/code&amp;gt; option.&lt;br /&gt;
* &#039;&#039;&#039;If&#039;&#039;&#039; you have a less common database setup, this tool has additional options to give you finer-grained control over what steps are run and how. Refer to [https://docs.bestpractical.com/rt/latest/rt-setup-database.html the full rt-setup-database documentation] to learn more about those.&lt;br /&gt;
* The command reads files from RT’s &amp;lt;code&amp;gt;etc/&amp;lt;/code&amp;gt; directory by default, so the easiest way to run it is to &amp;lt;code&amp;gt;cd /opt/rt5&amp;lt;/code&amp;gt; first, and then it will find the necessary files automatically.&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /opt/rt5&lt;br /&gt;
sudo sbin/rt-setup-database --action=init&amp;lt;/pre&amp;gt;&lt;br /&gt;
Enter the password for your database administrator account when prompted.&lt;br /&gt;
&lt;br /&gt;
=== Set up fulltext indexing ===&lt;br /&gt;
&lt;br /&gt;
Fulltext indexing speeds up searches for ticket content, which makes RT a lot nicer to use.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;--noask&amp;lt;/code&amp;gt; uses the default names for the index, which will be fine for a new install and simplifies the setup.&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo /opt/rt5/sbin/rt-setup-fulltext-index --noask&amp;lt;/pre&amp;gt;&lt;br /&gt;
Enter the password for your database administrator account when prompted. The end of the process will output some RT configuration that looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;### EXAMPLE OUTPUT ONLY - Don&#039;t use this directly!&lt;br /&gt;
Set( %FullTextSearch,&lt;br /&gt;
    Enable     =&amp;gt; 1,&lt;br /&gt;
    Indexed    =&amp;gt; 1,&lt;br /&gt;
    # Additional output from rt-setup-fulltext-index should be here.&lt;br /&gt;
    # The configuration varies by database type.&lt;br /&gt;
);&amp;lt;/pre&amp;gt;&lt;br /&gt;
Copy the output generated when you run &amp;lt;code&amp;gt;rt-setup-fulltext-index&amp;lt;/code&amp;gt; and save it to the file &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.d/FulltextIndex.pm&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Set permissions ===&lt;br /&gt;
&lt;br /&gt;
All of RT’s configuration files should be readable by the user that runs the web server, and no other users, in order to protect sensitive information like the database password. RT provides a command to set permissions appropriately according to your distribution and configuration. &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt; to the directory where you extracted the RT source code, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd rt-5.0.2&lt;br /&gt;
sudo make fixperms&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Verify the installation ===&lt;br /&gt;
&lt;br /&gt;
If everything has gone well, then you should be able to set a password for RT’s &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; user. You’ll use this later to log in to the web interface and continue setting up your system. Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo /opt/rt5/sbin/rt-passwd root&amp;lt;/pre&amp;gt;&lt;br /&gt;
Set the password when prompted. Record this; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s web server ==&lt;br /&gt;
&lt;br /&gt;
=== Configure Apache modules ===&lt;br /&gt;
&lt;br /&gt;
You will need to have the following modules enabled in Apache to run RT. You should already have these installed if you followed the instructions above.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;alias&amp;lt;/code&amp;gt; (required to map URLs to RT)&lt;br /&gt;
* &amp;lt;code&amp;gt;fcgid&amp;lt;/code&amp;gt; (required for Apache to talk to RT)&lt;br /&gt;
* &amp;lt;code&amp;gt;mpm_prefork&amp;lt;/code&amp;gt; (Apache requires you to select an MPM. RT is designed to work with the prefork module.)&lt;br /&gt;
* &amp;lt;code&amp;gt;ssl&amp;lt;/code&amp;gt; (required to serve HTTPS; optional otherwise)&lt;br /&gt;
&lt;br /&gt;
Enable them following these instructions:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo a2dismod mpm_event&lt;br /&gt;
sudo a2enmod fcgid&lt;br /&gt;
sudo a2enmod mpm_prefork&lt;br /&gt;
sudo a2enmod ssl&amp;lt;/pre&amp;gt;&lt;br /&gt;
| &amp;lt;pre&amp;gt;echo LoadModule mpm_prefork_module modules/mod_mpm_prefork.so | sudo tee /etc/httpd/conf.modules.d/00-mpm.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Disable default VirtualHosts (optional) ===&lt;br /&gt;
&lt;br /&gt;
If this web server is dedicated to RT, then you should disable the VirtualHosts that are included with the stock configuration. Run:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo a2dissite 000-default&lt;br /&gt;
sudo a2dissite default-ssl&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo sed -i~ &#039;/^&amp;lt;VirtualHost\b/ , /^&amp;lt;\/VirtualHost\b/ d&#039; /etc/httpd/conf.d/ssl.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Configure an Apache VirtualHost ===&lt;br /&gt;
&lt;br /&gt;
Create a file at the following location. You can change the &amp;lt;code&amp;gt;RT&amp;lt;/code&amp;gt; part of the filename if you like, but the file must exist in this directory and have a &amp;lt;code&amp;gt;.conf&amp;lt;/code&amp;gt; suffix.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;/etc/apache2/sites-available/RT.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
Then after you create the file, run: &amp;lt;code&amp;gt;sudo a2ensite RT&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;/etc/httpd/conf.d/vhost_RT.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
(This filename needs to come after &amp;lt;code&amp;gt;ssl.conf&amp;lt;/code&amp;gt; in the directory listing.)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Use an editor to save all the text below to the new &amp;lt;code&amp;gt;RT.conf&amp;lt;/code&amp;gt; and then fill in settings for your site everywhere the text &amp;lt;code&amp;gt;EDIT WITH&amp;lt;/code&amp;gt; appears.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### Primary RT VirtualHost&lt;br /&gt;
# You can change both the bind address and/or the port here as required.&lt;br /&gt;
# This default will listen for HTTPS connections on all interfaces.&lt;br /&gt;
&amp;lt;VirtualHost *:443&amp;gt;&lt;br /&gt;
  # EDIT HERE with the domain name of the web server.&lt;br /&gt;
  ServerName rt.yourdomain.example.com&lt;br /&gt;
  &amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
    SSLEngine on&lt;br /&gt;
    # These specify the paths to the SSL certificate and private key Apache&lt;br /&gt;
    # should use. These example paths are common for Let&#039;s Encrypt. If you&lt;br /&gt;
    # don&#039;t use Let&#039;s Encrypt, the standard location for these files is under&lt;br /&gt;
    # (Debian/Ubuntu) /etc/ssl&lt;br /&gt;
    # (Red Hat/Fedora/CentOS) /etc/pki/tls&lt;br /&gt;
    # EDIT HERE with the appropriate paths for your server&lt;br /&gt;
    SSLCertificateFile /etc/letsencrypt/live/example.com/fullchain.pem&lt;br /&gt;
    SSLCertificateKeyFile /etc/letsencrypt/live/example.com/privkey.pem&lt;br /&gt;
  &amp;lt;/IfModule&amp;gt;&lt;br /&gt;
  &amp;lt;Location /&amp;gt;&lt;br /&gt;
    Require all granted&lt;br /&gt;
    Options +ExecCGI&lt;br /&gt;
    AddHandler fcgid-script fcgi&lt;br /&gt;
  &amp;lt;/Location&amp;gt;&lt;br /&gt;
  AddDefaultCharset UTF-8&lt;br /&gt;
  DocumentRoot /opt/rt5/share/html&lt;br /&gt;
  ScriptAlias / /opt/rt5/sbin/rt-server.fcgi/&lt;br /&gt;
  # The default mod_fcgid timeout is 40 seconds.&lt;br /&gt;
  # We increase it here to allow for large ticket searches, etc.&lt;br /&gt;
  FcgidIOTimeout 200&lt;br /&gt;
  # mod_fcgid only allows 128KiB requests by default. This is too small for users&lt;br /&gt;
  # to upload files to RT. You can ultimately choose any setting you&#039;re&lt;br /&gt;
  # comfortable with; 70MiB here should allow most requests without being too&lt;br /&gt;
  # open.&lt;br /&gt;
  FcgidMaxRequestLen 73400320&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
### End primary RT VirtualHost&lt;br /&gt;
&lt;br /&gt;
### Optional HTTPS Redirect VirtualHost&lt;br /&gt;
# Most modern servers support HTTPS and want all web traffic to go through it.&lt;br /&gt;
# This VirtualHost redirects normal HTTP traffic to HTTPS.&lt;br /&gt;
# You can delete this whole section if you don&#039;t want or need this.&lt;br /&gt;
&amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
  # You can change both the bind address and/or the port here as required.&lt;br /&gt;
  # This default will listen for HTTP connections on all interfaces.&lt;br /&gt;
  &amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
    SSLEngine off&lt;br /&gt;
    # EDIT HERE both lines below with the domain name of your web server.&lt;br /&gt;
    ServerName rt.yourdomain.example.com&lt;br /&gt;
    Redirect permanent / https://rt.yourdomain.example.com/&lt;br /&gt;
  &amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/IfModule&amp;gt;&lt;br /&gt;
### End optional HTTPS Redirect VirtualHost&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
After you’ve edited the file, load the configuration with:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo systemctl reload apache2&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo systemctl reload httpd&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If this command reports an error, double-check the configuration file for typos, especially in option names, file paths, and the&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;amp;lt;Section&amp;amp;gt;&amp;lt;/code&amp;gt; pairs. Edit again and reload the configuration until it succeeds without output.&lt;br /&gt;
&lt;br /&gt;
=== Verify the web interface ===&lt;br /&gt;
&lt;br /&gt;
You should be able to visit your web server in your browser, and be presented with RT’s login screen. You should be able to log in with username &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; and the password you set previously.&lt;br /&gt;
&lt;br /&gt;
If you run into trouble, the first place to look for more information is by reading Apache’s error log:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo less /var/log/apache2/error.log&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo less /var/log/httpd/error.log&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s mail server ==&lt;br /&gt;
&lt;br /&gt;
RT both can both send and receive ticket updates via email. Unfortunately, there are too many variables to document a useful setup process here: getting this working usually requires creating DNS records, and coordinating with existing mail servers, which will be the main constraint on your setup. Instead this guide provides a brief overview of how the integration works, and where the connection points are that you likely need to work on.&lt;br /&gt;
&lt;br /&gt;
=== Sending Mail ===&lt;br /&gt;
&lt;br /&gt;
RT only knows how to send mail by passing it off to another program on the system. It cannot connect or authenticate directly to external mail servers. In the default configuration, RT runs the standard &amp;lt;code&amp;gt;sendmail&amp;lt;/code&amp;gt; command. There are [https://docs.bestpractical.com/rt/latest/RT_Config.html#Outgoing-mail configuration options to send mail through different commands] if you need.&lt;br /&gt;
&lt;br /&gt;
The most common setup is to install and configure a proper Mail Transfer Agent (MTA) like Postfix or Exim, and then configure it to send mail to the wider Internet as you need. This works well because the MTAs are robust and well-tested; they have flexible configuration to let you send mail out by relaying to other mail servers you specify with optional authentication; and most distributions install one by default anyway. The only hard part is configuring the MTA to send mail following your site’s policies.&lt;br /&gt;
&lt;br /&gt;
Other software is available that provides a slimmer version of the &amp;lt;code&amp;gt;sendmail&amp;lt;/code&amp;gt; command that connects to an external mail server for you, like ssmtp. These programs are usually easier to configure than an MTA, but they often lose email permanently if they can’t connect to the external server at the time it’s sent. (MTAs keep email queued locally until they successfully deliver it to another server.)&lt;br /&gt;
&lt;br /&gt;
=== Receiving email ===&lt;br /&gt;
&lt;br /&gt;
RT installs a command called &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; that receives an email on standard input and posts it to RT’s REST web interface, where it gets saved in the database and added to a ticket. You need to arrange for a way to send incoming email to this command.&lt;br /&gt;
&lt;br /&gt;
The most common setup is to have an MTA on the same box as RT receive email directly, and then set up mail aliases that call this command when mail comes in. Example &amp;lt;code&amp;gt;/etc/aliases&amp;lt;/code&amp;gt; entries look like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rt: &amp;quot;|/opt/rt5/bin/rt-mailgate --queue general --action correspond --url https://rt.yourdomain.example.com/&amp;quot;&lt;br /&gt;
rt-comment: &amp;quot;|/opt/rt5/bin/rt-mailgate --queue general --action comment --url https://rt.yourdomain.example.com/&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
This works well because, again, you’re probably running an MTA anyway; and the MTA can hold and queue mail if it comes in while RT is down for any reason, giving you a buffer against downtime.&lt;br /&gt;
&lt;br /&gt;
Another common option is to periodically run a tool that fetches mail using a protocol like IMAP, like fetchmail or getmail, and passes it on to &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt;. This is less common because it requires setting up another tool to run, and securely storing another set of mail server credentials. But it is useful when local policy prevents the RT server from receiving email directly.&lt;br /&gt;
&lt;br /&gt;
This is much less common, but it might help to know that &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; doesn’t have to run on the same system as RT itself. It just needs to be able to connect to RT’s web interface. If you don’t have any other options, you can install the RT software on a different system that receives email, and configure &#039;&#039;that&#039;&#039; system to run &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; and pass it on to the RT server. To do that, just repeat the installation instructions above, skipping the steps about installing the database and web server.&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s background jobs ==&lt;br /&gt;
&lt;br /&gt;
Create a file &amp;lt;code&amp;gt;/etc/cron.d/rt&amp;lt;/code&amp;gt; with the following content. You may edit all of the time fields as you see fit. Refer to the crontab(5) man page for details about their definitions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Update the fulltext index with new ticket data&lt;br /&gt;
*/3 *   *   *   *   root    /opt/rt5/sbin/rt-fulltext-indexer&lt;br /&gt;
# Email out dashboards that users have subscribed to&lt;br /&gt;
0   *   *   *   *   root    /opt/rt5/sbin/rt-email-dashboards&lt;br /&gt;
# Clean old sessions from the database&lt;br /&gt;
10  3   *   *   *   root    /opt/rt5/sbin/rt-clean-sessions --older 8d&lt;br /&gt;
# Email out weekly digests for users who have requested it&lt;br /&gt;
50  4   *   *   Mon root    /opt/rt5/sbin/rt-email-digest -m weekly&lt;br /&gt;
# Email out daily digests for users who have requested it&lt;br /&gt;
50  5   *   *   *   root    /opt/rt5/sbin/rt-email-digest -m daily&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
You can run all these jobs as the same user that runs your web server, rather than root. Run:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo sed -i &#039;s/\broot\b/www-data/&#039; /etc/cron.d/rt&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo sed -i &#039;s/\broot\b/apache/&#039; /etc/cron.d/rt&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Set up RT ==&lt;br /&gt;
&lt;br /&gt;
If you’ve gotten this far, congratulations, your RT install is really done now. You can start setting up RT with users, groups, queues, and business logic. [[Main Page|Head back to the main page]] to start exploring those topics.&lt;/div&gt;</summary>
		<author><name>Brett</name></author>
	</entry>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=ManualInstallation&amp;diff=27069</id>
		<title>ManualInstallation</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=ManualInstallation&amp;diff=27069"/>
		<updated>2022-03-03T15:20:51Z</updated>

		<summary type="html">&lt;p&gt;Brett: fix MariaDB GRANT typo&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Prev: [[ManualRequirements]] — Up: [[UserManual]] — Next: [[ManualApacheConfig]]&lt;br /&gt;
&lt;br /&gt;
This guide walks you through installing RT from source on a modern, popular Linux distro. Specifically, that means a distribution based on Debian or Red Hat that’s been released since around 2020.&lt;br /&gt;
&lt;br /&gt;
This guide assumes:&lt;br /&gt;
&lt;br /&gt;
* You can install packages generally available in Debian/Ubuntu or Red Hat/Fedora/CentOS.&lt;br /&gt;
* You want to install RT, and all of its Perl dependencies, from source to get the latest versions. (This is a trade-off. It means the boundaries of your install will be very clear, but you won’t get security updates for RT or Perl modules from your distribution.)&lt;br /&gt;
* You are willing to install a couple of extra tools to manage the RT installation similarly to how you would in other packaging systems (like PyPI, npm, etc.).&lt;br /&gt;
* You are willing to do a relatively maximal install of RT, enabling all the options during installation and then setting what you need in the configuration. (You could save a little space and time by being pickier about your options, but then that complicates the guide and makes it harder to turn those options on later if you want.)&lt;br /&gt;
* You are using a regular user account on the Linux system that can get superuser privileges with sudo.&lt;br /&gt;
&lt;br /&gt;
== Install the base dependencies ==&lt;br /&gt;
&lt;br /&gt;
These are required by RT, either to run or to install the dependencies.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install autoconf build-essential cpanminus curl libexpat-dev libgd-dev libssl-dev libz-dev gnupg graphviz lynx openssl perl&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf config-manager --set-enabled powertools&lt;br /&gt;
sudo dnf install patch tar which gcc gcc-c++ perl-core perl-App-cpanminus graphviz expat-devel gd-devel lynx openssl openssl-devel&lt;br /&gt;
sudo setenforce 0&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
(Turning off SELinux enforcement is required on Red Hat-based distributions because, as of October 2021, nobody has written a policy for RT.)&lt;br /&gt;
&lt;br /&gt;
== Install a database ==&lt;br /&gt;
&lt;br /&gt;
You need access to a database server. It can be remote, or you can install a database server alongside RT. RT supports a few different databases, but the best supported options are PostgreSQL and MariaDB.&lt;br /&gt;
&lt;br /&gt;
=== Installing and configuring the PostgreSQL server ===&lt;br /&gt;
&lt;br /&gt;
If you want to install a fresh PostgreSQL database server alongside RT:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install postgresql&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install postgresql-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In order to set up RT’s database, you will need a PostgreSQL account that can create databases and roles and be authenticated with a password. If you don’t have that, you can create it by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo createuser --createdb --createrole --login --pwprompt rt_admin&amp;lt;/pre&amp;gt;&lt;br /&gt;
Set the password when prompted. Record this; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
=== Enable password authentication in PostgreSQL ===&lt;br /&gt;
&lt;br /&gt;
You need to consider this step whether you install the database locally, or use an existing one already running. RT supports connecting to PostgreSQL a few different ways, but authenticating with a username and password is simplest, and this guide is written based on that. Not all PostgreSQL installations allow this authentication method by default. You need to review your &amp;lt;code&amp;gt;pg_hba.conf&amp;lt;/code&amp;gt; file located at:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;/etc/postgresql/VERSION/main/pg_hba.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;/var/lib/pgsql/VERSION/data/pg_hba.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Replace &amp;lt;code&amp;gt;VERSION&amp;lt;/code&amp;gt; with the version of your PostgreSQL database. Add these two lines &#039;&#039;&#039;above&#039;&#039;&#039; any other lines that start with &amp;lt;code&amp;gt;host&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;host  rt5  rt_user   all  md5&lt;br /&gt;
host  rt5  rt_admin  all  md5&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This configuration will let &amp;lt;code&amp;gt;rt_user&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;rt_admin&amp;lt;/code&amp;gt; authorize themselves for the &amp;lt;code&amp;gt;rt5&amp;lt;/code&amp;gt; database using an &amp;lt;code&amp;gt;md5&amp;lt;/code&amp;gt; crypted password over a network connection (possibly using the localhost loopback network). You might be able to further restrict some of these fields for improved security, but doing so is outside the scope of this install guide. Refer to [https://www.postgresql.org/docs/current/auth-pg-hba-conf.html the pg_hba.conf documentation] for more details.&lt;br /&gt;
&lt;br /&gt;
Save your changes and reload the database:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo systemctl reload postgresql&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Installing the PostgreSQL client libraries ===&lt;br /&gt;
&lt;br /&gt;
These are required for RT to be able to talk to any PostgreSQL server.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install libpq-dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install postgresql-devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Once this is done you can skip ahead to installing a web server.&lt;br /&gt;
&lt;br /&gt;
=== Installing and configuring the MariaDB server ===&lt;br /&gt;
&lt;br /&gt;
If you want to install a fresh MariaDB database server alongside RT:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install mariadb-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install mariadb-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In order to set up RT’s database, you will need a MySQL superuser account. To stay consistent with PostgreSQL, I suggest setting a password for it. You can do that by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo mysql mysql&lt;br /&gt;
MariaDB [mysql]&amp;amp;gt; GRANT ALL PRIVILEGES ON rt5.* TO rt_admin@localhost IDENTIFIED BY &#039;YourPassphraseHere&#039; WITH GRANT OPTION;&amp;lt;/pre&amp;gt;&lt;br /&gt;
Record your passphrase; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
=== Adjust MariaDB’s max_allowed_packet setting ===&lt;br /&gt;
&lt;br /&gt;
You need to consider this step whether you install the database locally, or use an existing one already running. [https://mariadb.com/kb/en/server-system-variables/#max_allowed_packet MariaDB’s &amp;lt;code&amp;gt;max_allowed_packet&amp;lt;/code&amp;gt; setting] functionally limits the size of attachments in RT. The default is 16MiB, which is too small for most installations. You can ultimately choose any setting you’re comfortable with; 64MiB here should allow most requests without being too open.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;echo -e &#039;[client-server]\nmax_allowed_packet=64M\n&#039; | sudo tee /etc/mysql/conf.d/max_allowed_packet.cnf&lt;br /&gt;
sudo systemctl reload mariadb&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;echo -e &#039;[client-server]\nmax_allowed_packet=64M\n&#039; | sudo tee /etc/my.cnf.d/max_allowed_packet.cnf&lt;br /&gt;
sudo systemctl reload mariadb&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Installing the MariaDB client libraries ===&lt;br /&gt;
&lt;br /&gt;
These are required for RT to be able to talk to any MariaDB server.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install libmariadb-dev libmariadb-dev-compat&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install mariadb-devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Install a web server with FastCGI ==&lt;br /&gt;
&lt;br /&gt;
FastCGI is the best way to host RT’s web interface today. Installing the web server before RT makes the installation process simpler, because RT will be able to automatically some details about your web server like what user it runs as.&lt;br /&gt;
&lt;br /&gt;
=== Installing Apache ===&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install apache2 libapache2-mod-fcgid&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install httpd mod_fcgid mod_ssl&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ### Installing nginx --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Install RT ==&lt;br /&gt;
&lt;br /&gt;
=== Get and unpack the RT source code ===&lt;br /&gt;
&lt;br /&gt;
Download the latest source code using the link on the [https://bestpractical.com/download-page RT download page], extract it using &amp;lt;code&amp;gt;tar -xf&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt; into the source code directory to run the rest of the commands in this section. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;curl -O https://download.bestpractical.com/pub/rt/release/rt-5.0.2.tar.gz&lt;br /&gt;
tar -xf rt-5.0.2.tar.gz&lt;br /&gt;
cd rt-5.0.2&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Pre-configure RT ===&lt;br /&gt;
&lt;br /&gt;
This command will detect some information about your system in order to install RT properly, and decide which set of dependencies to install. Here’s what the different parts of our command are doing:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;--with-db-type=TYPE&amp;lt;/code&amp;gt; - Replace &amp;lt;code&amp;gt;TYPE&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;Pg&amp;lt;/code&amp;gt; for PostgreSQL, or &amp;lt;code&amp;gt;mysql&amp;lt;/code&amp;gt; for MariaDB.&lt;br /&gt;
* &amp;lt;code&amp;gt;--prefix=/opt/rt5&amp;lt;/code&amp;gt; sets the directory where RT will install all of its libraries, tools, and supporting files. You can choose another path if you like.&lt;br /&gt;
* The rest of the options tell RT to install additional dependencies for optional features.&lt;br /&gt;
&lt;br /&gt;
Make sure you have &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt;ed into the RT source directory, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;./configure --with-db-type=TYPE --prefix=/opt/rt5 --with-attachment-store=disk --enable-externalauth --enable-gd --enable-graphviz --enable-gpg --enable-smime&amp;lt;/pre&amp;gt;&lt;br /&gt;
For more background, [https://docs.bestpractical.com/rt/latest/configure.html refer to the RT configure options documentation].&lt;br /&gt;
&lt;br /&gt;
=== Set up RT&#039;s install environment ===&lt;br /&gt;
&lt;br /&gt;
These steps set things up so we can install RT&#039;s Perl dependencies alongside RT itself. Make sure you have &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt;ed into the RT source directory, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo make dirs&lt;br /&gt;
sudo ln -s . /opt/rt5/local/lib/perl5&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next we write an environment file that configures Perl tools, including RT itself, to load and install libraries under the RT install directory. Use an editor to save all the text below to &amp;lt;code&amp;gt;/opt/rt5/RT.env&amp;lt;/code&amp;gt;. If you&#039;re using a different installation prefix, you should edit the line that sets &amp;lt;code&amp;gt;RTHOME&amp;lt;/code&amp;gt; to the directory you chose. Otherwise, you shouldn&#039;t need to make any changes to this file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# RT.env&lt;br /&gt;
# When you want to do maintenance on RT (like installing or upgrading&lt;br /&gt;
# dependencies or plugins), load this file in your shell by running:&lt;br /&gt;
#   . /opt/rt5/RT.env&lt;br /&gt;
# This will set the necessary environment variables to load and&lt;br /&gt;
# install Perl modules under the RT installation directory.&lt;br /&gt;
export RTHOME=&amp;quot;/opt/rt5&amp;quot;&lt;br /&gt;
export PERL5LIB=&amp;quot;$RTHOME/local/lib${PERL5LIB:+:$PERL5LIB}&amp;quot;&lt;br /&gt;
export PERL_CPANM_OPT=&amp;quot;${PERL_CPANM_OPT:+$PERL_CPANM_OPT }--sudo --local-lib-contained=\&amp;quot;$RTHOME/local\&amp;quot;&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Install RT and its Perl dependencies ===&lt;br /&gt;
&lt;br /&gt;
This command will download, build, and install all of the Perl modules necessary to run RT with the configuration you set above. Here’s what the different parts of the command are doing:&lt;br /&gt;
&lt;br /&gt;
* First we load the environment we set up in the last step, to install dependencies in RT&#039;s install directories.&lt;br /&gt;
* &amp;lt;code&amp;gt;make fixdeps&amp;lt;/code&amp;gt; actually installs those dependencies.&lt;br /&gt;
* &amp;lt;code&amp;gt;RT_FIX_DEPS_CMD=cpanm&amp;lt;/code&amp;gt; tells RT to use cpanminus to install dependencies (instead of the older, default &amp;lt;code&amp;gt;cpan&amp;lt;/code&amp;gt; command).&lt;br /&gt;
* &amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt; installs all of RT’s files under &amp;lt;code&amp;gt;/opt/rt5&amp;lt;/code&amp;gt; (or the prefix directory you set earlier). It will only run if &amp;lt;code&amp;gt;fixdeps&amp;lt;/code&amp;gt; installed all the necessary libraries under &amp;lt;code&amp;gt;PERL5LIB&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Make sure you have &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt;ed into the RT source directory, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;. /opt/rt5/RT.env&lt;br /&gt;
make fixdeps RT_FIX_DEPS_CMD=cpanm&lt;br /&gt;
sudo make install PERL5LIB=&amp;quot;$PERL5LIB&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
If it works, the command will eventually output a message that says “Congratulations. RT is now installed.” followed by instructions about configuring and setting up the database. We’ll do that next.&lt;br /&gt;
&lt;br /&gt;
=== Configure RT ===&lt;br /&gt;
&lt;br /&gt;
[https://docs.bestpractical.com/rt/latest/RT_Config.html RT has many configuration options.] You can put configuration options in the file &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/code&amp;gt;, or in individual files under &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.d/&amp;lt;/code&amp;gt;. Use an editor to save all the text below to &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/code&amp;gt; (you can just overwrite the existing file, or add this to the bottom of what’s there) and then fill in settings for your site everywhere the text &amp;lt;code&amp;gt;EDIT WITH&amp;lt;/code&amp;gt; appears.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Single-quote all values EXCEPT the special value `undef`&lt;br /&gt;
# that turns off a setting.&lt;br /&gt;
&lt;br /&gt;
# rtname appears in ticket email subjects. It needs to be globally unique,&lt;br /&gt;
# so use your organization&#039;s domain name.&lt;br /&gt;
Set($rtname, &#039;EDIT WITH yourdomain.example.com&#039;);&lt;br /&gt;
# Organization is used in the database for ticket links, etc. It also needs to&lt;br /&gt;
# be globally unique, so use your organization&#039;s domain name.&lt;br /&gt;
Set($Organization, &#039;EDIT WITH yourdomain.example.com&#039;);&lt;br /&gt;
# WebDomain is domain name of the RT web server. RT uses it to construct links&lt;br /&gt;
# and defend against CSRFs.&lt;br /&gt;
Set($WebDomain, &#039;EDIT WITH rt.yourdomain.example.com&#039;);&lt;br /&gt;
# WebPort is the port where the RT web server runs. Edit the number below if&lt;br /&gt;
# you&#039;re not using the standard HTTPS port.&lt;br /&gt;
Set($WebPort, &#039;443&#039;);&lt;br /&gt;
&lt;br /&gt;
# DatabaseUser is the name of the database account RT uses to read and store&lt;br /&gt;
# data. &#039;rt_user&#039; is the default but you can change it if you like.&lt;br /&gt;
# DO NOT use the &#039;rt_admin&#039; superuser created in the instructions above.&lt;br /&gt;
Set($DatabaseUser, &#039;rt_user&#039;);&lt;br /&gt;
# DatabasePassword is the password for DatabaseUser.&lt;br /&gt;
Set($DatabasePassword, &#039;EDIT WITH SomePassphraseHere&#039;);&lt;br /&gt;
# DatabaseHost is the hostname of the database server RT should use.&lt;br /&gt;
# Change &#039;localhost&#039; if it lives on a different server.&lt;br /&gt;
Set($DatabaseHost, &#039;localhost&#039;);&lt;br /&gt;
# DatabasePort is the port number of the database server RT should use.&lt;br /&gt;
# `undef` means the default for that database. Change it if you&#039;re not&lt;br /&gt;
# using the standard port.&lt;br /&gt;
Set($DatabasePort, undef);&lt;br /&gt;
# DatabaseName is the name of RT&#039;s database hosted on DatabaseHost.&lt;br /&gt;
# &#039;rt5&#039; is the default but you can change it if you like.&lt;br /&gt;
Set($DatabaseName, &#039;rt5&#039;);&lt;br /&gt;
# DatabaseAdmin is the name of the user in the database used to perform&lt;br /&gt;
# major administrative tasks. Change &#039;rt_admin&#039; if you&#039;re using a user&lt;br /&gt;
# besides the one created in this guide.&lt;br /&gt;
Set($DatabaseAdmin, &#039;rt_admin&#039;);&lt;br /&gt;
&lt;br /&gt;
# RT can log to syslog, stderr, and/or a dedicated file.&lt;br /&gt;
# Log settings are used both by the primary server and by command line&lt;br /&gt;
# tools like rt-crontool, rt-ldapimport, etc.&lt;br /&gt;
# You set all of RT&#039;s $LogTo* paramaters to a standard log level: &#039;debug&#039;,&lt;br /&gt;
# &#039;info&#039;, &#039;notice&#039;, &#039;warning&#039;, &#039;error&#039;, &#039;critical&#039;, &#039;alert&#039;, or &#039;emergency&#039;.&lt;br /&gt;
# For a modern install, I recommend logging primarily to syslog, so it goes&lt;br /&gt;
# to journald where it&#039;s easy to query and automatically gets rotated.&lt;br /&gt;
Set($LogToSyslog, &#039;info&#039;);&lt;br /&gt;
&lt;br /&gt;
# When the RT server logs to stderr, that usually goes to your web server&#039;s&lt;br /&gt;
# error log. Command line tools log to their own stderr. Setting this to&lt;br /&gt;
# &#039;warning&#039; or &#039;error&#039; helps ensure you get notified if RT&#039;s cron jobs&lt;br /&gt;
# encounter problems.&lt;br /&gt;
Set($LogToSTDERR, &#039;warning&#039;);&lt;br /&gt;
&lt;br /&gt;
# Turn off optional features that require additional configuration.&lt;br /&gt;
# If you want to use these, refer to the RT_Config documentation for&lt;br /&gt;
# instructions on how to set them up.&lt;br /&gt;
Set(%GnuPG, &#039;Enable&#039; =&amp;gt; &#039;0&#039;);&lt;br /&gt;
Set(%SMIME, &#039;Enable&#039; =&amp;gt; &#039;0&#039;);&lt;br /&gt;
&lt;br /&gt;
# Perl expects to find this 1 at the end of the file.&lt;br /&gt;
1;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;RT_SiteConfig.pm&amp;lt;/code&amp;gt; is actually Perl code. RT runs the code directly to load the configuration. Any time you finish editing it, you can check that you didn’t make any syntax errors by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;perl -c /opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Set up RT’s database ===&lt;br /&gt;
&lt;br /&gt;
RT includes a tool to help you set up its database. By default, it connects to the database as an administrator to create the database and user that you configured in the previous step.&lt;br /&gt;
&lt;br /&gt;
(The instructions from &amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt; and RT’s README file tell you to run &amp;lt;code&amp;gt;make initialize-database&amp;lt;/code&amp;gt;. That just runs &amp;lt;code&amp;gt;rt-setup-database&amp;lt;/code&amp;gt; for you. Running the tool directly makes it easier to pass the options you need.)&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;--action=init&amp;lt;/code&amp;gt; tells the tool to create the user, the database, the tables inside it, and insert core data RT needs to function.&lt;br /&gt;
* &#039;&#039;&#039;If&#039;&#039;&#039; you are using an existing database server and the database adminstrator has already created the user account and database for RT, then you can add the &amp;lt;code&amp;gt;--skip-create&amp;lt;/code&amp;gt; option.&lt;br /&gt;
* &#039;&#039;&#039;If&#039;&#039;&#039; you have a less common database setup, this tool has additional options to give you finer-grained control over what steps are run and how. Refer to [https://docs.bestpractical.com/rt/latest/rt-setup-database.html the full rt-setup-database documentation] to learn more about those.&lt;br /&gt;
* The command reads files from RT’s &amp;lt;code&amp;gt;etc/&amp;lt;/code&amp;gt; directory by default, so the easiest way to run it is to &amp;lt;code&amp;gt;cd /opt/rt5&amp;lt;/code&amp;gt; first, and then it will find the necessary files automatically.&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /opt/rt5&lt;br /&gt;
sudo sbin/rt-setup-database --action=init&amp;lt;/pre&amp;gt;&lt;br /&gt;
Enter the password for your database administrator account when prompted.&lt;br /&gt;
&lt;br /&gt;
=== Set up fulltext indexing ===&lt;br /&gt;
&lt;br /&gt;
Fulltext indexing speeds up searches for ticket content, which makes RT a lot nicer to use.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;--noask&amp;lt;/code&amp;gt; uses the default names for the index, which will be fine for a new install and simplifies the setup.&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo /opt/rt5/sbin/rt-setup-fulltext-index --noask&amp;lt;/pre&amp;gt;&lt;br /&gt;
Enter the password for your database administrator account when prompted. The end of the process will output some RT configuration that looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;### EXAMPLE OUTPUT ONLY - Don&#039;t use this directly!&lt;br /&gt;
Set( %FullTextSearch,&lt;br /&gt;
    Enable     =&amp;gt; 1,&lt;br /&gt;
    Indexed    =&amp;gt; 1,&lt;br /&gt;
    # Additional output from rt-setup-fulltext-index should be here.&lt;br /&gt;
    # The configuration varies by database type.&lt;br /&gt;
);&amp;lt;/pre&amp;gt;&lt;br /&gt;
Copy the output generated when you run &amp;lt;code&amp;gt;rt-setup-fulltext-index&amp;lt;/code&amp;gt; and save it to the file &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.d/FulltextIndex.pm&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Set permissions ===&lt;br /&gt;
&lt;br /&gt;
All of RT’s configuration files should be readable by the user that runs the web server, and no other users, in order to protect sensitive information like the database password. RT provides a command to set permissions appropriately according to your distribution and configuration. &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt; to the directory where you extracted the RT source code, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd rt-5.0.2&lt;br /&gt;
sudo make fixperms&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Verify the installation ===&lt;br /&gt;
&lt;br /&gt;
If everything has gone well, then you should be able to set a password for RT’s &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; user. You’ll use this later to log in to the web interface and continue setting up your system. Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo /opt/rt5/sbin/rt-passwd root&amp;lt;/pre&amp;gt;&lt;br /&gt;
Set the password when prompted. Record this; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s web server ==&lt;br /&gt;
&lt;br /&gt;
=== Configure Apache modules ===&lt;br /&gt;
&lt;br /&gt;
You will need to have the following modules enabled in Apache to run RT. You should already have these installed if you followed the instructions above.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;alias&amp;lt;/code&amp;gt; (required to map URLs to RT)&lt;br /&gt;
* &amp;lt;code&amp;gt;fcgid&amp;lt;/code&amp;gt; (required for Apache to talk to RT)&lt;br /&gt;
* &amp;lt;code&amp;gt;mpm_prefork&amp;lt;/code&amp;gt; (Apache requires you to select an MPM. RT is designed to work with the prefork module.)&lt;br /&gt;
* &amp;lt;code&amp;gt;ssl&amp;lt;/code&amp;gt; (required to serve HTTPS; optional otherwise)&lt;br /&gt;
&lt;br /&gt;
Enable them following these instructions:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo a2dismod mpm_event&lt;br /&gt;
sudo a2enmod fcgid&lt;br /&gt;
sudo a2enmod mpm_prefork&lt;br /&gt;
sudo a2enmod ssl&amp;lt;/pre&amp;gt;&lt;br /&gt;
| &amp;lt;pre&amp;gt;echo LoadModule mpm_prefork_module modules/mod_mpm_prefork.so | sudo tee /etc/httpd/conf.modules.d/00-mpm.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Disable default VirtualHosts (optional) ===&lt;br /&gt;
&lt;br /&gt;
If this web server is dedicated to RT, then you should disable the VirtualHosts that are included with the stock configuration. Run:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo a2dissite 000-default&lt;br /&gt;
sudo a2dissite default-ssl&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo sed -i~ &#039;/^&amp;lt;VirtualHost\b/ , /^&amp;lt;\/VirtualHost\b/ d&#039; /etc/httpd/conf.d/ssl.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Configure an Apache VirtualHost ===&lt;br /&gt;
&lt;br /&gt;
Create a file at the following location. You can change the &amp;lt;code&amp;gt;RT&amp;lt;/code&amp;gt; part of the filename if you like, but the file must exist in this directory and have a &amp;lt;code&amp;gt;.conf&amp;lt;/code&amp;gt; suffix.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;/etc/apache2/sites-available/RT.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
Then after you create the file, run: &amp;lt;code&amp;gt;sudo a2ensite RT&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;/etc/httpd/conf.d/vhost_RT.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
(This filename needs to come after &amp;lt;code&amp;gt;ssl.conf&amp;lt;/code&amp;gt; in the directory listing.)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Use an editor to save all the text below to the new &amp;lt;code&amp;gt;RT.conf&amp;lt;/code&amp;gt; and then fill in settings for your site everywhere the text &amp;lt;code&amp;gt;EDIT WITH&amp;lt;/code&amp;gt; appears.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### Primary RT VirtualHost&lt;br /&gt;
# You can change both the bind address and/or the port here as required.&lt;br /&gt;
# This default will listen for HTTPS connections on all interfaces.&lt;br /&gt;
&amp;lt;VirtualHost *:443&amp;gt;&lt;br /&gt;
  # EDIT HERE with the domain name of the web server.&lt;br /&gt;
  ServerName rt.yourdomain.example.com&lt;br /&gt;
  &amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
    SSLEngine on&lt;br /&gt;
    # These specify the paths to the SSL certificate and private key Apache&lt;br /&gt;
    # should use. These example paths are common for Let&#039;s Encrypt. If you&lt;br /&gt;
    # don&#039;t use Let&#039;s Encrypt, the standard location for these files is under&lt;br /&gt;
    # (Debian/Ubuntu) /etc/ssl&lt;br /&gt;
    # (Red Hat/Fedora/CentOS) /etc/pki/tls&lt;br /&gt;
    # EDIT HERE with the appropriate paths for your server&lt;br /&gt;
    SSLCertificateFile /etc/letsencrypt/live/example.com/fullchain.pem&lt;br /&gt;
    SSLCertificateKeyFile /etc/letsencrypt/live/example.com/privkey.pem&lt;br /&gt;
  &amp;lt;/IfModule&amp;gt;&lt;br /&gt;
  &amp;lt;Location /&amp;gt;&lt;br /&gt;
    Require all granted&lt;br /&gt;
    Options +ExecCGI&lt;br /&gt;
    AddHandler fcgid-script fcgi&lt;br /&gt;
  &amp;lt;/Location&amp;gt;&lt;br /&gt;
  AddDefaultCharset UTF-8&lt;br /&gt;
  DocumentRoot /opt/rt5/share/html&lt;br /&gt;
  ScriptAlias / /opt/rt5/sbin/rt-server.fcgi/&lt;br /&gt;
  # The default mod_fcgid timeout is 40 seconds.&lt;br /&gt;
  # We increase it here to allow for large ticket searches, etc.&lt;br /&gt;
  FcgidIOTimeout 200&lt;br /&gt;
  # mod_fcgid only allows 128KiB requests by default. This is too small for users&lt;br /&gt;
  # to upload files to RT. You can ultimately choose any setting you&#039;re&lt;br /&gt;
  # comfortable with; 70MiB here should allow most requests without being too&lt;br /&gt;
  # open.&lt;br /&gt;
  FcgidMaxRequestLen 73400320&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
### End primary RT VirtualHost&lt;br /&gt;
&lt;br /&gt;
### Optional HTTPS Redirect VirtualHost&lt;br /&gt;
# Most modern servers support HTTPS and want all web traffic to go through it.&lt;br /&gt;
# This VirtualHost redirects normal HTTP traffic to HTTPS.&lt;br /&gt;
# You can delete this whole section if you don&#039;t want or need this.&lt;br /&gt;
&amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
  # You can change both the bind address and/or the port here as required.&lt;br /&gt;
  # This default will listen for HTTP connections on all interfaces.&lt;br /&gt;
  &amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
    SSLEngine off&lt;br /&gt;
    # EDIT HERE both lines below with the domain name of your web server.&lt;br /&gt;
    ServerName rt.yourdomain.example.com&lt;br /&gt;
    Redirect permanent / https://rt.yourdomain.example.com/&lt;br /&gt;
  &amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/IfModule&amp;gt;&lt;br /&gt;
### End optional HTTPS Redirect VirtualHost&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
After you’ve edited the file, load the configuration with:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo systemctl reload apache2&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo systemctl reload httpd&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If this command reports an error, double-check the configuration file for typos, especially in option names, file paths, and the&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;amp;lt;Section&amp;amp;gt;&amp;lt;/code&amp;gt; pairs. Edit again and reload the configuration until it succeeds without output.&lt;br /&gt;
&lt;br /&gt;
=== Verify the web interface ===&lt;br /&gt;
&lt;br /&gt;
You should be able to visit your web server in your browser, and be presented with RT’s login screen. You should be able to log in with username &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; and the password you set previously.&lt;br /&gt;
&lt;br /&gt;
If you run into trouble, the first place to look for more information is by reading Apache’s error log:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo less /var/log/apache2/error.log&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo less /var/log/httpd/error.log&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s mail server ==&lt;br /&gt;
&lt;br /&gt;
RT both can both send and receive ticket updates via email. Unfortunately, there are too many variables to document a useful setup process here: getting this working usually requires creating DNS records, and coordinating with existing mail servers, which will be the main constraint on your setup. Instead this guide provides a brief overview of how the integration works, and where the connection points are that you likely need to work on.&lt;br /&gt;
&lt;br /&gt;
=== Sending Mail ===&lt;br /&gt;
&lt;br /&gt;
RT only knows how to send mail by passing it off to another program on the system. It cannot connect or authenticate directly to external mail servers. In the default configuration, RT runs the standard &amp;lt;code&amp;gt;sendmail&amp;lt;/code&amp;gt; command. There are [https://docs.bestpractical.com/rt/latest/RT_Config.html#Outgoing-mail configuration options to send mail through different commands] if you need.&lt;br /&gt;
&lt;br /&gt;
The most common setup is to install and configure a proper Mail Transfer Agent (MTA) like Postfix or Exim, and then configure it to send mail to the wider Internet as you need. This works well because the MTAs are robust and well-tested; they have flexible configuration to let you send mail out by relaying to other mail servers you specify with optional authentication; and most distributions install one by default anyway. The only hard part is configuring the MTA to send mail following your site’s policies.&lt;br /&gt;
&lt;br /&gt;
Other software is available that provides a slimmer version of the &amp;lt;code&amp;gt;sendmail&amp;lt;/code&amp;gt; command that connects to an external mail server for you, like ssmtp. These programs are usually easier to configure than an MTA, but they often lose email permanently if they can’t connect to the external server at the time it’s sent. (MTAs keep email queued locally until they successfully deliver it to another server.)&lt;br /&gt;
&lt;br /&gt;
=== Receiving email ===&lt;br /&gt;
&lt;br /&gt;
RT installs a command called &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; that receives an email on standard input and posts it to RT’s REST web interface, where it gets saved in the database and added to a ticket. You need to arrange for a way to send incoming email to this command.&lt;br /&gt;
&lt;br /&gt;
The most common setup is to have an MTA on the same box as RT receive email directly, and then set up mail aliases that call this command when mail comes in. Example &amp;lt;code&amp;gt;/etc/aliases&amp;lt;/code&amp;gt; entries look like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rt: &amp;quot;|/opt/rt5/bin/rt-mailgate --queue general --action correspond --url https://rt.yourdomain.example.com/&amp;quot;&lt;br /&gt;
rt-comment: &amp;quot;|/opt/rt5/bin/rt-mailgate --queue general --action comment --url https://rt.yourdomain.example.com/&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
This works well because, again, you’re probably running an MTA anyway; and the MTA can hold and queue mail if it comes in while RT is down for any reason, giving you a buffer against downtime.&lt;br /&gt;
&lt;br /&gt;
Another common option is to periodically run a tool that fetches mail using a protocol like IMAP, like fetchmail or getmail, and passes it on to &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt;. This is less common because it requires setting up another tool to run, and securely storing another set of mail server credentials. But it is useful when local policy prevents the RT server from receiving email directly.&lt;br /&gt;
&lt;br /&gt;
This is much less common, but it might help to know that &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; doesn’t have to run on the same system as RT itself. It just needs to be able to connect to RT’s web interface. If you don’t have any other options, you can install the RT software on a different system that receives email, and configure &#039;&#039;that&#039;&#039; system to run &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; and pass it on to the RT server. To do that, just repeat the installation instructions above, skipping the steps about installing the database and web server.&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s background jobs ==&lt;br /&gt;
&lt;br /&gt;
Create a file &amp;lt;code&amp;gt;/etc/cron.d/rt&amp;lt;/code&amp;gt; with the following content. You may edit all of the time fields as you see fit. Refer to the crontab(5) man page for details about their definitions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Update the fulltext index with new ticket data&lt;br /&gt;
*/3 *   *   *   *   root    /opt/rt5/sbin/rt-fulltext-indexer&lt;br /&gt;
# Email out dashboards that users have subscribed to&lt;br /&gt;
0   *   *   *   *   root    /opt/rt5/sbin/rt-email-dashboards&lt;br /&gt;
# Clean old sessions from the database&lt;br /&gt;
10  3   *   *   *   root    /opt/rt5/sbin/rt-clean-sessions --older 8d&lt;br /&gt;
# Email out weekly digests for users who have requested it&lt;br /&gt;
50  4   *   *   Mon root    /opt/rt5/sbin/rt-email-digest -m weekly&lt;br /&gt;
# Email out daily digests for users who have requested it&lt;br /&gt;
50  5   *   *   *   root    /opt/rt5/sbin/rt-email-digest -m daily&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
You can run all these jobs as the same user that runs your web server, rather than root. Run:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo sed -i &#039;s/\broot\b/www-data/&#039; /etc/cron.d/rt&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo sed -i &#039;s/\broot\b/apache/&#039; /etc/cron.d/rt&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Set up RT ==&lt;br /&gt;
&lt;br /&gt;
If you’ve gotten this far, congratulations, your RT install is really done now. You can start setting up RT with users, groups, queues, and business logic. [[Main Page|Head back to the main page]] to start exploring those topics.&lt;/div&gt;</summary>
		<author><name>Brett</name></author>
	</entry>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=ManualInstallation&amp;diff=27068</id>
		<title>ManualInstallation</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=ManualInstallation&amp;diff=27068"/>
		<updated>2022-03-03T15:20:35Z</updated>

		<summary type="html">&lt;p&gt;Brett: fix MariaDB GRANT database syntax&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Prev: [[ManualRequirements]] — Up: [[UserManual]] — Next: [[ManualApacheConfig]]&lt;br /&gt;
&lt;br /&gt;
This guide walks you through installing RT from source on a modern, popular Linux distro. Specifically, that means a distribution based on Debian or Red Hat that’s been released since around 2020.&lt;br /&gt;
&lt;br /&gt;
This guide assumes:&lt;br /&gt;
&lt;br /&gt;
* You can install packages generally available in Debian/Ubuntu or Red Hat/Fedora/CentOS.&lt;br /&gt;
* You want to install RT, and all of its Perl dependencies, from source to get the latest versions. (This is a trade-off. It means the boundaries of your install will be very clear, but you won’t get security updates for RT or Perl modules from your distribution.)&lt;br /&gt;
* You are willing to install a couple of extra tools to manage the RT installation similarly to how you would in other packaging systems (like PyPI, npm, etc.).&lt;br /&gt;
* You are willing to do a relatively maximal install of RT, enabling all the options during installation and then setting what you need in the configuration. (You could save a little space and time by being pickier about your options, but then that complicates the guide and makes it harder to turn those options on later if you want.)&lt;br /&gt;
* You are using a regular user account on the Linux system that can get superuser privileges with sudo.&lt;br /&gt;
&lt;br /&gt;
== Install the base dependencies ==&lt;br /&gt;
&lt;br /&gt;
These are required by RT, either to run or to install the dependencies.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install autoconf build-essential cpanminus curl libexpat-dev libgd-dev libssl-dev libz-dev gnupg graphviz lynx openssl perl&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf config-manager --set-enabled powertools&lt;br /&gt;
sudo dnf install patch tar which gcc gcc-c++ perl-core perl-App-cpanminus graphviz expat-devel gd-devel lynx openssl openssl-devel&lt;br /&gt;
sudo setenforce 0&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
(Turning off SELinux enforcement is required on Red Hat-based distributions because, as of October 2021, nobody has written a policy for RT.)&lt;br /&gt;
&lt;br /&gt;
== Install a database ==&lt;br /&gt;
&lt;br /&gt;
You need access to a database server. It can be remote, or you can install a database server alongside RT. RT supports a few different databases, but the best supported options are PostgreSQL and MariaDB.&lt;br /&gt;
&lt;br /&gt;
=== Installing and configuring the PostgreSQL server ===&lt;br /&gt;
&lt;br /&gt;
If you want to install a fresh PostgreSQL database server alongside RT:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install postgresql&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install postgresql-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In order to set up RT’s database, you will need a PostgreSQL account that can create databases and roles and be authenticated with a password. If you don’t have that, you can create it by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo createuser --createdb --createrole --login --pwprompt rt_admin&amp;lt;/pre&amp;gt;&lt;br /&gt;
Set the password when prompted. Record this; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
=== Enable password authentication in PostgreSQL ===&lt;br /&gt;
&lt;br /&gt;
You need to consider this step whether you install the database locally, or use an existing one already running. RT supports connecting to PostgreSQL a few different ways, but authenticating with a username and password is simplest, and this guide is written based on that. Not all PostgreSQL installations allow this authentication method by default. You need to review your &amp;lt;code&amp;gt;pg_hba.conf&amp;lt;/code&amp;gt; file located at:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;/etc/postgresql/VERSION/main/pg_hba.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;/var/lib/pgsql/VERSION/data/pg_hba.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Replace &amp;lt;code&amp;gt;VERSION&amp;lt;/code&amp;gt; with the version of your PostgreSQL database. Add these two lines &#039;&#039;&#039;above&#039;&#039;&#039; any other lines that start with &amp;lt;code&amp;gt;host&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;host  rt5  rt_user   all  md5&lt;br /&gt;
host  rt5  rt_admin  all  md5&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This configuration will let &amp;lt;code&amp;gt;rt_user&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;rt_admin&amp;lt;/code&amp;gt; authorize themselves for the &amp;lt;code&amp;gt;rt5&amp;lt;/code&amp;gt; database using an &amp;lt;code&amp;gt;md5&amp;lt;/code&amp;gt; crypted password over a network connection (possibly using the localhost loopback network). You might be able to further restrict some of these fields for improved security, but doing so is outside the scope of this install guide. Refer to [https://www.postgresql.org/docs/current/auth-pg-hba-conf.html the pg_hba.conf documentation] for more details.&lt;br /&gt;
&lt;br /&gt;
Save your changes and reload the database:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo systemctl reload postgresql&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Installing the PostgreSQL client libraries ===&lt;br /&gt;
&lt;br /&gt;
These are required for RT to be able to talk to any PostgreSQL server.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install libpq-dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install postgresql-devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Once this is done you can skip ahead to installing a web server.&lt;br /&gt;
&lt;br /&gt;
=== Installing and configuring the MariaDB server ===&lt;br /&gt;
&lt;br /&gt;
If you want to install a fresh MariaDB database server alongside RT:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install mariadb-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install mariadb-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In order to set up RT’s database, you will need a MySQL superuser account. To stay consistent with PostgreSQL, I suggest setting a password for it. You can do that by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo mysql mysql&lt;br /&gt;
MariaDB [mysql]&amp;amp;gt; GRANT ALL PRIVELEGES ON rt5.* TO rt_admin@localhost IDENTIFIED BY &#039;YourPassphraseHere&#039; WITH GRANT OPTION;&amp;lt;/pre&amp;gt;&lt;br /&gt;
Record your passphrase; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
=== Adjust MariaDB’s max_allowed_packet setting ===&lt;br /&gt;
&lt;br /&gt;
You need to consider this step whether you install the database locally, or use an existing one already running. [https://mariadb.com/kb/en/server-system-variables/#max_allowed_packet MariaDB’s &amp;lt;code&amp;gt;max_allowed_packet&amp;lt;/code&amp;gt; setting] functionally limits the size of attachments in RT. The default is 16MiB, which is too small for most installations. You can ultimately choose any setting you’re comfortable with; 64MiB here should allow most requests without being too open.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;echo -e &#039;[client-server]\nmax_allowed_packet=64M\n&#039; | sudo tee /etc/mysql/conf.d/max_allowed_packet.cnf&lt;br /&gt;
sudo systemctl reload mariadb&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;echo -e &#039;[client-server]\nmax_allowed_packet=64M\n&#039; | sudo tee /etc/my.cnf.d/max_allowed_packet.cnf&lt;br /&gt;
sudo systemctl reload mariadb&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Installing the MariaDB client libraries ===&lt;br /&gt;
&lt;br /&gt;
These are required for RT to be able to talk to any MariaDB server.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install libmariadb-dev libmariadb-dev-compat&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install mariadb-devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Install a web server with FastCGI ==&lt;br /&gt;
&lt;br /&gt;
FastCGI is the best way to host RT’s web interface today. Installing the web server before RT makes the installation process simpler, because RT will be able to automatically some details about your web server like what user it runs as.&lt;br /&gt;
&lt;br /&gt;
=== Installing Apache ===&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install apache2 libapache2-mod-fcgid&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install httpd mod_fcgid mod_ssl&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ### Installing nginx --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Install RT ==&lt;br /&gt;
&lt;br /&gt;
=== Get and unpack the RT source code ===&lt;br /&gt;
&lt;br /&gt;
Download the latest source code using the link on the [https://bestpractical.com/download-page RT download page], extract it using &amp;lt;code&amp;gt;tar -xf&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt; into the source code directory to run the rest of the commands in this section. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;curl -O https://download.bestpractical.com/pub/rt/release/rt-5.0.2.tar.gz&lt;br /&gt;
tar -xf rt-5.0.2.tar.gz&lt;br /&gt;
cd rt-5.0.2&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Pre-configure RT ===&lt;br /&gt;
&lt;br /&gt;
This command will detect some information about your system in order to install RT properly, and decide which set of dependencies to install. Here’s what the different parts of our command are doing:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;--with-db-type=TYPE&amp;lt;/code&amp;gt; - Replace &amp;lt;code&amp;gt;TYPE&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;Pg&amp;lt;/code&amp;gt; for PostgreSQL, or &amp;lt;code&amp;gt;mysql&amp;lt;/code&amp;gt; for MariaDB.&lt;br /&gt;
* &amp;lt;code&amp;gt;--prefix=/opt/rt5&amp;lt;/code&amp;gt; sets the directory where RT will install all of its libraries, tools, and supporting files. You can choose another path if you like.&lt;br /&gt;
* The rest of the options tell RT to install additional dependencies for optional features.&lt;br /&gt;
&lt;br /&gt;
Make sure you have &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt;ed into the RT source directory, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;./configure --with-db-type=TYPE --prefix=/opt/rt5 --with-attachment-store=disk --enable-externalauth --enable-gd --enable-graphviz --enable-gpg --enable-smime&amp;lt;/pre&amp;gt;&lt;br /&gt;
For more background, [https://docs.bestpractical.com/rt/latest/configure.html refer to the RT configure options documentation].&lt;br /&gt;
&lt;br /&gt;
=== Set up RT&#039;s install environment ===&lt;br /&gt;
&lt;br /&gt;
These steps set things up so we can install RT&#039;s Perl dependencies alongside RT itself. Make sure you have &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt;ed into the RT source directory, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo make dirs&lt;br /&gt;
sudo ln -s . /opt/rt5/local/lib/perl5&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next we write an environment file that configures Perl tools, including RT itself, to load and install libraries under the RT install directory. Use an editor to save all the text below to &amp;lt;code&amp;gt;/opt/rt5/RT.env&amp;lt;/code&amp;gt;. If you&#039;re using a different installation prefix, you should edit the line that sets &amp;lt;code&amp;gt;RTHOME&amp;lt;/code&amp;gt; to the directory you chose. Otherwise, you shouldn&#039;t need to make any changes to this file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# RT.env&lt;br /&gt;
# When you want to do maintenance on RT (like installing or upgrading&lt;br /&gt;
# dependencies or plugins), load this file in your shell by running:&lt;br /&gt;
#   . /opt/rt5/RT.env&lt;br /&gt;
# This will set the necessary environment variables to load and&lt;br /&gt;
# install Perl modules under the RT installation directory.&lt;br /&gt;
export RTHOME=&amp;quot;/opt/rt5&amp;quot;&lt;br /&gt;
export PERL5LIB=&amp;quot;$RTHOME/local/lib${PERL5LIB:+:$PERL5LIB}&amp;quot;&lt;br /&gt;
export PERL_CPANM_OPT=&amp;quot;${PERL_CPANM_OPT:+$PERL_CPANM_OPT }--sudo --local-lib-contained=\&amp;quot;$RTHOME/local\&amp;quot;&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Install RT and its Perl dependencies ===&lt;br /&gt;
&lt;br /&gt;
This command will download, build, and install all of the Perl modules necessary to run RT with the configuration you set above. Here’s what the different parts of the command are doing:&lt;br /&gt;
&lt;br /&gt;
* First we load the environment we set up in the last step, to install dependencies in RT&#039;s install directories.&lt;br /&gt;
* &amp;lt;code&amp;gt;make fixdeps&amp;lt;/code&amp;gt; actually installs those dependencies.&lt;br /&gt;
* &amp;lt;code&amp;gt;RT_FIX_DEPS_CMD=cpanm&amp;lt;/code&amp;gt; tells RT to use cpanminus to install dependencies (instead of the older, default &amp;lt;code&amp;gt;cpan&amp;lt;/code&amp;gt; command).&lt;br /&gt;
* &amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt; installs all of RT’s files under &amp;lt;code&amp;gt;/opt/rt5&amp;lt;/code&amp;gt; (or the prefix directory you set earlier). It will only run if &amp;lt;code&amp;gt;fixdeps&amp;lt;/code&amp;gt; installed all the necessary libraries under &amp;lt;code&amp;gt;PERL5LIB&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Make sure you have &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt;ed into the RT source directory, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;. /opt/rt5/RT.env&lt;br /&gt;
make fixdeps RT_FIX_DEPS_CMD=cpanm&lt;br /&gt;
sudo make install PERL5LIB=&amp;quot;$PERL5LIB&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
If it works, the command will eventually output a message that says “Congratulations. RT is now installed.” followed by instructions about configuring and setting up the database. We’ll do that next.&lt;br /&gt;
&lt;br /&gt;
=== Configure RT ===&lt;br /&gt;
&lt;br /&gt;
[https://docs.bestpractical.com/rt/latest/RT_Config.html RT has many configuration options.] You can put configuration options in the file &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/code&amp;gt;, or in individual files under &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.d/&amp;lt;/code&amp;gt;. Use an editor to save all the text below to &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/code&amp;gt; (you can just overwrite the existing file, or add this to the bottom of what’s there) and then fill in settings for your site everywhere the text &amp;lt;code&amp;gt;EDIT WITH&amp;lt;/code&amp;gt; appears.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Single-quote all values EXCEPT the special value `undef`&lt;br /&gt;
# that turns off a setting.&lt;br /&gt;
&lt;br /&gt;
# rtname appears in ticket email subjects. It needs to be globally unique,&lt;br /&gt;
# so use your organization&#039;s domain name.&lt;br /&gt;
Set($rtname, &#039;EDIT WITH yourdomain.example.com&#039;);&lt;br /&gt;
# Organization is used in the database for ticket links, etc. It also needs to&lt;br /&gt;
# be globally unique, so use your organization&#039;s domain name.&lt;br /&gt;
Set($Organization, &#039;EDIT WITH yourdomain.example.com&#039;);&lt;br /&gt;
# WebDomain is domain name of the RT web server. RT uses it to construct links&lt;br /&gt;
# and defend against CSRFs.&lt;br /&gt;
Set($WebDomain, &#039;EDIT WITH rt.yourdomain.example.com&#039;);&lt;br /&gt;
# WebPort is the port where the RT web server runs. Edit the number below if&lt;br /&gt;
# you&#039;re not using the standard HTTPS port.&lt;br /&gt;
Set($WebPort, &#039;443&#039;);&lt;br /&gt;
&lt;br /&gt;
# DatabaseUser is the name of the database account RT uses to read and store&lt;br /&gt;
# data. &#039;rt_user&#039; is the default but you can change it if you like.&lt;br /&gt;
# DO NOT use the &#039;rt_admin&#039; superuser created in the instructions above.&lt;br /&gt;
Set($DatabaseUser, &#039;rt_user&#039;);&lt;br /&gt;
# DatabasePassword is the password for DatabaseUser.&lt;br /&gt;
Set($DatabasePassword, &#039;EDIT WITH SomePassphraseHere&#039;);&lt;br /&gt;
# DatabaseHost is the hostname of the database server RT should use.&lt;br /&gt;
# Change &#039;localhost&#039; if it lives on a different server.&lt;br /&gt;
Set($DatabaseHost, &#039;localhost&#039;);&lt;br /&gt;
# DatabasePort is the port number of the database server RT should use.&lt;br /&gt;
# `undef` means the default for that database. Change it if you&#039;re not&lt;br /&gt;
# using the standard port.&lt;br /&gt;
Set($DatabasePort, undef);&lt;br /&gt;
# DatabaseName is the name of RT&#039;s database hosted on DatabaseHost.&lt;br /&gt;
# &#039;rt5&#039; is the default but you can change it if you like.&lt;br /&gt;
Set($DatabaseName, &#039;rt5&#039;);&lt;br /&gt;
# DatabaseAdmin is the name of the user in the database used to perform&lt;br /&gt;
# major administrative tasks. Change &#039;rt_admin&#039; if you&#039;re using a user&lt;br /&gt;
# besides the one created in this guide.&lt;br /&gt;
Set($DatabaseAdmin, &#039;rt_admin&#039;);&lt;br /&gt;
&lt;br /&gt;
# RT can log to syslog, stderr, and/or a dedicated file.&lt;br /&gt;
# Log settings are used both by the primary server and by command line&lt;br /&gt;
# tools like rt-crontool, rt-ldapimport, etc.&lt;br /&gt;
# You set all of RT&#039;s $LogTo* paramaters to a standard log level: &#039;debug&#039;,&lt;br /&gt;
# &#039;info&#039;, &#039;notice&#039;, &#039;warning&#039;, &#039;error&#039;, &#039;critical&#039;, &#039;alert&#039;, or &#039;emergency&#039;.&lt;br /&gt;
# For a modern install, I recommend logging primarily to syslog, so it goes&lt;br /&gt;
# to journald where it&#039;s easy to query and automatically gets rotated.&lt;br /&gt;
Set($LogToSyslog, &#039;info&#039;);&lt;br /&gt;
&lt;br /&gt;
# When the RT server logs to stderr, that usually goes to your web server&#039;s&lt;br /&gt;
# error log. Command line tools log to their own stderr. Setting this to&lt;br /&gt;
# &#039;warning&#039; or &#039;error&#039; helps ensure you get notified if RT&#039;s cron jobs&lt;br /&gt;
# encounter problems.&lt;br /&gt;
Set($LogToSTDERR, &#039;warning&#039;);&lt;br /&gt;
&lt;br /&gt;
# Turn off optional features that require additional configuration.&lt;br /&gt;
# If you want to use these, refer to the RT_Config documentation for&lt;br /&gt;
# instructions on how to set them up.&lt;br /&gt;
Set(%GnuPG, &#039;Enable&#039; =&amp;gt; &#039;0&#039;);&lt;br /&gt;
Set(%SMIME, &#039;Enable&#039; =&amp;gt; &#039;0&#039;);&lt;br /&gt;
&lt;br /&gt;
# Perl expects to find this 1 at the end of the file.&lt;br /&gt;
1;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;RT_SiteConfig.pm&amp;lt;/code&amp;gt; is actually Perl code. RT runs the code directly to load the configuration. Any time you finish editing it, you can check that you didn’t make any syntax errors by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;perl -c /opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Set up RT’s database ===&lt;br /&gt;
&lt;br /&gt;
RT includes a tool to help you set up its database. By default, it connects to the database as an administrator to create the database and user that you configured in the previous step.&lt;br /&gt;
&lt;br /&gt;
(The instructions from &amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt; and RT’s README file tell you to run &amp;lt;code&amp;gt;make initialize-database&amp;lt;/code&amp;gt;. That just runs &amp;lt;code&amp;gt;rt-setup-database&amp;lt;/code&amp;gt; for you. Running the tool directly makes it easier to pass the options you need.)&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;--action=init&amp;lt;/code&amp;gt; tells the tool to create the user, the database, the tables inside it, and insert core data RT needs to function.&lt;br /&gt;
* &#039;&#039;&#039;If&#039;&#039;&#039; you are using an existing database server and the database adminstrator has already created the user account and database for RT, then you can add the &amp;lt;code&amp;gt;--skip-create&amp;lt;/code&amp;gt; option.&lt;br /&gt;
* &#039;&#039;&#039;If&#039;&#039;&#039; you have a less common database setup, this tool has additional options to give you finer-grained control over what steps are run and how. Refer to [https://docs.bestpractical.com/rt/latest/rt-setup-database.html the full rt-setup-database documentation] to learn more about those.&lt;br /&gt;
* The command reads files from RT’s &amp;lt;code&amp;gt;etc/&amp;lt;/code&amp;gt; directory by default, so the easiest way to run it is to &amp;lt;code&amp;gt;cd /opt/rt5&amp;lt;/code&amp;gt; first, and then it will find the necessary files automatically.&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /opt/rt5&lt;br /&gt;
sudo sbin/rt-setup-database --action=init&amp;lt;/pre&amp;gt;&lt;br /&gt;
Enter the password for your database administrator account when prompted.&lt;br /&gt;
&lt;br /&gt;
=== Set up fulltext indexing ===&lt;br /&gt;
&lt;br /&gt;
Fulltext indexing speeds up searches for ticket content, which makes RT a lot nicer to use.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;--noask&amp;lt;/code&amp;gt; uses the default names for the index, which will be fine for a new install and simplifies the setup.&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo /opt/rt5/sbin/rt-setup-fulltext-index --noask&amp;lt;/pre&amp;gt;&lt;br /&gt;
Enter the password for your database administrator account when prompted. The end of the process will output some RT configuration that looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;### EXAMPLE OUTPUT ONLY - Don&#039;t use this directly!&lt;br /&gt;
Set( %FullTextSearch,&lt;br /&gt;
    Enable     =&amp;gt; 1,&lt;br /&gt;
    Indexed    =&amp;gt; 1,&lt;br /&gt;
    # Additional output from rt-setup-fulltext-index should be here.&lt;br /&gt;
    # The configuration varies by database type.&lt;br /&gt;
);&amp;lt;/pre&amp;gt;&lt;br /&gt;
Copy the output generated when you run &amp;lt;code&amp;gt;rt-setup-fulltext-index&amp;lt;/code&amp;gt; and save it to the file &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.d/FulltextIndex.pm&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Set permissions ===&lt;br /&gt;
&lt;br /&gt;
All of RT’s configuration files should be readable by the user that runs the web server, and no other users, in order to protect sensitive information like the database password. RT provides a command to set permissions appropriately according to your distribution and configuration. &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt; to the directory where you extracted the RT source code, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd rt-5.0.2&lt;br /&gt;
sudo make fixperms&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Verify the installation ===&lt;br /&gt;
&lt;br /&gt;
If everything has gone well, then you should be able to set a password for RT’s &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; user. You’ll use this later to log in to the web interface and continue setting up your system. Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo /opt/rt5/sbin/rt-passwd root&amp;lt;/pre&amp;gt;&lt;br /&gt;
Set the password when prompted. Record this; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s web server ==&lt;br /&gt;
&lt;br /&gt;
=== Configure Apache modules ===&lt;br /&gt;
&lt;br /&gt;
You will need to have the following modules enabled in Apache to run RT. You should already have these installed if you followed the instructions above.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;alias&amp;lt;/code&amp;gt; (required to map URLs to RT)&lt;br /&gt;
* &amp;lt;code&amp;gt;fcgid&amp;lt;/code&amp;gt; (required for Apache to talk to RT)&lt;br /&gt;
* &amp;lt;code&amp;gt;mpm_prefork&amp;lt;/code&amp;gt; (Apache requires you to select an MPM. RT is designed to work with the prefork module.)&lt;br /&gt;
* &amp;lt;code&amp;gt;ssl&amp;lt;/code&amp;gt; (required to serve HTTPS; optional otherwise)&lt;br /&gt;
&lt;br /&gt;
Enable them following these instructions:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo a2dismod mpm_event&lt;br /&gt;
sudo a2enmod fcgid&lt;br /&gt;
sudo a2enmod mpm_prefork&lt;br /&gt;
sudo a2enmod ssl&amp;lt;/pre&amp;gt;&lt;br /&gt;
| &amp;lt;pre&amp;gt;echo LoadModule mpm_prefork_module modules/mod_mpm_prefork.so | sudo tee /etc/httpd/conf.modules.d/00-mpm.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Disable default VirtualHosts (optional) ===&lt;br /&gt;
&lt;br /&gt;
If this web server is dedicated to RT, then you should disable the VirtualHosts that are included with the stock configuration. Run:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo a2dissite 000-default&lt;br /&gt;
sudo a2dissite default-ssl&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo sed -i~ &#039;/^&amp;lt;VirtualHost\b/ , /^&amp;lt;\/VirtualHost\b/ d&#039; /etc/httpd/conf.d/ssl.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Configure an Apache VirtualHost ===&lt;br /&gt;
&lt;br /&gt;
Create a file at the following location. You can change the &amp;lt;code&amp;gt;RT&amp;lt;/code&amp;gt; part of the filename if you like, but the file must exist in this directory and have a &amp;lt;code&amp;gt;.conf&amp;lt;/code&amp;gt; suffix.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;/etc/apache2/sites-available/RT.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
Then after you create the file, run: &amp;lt;code&amp;gt;sudo a2ensite RT&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;/etc/httpd/conf.d/vhost_RT.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
(This filename needs to come after &amp;lt;code&amp;gt;ssl.conf&amp;lt;/code&amp;gt; in the directory listing.)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Use an editor to save all the text below to the new &amp;lt;code&amp;gt;RT.conf&amp;lt;/code&amp;gt; and then fill in settings for your site everywhere the text &amp;lt;code&amp;gt;EDIT WITH&amp;lt;/code&amp;gt; appears.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### Primary RT VirtualHost&lt;br /&gt;
# You can change both the bind address and/or the port here as required.&lt;br /&gt;
# This default will listen for HTTPS connections on all interfaces.&lt;br /&gt;
&amp;lt;VirtualHost *:443&amp;gt;&lt;br /&gt;
  # EDIT HERE with the domain name of the web server.&lt;br /&gt;
  ServerName rt.yourdomain.example.com&lt;br /&gt;
  &amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
    SSLEngine on&lt;br /&gt;
    # These specify the paths to the SSL certificate and private key Apache&lt;br /&gt;
    # should use. These example paths are common for Let&#039;s Encrypt. If you&lt;br /&gt;
    # don&#039;t use Let&#039;s Encrypt, the standard location for these files is under&lt;br /&gt;
    # (Debian/Ubuntu) /etc/ssl&lt;br /&gt;
    # (Red Hat/Fedora/CentOS) /etc/pki/tls&lt;br /&gt;
    # EDIT HERE with the appropriate paths for your server&lt;br /&gt;
    SSLCertificateFile /etc/letsencrypt/live/example.com/fullchain.pem&lt;br /&gt;
    SSLCertificateKeyFile /etc/letsencrypt/live/example.com/privkey.pem&lt;br /&gt;
  &amp;lt;/IfModule&amp;gt;&lt;br /&gt;
  &amp;lt;Location /&amp;gt;&lt;br /&gt;
    Require all granted&lt;br /&gt;
    Options +ExecCGI&lt;br /&gt;
    AddHandler fcgid-script fcgi&lt;br /&gt;
  &amp;lt;/Location&amp;gt;&lt;br /&gt;
  AddDefaultCharset UTF-8&lt;br /&gt;
  DocumentRoot /opt/rt5/share/html&lt;br /&gt;
  ScriptAlias / /opt/rt5/sbin/rt-server.fcgi/&lt;br /&gt;
  # The default mod_fcgid timeout is 40 seconds.&lt;br /&gt;
  # We increase it here to allow for large ticket searches, etc.&lt;br /&gt;
  FcgidIOTimeout 200&lt;br /&gt;
  # mod_fcgid only allows 128KiB requests by default. This is too small for users&lt;br /&gt;
  # to upload files to RT. You can ultimately choose any setting you&#039;re&lt;br /&gt;
  # comfortable with; 70MiB here should allow most requests without being too&lt;br /&gt;
  # open.&lt;br /&gt;
  FcgidMaxRequestLen 73400320&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
### End primary RT VirtualHost&lt;br /&gt;
&lt;br /&gt;
### Optional HTTPS Redirect VirtualHost&lt;br /&gt;
# Most modern servers support HTTPS and want all web traffic to go through it.&lt;br /&gt;
# This VirtualHost redirects normal HTTP traffic to HTTPS.&lt;br /&gt;
# You can delete this whole section if you don&#039;t want or need this.&lt;br /&gt;
&amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
  # You can change both the bind address and/or the port here as required.&lt;br /&gt;
  # This default will listen for HTTP connections on all interfaces.&lt;br /&gt;
  &amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
    SSLEngine off&lt;br /&gt;
    # EDIT HERE both lines below with the domain name of your web server.&lt;br /&gt;
    ServerName rt.yourdomain.example.com&lt;br /&gt;
    Redirect permanent / https://rt.yourdomain.example.com/&lt;br /&gt;
  &amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/IfModule&amp;gt;&lt;br /&gt;
### End optional HTTPS Redirect VirtualHost&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
After you’ve edited the file, load the configuration with:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo systemctl reload apache2&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo systemctl reload httpd&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If this command reports an error, double-check the configuration file for typos, especially in option names, file paths, and the&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;amp;lt;Section&amp;amp;gt;&amp;lt;/code&amp;gt; pairs. Edit again and reload the configuration until it succeeds without output.&lt;br /&gt;
&lt;br /&gt;
=== Verify the web interface ===&lt;br /&gt;
&lt;br /&gt;
You should be able to visit your web server in your browser, and be presented with RT’s login screen. You should be able to log in with username &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; and the password you set previously.&lt;br /&gt;
&lt;br /&gt;
If you run into trouble, the first place to look for more information is by reading Apache’s error log:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo less /var/log/apache2/error.log&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo less /var/log/httpd/error.log&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s mail server ==&lt;br /&gt;
&lt;br /&gt;
RT both can both send and receive ticket updates via email. Unfortunately, there are too many variables to document a useful setup process here: getting this working usually requires creating DNS records, and coordinating with existing mail servers, which will be the main constraint on your setup. Instead this guide provides a brief overview of how the integration works, and where the connection points are that you likely need to work on.&lt;br /&gt;
&lt;br /&gt;
=== Sending Mail ===&lt;br /&gt;
&lt;br /&gt;
RT only knows how to send mail by passing it off to another program on the system. It cannot connect or authenticate directly to external mail servers. In the default configuration, RT runs the standard &amp;lt;code&amp;gt;sendmail&amp;lt;/code&amp;gt; command. There are [https://docs.bestpractical.com/rt/latest/RT_Config.html#Outgoing-mail configuration options to send mail through different commands] if you need.&lt;br /&gt;
&lt;br /&gt;
The most common setup is to install and configure a proper Mail Transfer Agent (MTA) like Postfix or Exim, and then configure it to send mail to the wider Internet as you need. This works well because the MTAs are robust and well-tested; they have flexible configuration to let you send mail out by relaying to other mail servers you specify with optional authentication; and most distributions install one by default anyway. The only hard part is configuring the MTA to send mail following your site’s policies.&lt;br /&gt;
&lt;br /&gt;
Other software is available that provides a slimmer version of the &amp;lt;code&amp;gt;sendmail&amp;lt;/code&amp;gt; command that connects to an external mail server for you, like ssmtp. These programs are usually easier to configure than an MTA, but they often lose email permanently if they can’t connect to the external server at the time it’s sent. (MTAs keep email queued locally until they successfully deliver it to another server.)&lt;br /&gt;
&lt;br /&gt;
=== Receiving email ===&lt;br /&gt;
&lt;br /&gt;
RT installs a command called &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; that receives an email on standard input and posts it to RT’s REST web interface, where it gets saved in the database and added to a ticket. You need to arrange for a way to send incoming email to this command.&lt;br /&gt;
&lt;br /&gt;
The most common setup is to have an MTA on the same box as RT receive email directly, and then set up mail aliases that call this command when mail comes in. Example &amp;lt;code&amp;gt;/etc/aliases&amp;lt;/code&amp;gt; entries look like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rt: &amp;quot;|/opt/rt5/bin/rt-mailgate --queue general --action correspond --url https://rt.yourdomain.example.com/&amp;quot;&lt;br /&gt;
rt-comment: &amp;quot;|/opt/rt5/bin/rt-mailgate --queue general --action comment --url https://rt.yourdomain.example.com/&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
This works well because, again, you’re probably running an MTA anyway; and the MTA can hold and queue mail if it comes in while RT is down for any reason, giving you a buffer against downtime.&lt;br /&gt;
&lt;br /&gt;
Another common option is to periodically run a tool that fetches mail using a protocol like IMAP, like fetchmail or getmail, and passes it on to &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt;. This is less common because it requires setting up another tool to run, and securely storing another set of mail server credentials. But it is useful when local policy prevents the RT server from receiving email directly.&lt;br /&gt;
&lt;br /&gt;
This is much less common, but it might help to know that &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; doesn’t have to run on the same system as RT itself. It just needs to be able to connect to RT’s web interface. If you don’t have any other options, you can install the RT software on a different system that receives email, and configure &#039;&#039;that&#039;&#039; system to run &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; and pass it on to the RT server. To do that, just repeat the installation instructions above, skipping the steps about installing the database and web server.&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s background jobs ==&lt;br /&gt;
&lt;br /&gt;
Create a file &amp;lt;code&amp;gt;/etc/cron.d/rt&amp;lt;/code&amp;gt; with the following content. You may edit all of the time fields as you see fit. Refer to the crontab(5) man page for details about their definitions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Update the fulltext index with new ticket data&lt;br /&gt;
*/3 *   *   *   *   root    /opt/rt5/sbin/rt-fulltext-indexer&lt;br /&gt;
# Email out dashboards that users have subscribed to&lt;br /&gt;
0   *   *   *   *   root    /opt/rt5/sbin/rt-email-dashboards&lt;br /&gt;
# Clean old sessions from the database&lt;br /&gt;
10  3   *   *   *   root    /opt/rt5/sbin/rt-clean-sessions --older 8d&lt;br /&gt;
# Email out weekly digests for users who have requested it&lt;br /&gt;
50  4   *   *   Mon root    /opt/rt5/sbin/rt-email-digest -m weekly&lt;br /&gt;
# Email out daily digests for users who have requested it&lt;br /&gt;
50  5   *   *   *   root    /opt/rt5/sbin/rt-email-digest -m daily&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
You can run all these jobs as the same user that runs your web server, rather than root. Run:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo sed -i &#039;s/\broot\b/www-data/&#039; /etc/cron.d/rt&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo sed -i &#039;s/\broot\b/apache/&#039; /etc/cron.d/rt&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Set up RT ==&lt;br /&gt;
&lt;br /&gt;
If you’ve gotten this far, congratulations, your RT install is really done now. You can start setting up RT with users, groups, queues, and business logic. [[Main Page|Head back to the main page]] to start exploring those topics.&lt;/div&gt;</summary>
		<author><name>Brett</name></author>
	</entry>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=ManualInstallation&amp;diff=27067</id>
		<title>ManualInstallation</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=ManualInstallation&amp;diff=27067"/>
		<updated>2022-03-03T15:10:20Z</updated>

		<summary type="html">&lt;p&gt;Brett: MariaDB GRANT needs a database selected&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Prev: [[ManualRequirements]] — Up: [[UserManual]] — Next: [[ManualApacheConfig]]&lt;br /&gt;
&lt;br /&gt;
This guide walks you through installing RT from source on a modern, popular Linux distro. Specifically, that means a distribution based on Debian or Red Hat that’s been released since around 2020.&lt;br /&gt;
&lt;br /&gt;
This guide assumes:&lt;br /&gt;
&lt;br /&gt;
* You can install packages generally available in Debian/Ubuntu or Red Hat/Fedora/CentOS.&lt;br /&gt;
* You want to install RT, and all of its Perl dependencies, from source to get the latest versions. (This is a trade-off. It means the boundaries of your install will be very clear, but you won’t get security updates for RT or Perl modules from your distribution.)&lt;br /&gt;
* You are willing to install a couple of extra tools to manage the RT installation similarly to how you would in other packaging systems (like PyPI, npm, etc.).&lt;br /&gt;
* You are willing to do a relatively maximal install of RT, enabling all the options during installation and then setting what you need in the configuration. (You could save a little space and time by being pickier about your options, but then that complicates the guide and makes it harder to turn those options on later if you want.)&lt;br /&gt;
* You are using a regular user account on the Linux system that can get superuser privileges with sudo.&lt;br /&gt;
&lt;br /&gt;
== Install the base dependencies ==&lt;br /&gt;
&lt;br /&gt;
These are required by RT, either to run or to install the dependencies.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install autoconf build-essential cpanminus curl libexpat-dev libgd-dev libssl-dev libz-dev gnupg graphviz lynx openssl perl&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf config-manager --set-enabled powertools&lt;br /&gt;
sudo dnf install patch tar which gcc gcc-c++ perl-core perl-App-cpanminus graphviz expat-devel gd-devel lynx openssl openssl-devel&lt;br /&gt;
sudo setenforce 0&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
(Turning off SELinux enforcement is required on Red Hat-based distributions because, as of October 2021, nobody has written a policy for RT.)&lt;br /&gt;
&lt;br /&gt;
== Install a database ==&lt;br /&gt;
&lt;br /&gt;
You need access to a database server. It can be remote, or you can install a database server alongside RT. RT supports a few different databases, but the best supported options are PostgreSQL and MariaDB.&lt;br /&gt;
&lt;br /&gt;
=== Installing and configuring the PostgreSQL server ===&lt;br /&gt;
&lt;br /&gt;
If you want to install a fresh PostgreSQL database server alongside RT:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install postgresql&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install postgresql-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In order to set up RT’s database, you will need a PostgreSQL account that can create databases and roles and be authenticated with a password. If you don’t have that, you can create it by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo createuser --createdb --createrole --login --pwprompt rt_admin&amp;lt;/pre&amp;gt;&lt;br /&gt;
Set the password when prompted. Record this; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
=== Enable password authentication in PostgreSQL ===&lt;br /&gt;
&lt;br /&gt;
You need to consider this step whether you install the database locally, or use an existing one already running. RT supports connecting to PostgreSQL a few different ways, but authenticating with a username and password is simplest, and this guide is written based on that. Not all PostgreSQL installations allow this authentication method by default. You need to review your &amp;lt;code&amp;gt;pg_hba.conf&amp;lt;/code&amp;gt; file located at:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;/etc/postgresql/VERSION/main/pg_hba.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;/var/lib/pgsql/VERSION/data/pg_hba.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Replace &amp;lt;code&amp;gt;VERSION&amp;lt;/code&amp;gt; with the version of your PostgreSQL database. Add these two lines &#039;&#039;&#039;above&#039;&#039;&#039; any other lines that start with &amp;lt;code&amp;gt;host&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;host  rt5  rt_user   all  md5&lt;br /&gt;
host  rt5  rt_admin  all  md5&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This configuration will let &amp;lt;code&amp;gt;rt_user&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;rt_admin&amp;lt;/code&amp;gt; authorize themselves for the &amp;lt;code&amp;gt;rt5&amp;lt;/code&amp;gt; database using an &amp;lt;code&amp;gt;md5&amp;lt;/code&amp;gt; crypted password over a network connection (possibly using the localhost loopback network). You might be able to further restrict some of these fields for improved security, but doing so is outside the scope of this install guide. Refer to [https://www.postgresql.org/docs/current/auth-pg-hba-conf.html the pg_hba.conf documentation] for more details.&lt;br /&gt;
&lt;br /&gt;
Save your changes and reload the database:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo systemctl reload postgresql&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Installing the PostgreSQL client libraries ===&lt;br /&gt;
&lt;br /&gt;
These are required for RT to be able to talk to any PostgreSQL server.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install libpq-dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install postgresql-devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Once this is done you can skip ahead to installing a web server.&lt;br /&gt;
&lt;br /&gt;
=== Installing and configuring the MariaDB server ===&lt;br /&gt;
&lt;br /&gt;
If you want to install a fresh MariaDB database server alongside RT:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install mariadb-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install mariadb-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In order to set up RT’s database, you will need a MySQL superuser account. To stay consistent with PostgreSQL, I suggest setting a password for it. You can do that by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo mysql mysql&lt;br /&gt;
MariaDB [mysql]&amp;amp;gt; GRANT ALL PRIVELEGES ON rt5 TO rt_admin@localhost IDENTIFIED BY &#039;YourPassphraseHere&#039; WITH GRANT OPTION;&amp;lt;/pre&amp;gt;&lt;br /&gt;
Record your passphrase; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
=== Adjust MariaDB’s max_allowed_packet setting ===&lt;br /&gt;
&lt;br /&gt;
You need to consider this step whether you install the database locally, or use an existing one already running. [https://mariadb.com/kb/en/server-system-variables/#max_allowed_packet MariaDB’s &amp;lt;code&amp;gt;max_allowed_packet&amp;lt;/code&amp;gt; setting] functionally limits the size of attachments in RT. The default is 16MiB, which is too small for most installations. You can ultimately choose any setting you’re comfortable with; 64MiB here should allow most requests without being too open.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;echo -e &#039;[client-server]\nmax_allowed_packet=64M\n&#039; | sudo tee /etc/mysql/conf.d/max_allowed_packet.cnf&lt;br /&gt;
sudo systemctl reload mariadb&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;echo -e &#039;[client-server]\nmax_allowed_packet=64M\n&#039; | sudo tee /etc/my.cnf.d/max_allowed_packet.cnf&lt;br /&gt;
sudo systemctl reload mariadb&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Installing the MariaDB client libraries ===&lt;br /&gt;
&lt;br /&gt;
These are required for RT to be able to talk to any MariaDB server.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install libmariadb-dev libmariadb-dev-compat&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install mariadb-devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Install a web server with FastCGI ==&lt;br /&gt;
&lt;br /&gt;
FastCGI is the best way to host RT’s web interface today. Installing the web server before RT makes the installation process simpler, because RT will be able to automatically some details about your web server like what user it runs as.&lt;br /&gt;
&lt;br /&gt;
=== Installing Apache ===&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install apache2 libapache2-mod-fcgid&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install httpd mod_fcgid mod_ssl&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ### Installing nginx --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Install RT ==&lt;br /&gt;
&lt;br /&gt;
=== Get and unpack the RT source code ===&lt;br /&gt;
&lt;br /&gt;
Download the latest source code using the link on the [https://bestpractical.com/download-page RT download page], extract it using &amp;lt;code&amp;gt;tar -xf&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt; into the source code directory to run the rest of the commands in this section. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;curl -O https://download.bestpractical.com/pub/rt/release/rt-5.0.2.tar.gz&lt;br /&gt;
tar -xf rt-5.0.2.tar.gz&lt;br /&gt;
cd rt-5.0.2&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Pre-configure RT ===&lt;br /&gt;
&lt;br /&gt;
This command will detect some information about your system in order to install RT properly, and decide which set of dependencies to install. Here’s what the different parts of our command are doing:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;--with-db-type=TYPE&amp;lt;/code&amp;gt; - Replace &amp;lt;code&amp;gt;TYPE&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;Pg&amp;lt;/code&amp;gt; for PostgreSQL, or &amp;lt;code&amp;gt;mysql&amp;lt;/code&amp;gt; for MariaDB.&lt;br /&gt;
* &amp;lt;code&amp;gt;--prefix=/opt/rt5&amp;lt;/code&amp;gt; sets the directory where RT will install all of its libraries, tools, and supporting files. You can choose another path if you like.&lt;br /&gt;
* The rest of the options tell RT to install additional dependencies for optional features.&lt;br /&gt;
&lt;br /&gt;
Make sure you have &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt;ed into the RT source directory, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;./configure --with-db-type=TYPE --prefix=/opt/rt5 --with-attachment-store=disk --enable-externalauth --enable-gd --enable-graphviz --enable-gpg --enable-smime&amp;lt;/pre&amp;gt;&lt;br /&gt;
For more background, [https://docs.bestpractical.com/rt/latest/configure.html refer to the RT configure options documentation].&lt;br /&gt;
&lt;br /&gt;
=== Set up RT&#039;s install environment ===&lt;br /&gt;
&lt;br /&gt;
These steps set things up so we can install RT&#039;s Perl dependencies alongside RT itself. Make sure you have &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt;ed into the RT source directory, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo make dirs&lt;br /&gt;
sudo ln -s . /opt/rt5/local/lib/perl5&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next we write an environment file that configures Perl tools, including RT itself, to load and install libraries under the RT install directory. Use an editor to save all the text below to &amp;lt;code&amp;gt;/opt/rt5/RT.env&amp;lt;/code&amp;gt;. If you&#039;re using a different installation prefix, you should edit the line that sets &amp;lt;code&amp;gt;RTHOME&amp;lt;/code&amp;gt; to the directory you chose. Otherwise, you shouldn&#039;t need to make any changes to this file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# RT.env&lt;br /&gt;
# When you want to do maintenance on RT (like installing or upgrading&lt;br /&gt;
# dependencies or plugins), load this file in your shell by running:&lt;br /&gt;
#   . /opt/rt5/RT.env&lt;br /&gt;
# This will set the necessary environment variables to load and&lt;br /&gt;
# install Perl modules under the RT installation directory.&lt;br /&gt;
export RTHOME=&amp;quot;/opt/rt5&amp;quot;&lt;br /&gt;
export PERL5LIB=&amp;quot;$RTHOME/local/lib${PERL5LIB:+:$PERL5LIB}&amp;quot;&lt;br /&gt;
export PERL_CPANM_OPT=&amp;quot;${PERL_CPANM_OPT:+$PERL_CPANM_OPT }--sudo --local-lib-contained=\&amp;quot;$RTHOME/local\&amp;quot;&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Install RT and its Perl dependencies ===&lt;br /&gt;
&lt;br /&gt;
This command will download, build, and install all of the Perl modules necessary to run RT with the configuration you set above. Here’s what the different parts of the command are doing:&lt;br /&gt;
&lt;br /&gt;
* First we load the environment we set up in the last step, to install dependencies in RT&#039;s install directories.&lt;br /&gt;
* &amp;lt;code&amp;gt;make fixdeps&amp;lt;/code&amp;gt; actually installs those dependencies.&lt;br /&gt;
* &amp;lt;code&amp;gt;RT_FIX_DEPS_CMD=cpanm&amp;lt;/code&amp;gt; tells RT to use cpanminus to install dependencies (instead of the older, default &amp;lt;code&amp;gt;cpan&amp;lt;/code&amp;gt; command).&lt;br /&gt;
* &amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt; installs all of RT’s files under &amp;lt;code&amp;gt;/opt/rt5&amp;lt;/code&amp;gt; (or the prefix directory you set earlier). It will only run if &amp;lt;code&amp;gt;fixdeps&amp;lt;/code&amp;gt; installed all the necessary libraries under &amp;lt;code&amp;gt;PERL5LIB&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Make sure you have &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt;ed into the RT source directory, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;. /opt/rt5/RT.env&lt;br /&gt;
make fixdeps RT_FIX_DEPS_CMD=cpanm&lt;br /&gt;
sudo make install PERL5LIB=&amp;quot;$PERL5LIB&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
If it works, the command will eventually output a message that says “Congratulations. RT is now installed.” followed by instructions about configuring and setting up the database. We’ll do that next.&lt;br /&gt;
&lt;br /&gt;
=== Configure RT ===&lt;br /&gt;
&lt;br /&gt;
[https://docs.bestpractical.com/rt/latest/RT_Config.html RT has many configuration options.] You can put configuration options in the file &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/code&amp;gt;, or in individual files under &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.d/&amp;lt;/code&amp;gt;. Use an editor to save all the text below to &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/code&amp;gt; (you can just overwrite the existing file, or add this to the bottom of what’s there) and then fill in settings for your site everywhere the text &amp;lt;code&amp;gt;EDIT WITH&amp;lt;/code&amp;gt; appears.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Single-quote all values EXCEPT the special value `undef`&lt;br /&gt;
# that turns off a setting.&lt;br /&gt;
&lt;br /&gt;
# rtname appears in ticket email subjects. It needs to be globally unique,&lt;br /&gt;
# so use your organization&#039;s domain name.&lt;br /&gt;
Set($rtname, &#039;EDIT WITH yourdomain.example.com&#039;);&lt;br /&gt;
# Organization is used in the database for ticket links, etc. It also needs to&lt;br /&gt;
# be globally unique, so use your organization&#039;s domain name.&lt;br /&gt;
Set($Organization, &#039;EDIT WITH yourdomain.example.com&#039;);&lt;br /&gt;
# WebDomain is domain name of the RT web server. RT uses it to construct links&lt;br /&gt;
# and defend against CSRFs.&lt;br /&gt;
Set($WebDomain, &#039;EDIT WITH rt.yourdomain.example.com&#039;);&lt;br /&gt;
# WebPort is the port where the RT web server runs. Edit the number below if&lt;br /&gt;
# you&#039;re not using the standard HTTPS port.&lt;br /&gt;
Set($WebPort, &#039;443&#039;);&lt;br /&gt;
&lt;br /&gt;
# DatabaseUser is the name of the database account RT uses to read and store&lt;br /&gt;
# data. &#039;rt_user&#039; is the default but you can change it if you like.&lt;br /&gt;
# DO NOT use the &#039;rt_admin&#039; superuser created in the instructions above.&lt;br /&gt;
Set($DatabaseUser, &#039;rt_user&#039;);&lt;br /&gt;
# DatabasePassword is the password for DatabaseUser.&lt;br /&gt;
Set($DatabasePassword, &#039;EDIT WITH SomePassphraseHere&#039;);&lt;br /&gt;
# DatabaseHost is the hostname of the database server RT should use.&lt;br /&gt;
# Change &#039;localhost&#039; if it lives on a different server.&lt;br /&gt;
Set($DatabaseHost, &#039;localhost&#039;);&lt;br /&gt;
# DatabasePort is the port number of the database server RT should use.&lt;br /&gt;
# `undef` means the default for that database. Change it if you&#039;re not&lt;br /&gt;
# using the standard port.&lt;br /&gt;
Set($DatabasePort, undef);&lt;br /&gt;
# DatabaseName is the name of RT&#039;s database hosted on DatabaseHost.&lt;br /&gt;
# &#039;rt5&#039; is the default but you can change it if you like.&lt;br /&gt;
Set($DatabaseName, &#039;rt5&#039;);&lt;br /&gt;
# DatabaseAdmin is the name of the user in the database used to perform&lt;br /&gt;
# major administrative tasks. Change &#039;rt_admin&#039; if you&#039;re using a user&lt;br /&gt;
# besides the one created in this guide.&lt;br /&gt;
Set($DatabaseAdmin, &#039;rt_admin&#039;);&lt;br /&gt;
&lt;br /&gt;
# RT can log to syslog, stderr, and/or a dedicated file.&lt;br /&gt;
# Log settings are used both by the primary server and by command line&lt;br /&gt;
# tools like rt-crontool, rt-ldapimport, etc.&lt;br /&gt;
# You set all of RT&#039;s $LogTo* paramaters to a standard log level: &#039;debug&#039;,&lt;br /&gt;
# &#039;info&#039;, &#039;notice&#039;, &#039;warning&#039;, &#039;error&#039;, &#039;critical&#039;, &#039;alert&#039;, or &#039;emergency&#039;.&lt;br /&gt;
# For a modern install, I recommend logging primarily to syslog, so it goes&lt;br /&gt;
# to journald where it&#039;s easy to query and automatically gets rotated.&lt;br /&gt;
Set($LogToSyslog, &#039;info&#039;);&lt;br /&gt;
&lt;br /&gt;
# When the RT server logs to stderr, that usually goes to your web server&#039;s&lt;br /&gt;
# error log. Command line tools log to their own stderr. Setting this to&lt;br /&gt;
# &#039;warning&#039; or &#039;error&#039; helps ensure you get notified if RT&#039;s cron jobs&lt;br /&gt;
# encounter problems.&lt;br /&gt;
Set($LogToSTDERR, &#039;warning&#039;);&lt;br /&gt;
&lt;br /&gt;
# Turn off optional features that require additional configuration.&lt;br /&gt;
# If you want to use these, refer to the RT_Config documentation for&lt;br /&gt;
# instructions on how to set them up.&lt;br /&gt;
Set(%GnuPG, &#039;Enable&#039; =&amp;gt; &#039;0&#039;);&lt;br /&gt;
Set(%SMIME, &#039;Enable&#039; =&amp;gt; &#039;0&#039;);&lt;br /&gt;
&lt;br /&gt;
# Perl expects to find this 1 at the end of the file.&lt;br /&gt;
1;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;RT_SiteConfig.pm&amp;lt;/code&amp;gt; is actually Perl code. RT runs the code directly to load the configuration. Any time you finish editing it, you can check that you didn’t make any syntax errors by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;perl -c /opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Set up RT’s database ===&lt;br /&gt;
&lt;br /&gt;
RT includes a tool to help you set up its database. By default, it connects to the database as an administrator to create the database and user that you configured in the previous step.&lt;br /&gt;
&lt;br /&gt;
(The instructions from &amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt; and RT’s README file tell you to run &amp;lt;code&amp;gt;make initialize-database&amp;lt;/code&amp;gt;. That just runs &amp;lt;code&amp;gt;rt-setup-database&amp;lt;/code&amp;gt; for you. Running the tool directly makes it easier to pass the options you need.)&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;--action=init&amp;lt;/code&amp;gt; tells the tool to create the user, the database, the tables inside it, and insert core data RT needs to function.&lt;br /&gt;
* &#039;&#039;&#039;If&#039;&#039;&#039; you are using an existing database server and the database adminstrator has already created the user account and database for RT, then you can add the &amp;lt;code&amp;gt;--skip-create&amp;lt;/code&amp;gt; option.&lt;br /&gt;
* &#039;&#039;&#039;If&#039;&#039;&#039; you have a less common database setup, this tool has additional options to give you finer-grained control over what steps are run and how. Refer to [https://docs.bestpractical.com/rt/latest/rt-setup-database.html the full rt-setup-database documentation] to learn more about those.&lt;br /&gt;
* The command reads files from RT’s &amp;lt;code&amp;gt;etc/&amp;lt;/code&amp;gt; directory by default, so the easiest way to run it is to &amp;lt;code&amp;gt;cd /opt/rt5&amp;lt;/code&amp;gt; first, and then it will find the necessary files automatically.&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /opt/rt5&lt;br /&gt;
sudo sbin/rt-setup-database --action=init&amp;lt;/pre&amp;gt;&lt;br /&gt;
Enter the password for your database administrator account when prompted.&lt;br /&gt;
&lt;br /&gt;
=== Set up fulltext indexing ===&lt;br /&gt;
&lt;br /&gt;
Fulltext indexing speeds up searches for ticket content, which makes RT a lot nicer to use.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;--noask&amp;lt;/code&amp;gt; uses the default names for the index, which will be fine for a new install and simplifies the setup.&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo /opt/rt5/sbin/rt-setup-fulltext-index --noask&amp;lt;/pre&amp;gt;&lt;br /&gt;
Enter the password for your database administrator account when prompted. The end of the process will output some RT configuration that looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;### EXAMPLE OUTPUT ONLY - Don&#039;t use this directly!&lt;br /&gt;
Set( %FullTextSearch,&lt;br /&gt;
    Enable     =&amp;gt; 1,&lt;br /&gt;
    Indexed    =&amp;gt; 1,&lt;br /&gt;
    # Additional output from rt-setup-fulltext-index should be here.&lt;br /&gt;
    # The configuration varies by database type.&lt;br /&gt;
);&amp;lt;/pre&amp;gt;&lt;br /&gt;
Copy the output generated when you run &amp;lt;code&amp;gt;rt-setup-fulltext-index&amp;lt;/code&amp;gt; and save it to the file &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.d/FulltextIndex.pm&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Set permissions ===&lt;br /&gt;
&lt;br /&gt;
All of RT’s configuration files should be readable by the user that runs the web server, and no other users, in order to protect sensitive information like the database password. RT provides a command to set permissions appropriately according to your distribution and configuration. &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt; to the directory where you extracted the RT source code, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd rt-5.0.2&lt;br /&gt;
sudo make fixperms&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Verify the installation ===&lt;br /&gt;
&lt;br /&gt;
If everything has gone well, then you should be able to set a password for RT’s &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; user. You’ll use this later to log in to the web interface and continue setting up your system. Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo /opt/rt5/sbin/rt-passwd root&amp;lt;/pre&amp;gt;&lt;br /&gt;
Set the password when prompted. Record this; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s web server ==&lt;br /&gt;
&lt;br /&gt;
=== Configure Apache modules ===&lt;br /&gt;
&lt;br /&gt;
You will need to have the following modules enabled in Apache to run RT. You should already have these installed if you followed the instructions above.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;alias&amp;lt;/code&amp;gt; (required to map URLs to RT)&lt;br /&gt;
* &amp;lt;code&amp;gt;fcgid&amp;lt;/code&amp;gt; (required for Apache to talk to RT)&lt;br /&gt;
* &amp;lt;code&amp;gt;mpm_prefork&amp;lt;/code&amp;gt; (Apache requires you to select an MPM. RT is designed to work with the prefork module.)&lt;br /&gt;
* &amp;lt;code&amp;gt;ssl&amp;lt;/code&amp;gt; (required to serve HTTPS; optional otherwise)&lt;br /&gt;
&lt;br /&gt;
Enable them following these instructions:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo a2dismod mpm_event&lt;br /&gt;
sudo a2enmod fcgid&lt;br /&gt;
sudo a2enmod mpm_prefork&lt;br /&gt;
sudo a2enmod ssl&amp;lt;/pre&amp;gt;&lt;br /&gt;
| &amp;lt;pre&amp;gt;echo LoadModule mpm_prefork_module modules/mod_mpm_prefork.so | sudo tee /etc/httpd/conf.modules.d/00-mpm.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Disable default VirtualHosts (optional) ===&lt;br /&gt;
&lt;br /&gt;
If this web server is dedicated to RT, then you should disable the VirtualHosts that are included with the stock configuration. Run:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo a2dissite 000-default&lt;br /&gt;
sudo a2dissite default-ssl&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo sed -i~ &#039;/^&amp;lt;VirtualHost\b/ , /^&amp;lt;\/VirtualHost\b/ d&#039; /etc/httpd/conf.d/ssl.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Configure an Apache VirtualHost ===&lt;br /&gt;
&lt;br /&gt;
Create a file at the following location. You can change the &amp;lt;code&amp;gt;RT&amp;lt;/code&amp;gt; part of the filename if you like, but the file must exist in this directory and have a &amp;lt;code&amp;gt;.conf&amp;lt;/code&amp;gt; suffix.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;/etc/apache2/sites-available/RT.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
Then after you create the file, run: &amp;lt;code&amp;gt;sudo a2ensite RT&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;/etc/httpd/conf.d/vhost_RT.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
(This filename needs to come after &amp;lt;code&amp;gt;ssl.conf&amp;lt;/code&amp;gt; in the directory listing.)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Use an editor to save all the text below to the new &amp;lt;code&amp;gt;RT.conf&amp;lt;/code&amp;gt; and then fill in settings for your site everywhere the text &amp;lt;code&amp;gt;EDIT WITH&amp;lt;/code&amp;gt; appears.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### Primary RT VirtualHost&lt;br /&gt;
# You can change both the bind address and/or the port here as required.&lt;br /&gt;
# This default will listen for HTTPS connections on all interfaces.&lt;br /&gt;
&amp;lt;VirtualHost *:443&amp;gt;&lt;br /&gt;
  # EDIT HERE with the domain name of the web server.&lt;br /&gt;
  ServerName rt.yourdomain.example.com&lt;br /&gt;
  &amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
    SSLEngine on&lt;br /&gt;
    # These specify the paths to the SSL certificate and private key Apache&lt;br /&gt;
    # should use. These example paths are common for Let&#039;s Encrypt. If you&lt;br /&gt;
    # don&#039;t use Let&#039;s Encrypt, the standard location for these files is under&lt;br /&gt;
    # (Debian/Ubuntu) /etc/ssl&lt;br /&gt;
    # (Red Hat/Fedora/CentOS) /etc/pki/tls&lt;br /&gt;
    # EDIT HERE with the appropriate paths for your server&lt;br /&gt;
    SSLCertificateFile /etc/letsencrypt/live/example.com/fullchain.pem&lt;br /&gt;
    SSLCertificateKeyFile /etc/letsencrypt/live/example.com/privkey.pem&lt;br /&gt;
  &amp;lt;/IfModule&amp;gt;&lt;br /&gt;
  &amp;lt;Location /&amp;gt;&lt;br /&gt;
    Require all granted&lt;br /&gt;
    Options +ExecCGI&lt;br /&gt;
    AddHandler fcgid-script fcgi&lt;br /&gt;
  &amp;lt;/Location&amp;gt;&lt;br /&gt;
  AddDefaultCharset UTF-8&lt;br /&gt;
  DocumentRoot /opt/rt5/share/html&lt;br /&gt;
  ScriptAlias / /opt/rt5/sbin/rt-server.fcgi/&lt;br /&gt;
  # The default mod_fcgid timeout is 40 seconds.&lt;br /&gt;
  # We increase it here to allow for large ticket searches, etc.&lt;br /&gt;
  FcgidIOTimeout 200&lt;br /&gt;
  # mod_fcgid only allows 128KiB requests by default. This is too small for users&lt;br /&gt;
  # to upload files to RT. You can ultimately choose any setting you&#039;re&lt;br /&gt;
  # comfortable with; 70MiB here should allow most requests without being too&lt;br /&gt;
  # open.&lt;br /&gt;
  FcgidMaxRequestLen 73400320&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
### End primary RT VirtualHost&lt;br /&gt;
&lt;br /&gt;
### Optional HTTPS Redirect VirtualHost&lt;br /&gt;
# Most modern servers support HTTPS and want all web traffic to go through it.&lt;br /&gt;
# This VirtualHost redirects normal HTTP traffic to HTTPS.&lt;br /&gt;
# You can delete this whole section if you don&#039;t want or need this.&lt;br /&gt;
&amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
  # You can change both the bind address and/or the port here as required.&lt;br /&gt;
  # This default will listen for HTTP connections on all interfaces.&lt;br /&gt;
  &amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
    SSLEngine off&lt;br /&gt;
    # EDIT HERE both lines below with the domain name of your web server.&lt;br /&gt;
    ServerName rt.yourdomain.example.com&lt;br /&gt;
    Redirect permanent / https://rt.yourdomain.example.com/&lt;br /&gt;
  &amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/IfModule&amp;gt;&lt;br /&gt;
### End optional HTTPS Redirect VirtualHost&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
After you’ve edited the file, load the configuration with:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo systemctl reload apache2&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo systemctl reload httpd&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If this command reports an error, double-check the configuration file for typos, especially in option names, file paths, and the&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;amp;lt;Section&amp;amp;gt;&amp;lt;/code&amp;gt; pairs. Edit again and reload the configuration until it succeeds without output.&lt;br /&gt;
&lt;br /&gt;
=== Verify the web interface ===&lt;br /&gt;
&lt;br /&gt;
You should be able to visit your web server in your browser, and be presented with RT’s login screen. You should be able to log in with username &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; and the password you set previously.&lt;br /&gt;
&lt;br /&gt;
If you run into trouble, the first place to look for more information is by reading Apache’s error log:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo less /var/log/apache2/error.log&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo less /var/log/httpd/error.log&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s mail server ==&lt;br /&gt;
&lt;br /&gt;
RT both can both send and receive ticket updates via email. Unfortunately, there are too many variables to document a useful setup process here: getting this working usually requires creating DNS records, and coordinating with existing mail servers, which will be the main constraint on your setup. Instead this guide provides a brief overview of how the integration works, and where the connection points are that you likely need to work on.&lt;br /&gt;
&lt;br /&gt;
=== Sending Mail ===&lt;br /&gt;
&lt;br /&gt;
RT only knows how to send mail by passing it off to another program on the system. It cannot connect or authenticate directly to external mail servers. In the default configuration, RT runs the standard &amp;lt;code&amp;gt;sendmail&amp;lt;/code&amp;gt; command. There are [https://docs.bestpractical.com/rt/latest/RT_Config.html#Outgoing-mail configuration options to send mail through different commands] if you need.&lt;br /&gt;
&lt;br /&gt;
The most common setup is to install and configure a proper Mail Transfer Agent (MTA) like Postfix or Exim, and then configure it to send mail to the wider Internet as you need. This works well because the MTAs are robust and well-tested; they have flexible configuration to let you send mail out by relaying to other mail servers you specify with optional authentication; and most distributions install one by default anyway. The only hard part is configuring the MTA to send mail following your site’s policies.&lt;br /&gt;
&lt;br /&gt;
Other software is available that provides a slimmer version of the &amp;lt;code&amp;gt;sendmail&amp;lt;/code&amp;gt; command that connects to an external mail server for you, like ssmtp. These programs are usually easier to configure than an MTA, but they often lose email permanently if they can’t connect to the external server at the time it’s sent. (MTAs keep email queued locally until they successfully deliver it to another server.)&lt;br /&gt;
&lt;br /&gt;
=== Receiving email ===&lt;br /&gt;
&lt;br /&gt;
RT installs a command called &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; that receives an email on standard input and posts it to RT’s REST web interface, where it gets saved in the database and added to a ticket. You need to arrange for a way to send incoming email to this command.&lt;br /&gt;
&lt;br /&gt;
The most common setup is to have an MTA on the same box as RT receive email directly, and then set up mail aliases that call this command when mail comes in. Example &amp;lt;code&amp;gt;/etc/aliases&amp;lt;/code&amp;gt; entries look like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rt: &amp;quot;|/opt/rt5/bin/rt-mailgate --queue general --action correspond --url https://rt.yourdomain.example.com/&amp;quot;&lt;br /&gt;
rt-comment: &amp;quot;|/opt/rt5/bin/rt-mailgate --queue general --action comment --url https://rt.yourdomain.example.com/&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
This works well because, again, you’re probably running an MTA anyway; and the MTA can hold and queue mail if it comes in while RT is down for any reason, giving you a buffer against downtime.&lt;br /&gt;
&lt;br /&gt;
Another common option is to periodically run a tool that fetches mail using a protocol like IMAP, like fetchmail or getmail, and passes it on to &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt;. This is less common because it requires setting up another tool to run, and securely storing another set of mail server credentials. But it is useful when local policy prevents the RT server from receiving email directly.&lt;br /&gt;
&lt;br /&gt;
This is much less common, but it might help to know that &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; doesn’t have to run on the same system as RT itself. It just needs to be able to connect to RT’s web interface. If you don’t have any other options, you can install the RT software on a different system that receives email, and configure &#039;&#039;that&#039;&#039; system to run &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; and pass it on to the RT server. To do that, just repeat the installation instructions above, skipping the steps about installing the database and web server.&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s background jobs ==&lt;br /&gt;
&lt;br /&gt;
Create a file &amp;lt;code&amp;gt;/etc/cron.d/rt&amp;lt;/code&amp;gt; with the following content. You may edit all of the time fields as you see fit. Refer to the crontab(5) man page for details about their definitions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Update the fulltext index with new ticket data&lt;br /&gt;
*/3 *   *   *   *   root    /opt/rt5/sbin/rt-fulltext-indexer&lt;br /&gt;
# Email out dashboards that users have subscribed to&lt;br /&gt;
0   *   *   *   *   root    /opt/rt5/sbin/rt-email-dashboards&lt;br /&gt;
# Clean old sessions from the database&lt;br /&gt;
10  3   *   *   *   root    /opt/rt5/sbin/rt-clean-sessions --older 8d&lt;br /&gt;
# Email out weekly digests for users who have requested it&lt;br /&gt;
50  4   *   *   Mon root    /opt/rt5/sbin/rt-email-digest -m weekly&lt;br /&gt;
# Email out daily digests for users who have requested it&lt;br /&gt;
50  5   *   *   *   root    /opt/rt5/sbin/rt-email-digest -m daily&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
You can run all these jobs as the same user that runs your web server, rather than root. Run:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo sed -i &#039;s/\broot\b/www-data/&#039; /etc/cron.d/rt&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo sed -i &#039;s/\broot\b/apache/&#039; /etc/cron.d/rt&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Set up RT ==&lt;br /&gt;
&lt;br /&gt;
If you’ve gotten this far, congratulations, your RT install is really done now. You can start setting up RT with users, groups, queues, and business logic. [[Main Page|Head back to the main page]] to start exploring those topics.&lt;/div&gt;</summary>
		<author><name>Brett</name></author>
	</entry>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=ManualInstallation&amp;diff=27066</id>
		<title>ManualInstallation</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=ManualInstallation&amp;diff=27066"/>
		<updated>2022-03-03T15:08:16Z</updated>

		<summary type="html">&lt;p&gt;Brett: `make install` needs to know PERL5LIB&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Prev: [[ManualRequirements]] — Up: [[UserManual]] — Next: [[ManualApacheConfig]]&lt;br /&gt;
&lt;br /&gt;
This guide walks you through installing RT from source on a modern, popular Linux distro. Specifically, that means a distribution based on Debian or Red Hat that’s been released since around 2020.&lt;br /&gt;
&lt;br /&gt;
This guide assumes:&lt;br /&gt;
&lt;br /&gt;
* You can install packages generally available in Debian/Ubuntu or Red Hat/Fedora/CentOS.&lt;br /&gt;
* You want to install RT, and all of its Perl dependencies, from source to get the latest versions. (This is a trade-off. It means the boundaries of your install will be very clear, but you won’t get security updates for RT or Perl modules from your distribution.)&lt;br /&gt;
* You are willing to install a couple of extra tools to manage the RT installation similarly to how you would in other packaging systems (like PyPI, npm, etc.).&lt;br /&gt;
* You are willing to do a relatively maximal install of RT, enabling all the options during installation and then setting what you need in the configuration. (You could save a little space and time by being pickier about your options, but then that complicates the guide and makes it harder to turn those options on later if you want.)&lt;br /&gt;
* You are using a regular user account on the Linux system that can get superuser privileges with sudo.&lt;br /&gt;
&lt;br /&gt;
== Install the base dependencies ==&lt;br /&gt;
&lt;br /&gt;
These are required by RT, either to run or to install the dependencies.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install autoconf build-essential cpanminus curl libexpat-dev libgd-dev libssl-dev libz-dev gnupg graphviz lynx openssl perl&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf config-manager --set-enabled powertools&lt;br /&gt;
sudo dnf install patch tar which gcc gcc-c++ perl-core perl-App-cpanminus graphviz expat-devel gd-devel lynx openssl openssl-devel&lt;br /&gt;
sudo setenforce 0&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
(Turning off SELinux enforcement is required on Red Hat-based distributions because, as of October 2021, nobody has written a policy for RT.)&lt;br /&gt;
&lt;br /&gt;
== Install a database ==&lt;br /&gt;
&lt;br /&gt;
You need access to a database server. It can be remote, or you can install a database server alongside RT. RT supports a few different databases, but the best supported options are PostgreSQL and MariaDB.&lt;br /&gt;
&lt;br /&gt;
=== Installing and configuring the PostgreSQL server ===&lt;br /&gt;
&lt;br /&gt;
If you want to install a fresh PostgreSQL database server alongside RT:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install postgresql&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install postgresql-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In order to set up RT’s database, you will need a PostgreSQL account that can create databases and roles and be authenticated with a password. If you don’t have that, you can create it by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo createuser --createdb --createrole --login --pwprompt rt_admin&amp;lt;/pre&amp;gt;&lt;br /&gt;
Set the password when prompted. Record this; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
=== Enable password authentication in PostgreSQL ===&lt;br /&gt;
&lt;br /&gt;
You need to consider this step whether you install the database locally, or use an existing one already running. RT supports connecting to PostgreSQL a few different ways, but authenticating with a username and password is simplest, and this guide is written based on that. Not all PostgreSQL installations allow this authentication method by default. You need to review your &amp;lt;code&amp;gt;pg_hba.conf&amp;lt;/code&amp;gt; file located at:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;/etc/postgresql/VERSION/main/pg_hba.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;/var/lib/pgsql/VERSION/data/pg_hba.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Replace &amp;lt;code&amp;gt;VERSION&amp;lt;/code&amp;gt; with the version of your PostgreSQL database. Add these two lines &#039;&#039;&#039;above&#039;&#039;&#039; any other lines that start with &amp;lt;code&amp;gt;host&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;host  rt5  rt_user   all  md5&lt;br /&gt;
host  rt5  rt_admin  all  md5&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This configuration will let &amp;lt;code&amp;gt;rt_user&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;rt_admin&amp;lt;/code&amp;gt; authorize themselves for the &amp;lt;code&amp;gt;rt5&amp;lt;/code&amp;gt; database using an &amp;lt;code&amp;gt;md5&amp;lt;/code&amp;gt; crypted password over a network connection (possibly using the localhost loopback network). You might be able to further restrict some of these fields for improved security, but doing so is outside the scope of this install guide. Refer to [https://www.postgresql.org/docs/current/auth-pg-hba-conf.html the pg_hba.conf documentation] for more details.&lt;br /&gt;
&lt;br /&gt;
Save your changes and reload the database:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo systemctl reload postgresql&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Installing the PostgreSQL client libraries ===&lt;br /&gt;
&lt;br /&gt;
These are required for RT to be able to talk to any PostgreSQL server.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install libpq-dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install postgresql-devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Once this is done you can skip ahead to installing a web server.&lt;br /&gt;
&lt;br /&gt;
=== Installing and configuring the MariaDB server ===&lt;br /&gt;
&lt;br /&gt;
If you want to install a fresh MariaDB database server alongside RT:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install mariadb-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install mariadb-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In order to set up RT’s database, you will need a MySQL superuser account. To stay consistent with PostgreSQL, I suggest setting a password for it. You can do that by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo mysql&lt;br /&gt;
mysql# GRANT ALL PRIVELEGES ON rt5 TO rt_admin@localhost IDENTIFIED BY &#039;YourPassphraseHere&#039; WITH GRANT OPTION;&amp;lt;/pre&amp;gt;&lt;br /&gt;
Record your passphrase; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
=== Adjust MariaDB’s max_allowed_packet setting ===&lt;br /&gt;
&lt;br /&gt;
You need to consider this step whether you install the database locally, or use an existing one already running. [https://mariadb.com/kb/en/server-system-variables/#max_allowed_packet MariaDB’s &amp;lt;code&amp;gt;max_allowed_packet&amp;lt;/code&amp;gt; setting] functionally limits the size of attachments in RT. The default is 16MiB, which is too small for most installations. You can ultimately choose any setting you’re comfortable with; 64MiB here should allow most requests without being too open.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;echo -e &#039;[client-server]\nmax_allowed_packet=64M\n&#039; | sudo tee /etc/mysql/conf.d/max_allowed_packet.cnf&lt;br /&gt;
sudo systemctl reload mariadb&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;echo -e &#039;[client-server]\nmax_allowed_packet=64M\n&#039; | sudo tee /etc/my.cnf.d/max_allowed_packet.cnf&lt;br /&gt;
sudo systemctl reload mariadb&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Installing the MariaDB client libraries ===&lt;br /&gt;
&lt;br /&gt;
These are required for RT to be able to talk to any MariaDB server.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install libmariadb-dev libmariadb-dev-compat&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install mariadb-devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Install a web server with FastCGI ==&lt;br /&gt;
&lt;br /&gt;
FastCGI is the best way to host RT’s web interface today. Installing the web server before RT makes the installation process simpler, because RT will be able to automatically some details about your web server like what user it runs as.&lt;br /&gt;
&lt;br /&gt;
=== Installing Apache ===&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install apache2 libapache2-mod-fcgid&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install httpd mod_fcgid mod_ssl&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ### Installing nginx --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Install RT ==&lt;br /&gt;
&lt;br /&gt;
=== Get and unpack the RT source code ===&lt;br /&gt;
&lt;br /&gt;
Download the latest source code using the link on the [https://bestpractical.com/download-page RT download page], extract it using &amp;lt;code&amp;gt;tar -xf&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt; into the source code directory to run the rest of the commands in this section. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;curl -O https://download.bestpractical.com/pub/rt/release/rt-5.0.2.tar.gz&lt;br /&gt;
tar -xf rt-5.0.2.tar.gz&lt;br /&gt;
cd rt-5.0.2&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Pre-configure RT ===&lt;br /&gt;
&lt;br /&gt;
This command will detect some information about your system in order to install RT properly, and decide which set of dependencies to install. Here’s what the different parts of our command are doing:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;--with-db-type=TYPE&amp;lt;/code&amp;gt; - Replace &amp;lt;code&amp;gt;TYPE&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;Pg&amp;lt;/code&amp;gt; for PostgreSQL, or &amp;lt;code&amp;gt;mysql&amp;lt;/code&amp;gt; for MariaDB.&lt;br /&gt;
* &amp;lt;code&amp;gt;--prefix=/opt/rt5&amp;lt;/code&amp;gt; sets the directory where RT will install all of its libraries, tools, and supporting files. You can choose another path if you like.&lt;br /&gt;
* The rest of the options tell RT to install additional dependencies for optional features.&lt;br /&gt;
&lt;br /&gt;
Make sure you have &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt;ed into the RT source directory, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;./configure --with-db-type=TYPE --prefix=/opt/rt5 --with-attachment-store=disk --enable-externalauth --enable-gd --enable-graphviz --enable-gpg --enable-smime&amp;lt;/pre&amp;gt;&lt;br /&gt;
For more background, [https://docs.bestpractical.com/rt/latest/configure.html refer to the RT configure options documentation].&lt;br /&gt;
&lt;br /&gt;
=== Set up RT&#039;s install environment ===&lt;br /&gt;
&lt;br /&gt;
These steps set things up so we can install RT&#039;s Perl dependencies alongside RT itself. Make sure you have &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt;ed into the RT source directory, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo make dirs&lt;br /&gt;
sudo ln -s . /opt/rt5/local/lib/perl5&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next we write an environment file that configures Perl tools, including RT itself, to load and install libraries under the RT install directory. Use an editor to save all the text below to &amp;lt;code&amp;gt;/opt/rt5/RT.env&amp;lt;/code&amp;gt;. If you&#039;re using a different installation prefix, you should edit the line that sets &amp;lt;code&amp;gt;RTHOME&amp;lt;/code&amp;gt; to the directory you chose. Otherwise, you shouldn&#039;t need to make any changes to this file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# RT.env&lt;br /&gt;
# When you want to do maintenance on RT (like installing or upgrading&lt;br /&gt;
# dependencies or plugins), load this file in your shell by running:&lt;br /&gt;
#   . /opt/rt5/RT.env&lt;br /&gt;
# This will set the necessary environment variables to load and&lt;br /&gt;
# install Perl modules under the RT installation directory.&lt;br /&gt;
export RTHOME=&amp;quot;/opt/rt5&amp;quot;&lt;br /&gt;
export PERL5LIB=&amp;quot;$RTHOME/local/lib${PERL5LIB:+:$PERL5LIB}&amp;quot;&lt;br /&gt;
export PERL_CPANM_OPT=&amp;quot;${PERL_CPANM_OPT:+$PERL_CPANM_OPT }--sudo --local-lib-contained=\&amp;quot;$RTHOME/local\&amp;quot;&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Install RT and its Perl dependencies ===&lt;br /&gt;
&lt;br /&gt;
This command will download, build, and install all of the Perl modules necessary to run RT with the configuration you set above. Here’s what the different parts of the command are doing:&lt;br /&gt;
&lt;br /&gt;
* First we load the environment we set up in the last step, to install dependencies in RT&#039;s install directories.&lt;br /&gt;
* &amp;lt;code&amp;gt;make fixdeps&amp;lt;/code&amp;gt; actually installs those dependencies.&lt;br /&gt;
* &amp;lt;code&amp;gt;RT_FIX_DEPS_CMD=cpanm&amp;lt;/code&amp;gt; tells RT to use cpanminus to install dependencies (instead of the older, default &amp;lt;code&amp;gt;cpan&amp;lt;/code&amp;gt; command).&lt;br /&gt;
* &amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt; installs all of RT’s files under &amp;lt;code&amp;gt;/opt/rt5&amp;lt;/code&amp;gt; (or the prefix directory you set earlier). It will only run if &amp;lt;code&amp;gt;fixdeps&amp;lt;/code&amp;gt; installed all the necessary libraries under &amp;lt;code&amp;gt;PERL5LIB&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Make sure you have &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt;ed into the RT source directory, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;. /opt/rt5/RT.env&lt;br /&gt;
make fixdeps RT_FIX_DEPS_CMD=cpanm&lt;br /&gt;
sudo make install PERL5LIB=&amp;quot;$PERL5LIB&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
If it works, the command will eventually output a message that says “Congratulations. RT is now installed.” followed by instructions about configuring and setting up the database. We’ll do that next.&lt;br /&gt;
&lt;br /&gt;
=== Configure RT ===&lt;br /&gt;
&lt;br /&gt;
[https://docs.bestpractical.com/rt/latest/RT_Config.html RT has many configuration options.] You can put configuration options in the file &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/code&amp;gt;, or in individual files under &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.d/&amp;lt;/code&amp;gt;. Use an editor to save all the text below to &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/code&amp;gt; (you can just overwrite the existing file, or add this to the bottom of what’s there) and then fill in settings for your site everywhere the text &amp;lt;code&amp;gt;EDIT WITH&amp;lt;/code&amp;gt; appears.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Single-quote all values EXCEPT the special value `undef`&lt;br /&gt;
# that turns off a setting.&lt;br /&gt;
&lt;br /&gt;
# rtname appears in ticket email subjects. It needs to be globally unique,&lt;br /&gt;
# so use your organization&#039;s domain name.&lt;br /&gt;
Set($rtname, &#039;EDIT WITH yourdomain.example.com&#039;);&lt;br /&gt;
# Organization is used in the database for ticket links, etc. It also needs to&lt;br /&gt;
# be globally unique, so use your organization&#039;s domain name.&lt;br /&gt;
Set($Organization, &#039;EDIT WITH yourdomain.example.com&#039;);&lt;br /&gt;
# WebDomain is domain name of the RT web server. RT uses it to construct links&lt;br /&gt;
# and defend against CSRFs.&lt;br /&gt;
Set($WebDomain, &#039;EDIT WITH rt.yourdomain.example.com&#039;);&lt;br /&gt;
# WebPort is the port where the RT web server runs. Edit the number below if&lt;br /&gt;
# you&#039;re not using the standard HTTPS port.&lt;br /&gt;
Set($WebPort, &#039;443&#039;);&lt;br /&gt;
&lt;br /&gt;
# DatabaseUser is the name of the database account RT uses to read and store&lt;br /&gt;
# data. &#039;rt_user&#039; is the default but you can change it if you like.&lt;br /&gt;
# DO NOT use the &#039;rt_admin&#039; superuser created in the instructions above.&lt;br /&gt;
Set($DatabaseUser, &#039;rt_user&#039;);&lt;br /&gt;
# DatabasePassword is the password for DatabaseUser.&lt;br /&gt;
Set($DatabasePassword, &#039;EDIT WITH SomePassphraseHere&#039;);&lt;br /&gt;
# DatabaseHost is the hostname of the database server RT should use.&lt;br /&gt;
# Change &#039;localhost&#039; if it lives on a different server.&lt;br /&gt;
Set($DatabaseHost, &#039;localhost&#039;);&lt;br /&gt;
# DatabasePort is the port number of the database server RT should use.&lt;br /&gt;
# `undef` means the default for that database. Change it if you&#039;re not&lt;br /&gt;
# using the standard port.&lt;br /&gt;
Set($DatabasePort, undef);&lt;br /&gt;
# DatabaseName is the name of RT&#039;s database hosted on DatabaseHost.&lt;br /&gt;
# &#039;rt5&#039; is the default but you can change it if you like.&lt;br /&gt;
Set($DatabaseName, &#039;rt5&#039;);&lt;br /&gt;
# DatabaseAdmin is the name of the user in the database used to perform&lt;br /&gt;
# major administrative tasks. Change &#039;rt_admin&#039; if you&#039;re using a user&lt;br /&gt;
# besides the one created in this guide.&lt;br /&gt;
Set($DatabaseAdmin, &#039;rt_admin&#039;);&lt;br /&gt;
&lt;br /&gt;
# RT can log to syslog, stderr, and/or a dedicated file.&lt;br /&gt;
# Log settings are used both by the primary server and by command line&lt;br /&gt;
# tools like rt-crontool, rt-ldapimport, etc.&lt;br /&gt;
# You set all of RT&#039;s $LogTo* paramaters to a standard log level: &#039;debug&#039;,&lt;br /&gt;
# &#039;info&#039;, &#039;notice&#039;, &#039;warning&#039;, &#039;error&#039;, &#039;critical&#039;, &#039;alert&#039;, or &#039;emergency&#039;.&lt;br /&gt;
# For a modern install, I recommend logging primarily to syslog, so it goes&lt;br /&gt;
# to journald where it&#039;s easy to query and automatically gets rotated.&lt;br /&gt;
Set($LogToSyslog, &#039;info&#039;);&lt;br /&gt;
&lt;br /&gt;
# When the RT server logs to stderr, that usually goes to your web server&#039;s&lt;br /&gt;
# error log. Command line tools log to their own stderr. Setting this to&lt;br /&gt;
# &#039;warning&#039; or &#039;error&#039; helps ensure you get notified if RT&#039;s cron jobs&lt;br /&gt;
# encounter problems.&lt;br /&gt;
Set($LogToSTDERR, &#039;warning&#039;);&lt;br /&gt;
&lt;br /&gt;
# Turn off optional features that require additional configuration.&lt;br /&gt;
# If you want to use these, refer to the RT_Config documentation for&lt;br /&gt;
# instructions on how to set them up.&lt;br /&gt;
Set(%GnuPG, &#039;Enable&#039; =&amp;gt; &#039;0&#039;);&lt;br /&gt;
Set(%SMIME, &#039;Enable&#039; =&amp;gt; &#039;0&#039;);&lt;br /&gt;
&lt;br /&gt;
# Perl expects to find this 1 at the end of the file.&lt;br /&gt;
1;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;RT_SiteConfig.pm&amp;lt;/code&amp;gt; is actually Perl code. RT runs the code directly to load the configuration. Any time you finish editing it, you can check that you didn’t make any syntax errors by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;perl -c /opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Set up RT’s database ===&lt;br /&gt;
&lt;br /&gt;
RT includes a tool to help you set up its database. By default, it connects to the database as an administrator to create the database and user that you configured in the previous step.&lt;br /&gt;
&lt;br /&gt;
(The instructions from &amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt; and RT’s README file tell you to run &amp;lt;code&amp;gt;make initialize-database&amp;lt;/code&amp;gt;. That just runs &amp;lt;code&amp;gt;rt-setup-database&amp;lt;/code&amp;gt; for you. Running the tool directly makes it easier to pass the options you need.)&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;--action=init&amp;lt;/code&amp;gt; tells the tool to create the user, the database, the tables inside it, and insert core data RT needs to function.&lt;br /&gt;
* &#039;&#039;&#039;If&#039;&#039;&#039; you are using an existing database server and the database adminstrator has already created the user account and database for RT, then you can add the &amp;lt;code&amp;gt;--skip-create&amp;lt;/code&amp;gt; option.&lt;br /&gt;
* &#039;&#039;&#039;If&#039;&#039;&#039; you have a less common database setup, this tool has additional options to give you finer-grained control over what steps are run and how. Refer to [https://docs.bestpractical.com/rt/latest/rt-setup-database.html the full rt-setup-database documentation] to learn more about those.&lt;br /&gt;
* The command reads files from RT’s &amp;lt;code&amp;gt;etc/&amp;lt;/code&amp;gt; directory by default, so the easiest way to run it is to &amp;lt;code&amp;gt;cd /opt/rt5&amp;lt;/code&amp;gt; first, and then it will find the necessary files automatically.&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /opt/rt5&lt;br /&gt;
sudo sbin/rt-setup-database --action=init&amp;lt;/pre&amp;gt;&lt;br /&gt;
Enter the password for your database administrator account when prompted.&lt;br /&gt;
&lt;br /&gt;
=== Set up fulltext indexing ===&lt;br /&gt;
&lt;br /&gt;
Fulltext indexing speeds up searches for ticket content, which makes RT a lot nicer to use.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;--noask&amp;lt;/code&amp;gt; uses the default names for the index, which will be fine for a new install and simplifies the setup.&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo /opt/rt5/sbin/rt-setup-fulltext-index --noask&amp;lt;/pre&amp;gt;&lt;br /&gt;
Enter the password for your database administrator account when prompted. The end of the process will output some RT configuration that looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;### EXAMPLE OUTPUT ONLY - Don&#039;t use this directly!&lt;br /&gt;
Set( %FullTextSearch,&lt;br /&gt;
    Enable     =&amp;gt; 1,&lt;br /&gt;
    Indexed    =&amp;gt; 1,&lt;br /&gt;
    # Additional output from rt-setup-fulltext-index should be here.&lt;br /&gt;
    # The configuration varies by database type.&lt;br /&gt;
);&amp;lt;/pre&amp;gt;&lt;br /&gt;
Copy the output generated when you run &amp;lt;code&amp;gt;rt-setup-fulltext-index&amp;lt;/code&amp;gt; and save it to the file &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.d/FulltextIndex.pm&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Set permissions ===&lt;br /&gt;
&lt;br /&gt;
All of RT’s configuration files should be readable by the user that runs the web server, and no other users, in order to protect sensitive information like the database password. RT provides a command to set permissions appropriately according to your distribution and configuration. &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt; to the directory where you extracted the RT source code, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd rt-5.0.2&lt;br /&gt;
sudo make fixperms&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Verify the installation ===&lt;br /&gt;
&lt;br /&gt;
If everything has gone well, then you should be able to set a password for RT’s &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; user. You’ll use this later to log in to the web interface and continue setting up your system. Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo /opt/rt5/sbin/rt-passwd root&amp;lt;/pre&amp;gt;&lt;br /&gt;
Set the password when prompted. Record this; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s web server ==&lt;br /&gt;
&lt;br /&gt;
=== Configure Apache modules ===&lt;br /&gt;
&lt;br /&gt;
You will need to have the following modules enabled in Apache to run RT. You should already have these installed if you followed the instructions above.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;alias&amp;lt;/code&amp;gt; (required to map URLs to RT)&lt;br /&gt;
* &amp;lt;code&amp;gt;fcgid&amp;lt;/code&amp;gt; (required for Apache to talk to RT)&lt;br /&gt;
* &amp;lt;code&amp;gt;mpm_prefork&amp;lt;/code&amp;gt; (Apache requires you to select an MPM. RT is designed to work with the prefork module.)&lt;br /&gt;
* &amp;lt;code&amp;gt;ssl&amp;lt;/code&amp;gt; (required to serve HTTPS; optional otherwise)&lt;br /&gt;
&lt;br /&gt;
Enable them following these instructions:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo a2dismod mpm_event&lt;br /&gt;
sudo a2enmod fcgid&lt;br /&gt;
sudo a2enmod mpm_prefork&lt;br /&gt;
sudo a2enmod ssl&amp;lt;/pre&amp;gt;&lt;br /&gt;
| &amp;lt;pre&amp;gt;echo LoadModule mpm_prefork_module modules/mod_mpm_prefork.so | sudo tee /etc/httpd/conf.modules.d/00-mpm.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Disable default VirtualHosts (optional) ===&lt;br /&gt;
&lt;br /&gt;
If this web server is dedicated to RT, then you should disable the VirtualHosts that are included with the stock configuration. Run:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo a2dissite 000-default&lt;br /&gt;
sudo a2dissite default-ssl&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo sed -i~ &#039;/^&amp;lt;VirtualHost\b/ , /^&amp;lt;\/VirtualHost\b/ d&#039; /etc/httpd/conf.d/ssl.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Configure an Apache VirtualHost ===&lt;br /&gt;
&lt;br /&gt;
Create a file at the following location. You can change the &amp;lt;code&amp;gt;RT&amp;lt;/code&amp;gt; part of the filename if you like, but the file must exist in this directory and have a &amp;lt;code&amp;gt;.conf&amp;lt;/code&amp;gt; suffix.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;/etc/apache2/sites-available/RT.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
Then after you create the file, run: &amp;lt;code&amp;gt;sudo a2ensite RT&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;/etc/httpd/conf.d/vhost_RT.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
(This filename needs to come after &amp;lt;code&amp;gt;ssl.conf&amp;lt;/code&amp;gt; in the directory listing.)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Use an editor to save all the text below to the new &amp;lt;code&amp;gt;RT.conf&amp;lt;/code&amp;gt; and then fill in settings for your site everywhere the text &amp;lt;code&amp;gt;EDIT WITH&amp;lt;/code&amp;gt; appears.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### Primary RT VirtualHost&lt;br /&gt;
# You can change both the bind address and/or the port here as required.&lt;br /&gt;
# This default will listen for HTTPS connections on all interfaces.&lt;br /&gt;
&amp;lt;VirtualHost *:443&amp;gt;&lt;br /&gt;
  # EDIT HERE with the domain name of the web server.&lt;br /&gt;
  ServerName rt.yourdomain.example.com&lt;br /&gt;
  &amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
    SSLEngine on&lt;br /&gt;
    # These specify the paths to the SSL certificate and private key Apache&lt;br /&gt;
    # should use. These example paths are common for Let&#039;s Encrypt. If you&lt;br /&gt;
    # don&#039;t use Let&#039;s Encrypt, the standard location for these files is under&lt;br /&gt;
    # (Debian/Ubuntu) /etc/ssl&lt;br /&gt;
    # (Red Hat/Fedora/CentOS) /etc/pki/tls&lt;br /&gt;
    # EDIT HERE with the appropriate paths for your server&lt;br /&gt;
    SSLCertificateFile /etc/letsencrypt/live/example.com/fullchain.pem&lt;br /&gt;
    SSLCertificateKeyFile /etc/letsencrypt/live/example.com/privkey.pem&lt;br /&gt;
  &amp;lt;/IfModule&amp;gt;&lt;br /&gt;
  &amp;lt;Location /&amp;gt;&lt;br /&gt;
    Require all granted&lt;br /&gt;
    Options +ExecCGI&lt;br /&gt;
    AddHandler fcgid-script fcgi&lt;br /&gt;
  &amp;lt;/Location&amp;gt;&lt;br /&gt;
  AddDefaultCharset UTF-8&lt;br /&gt;
  DocumentRoot /opt/rt5/share/html&lt;br /&gt;
  ScriptAlias / /opt/rt5/sbin/rt-server.fcgi/&lt;br /&gt;
  # The default mod_fcgid timeout is 40 seconds.&lt;br /&gt;
  # We increase it here to allow for large ticket searches, etc.&lt;br /&gt;
  FcgidIOTimeout 200&lt;br /&gt;
  # mod_fcgid only allows 128KiB requests by default. This is too small for users&lt;br /&gt;
  # to upload files to RT. You can ultimately choose any setting you&#039;re&lt;br /&gt;
  # comfortable with; 70MiB here should allow most requests without being too&lt;br /&gt;
  # open.&lt;br /&gt;
  FcgidMaxRequestLen 73400320&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
### End primary RT VirtualHost&lt;br /&gt;
&lt;br /&gt;
### Optional HTTPS Redirect VirtualHost&lt;br /&gt;
# Most modern servers support HTTPS and want all web traffic to go through it.&lt;br /&gt;
# This VirtualHost redirects normal HTTP traffic to HTTPS.&lt;br /&gt;
# You can delete this whole section if you don&#039;t want or need this.&lt;br /&gt;
&amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
  # You can change both the bind address and/or the port here as required.&lt;br /&gt;
  # This default will listen for HTTP connections on all interfaces.&lt;br /&gt;
  &amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
    SSLEngine off&lt;br /&gt;
    # EDIT HERE both lines below with the domain name of your web server.&lt;br /&gt;
    ServerName rt.yourdomain.example.com&lt;br /&gt;
    Redirect permanent / https://rt.yourdomain.example.com/&lt;br /&gt;
  &amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/IfModule&amp;gt;&lt;br /&gt;
### End optional HTTPS Redirect VirtualHost&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
After you’ve edited the file, load the configuration with:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo systemctl reload apache2&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo systemctl reload httpd&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If this command reports an error, double-check the configuration file for typos, especially in option names, file paths, and the&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;amp;lt;Section&amp;amp;gt;&amp;lt;/code&amp;gt; pairs. Edit again and reload the configuration until it succeeds without output.&lt;br /&gt;
&lt;br /&gt;
=== Verify the web interface ===&lt;br /&gt;
&lt;br /&gt;
You should be able to visit your web server in your browser, and be presented with RT’s login screen. You should be able to log in with username &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; and the password you set previously.&lt;br /&gt;
&lt;br /&gt;
If you run into trouble, the first place to look for more information is by reading Apache’s error log:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo less /var/log/apache2/error.log&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo less /var/log/httpd/error.log&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s mail server ==&lt;br /&gt;
&lt;br /&gt;
RT both can both send and receive ticket updates via email. Unfortunately, there are too many variables to document a useful setup process here: getting this working usually requires creating DNS records, and coordinating with existing mail servers, which will be the main constraint on your setup. Instead this guide provides a brief overview of how the integration works, and where the connection points are that you likely need to work on.&lt;br /&gt;
&lt;br /&gt;
=== Sending Mail ===&lt;br /&gt;
&lt;br /&gt;
RT only knows how to send mail by passing it off to another program on the system. It cannot connect or authenticate directly to external mail servers. In the default configuration, RT runs the standard &amp;lt;code&amp;gt;sendmail&amp;lt;/code&amp;gt; command. There are [https://docs.bestpractical.com/rt/latest/RT_Config.html#Outgoing-mail configuration options to send mail through different commands] if you need.&lt;br /&gt;
&lt;br /&gt;
The most common setup is to install and configure a proper Mail Transfer Agent (MTA) like Postfix or Exim, and then configure it to send mail to the wider Internet as you need. This works well because the MTAs are robust and well-tested; they have flexible configuration to let you send mail out by relaying to other mail servers you specify with optional authentication; and most distributions install one by default anyway. The only hard part is configuring the MTA to send mail following your site’s policies.&lt;br /&gt;
&lt;br /&gt;
Other software is available that provides a slimmer version of the &amp;lt;code&amp;gt;sendmail&amp;lt;/code&amp;gt; command that connects to an external mail server for you, like ssmtp. These programs are usually easier to configure than an MTA, but they often lose email permanently if they can’t connect to the external server at the time it’s sent. (MTAs keep email queued locally until they successfully deliver it to another server.)&lt;br /&gt;
&lt;br /&gt;
=== Receiving email ===&lt;br /&gt;
&lt;br /&gt;
RT installs a command called &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; that receives an email on standard input and posts it to RT’s REST web interface, where it gets saved in the database and added to a ticket. You need to arrange for a way to send incoming email to this command.&lt;br /&gt;
&lt;br /&gt;
The most common setup is to have an MTA on the same box as RT receive email directly, and then set up mail aliases that call this command when mail comes in. Example &amp;lt;code&amp;gt;/etc/aliases&amp;lt;/code&amp;gt; entries look like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rt: &amp;quot;|/opt/rt5/bin/rt-mailgate --queue general --action correspond --url https://rt.yourdomain.example.com/&amp;quot;&lt;br /&gt;
rt-comment: &amp;quot;|/opt/rt5/bin/rt-mailgate --queue general --action comment --url https://rt.yourdomain.example.com/&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
This works well because, again, you’re probably running an MTA anyway; and the MTA can hold and queue mail if it comes in while RT is down for any reason, giving you a buffer against downtime.&lt;br /&gt;
&lt;br /&gt;
Another common option is to periodically run a tool that fetches mail using a protocol like IMAP, like fetchmail or getmail, and passes it on to &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt;. This is less common because it requires setting up another tool to run, and securely storing another set of mail server credentials. But it is useful when local policy prevents the RT server from receiving email directly.&lt;br /&gt;
&lt;br /&gt;
This is much less common, but it might help to know that &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; doesn’t have to run on the same system as RT itself. It just needs to be able to connect to RT’s web interface. If you don’t have any other options, you can install the RT software on a different system that receives email, and configure &#039;&#039;that&#039;&#039; system to run &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; and pass it on to the RT server. To do that, just repeat the installation instructions above, skipping the steps about installing the database and web server.&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s background jobs ==&lt;br /&gt;
&lt;br /&gt;
Create a file &amp;lt;code&amp;gt;/etc/cron.d/rt&amp;lt;/code&amp;gt; with the following content. You may edit all of the time fields as you see fit. Refer to the crontab(5) man page for details about their definitions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Update the fulltext index with new ticket data&lt;br /&gt;
*/3 *   *   *   *   root    /opt/rt5/sbin/rt-fulltext-indexer&lt;br /&gt;
# Email out dashboards that users have subscribed to&lt;br /&gt;
0   *   *   *   *   root    /opt/rt5/sbin/rt-email-dashboards&lt;br /&gt;
# Clean old sessions from the database&lt;br /&gt;
10  3   *   *   *   root    /opt/rt5/sbin/rt-clean-sessions --older 8d&lt;br /&gt;
# Email out weekly digests for users who have requested it&lt;br /&gt;
50  4   *   *   Mon root    /opt/rt5/sbin/rt-email-digest -m weekly&lt;br /&gt;
# Email out daily digests for users who have requested it&lt;br /&gt;
50  5   *   *   *   root    /opt/rt5/sbin/rt-email-digest -m daily&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
You can run all these jobs as the same user that runs your web server, rather than root. Run:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo sed -i &#039;s/\broot\b/www-data/&#039; /etc/cron.d/rt&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo sed -i &#039;s/\broot\b/apache/&#039; /etc/cron.d/rt&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Set up RT ==&lt;br /&gt;
&lt;br /&gt;
If you’ve gotten this far, congratulations, your RT install is really done now. You can start setting up RT with users, groups, queues, and business logic. [[Main Page|Head back to the main page]] to start exploring those topics.&lt;/div&gt;</summary>
		<author><name>Brett</name></author>
	</entry>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=ManualInstallation&amp;diff=27065</id>
		<title>ManualInstallation</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=ManualInstallation&amp;diff=27065"/>
		<updated>2022-03-03T15:07:08Z</updated>

		<summary type="html">&lt;p&gt;Brett: fix MariaDB GRANT syntax&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Prev: [[ManualRequirements]] — Up: [[UserManual]] — Next: [[ManualApacheConfig]]&lt;br /&gt;
&lt;br /&gt;
This guide walks you through installing RT from source on a modern, popular Linux distro. Specifically, that means a distribution based on Debian or Red Hat that’s been released since around 2020.&lt;br /&gt;
&lt;br /&gt;
This guide assumes:&lt;br /&gt;
&lt;br /&gt;
* You can install packages generally available in Debian/Ubuntu or Red Hat/Fedora/CentOS.&lt;br /&gt;
* You want to install RT, and all of its Perl dependencies, from source to get the latest versions. (This is a trade-off. It means the boundaries of your install will be very clear, but you won’t get security updates for RT or Perl modules from your distribution.)&lt;br /&gt;
* You are willing to install a couple of extra tools to manage the RT installation similarly to how you would in other packaging systems (like PyPI, npm, etc.).&lt;br /&gt;
* You are willing to do a relatively maximal install of RT, enabling all the options during installation and then setting what you need in the configuration. (You could save a little space and time by being pickier about your options, but then that complicates the guide and makes it harder to turn those options on later if you want.)&lt;br /&gt;
* You are using a regular user account on the Linux system that can get superuser privileges with sudo.&lt;br /&gt;
&lt;br /&gt;
== Install the base dependencies ==&lt;br /&gt;
&lt;br /&gt;
These are required by RT, either to run or to install the dependencies.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install autoconf build-essential cpanminus curl libexpat-dev libgd-dev libssl-dev libz-dev gnupg graphviz lynx openssl perl&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf config-manager --set-enabled powertools&lt;br /&gt;
sudo dnf install patch tar which gcc gcc-c++ perl-core perl-App-cpanminus graphviz expat-devel gd-devel lynx openssl openssl-devel&lt;br /&gt;
sudo setenforce 0&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
(Turning off SELinux enforcement is required on Red Hat-based distributions because, as of October 2021, nobody has written a policy for RT.)&lt;br /&gt;
&lt;br /&gt;
== Install a database ==&lt;br /&gt;
&lt;br /&gt;
You need access to a database server. It can be remote, or you can install a database server alongside RT. RT supports a few different databases, but the best supported options are PostgreSQL and MariaDB.&lt;br /&gt;
&lt;br /&gt;
=== Installing and configuring the PostgreSQL server ===&lt;br /&gt;
&lt;br /&gt;
If you want to install a fresh PostgreSQL database server alongside RT:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install postgresql&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install postgresql-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In order to set up RT’s database, you will need a PostgreSQL account that can create databases and roles and be authenticated with a password. If you don’t have that, you can create it by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo createuser --createdb --createrole --login --pwprompt rt_admin&amp;lt;/pre&amp;gt;&lt;br /&gt;
Set the password when prompted. Record this; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
=== Enable password authentication in PostgreSQL ===&lt;br /&gt;
&lt;br /&gt;
You need to consider this step whether you install the database locally, or use an existing one already running. RT supports connecting to PostgreSQL a few different ways, but authenticating with a username and password is simplest, and this guide is written based on that. Not all PostgreSQL installations allow this authentication method by default. You need to review your &amp;lt;code&amp;gt;pg_hba.conf&amp;lt;/code&amp;gt; file located at:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;/etc/postgresql/VERSION/main/pg_hba.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;/var/lib/pgsql/VERSION/data/pg_hba.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Replace &amp;lt;code&amp;gt;VERSION&amp;lt;/code&amp;gt; with the version of your PostgreSQL database. Add these two lines &#039;&#039;&#039;above&#039;&#039;&#039; any other lines that start with &amp;lt;code&amp;gt;host&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;host  rt5  rt_user   all  md5&lt;br /&gt;
host  rt5  rt_admin  all  md5&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This configuration will let &amp;lt;code&amp;gt;rt_user&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;rt_admin&amp;lt;/code&amp;gt; authorize themselves for the &amp;lt;code&amp;gt;rt5&amp;lt;/code&amp;gt; database using an &amp;lt;code&amp;gt;md5&amp;lt;/code&amp;gt; crypted password over a network connection (possibly using the localhost loopback network). You might be able to further restrict some of these fields for improved security, but doing so is outside the scope of this install guide. Refer to [https://www.postgresql.org/docs/current/auth-pg-hba-conf.html the pg_hba.conf documentation] for more details.&lt;br /&gt;
&lt;br /&gt;
Save your changes and reload the database:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo systemctl reload postgresql&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Installing the PostgreSQL client libraries ===&lt;br /&gt;
&lt;br /&gt;
These are required for RT to be able to talk to any PostgreSQL server.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install libpq-dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install postgresql-devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Once this is done you can skip ahead to installing a web server.&lt;br /&gt;
&lt;br /&gt;
=== Installing and configuring the MariaDB server ===&lt;br /&gt;
&lt;br /&gt;
If you want to install a fresh MariaDB database server alongside RT:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install mariadb-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install mariadb-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In order to set up RT’s database, you will need a MySQL superuser account. To stay consistent with PostgreSQL, I suggest setting a password for it. You can do that by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo mysql&lt;br /&gt;
mysql# GRANT ALL PRIVELEGES ON rt5 TO rt_admin@localhost IDENTIFIED BY &#039;YourPassphraseHere&#039; WITH GRANT OPTION;&amp;lt;/pre&amp;gt;&lt;br /&gt;
Record your passphrase; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
=== Adjust MariaDB’s max_allowed_packet setting ===&lt;br /&gt;
&lt;br /&gt;
You need to consider this step whether you install the database locally, or use an existing one already running. [https://mariadb.com/kb/en/server-system-variables/#max_allowed_packet MariaDB’s &amp;lt;code&amp;gt;max_allowed_packet&amp;lt;/code&amp;gt; setting] functionally limits the size of attachments in RT. The default is 16MiB, which is too small for most installations. You can ultimately choose any setting you’re comfortable with; 64MiB here should allow most requests without being too open.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;echo -e &#039;[client-server]\nmax_allowed_packet=64M\n&#039; | sudo tee /etc/mysql/conf.d/max_allowed_packet.cnf&lt;br /&gt;
sudo systemctl reload mariadb&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;echo -e &#039;[client-server]\nmax_allowed_packet=64M\n&#039; | sudo tee /etc/my.cnf.d/max_allowed_packet.cnf&lt;br /&gt;
sudo systemctl reload mariadb&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Installing the MariaDB client libraries ===&lt;br /&gt;
&lt;br /&gt;
These are required for RT to be able to talk to any MariaDB server.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install libmariadb-dev libmariadb-dev-compat&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install mariadb-devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Install a web server with FastCGI ==&lt;br /&gt;
&lt;br /&gt;
FastCGI is the best way to host RT’s web interface today. Installing the web server before RT makes the installation process simpler, because RT will be able to automatically some details about your web server like what user it runs as.&lt;br /&gt;
&lt;br /&gt;
=== Installing Apache ===&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install apache2 libapache2-mod-fcgid&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install httpd mod_fcgid mod_ssl&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ### Installing nginx --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Install RT ==&lt;br /&gt;
&lt;br /&gt;
=== Get and unpack the RT source code ===&lt;br /&gt;
&lt;br /&gt;
Download the latest source code using the link on the [https://bestpractical.com/download-page RT download page], extract it using &amp;lt;code&amp;gt;tar -xf&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt; into the source code directory to run the rest of the commands in this section. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;curl -O https://download.bestpractical.com/pub/rt/release/rt-5.0.2.tar.gz&lt;br /&gt;
tar -xf rt-5.0.2.tar.gz&lt;br /&gt;
cd rt-5.0.2&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Pre-configure RT ===&lt;br /&gt;
&lt;br /&gt;
This command will detect some information about your system in order to install RT properly, and decide which set of dependencies to install. Here’s what the different parts of our command are doing:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;--with-db-type=TYPE&amp;lt;/code&amp;gt; - Replace &amp;lt;code&amp;gt;TYPE&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;Pg&amp;lt;/code&amp;gt; for PostgreSQL, or &amp;lt;code&amp;gt;mysql&amp;lt;/code&amp;gt; for MariaDB.&lt;br /&gt;
* &amp;lt;code&amp;gt;--prefix=/opt/rt5&amp;lt;/code&amp;gt; sets the directory where RT will install all of its libraries, tools, and supporting files. You can choose another path if you like.&lt;br /&gt;
* The rest of the options tell RT to install additional dependencies for optional features.&lt;br /&gt;
&lt;br /&gt;
Make sure you have &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt;ed into the RT source directory, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;./configure --with-db-type=TYPE --prefix=/opt/rt5 --with-attachment-store=disk --enable-externalauth --enable-gd --enable-graphviz --enable-gpg --enable-smime&amp;lt;/pre&amp;gt;&lt;br /&gt;
For more background, [https://docs.bestpractical.com/rt/latest/configure.html refer to the RT configure options documentation].&lt;br /&gt;
&lt;br /&gt;
=== Set up RT&#039;s install environment ===&lt;br /&gt;
&lt;br /&gt;
These steps set things up so we can install RT&#039;s Perl dependencies alongside RT itself. Make sure you have &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt;ed into the RT source directory, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo make dirs&lt;br /&gt;
sudo ln -s . /opt/rt5/local/lib/perl5&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next we write an environment file that configures Perl tools, including RT itself, to load and install libraries under the RT install directory. Use an editor to save all the text below to &amp;lt;code&amp;gt;/opt/rt5/RT.env&amp;lt;/code&amp;gt;. If you&#039;re using a different installation prefix, you should edit the line that sets &amp;lt;code&amp;gt;RTHOME&amp;lt;/code&amp;gt; to the directory you chose. Otherwise, you shouldn&#039;t need to make any changes to this file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# RT.env&lt;br /&gt;
# When you want to do maintenance on RT (like installing or upgrading&lt;br /&gt;
# dependencies or plugins), load this file in your shell by running:&lt;br /&gt;
#   . /opt/rt5/RT.env&lt;br /&gt;
# This will set the necessary environment variables to load and&lt;br /&gt;
# install Perl modules under the RT installation directory.&lt;br /&gt;
export RTHOME=&amp;quot;/opt/rt5&amp;quot;&lt;br /&gt;
export PERL5LIB=&amp;quot;$RTHOME/local/lib${PERL5LIB:+:$PERL5LIB}&amp;quot;&lt;br /&gt;
export PERL_CPANM_OPT=&amp;quot;${PERL_CPANM_OPT:+$PERL_CPANM_OPT }--sudo --local-lib-contained=\&amp;quot;$RTHOME/local\&amp;quot;&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Install RT and its Perl dependencies ===&lt;br /&gt;
&lt;br /&gt;
This command will download, build, and install all of the Perl modules necessary to run RT with the configuration you set above. Here’s what the different parts of the command are doing:&lt;br /&gt;
&lt;br /&gt;
* First we load the environment we set up in the last step, to install dependencies in RT&#039;s install directories.&lt;br /&gt;
* &amp;lt;code&amp;gt;make fixdeps&amp;lt;/code&amp;gt; actually installs those dependencies.&lt;br /&gt;
* &amp;lt;code&amp;gt;RT_FIX_DEPS_CMD=cpanm&amp;lt;/code&amp;gt; tells RT to use cpanminus to install dependencies (instead of the older, default &amp;lt;code&amp;gt;cpan&amp;lt;/code&amp;gt; command).&lt;br /&gt;
* &amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt; installs all of RT’s files under &amp;lt;code&amp;gt;/opt/rt5&amp;lt;/code&amp;gt; (or the prefix directory you set earlier). It will only run if &amp;lt;code&amp;gt;fixdeps&amp;lt;/code&amp;gt; succeeds.&lt;br /&gt;
&lt;br /&gt;
Make sure you have &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt;ed into the RT source directory, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;. /opt/rt5/RT.env&lt;br /&gt;
make fixdeps RT_FIX_DEPS_CMD=cpanm&lt;br /&gt;
sudo make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
If it works, the command will eventually output a message that says “Congratulations. RT is now installed.” followed by instructions about configuring and setting up the database. We’ll do that next.&lt;br /&gt;
&lt;br /&gt;
=== Configure RT ===&lt;br /&gt;
&lt;br /&gt;
[https://docs.bestpractical.com/rt/latest/RT_Config.html RT has many configuration options.] You can put configuration options in the file &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/code&amp;gt;, or in individual files under &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.d/&amp;lt;/code&amp;gt;. Use an editor to save all the text below to &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/code&amp;gt; (you can just overwrite the existing file, or add this to the bottom of what’s there) and then fill in settings for your site everywhere the text &amp;lt;code&amp;gt;EDIT WITH&amp;lt;/code&amp;gt; appears.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Single-quote all values EXCEPT the special value `undef`&lt;br /&gt;
# that turns off a setting.&lt;br /&gt;
&lt;br /&gt;
# rtname appears in ticket email subjects. It needs to be globally unique,&lt;br /&gt;
# so use your organization&#039;s domain name.&lt;br /&gt;
Set($rtname, &#039;EDIT WITH yourdomain.example.com&#039;);&lt;br /&gt;
# Organization is used in the database for ticket links, etc. It also needs to&lt;br /&gt;
# be globally unique, so use your organization&#039;s domain name.&lt;br /&gt;
Set($Organization, &#039;EDIT WITH yourdomain.example.com&#039;);&lt;br /&gt;
# WebDomain is domain name of the RT web server. RT uses it to construct links&lt;br /&gt;
# and defend against CSRFs.&lt;br /&gt;
Set($WebDomain, &#039;EDIT WITH rt.yourdomain.example.com&#039;);&lt;br /&gt;
# WebPort is the port where the RT web server runs. Edit the number below if&lt;br /&gt;
# you&#039;re not using the standard HTTPS port.&lt;br /&gt;
Set($WebPort, &#039;443&#039;);&lt;br /&gt;
&lt;br /&gt;
# DatabaseUser is the name of the database account RT uses to read and store&lt;br /&gt;
# data. &#039;rt_user&#039; is the default but you can change it if you like.&lt;br /&gt;
# DO NOT use the &#039;rt_admin&#039; superuser created in the instructions above.&lt;br /&gt;
Set($DatabaseUser, &#039;rt_user&#039;);&lt;br /&gt;
# DatabasePassword is the password for DatabaseUser.&lt;br /&gt;
Set($DatabasePassword, &#039;EDIT WITH SomePassphraseHere&#039;);&lt;br /&gt;
# DatabaseHost is the hostname of the database server RT should use.&lt;br /&gt;
# Change &#039;localhost&#039; if it lives on a different server.&lt;br /&gt;
Set($DatabaseHost, &#039;localhost&#039;);&lt;br /&gt;
# DatabasePort is the port number of the database server RT should use.&lt;br /&gt;
# `undef` means the default for that database. Change it if you&#039;re not&lt;br /&gt;
# using the standard port.&lt;br /&gt;
Set($DatabasePort, undef);&lt;br /&gt;
# DatabaseName is the name of RT&#039;s database hosted on DatabaseHost.&lt;br /&gt;
# &#039;rt5&#039; is the default but you can change it if you like.&lt;br /&gt;
Set($DatabaseName, &#039;rt5&#039;);&lt;br /&gt;
# DatabaseAdmin is the name of the user in the database used to perform&lt;br /&gt;
# major administrative tasks. Change &#039;rt_admin&#039; if you&#039;re using a user&lt;br /&gt;
# besides the one created in this guide.&lt;br /&gt;
Set($DatabaseAdmin, &#039;rt_admin&#039;);&lt;br /&gt;
&lt;br /&gt;
# RT can log to syslog, stderr, and/or a dedicated file.&lt;br /&gt;
# Log settings are used both by the primary server and by command line&lt;br /&gt;
# tools like rt-crontool, rt-ldapimport, etc.&lt;br /&gt;
# You set all of RT&#039;s $LogTo* paramaters to a standard log level: &#039;debug&#039;,&lt;br /&gt;
# &#039;info&#039;, &#039;notice&#039;, &#039;warning&#039;, &#039;error&#039;, &#039;critical&#039;, &#039;alert&#039;, or &#039;emergency&#039;.&lt;br /&gt;
# For a modern install, I recommend logging primarily to syslog, so it goes&lt;br /&gt;
# to journald where it&#039;s easy to query and automatically gets rotated.&lt;br /&gt;
Set($LogToSyslog, &#039;info&#039;);&lt;br /&gt;
&lt;br /&gt;
# When the RT server logs to stderr, that usually goes to your web server&#039;s&lt;br /&gt;
# error log. Command line tools log to their own stderr. Setting this to&lt;br /&gt;
# &#039;warning&#039; or &#039;error&#039; helps ensure you get notified if RT&#039;s cron jobs&lt;br /&gt;
# encounter problems.&lt;br /&gt;
Set($LogToSTDERR, &#039;warning&#039;);&lt;br /&gt;
&lt;br /&gt;
# Turn off optional features that require additional configuration.&lt;br /&gt;
# If you want to use these, refer to the RT_Config documentation for&lt;br /&gt;
# instructions on how to set them up.&lt;br /&gt;
Set(%GnuPG, &#039;Enable&#039; =&amp;gt; &#039;0&#039;);&lt;br /&gt;
Set(%SMIME, &#039;Enable&#039; =&amp;gt; &#039;0&#039;);&lt;br /&gt;
&lt;br /&gt;
# Perl expects to find this 1 at the end of the file.&lt;br /&gt;
1;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;RT_SiteConfig.pm&amp;lt;/code&amp;gt; is actually Perl code. RT runs the code directly to load the configuration. Any time you finish editing it, you can check that you didn’t make any syntax errors by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;perl -c /opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Set up RT’s database ===&lt;br /&gt;
&lt;br /&gt;
RT includes a tool to help you set up its database. By default, it connects to the database as an administrator to create the database and user that you configured in the previous step.&lt;br /&gt;
&lt;br /&gt;
(The instructions from &amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt; and RT’s README file tell you to run &amp;lt;code&amp;gt;make initialize-database&amp;lt;/code&amp;gt;. That just runs &amp;lt;code&amp;gt;rt-setup-database&amp;lt;/code&amp;gt; for you. Running the tool directly makes it easier to pass the options you need.)&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;--action=init&amp;lt;/code&amp;gt; tells the tool to create the user, the database, the tables inside it, and insert core data RT needs to function.&lt;br /&gt;
* &#039;&#039;&#039;If&#039;&#039;&#039; you are using an existing database server and the database adminstrator has already created the user account and database for RT, then you can add the &amp;lt;code&amp;gt;--skip-create&amp;lt;/code&amp;gt; option.&lt;br /&gt;
* &#039;&#039;&#039;If&#039;&#039;&#039; you have a less common database setup, this tool has additional options to give you finer-grained control over what steps are run and how. Refer to [https://docs.bestpractical.com/rt/latest/rt-setup-database.html the full rt-setup-database documentation] to learn more about those.&lt;br /&gt;
* The command reads files from RT’s &amp;lt;code&amp;gt;etc/&amp;lt;/code&amp;gt; directory by default, so the easiest way to run it is to &amp;lt;code&amp;gt;cd /opt/rt5&amp;lt;/code&amp;gt; first, and then it will find the necessary files automatically.&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /opt/rt5&lt;br /&gt;
sudo sbin/rt-setup-database --action=init&amp;lt;/pre&amp;gt;&lt;br /&gt;
Enter the password for your database administrator account when prompted.&lt;br /&gt;
&lt;br /&gt;
=== Set up fulltext indexing ===&lt;br /&gt;
&lt;br /&gt;
Fulltext indexing speeds up searches for ticket content, which makes RT a lot nicer to use.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;--noask&amp;lt;/code&amp;gt; uses the default names for the index, which will be fine for a new install and simplifies the setup.&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo /opt/rt5/sbin/rt-setup-fulltext-index --noask&amp;lt;/pre&amp;gt;&lt;br /&gt;
Enter the password for your database administrator account when prompted. The end of the process will output some RT configuration that looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;### EXAMPLE OUTPUT ONLY - Don&#039;t use this directly!&lt;br /&gt;
Set( %FullTextSearch,&lt;br /&gt;
    Enable     =&amp;gt; 1,&lt;br /&gt;
    Indexed    =&amp;gt; 1,&lt;br /&gt;
    # Additional output from rt-setup-fulltext-index should be here.&lt;br /&gt;
    # The configuration varies by database type.&lt;br /&gt;
);&amp;lt;/pre&amp;gt;&lt;br /&gt;
Copy the output generated when you run &amp;lt;code&amp;gt;rt-setup-fulltext-index&amp;lt;/code&amp;gt; and save it to the file &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.d/FulltextIndex.pm&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Set permissions ===&lt;br /&gt;
&lt;br /&gt;
All of RT’s configuration files should be readable by the user that runs the web server, and no other users, in order to protect sensitive information like the database password. RT provides a command to set permissions appropriately according to your distribution and configuration. &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt; to the directory where you extracted the RT source code, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd rt-5.0.2&lt;br /&gt;
sudo make fixperms&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Verify the installation ===&lt;br /&gt;
&lt;br /&gt;
If everything has gone well, then you should be able to set a password for RT’s &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; user. You’ll use this later to log in to the web interface and continue setting up your system. Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo /opt/rt5/sbin/rt-passwd root&amp;lt;/pre&amp;gt;&lt;br /&gt;
Set the password when prompted. Record this; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s web server ==&lt;br /&gt;
&lt;br /&gt;
=== Configure Apache modules ===&lt;br /&gt;
&lt;br /&gt;
You will need to have the following modules enabled in Apache to run RT. You should already have these installed if you followed the instructions above.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;alias&amp;lt;/code&amp;gt; (required to map URLs to RT)&lt;br /&gt;
* &amp;lt;code&amp;gt;fcgid&amp;lt;/code&amp;gt; (required for Apache to talk to RT)&lt;br /&gt;
* &amp;lt;code&amp;gt;mpm_prefork&amp;lt;/code&amp;gt; (Apache requires you to select an MPM. RT is designed to work with the prefork module.)&lt;br /&gt;
* &amp;lt;code&amp;gt;ssl&amp;lt;/code&amp;gt; (required to serve HTTPS; optional otherwise)&lt;br /&gt;
&lt;br /&gt;
Enable them following these instructions:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo a2dismod mpm_event&lt;br /&gt;
sudo a2enmod fcgid&lt;br /&gt;
sudo a2enmod mpm_prefork&lt;br /&gt;
sudo a2enmod ssl&amp;lt;/pre&amp;gt;&lt;br /&gt;
| &amp;lt;pre&amp;gt;echo LoadModule mpm_prefork_module modules/mod_mpm_prefork.so | sudo tee /etc/httpd/conf.modules.d/00-mpm.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Disable default VirtualHosts (optional) ===&lt;br /&gt;
&lt;br /&gt;
If this web server is dedicated to RT, then you should disable the VirtualHosts that are included with the stock configuration. Run:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo a2dissite 000-default&lt;br /&gt;
sudo a2dissite default-ssl&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo sed -i~ &#039;/^&amp;lt;VirtualHost\b/ , /^&amp;lt;\/VirtualHost\b/ d&#039; /etc/httpd/conf.d/ssl.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Configure an Apache VirtualHost ===&lt;br /&gt;
&lt;br /&gt;
Create a file at the following location. You can change the &amp;lt;code&amp;gt;RT&amp;lt;/code&amp;gt; part of the filename if you like, but the file must exist in this directory and have a &amp;lt;code&amp;gt;.conf&amp;lt;/code&amp;gt; suffix.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;/etc/apache2/sites-available/RT.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
Then after you create the file, run: &amp;lt;code&amp;gt;sudo a2ensite RT&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;/etc/httpd/conf.d/vhost_RT.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
(This filename needs to come after &amp;lt;code&amp;gt;ssl.conf&amp;lt;/code&amp;gt; in the directory listing.)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Use an editor to save all the text below to the new &amp;lt;code&amp;gt;RT.conf&amp;lt;/code&amp;gt; and then fill in settings for your site everywhere the text &amp;lt;code&amp;gt;EDIT WITH&amp;lt;/code&amp;gt; appears.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### Primary RT VirtualHost&lt;br /&gt;
# You can change both the bind address and/or the port here as required.&lt;br /&gt;
# This default will listen for HTTPS connections on all interfaces.&lt;br /&gt;
&amp;lt;VirtualHost *:443&amp;gt;&lt;br /&gt;
  # EDIT HERE with the domain name of the web server.&lt;br /&gt;
  ServerName rt.yourdomain.example.com&lt;br /&gt;
  &amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
    SSLEngine on&lt;br /&gt;
    # These specify the paths to the SSL certificate and private key Apache&lt;br /&gt;
    # should use. These example paths are common for Let&#039;s Encrypt. If you&lt;br /&gt;
    # don&#039;t use Let&#039;s Encrypt, the standard location for these files is under&lt;br /&gt;
    # (Debian/Ubuntu) /etc/ssl&lt;br /&gt;
    # (Red Hat/Fedora/CentOS) /etc/pki/tls&lt;br /&gt;
    # EDIT HERE with the appropriate paths for your server&lt;br /&gt;
    SSLCertificateFile /etc/letsencrypt/live/example.com/fullchain.pem&lt;br /&gt;
    SSLCertificateKeyFile /etc/letsencrypt/live/example.com/privkey.pem&lt;br /&gt;
  &amp;lt;/IfModule&amp;gt;&lt;br /&gt;
  &amp;lt;Location /&amp;gt;&lt;br /&gt;
    Require all granted&lt;br /&gt;
    Options +ExecCGI&lt;br /&gt;
    AddHandler fcgid-script fcgi&lt;br /&gt;
  &amp;lt;/Location&amp;gt;&lt;br /&gt;
  AddDefaultCharset UTF-8&lt;br /&gt;
  DocumentRoot /opt/rt5/share/html&lt;br /&gt;
  ScriptAlias / /opt/rt5/sbin/rt-server.fcgi/&lt;br /&gt;
  # The default mod_fcgid timeout is 40 seconds.&lt;br /&gt;
  # We increase it here to allow for large ticket searches, etc.&lt;br /&gt;
  FcgidIOTimeout 200&lt;br /&gt;
  # mod_fcgid only allows 128KiB requests by default. This is too small for users&lt;br /&gt;
  # to upload files to RT. You can ultimately choose any setting you&#039;re&lt;br /&gt;
  # comfortable with; 70MiB here should allow most requests without being too&lt;br /&gt;
  # open.&lt;br /&gt;
  FcgidMaxRequestLen 73400320&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
### End primary RT VirtualHost&lt;br /&gt;
&lt;br /&gt;
### Optional HTTPS Redirect VirtualHost&lt;br /&gt;
# Most modern servers support HTTPS and want all web traffic to go through it.&lt;br /&gt;
# This VirtualHost redirects normal HTTP traffic to HTTPS.&lt;br /&gt;
# You can delete this whole section if you don&#039;t want or need this.&lt;br /&gt;
&amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
  # You can change both the bind address and/or the port here as required.&lt;br /&gt;
  # This default will listen for HTTP connections on all interfaces.&lt;br /&gt;
  &amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
    SSLEngine off&lt;br /&gt;
    # EDIT HERE both lines below with the domain name of your web server.&lt;br /&gt;
    ServerName rt.yourdomain.example.com&lt;br /&gt;
    Redirect permanent / https://rt.yourdomain.example.com/&lt;br /&gt;
  &amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/IfModule&amp;gt;&lt;br /&gt;
### End optional HTTPS Redirect VirtualHost&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
After you’ve edited the file, load the configuration with:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo systemctl reload apache2&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo systemctl reload httpd&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If this command reports an error, double-check the configuration file for typos, especially in option names, file paths, and the&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;amp;lt;Section&amp;amp;gt;&amp;lt;/code&amp;gt; pairs. Edit again and reload the configuration until it succeeds without output.&lt;br /&gt;
&lt;br /&gt;
=== Verify the web interface ===&lt;br /&gt;
&lt;br /&gt;
You should be able to visit your web server in your browser, and be presented with RT’s login screen. You should be able to log in with username &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; and the password you set previously.&lt;br /&gt;
&lt;br /&gt;
If you run into trouble, the first place to look for more information is by reading Apache’s error log:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo less /var/log/apache2/error.log&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo less /var/log/httpd/error.log&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s mail server ==&lt;br /&gt;
&lt;br /&gt;
RT both can both send and receive ticket updates via email. Unfortunately, there are too many variables to document a useful setup process here: getting this working usually requires creating DNS records, and coordinating with existing mail servers, which will be the main constraint on your setup. Instead this guide provides a brief overview of how the integration works, and where the connection points are that you likely need to work on.&lt;br /&gt;
&lt;br /&gt;
=== Sending Mail ===&lt;br /&gt;
&lt;br /&gt;
RT only knows how to send mail by passing it off to another program on the system. It cannot connect or authenticate directly to external mail servers. In the default configuration, RT runs the standard &amp;lt;code&amp;gt;sendmail&amp;lt;/code&amp;gt; command. There are [https://docs.bestpractical.com/rt/latest/RT_Config.html#Outgoing-mail configuration options to send mail through different commands] if you need.&lt;br /&gt;
&lt;br /&gt;
The most common setup is to install and configure a proper Mail Transfer Agent (MTA) like Postfix or Exim, and then configure it to send mail to the wider Internet as you need. This works well because the MTAs are robust and well-tested; they have flexible configuration to let you send mail out by relaying to other mail servers you specify with optional authentication; and most distributions install one by default anyway. The only hard part is configuring the MTA to send mail following your site’s policies.&lt;br /&gt;
&lt;br /&gt;
Other software is available that provides a slimmer version of the &amp;lt;code&amp;gt;sendmail&amp;lt;/code&amp;gt; command that connects to an external mail server for you, like ssmtp. These programs are usually easier to configure than an MTA, but they often lose email permanently if they can’t connect to the external server at the time it’s sent. (MTAs keep email queued locally until they successfully deliver it to another server.)&lt;br /&gt;
&lt;br /&gt;
=== Receiving email ===&lt;br /&gt;
&lt;br /&gt;
RT installs a command called &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; that receives an email on standard input and posts it to RT’s REST web interface, where it gets saved in the database and added to a ticket. You need to arrange for a way to send incoming email to this command.&lt;br /&gt;
&lt;br /&gt;
The most common setup is to have an MTA on the same box as RT receive email directly, and then set up mail aliases that call this command when mail comes in. Example &amp;lt;code&amp;gt;/etc/aliases&amp;lt;/code&amp;gt; entries look like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rt: &amp;quot;|/opt/rt5/bin/rt-mailgate --queue general --action correspond --url https://rt.yourdomain.example.com/&amp;quot;&lt;br /&gt;
rt-comment: &amp;quot;|/opt/rt5/bin/rt-mailgate --queue general --action comment --url https://rt.yourdomain.example.com/&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
This works well because, again, you’re probably running an MTA anyway; and the MTA can hold and queue mail if it comes in while RT is down for any reason, giving you a buffer against downtime.&lt;br /&gt;
&lt;br /&gt;
Another common option is to periodically run a tool that fetches mail using a protocol like IMAP, like fetchmail or getmail, and passes it on to &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt;. This is less common because it requires setting up another tool to run, and securely storing another set of mail server credentials. But it is useful when local policy prevents the RT server from receiving email directly.&lt;br /&gt;
&lt;br /&gt;
This is much less common, but it might help to know that &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; doesn’t have to run on the same system as RT itself. It just needs to be able to connect to RT’s web interface. If you don’t have any other options, you can install the RT software on a different system that receives email, and configure &#039;&#039;that&#039;&#039; system to run &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; and pass it on to the RT server. To do that, just repeat the installation instructions above, skipping the steps about installing the database and web server.&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s background jobs ==&lt;br /&gt;
&lt;br /&gt;
Create a file &amp;lt;code&amp;gt;/etc/cron.d/rt&amp;lt;/code&amp;gt; with the following content. You may edit all of the time fields as you see fit. Refer to the crontab(5) man page for details about their definitions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Update the fulltext index with new ticket data&lt;br /&gt;
*/3 *   *   *   *   root    /opt/rt5/sbin/rt-fulltext-indexer&lt;br /&gt;
# Email out dashboards that users have subscribed to&lt;br /&gt;
0   *   *   *   *   root    /opt/rt5/sbin/rt-email-dashboards&lt;br /&gt;
# Clean old sessions from the database&lt;br /&gt;
10  3   *   *   *   root    /opt/rt5/sbin/rt-clean-sessions --older 8d&lt;br /&gt;
# Email out weekly digests for users who have requested it&lt;br /&gt;
50  4   *   *   Mon root    /opt/rt5/sbin/rt-email-digest -m weekly&lt;br /&gt;
# Email out daily digests for users who have requested it&lt;br /&gt;
50  5   *   *   *   root    /opt/rt5/sbin/rt-email-digest -m daily&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
You can run all these jobs as the same user that runs your web server, rather than root. Run:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo sed -i &#039;s/\broot\b/www-data/&#039; /etc/cron.d/rt&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo sed -i &#039;s/\broot\b/apache/&#039; /etc/cron.d/rt&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Set up RT ==&lt;br /&gt;
&lt;br /&gt;
If you’ve gotten this far, congratulations, your RT install is really done now. You can start setting up RT with users, groups, queues, and business logic. [[Main Page|Head back to the main page]] to start exploring those topics.&lt;/div&gt;</summary>
		<author><name>Brett</name></author>
	</entry>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=ManualInstallation&amp;diff=27060</id>
		<title>ManualInstallation</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=ManualInstallation&amp;diff=27060"/>
		<updated>2022-01-25T22:43:55Z</updated>

		<summary type="html">&lt;p&gt;Brett: add a section about writing an environment file - to help with later maintenance&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Prev: [[ManualRequirements]] — Up: [[UserManual]] — Next: [[ManualApacheConfig]]&lt;br /&gt;
&lt;br /&gt;
This guide walks you through installing RT from source on a modern, popular Linux distro. Specifically, that means a distribution based on Debian or Red Hat that’s been released since around 2020.&lt;br /&gt;
&lt;br /&gt;
This guide assumes:&lt;br /&gt;
&lt;br /&gt;
* You can install packages generally available in Debian/Ubuntu or Red Hat/Fedora/CentOS.&lt;br /&gt;
* You want to install RT, and all of its Perl dependencies, from source to get the latest versions. (This is a trade-off. It means the boundaries of your install will be very clear, but you won’t get security updates for RT or Perl modules from your distribution.)&lt;br /&gt;
* You are willing to install a couple of extra tools to manage the RT installation similarly to how you would in other packaging systems (like PyPI, npm, etc.).&lt;br /&gt;
* You are willing to do a relatively maximal install of RT, enabling all the options during installation and then setting what you need in the configuration. (You could save a little space and time by being pickier about your options, but then that complicates the guide and makes it harder to turn those options on later if you want.)&lt;br /&gt;
* You are using a regular user account on the Linux system that can get superuser privileges with sudo.&lt;br /&gt;
&lt;br /&gt;
== Install the base dependencies ==&lt;br /&gt;
&lt;br /&gt;
These are required by RT, either to run or to install the dependencies.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install autoconf build-essential cpanminus curl libexpat-dev libgd-dev libssl-dev libz-dev gnupg graphviz lynx openssl perl&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf config-manager --set-enabled powertools&lt;br /&gt;
sudo dnf install patch tar which gcc gcc-c++ perl-core perl-App-cpanminus graphviz expat-devel gd-devel lynx openssl openssl-devel&lt;br /&gt;
sudo setenforce 0&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
(Turning off SELinux enforcement is required on Red Hat-based distributions because, as of October 2021, nobody has written a policy for RT.)&lt;br /&gt;
&lt;br /&gt;
== Install a database ==&lt;br /&gt;
&lt;br /&gt;
You need access to a database server. It can be remote, or you can install a database server alongside RT. RT supports a few different databases, but the best supported options are PostgreSQL and MariaDB.&lt;br /&gt;
&lt;br /&gt;
=== Installing and configuring the PostgreSQL server ===&lt;br /&gt;
&lt;br /&gt;
If you want to install a fresh PostgreSQL database server alongside RT:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install postgresql&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install postgresql-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In order to set up RT’s database, you will need a PostgreSQL account that can create databases and roles and be authenticated with a password. If you don’t have that, you can create it by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo createuser --createdb --createrole --login --pwprompt rt_admin&amp;lt;/pre&amp;gt;&lt;br /&gt;
Set the password when prompted. Record this; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
=== Enable password authentication in PostgreSQL ===&lt;br /&gt;
&lt;br /&gt;
You need to consider this step whether you install the database locally, or use an existing one already running. RT supports connecting to PostgreSQL a few different ways, but authenticating with a username and password is simplest, and this guide is written based on that. Not all PostgreSQL installations allow this authentication method by default. You need to review your &amp;lt;code&amp;gt;pg_hba.conf&amp;lt;/code&amp;gt; file located at:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;/etc/postgresql/VERSION/main/pg_hba.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;/var/lib/pgsql/VERSION/data/pg_hba.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Replace &amp;lt;code&amp;gt;VERSION&amp;lt;/code&amp;gt; with the version of your PostgreSQL database. Add these two lines &#039;&#039;&#039;above&#039;&#039;&#039; any other lines that start with &amp;lt;code&amp;gt;host&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;host  rt5  rt_user   all  md5&lt;br /&gt;
host  rt5  rt_admin  all  md5&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This configuration will let &amp;lt;code&amp;gt;rt_user&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;rt_admin&amp;lt;/code&amp;gt; authorize themselves for the &amp;lt;code&amp;gt;rt5&amp;lt;/code&amp;gt; database using an &amp;lt;code&amp;gt;md5&amp;lt;/code&amp;gt; crypted password over a network connection (possibly using the localhost loopback network). You might be able to further restrict some of these fields for improved security, but doing so is outside the scope of this install guide. Refer to [https://www.postgresql.org/docs/current/auth-pg-hba-conf.html the pg_hba.conf documentation] for more details.&lt;br /&gt;
&lt;br /&gt;
Save your changes and reload the database:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo systemctl reload postgresql&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Installing the PostgreSQL client libraries ===&lt;br /&gt;
&lt;br /&gt;
These are required for RT to be able to talk to any PostgreSQL server.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install libpq-dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install postgresql-devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Once this is done you can skip ahead to installing a web server.&lt;br /&gt;
&lt;br /&gt;
=== Installing and configuring the MariaDB server ===&lt;br /&gt;
&lt;br /&gt;
If you want to install a fresh MariaDB database server alongside RT:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install mariadb-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install mariadb-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In order to set up RT’s database, you will need a MySQL superuser account. To stay consistent with PostgreSQL, I suggest setting a password for it. You can do that by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo mysql&lt;br /&gt;
mysql# GRANT ALL PRIVELEGES WITH GRANT OPTION ON rt5 TO rt_admin@localhost IDENTIFIED BY &#039;YourPassphraseHere&#039;;&amp;lt;/pre&amp;gt;&lt;br /&gt;
Record your passphrase; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
=== Adjust MariaDB’s max_allowed_packet setting ===&lt;br /&gt;
&lt;br /&gt;
You need to consider this step whether you install the database locally, or use an existing one already running. [https://mariadb.com/kb/en/server-system-variables/#max_allowed_packet MariaDB’s &amp;lt;code&amp;gt;max_allowed_packet&amp;lt;/code&amp;gt; setting] functionally limits the size of attachments in RT. The default is 16MiB, which is too small for most installations. You can ultimately choose any setting you’re comfortable with; 64MiB here should allow most requests without being too open.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;echo -e &#039;[client-server]\nmax_allowed_packet=64M\n&#039; | sudo tee /etc/mysql/conf.d/max_allowed_packet.cnf&lt;br /&gt;
sudo systemctl reload mariadb&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;echo -e &#039;[client-server]\nmax_allowed_packet=64M\n&#039; | sudo tee /etc/my.cnf.d/max_allowed_packet.cnf&lt;br /&gt;
sudo systemctl reload mariadb&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Installing the MariaDB client libraries ===&lt;br /&gt;
&lt;br /&gt;
These are required for RT to be able to talk to any MariaDB server.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install libmariadb-dev libmariadb-dev-compat&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install mariadb-devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Install a web server with FastCGI ==&lt;br /&gt;
&lt;br /&gt;
FastCGI is the best way to host RT’s web interface today. Installing the web server before RT makes the installation process simpler, because RT will be able to automatically some details about your web server like what user it runs as.&lt;br /&gt;
&lt;br /&gt;
=== Installing Apache ===&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install apache2 libapache2-mod-fcgid&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install httpd mod_fcgid mod_ssl&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ### Installing nginx --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Install RT ==&lt;br /&gt;
&lt;br /&gt;
=== Get and unpack the RT source code ===&lt;br /&gt;
&lt;br /&gt;
Download the latest source code using the link on the [https://bestpractical.com/download-page RT download page], extract it using &amp;lt;code&amp;gt;tar -xf&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt; into the source code directory to run the rest of the commands in this section. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;curl -O https://download.bestpractical.com/pub/rt/release/rt-5.0.2.tar.gz&lt;br /&gt;
tar -xf rt-5.0.2.tar.gz&lt;br /&gt;
cd rt-5.0.2&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Pre-configure RT ===&lt;br /&gt;
&lt;br /&gt;
This command will detect some information about your system in order to install RT properly, and decide which set of dependencies to install. Here’s what the different parts of our command are doing:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;--with-db-type=TYPE&amp;lt;/code&amp;gt; - Replace &amp;lt;code&amp;gt;TYPE&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;Pg&amp;lt;/code&amp;gt; for PostgreSQL, or &amp;lt;code&amp;gt;mysql&amp;lt;/code&amp;gt; for MariaDB.&lt;br /&gt;
* &amp;lt;code&amp;gt;--prefix=/opt/rt5&amp;lt;/code&amp;gt; sets the directory where RT will install all of its libraries, tools, and supporting files. You can choose another path if you like.&lt;br /&gt;
* The rest of the options tell RT to install additional dependencies for optional features.&lt;br /&gt;
&lt;br /&gt;
Make sure you have &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt;ed into the RT source directory, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;./configure --with-db-type=TYPE --prefix=/opt/rt5 --with-attachment-store=disk --enable-externalauth --enable-gd --enable-graphviz --enable-gpg --enable-smime&amp;lt;/pre&amp;gt;&lt;br /&gt;
For more background, [https://docs.bestpractical.com/rt/latest/configure.html refer to the RT configure options documentation].&lt;br /&gt;
&lt;br /&gt;
=== Set up RT&#039;s install environment ===&lt;br /&gt;
&lt;br /&gt;
These steps set things up so we can install RT&#039;s Perl dependencies alongside RT itself. Make sure you have &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt;ed into the RT source directory, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo make dirs&lt;br /&gt;
sudo ln -s . /opt/rt5/local/lib/perl5&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next we write an environment file that configures Perl tools, including RT itself, to load and install libraries under the RT install directory. Use an editor to save all the text below to &amp;lt;code&amp;gt;/opt/rt5/RT.env&amp;lt;/code&amp;gt;. If you&#039;re using a different installation prefix, you should edit the line that sets &amp;lt;code&amp;gt;RTHOME&amp;lt;/code&amp;gt; to the directory you chose. Otherwise, you shouldn&#039;t need to make any changes to this file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# RT.env&lt;br /&gt;
# When you want to do maintenance on RT (like installing or upgrading&lt;br /&gt;
# dependencies or plugins), load this file in your shell by running:&lt;br /&gt;
#   . /opt/rt5/RT.env&lt;br /&gt;
# This will set the necessary environment variables to load and&lt;br /&gt;
# install Perl modules under the RT installation directory.&lt;br /&gt;
export RTHOME=&amp;quot;/opt/rt5&amp;quot;&lt;br /&gt;
export PERL5LIB=&amp;quot;$RTHOME/local/lib${PERL5LIB:+:$PERL5LIB}&amp;quot;&lt;br /&gt;
export PERL_CPANM_OPT=&amp;quot;${PERL_CPANM_OPT:+$PERL_CPANM_OPT }--sudo --local-lib-contained=\&amp;quot;$RTHOME/local\&amp;quot;&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Install RT and its Perl dependencies ===&lt;br /&gt;
&lt;br /&gt;
This command will download, build, and install all of the Perl modules necessary to run RT with the configuration you set above. Here’s what the different parts of the command are doing:&lt;br /&gt;
&lt;br /&gt;
* First we load the environment we set up in the last step, to install dependencies in RT&#039;s install directories.&lt;br /&gt;
* &amp;lt;code&amp;gt;make fixdeps&amp;lt;/code&amp;gt; actually installs those dependencies.&lt;br /&gt;
* &amp;lt;code&amp;gt;RT_FIX_DEPS_CMD=cpanm&amp;lt;/code&amp;gt; tells RT to use cpanminus to install dependencies (instead of the older, default &amp;lt;code&amp;gt;cpan&amp;lt;/code&amp;gt; command).&lt;br /&gt;
* &amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt; installs all of RT’s files under &amp;lt;code&amp;gt;/opt/rt5&amp;lt;/code&amp;gt; (or the prefix directory you set earlier). It will only run if &amp;lt;code&amp;gt;fixdeps&amp;lt;/code&amp;gt; succeeds.&lt;br /&gt;
&lt;br /&gt;
Make sure you have &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt;ed into the RT source directory, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;. /opt/rt5/RT.env&lt;br /&gt;
make fixdeps RT_FIX_DEPS_CMD=cpanm&lt;br /&gt;
sudo make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
If it works, the command will eventually output a message that says “Congratulations. RT is now installed.” followed by instructions about configuring and setting up the database. We’ll do that next.&lt;br /&gt;
&lt;br /&gt;
=== Configure RT ===&lt;br /&gt;
&lt;br /&gt;
[https://docs.bestpractical.com/rt/latest/RT_Config.html RT has many configuration options.] You can put configuration options in the file &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/code&amp;gt;, or in individual files under &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.d/&amp;lt;/code&amp;gt;. Use an editor to save all the text below to &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/code&amp;gt; (you can just overwrite the existing file, or add this to the bottom of what’s there) and then fill in settings for your site everywhere the text &amp;lt;code&amp;gt;EDIT WITH&amp;lt;/code&amp;gt; appears.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Single-quote all values EXCEPT the special value `undef`&lt;br /&gt;
# that turns off a setting.&lt;br /&gt;
&lt;br /&gt;
# rtname appears in ticket email subjects. It needs to be globally unique,&lt;br /&gt;
# so use your organization&#039;s domain name.&lt;br /&gt;
Set($rtname, &#039;EDIT WITH yourdomain.example.com&#039;);&lt;br /&gt;
# Organization is used in the database for ticket links, etc. It also needs to&lt;br /&gt;
# be globally unique, so use your organization&#039;s domain name.&lt;br /&gt;
Set($Organization, &#039;EDIT WITH yourdomain.example.com&#039;);&lt;br /&gt;
# WebDomain is domain name of the RT web server. RT uses it to construct links&lt;br /&gt;
# and defend against CSRFs.&lt;br /&gt;
Set($WebDomain, &#039;EDIT WITH rt.yourdomain.example.com&#039;);&lt;br /&gt;
# WebPort is the port where the RT web server runs. Edit the number below if&lt;br /&gt;
# you&#039;re not using the standard HTTPS port.&lt;br /&gt;
Set($WebPort, &#039;443&#039;);&lt;br /&gt;
&lt;br /&gt;
# DatabaseUser is the name of the database account RT uses to read and store&lt;br /&gt;
# data. &#039;rt_user&#039; is the default but you can change it if you like.&lt;br /&gt;
# DO NOT use the &#039;rt_admin&#039; superuser created in the instructions above.&lt;br /&gt;
Set($DatabaseUser, &#039;rt_user&#039;);&lt;br /&gt;
# DatabasePassword is the password for DatabaseUser.&lt;br /&gt;
Set($DatabasePassword, &#039;EDIT WITH SomePassphraseHere&#039;);&lt;br /&gt;
# DatabaseHost is the hostname of the database server RT should use.&lt;br /&gt;
# Change &#039;localhost&#039; if it lives on a different server.&lt;br /&gt;
Set($DatabaseHost, &#039;localhost&#039;);&lt;br /&gt;
# DatabasePort is the port number of the database server RT should use.&lt;br /&gt;
# `undef` means the default for that database. Change it if you&#039;re not&lt;br /&gt;
# using the standard port.&lt;br /&gt;
Set($DatabasePort, undef);&lt;br /&gt;
# DatabaseName is the name of RT&#039;s database hosted on DatabaseHost.&lt;br /&gt;
# &#039;rt5&#039; is the default but you can change it if you like.&lt;br /&gt;
Set($DatabaseName, &#039;rt5&#039;);&lt;br /&gt;
# DatabaseAdmin is the name of the user in the database used to perform&lt;br /&gt;
# major administrative tasks. Change &#039;rt_admin&#039; if you&#039;re using a user&lt;br /&gt;
# besides the one created in this guide.&lt;br /&gt;
Set($DatabaseAdmin, &#039;rt_admin&#039;);&lt;br /&gt;
&lt;br /&gt;
# RT can log to syslog, stderr, and/or a dedicated file.&lt;br /&gt;
# Log settings are used both by the primary server and by command line&lt;br /&gt;
# tools like rt-crontool, rt-ldapimport, etc.&lt;br /&gt;
# You set all of RT&#039;s $LogTo* paramaters to a standard log level: &#039;debug&#039;,&lt;br /&gt;
# &#039;info&#039;, &#039;notice&#039;, &#039;warning&#039;, &#039;error&#039;, &#039;critical&#039;, &#039;alert&#039;, or &#039;emergency&#039;.&lt;br /&gt;
# For a modern install, I recommend logging primarily to syslog, so it goes&lt;br /&gt;
# to journald where it&#039;s easy to query and automatically gets rotated.&lt;br /&gt;
Set($LogToSyslog, &#039;info&#039;);&lt;br /&gt;
&lt;br /&gt;
# When the RT server logs to stderr, that usually goes to your web server&#039;s&lt;br /&gt;
# error log. Command line tools log to their own stderr. Setting this to&lt;br /&gt;
# &#039;warning&#039; or &#039;error&#039; helps ensure you get notified if RT&#039;s cron jobs&lt;br /&gt;
# encounter problems.&lt;br /&gt;
Set($LogToSTDERR, &#039;warning&#039;);&lt;br /&gt;
&lt;br /&gt;
# Turn off optional features that require additional configuration.&lt;br /&gt;
# If you want to use these, refer to the RT_Config documentation for&lt;br /&gt;
# instructions on how to set them up.&lt;br /&gt;
Set(%GnuPG, &#039;Enable&#039; =&amp;gt; &#039;0&#039;);&lt;br /&gt;
Set(%SMIME, &#039;Enable&#039; =&amp;gt; &#039;0&#039;);&lt;br /&gt;
&lt;br /&gt;
# Perl expects to find this 1 at the end of the file.&lt;br /&gt;
1;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;RT_SiteConfig.pm&amp;lt;/code&amp;gt; is actually Perl code. RT runs the code directly to load the configuration. Any time you finish editing it, you can check that you didn’t make any syntax errors by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;perl -c /opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Set up RT’s database ===&lt;br /&gt;
&lt;br /&gt;
RT includes a tool to help you set up its database. By default, it connects to the database as an administrator to create the database and user that you configured in the previous step.&lt;br /&gt;
&lt;br /&gt;
(The instructions from &amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt; and RT’s README file tell you to run &amp;lt;code&amp;gt;make initialize-database&amp;lt;/code&amp;gt;. That just runs &amp;lt;code&amp;gt;rt-setup-database&amp;lt;/code&amp;gt; for you. Running the tool directly makes it easier to pass the options you need.)&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;--action=init&amp;lt;/code&amp;gt; tells the tool to create the user, the database, the tables inside it, and insert core data RT needs to function.&lt;br /&gt;
* &#039;&#039;&#039;If&#039;&#039;&#039; you are using an existing database server and the database adminstrator has already created the user account and database for RT, then you can add the &amp;lt;code&amp;gt;--skip-create&amp;lt;/code&amp;gt; option.&lt;br /&gt;
* &#039;&#039;&#039;If&#039;&#039;&#039; you have a less common database setup, this tool has additional options to give you finer-grained control over what steps are run and how. Refer to [https://docs.bestpractical.com/rt/latest/rt-setup-database.html the full rt-setup-database documentation] to learn more about those.&lt;br /&gt;
* The command reads files from RT’s &amp;lt;code&amp;gt;etc/&amp;lt;/code&amp;gt; directory by default, so the easiest way to run it is to &amp;lt;code&amp;gt;cd /opt/rt5&amp;lt;/code&amp;gt; first, and then it will find the necessary files automatically.&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /opt/rt5&lt;br /&gt;
sudo sbin/rt-setup-database --action=init&amp;lt;/pre&amp;gt;&lt;br /&gt;
Enter the password for your database administrator account when prompted.&lt;br /&gt;
&lt;br /&gt;
=== Set up fulltext indexing ===&lt;br /&gt;
&lt;br /&gt;
Fulltext indexing speeds up searches for ticket content, which makes RT a lot nicer to use.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;--noask&amp;lt;/code&amp;gt; uses the default names for the index, which will be fine for a new install and simplifies the setup.&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo /opt/rt5/sbin/rt-setup-fulltext-index --noask&amp;lt;/pre&amp;gt;&lt;br /&gt;
Enter the password for your database administrator account when prompted. The end of the process will output some RT configuration that looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;### EXAMPLE OUTPUT ONLY - Don&#039;t use this directly!&lt;br /&gt;
Set( %FullTextSearch,&lt;br /&gt;
    Enable     =&amp;gt; 1,&lt;br /&gt;
    Indexed    =&amp;gt; 1,&lt;br /&gt;
    # Additional output from rt-setup-fulltext-index should be here.&lt;br /&gt;
    # The configuration varies by database type.&lt;br /&gt;
);&amp;lt;/pre&amp;gt;&lt;br /&gt;
Copy the output generated when you run &amp;lt;code&amp;gt;rt-setup-fulltext-index&amp;lt;/code&amp;gt; and save it to the file &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.d/FulltextIndex.pm&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Set permissions ===&lt;br /&gt;
&lt;br /&gt;
All of RT’s configuration files should be readable by the user that runs the web server, and no other users, in order to protect sensitive information like the database password. RT provides a command to set permissions appropriately according to your distribution and configuration. &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt; to the directory where you extracted the RT source code, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd rt-5.0.2&lt;br /&gt;
sudo make fixperms&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Verify the installation ===&lt;br /&gt;
&lt;br /&gt;
If everything has gone well, then you should be able to set a password for RT’s &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; user. You’ll use this later to log in to the web interface and continue setting up your system. Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo /opt/rt5/sbin/rt-passwd root&amp;lt;/pre&amp;gt;&lt;br /&gt;
Set the password when prompted. Record this; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s web server ==&lt;br /&gt;
&lt;br /&gt;
=== Configure Apache modules ===&lt;br /&gt;
&lt;br /&gt;
You will need to have the following modules enabled in Apache to run RT. You should already have these installed if you followed the instructions above.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;alias&amp;lt;/code&amp;gt; (required to map URLs to RT)&lt;br /&gt;
* &amp;lt;code&amp;gt;fcgid&amp;lt;/code&amp;gt; (required for Apache to talk to RT)&lt;br /&gt;
* &amp;lt;code&amp;gt;mpm_prefork&amp;lt;/code&amp;gt; (Apache requires you to select an MPM. RT is designed to work with the prefork module.)&lt;br /&gt;
* &amp;lt;code&amp;gt;ssl&amp;lt;/code&amp;gt; (required to serve HTTPS; optional otherwise)&lt;br /&gt;
&lt;br /&gt;
Enable them following these instructions:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo a2dismod mpm_event&lt;br /&gt;
sudo a2enmod fcgid&lt;br /&gt;
sudo a2enmod mpm_prefork&lt;br /&gt;
sudo a2enmod ssl&amp;lt;/pre&amp;gt;&lt;br /&gt;
| &amp;lt;pre&amp;gt;echo LoadModule mpm_prefork_module modules/mod_mpm_prefork.so | sudo tee /etc/httpd/conf.modules.d/00-mpm.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Disable default VirtualHosts (optional) ===&lt;br /&gt;
&lt;br /&gt;
If this web server is dedicated to RT, then you should disable the VirtualHosts that are included with the stock configuration. Run:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo a2dissite 000-default&lt;br /&gt;
sudo a2dissite default-ssl&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo sed -i~ &#039;/^&amp;lt;VirtualHost\b/ , /^&amp;lt;\/VirtualHost\b/ d&#039; /etc/httpd/conf.d/ssl.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Configure an Apache VirtualHost ===&lt;br /&gt;
&lt;br /&gt;
Create a file at the following location. You can change the &amp;lt;code&amp;gt;RT&amp;lt;/code&amp;gt; part of the filename if you like, but the file must exist in this directory and have a &amp;lt;code&amp;gt;.conf&amp;lt;/code&amp;gt; suffix.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;/etc/apache2/sites-available/RT.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
Then after you create the file, run: &amp;lt;code&amp;gt;sudo a2ensite RT&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;/etc/httpd/conf.d/vhost_RT.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
(This filename needs to come after &amp;lt;code&amp;gt;ssl.conf&amp;lt;/code&amp;gt; in the directory listing.)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Use an editor to save all the text below to the new &amp;lt;code&amp;gt;RT.conf&amp;lt;/code&amp;gt; and then fill in settings for your site everywhere the text &amp;lt;code&amp;gt;EDIT WITH&amp;lt;/code&amp;gt; appears.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### Primary RT VirtualHost&lt;br /&gt;
# You can change both the bind address and/or the port here as required.&lt;br /&gt;
# This default will listen for HTTPS connections on all interfaces.&lt;br /&gt;
&amp;lt;VirtualHost *:443&amp;gt;&lt;br /&gt;
  # EDIT HERE with the domain name of the web server.&lt;br /&gt;
  ServerName rt.yourdomain.example.com&lt;br /&gt;
  &amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
    SSLEngine on&lt;br /&gt;
    # These specify the paths to the SSL certificate and private key Apache&lt;br /&gt;
    # should use. These example paths are common for Let&#039;s Encrypt. If you&lt;br /&gt;
    # don&#039;t use Let&#039;s Encrypt, the standard location for these files is under&lt;br /&gt;
    # (Debian/Ubuntu) /etc/ssl&lt;br /&gt;
    # (Red Hat/Fedora/CentOS) /etc/pki/tls&lt;br /&gt;
    # EDIT HERE with the appropriate paths for your server&lt;br /&gt;
    SSLCertificateFile /etc/letsencrypt/live/example.com/fullchain.pem&lt;br /&gt;
    SSLCertificateKeyFile /etc/letsencrypt/live/example.com/privkey.pem&lt;br /&gt;
  &amp;lt;/IfModule&amp;gt;&lt;br /&gt;
  &amp;lt;Location /&amp;gt;&lt;br /&gt;
    Require all granted&lt;br /&gt;
    Options +ExecCGI&lt;br /&gt;
    AddHandler fcgid-script fcgi&lt;br /&gt;
  &amp;lt;/Location&amp;gt;&lt;br /&gt;
  AddDefaultCharset UTF-8&lt;br /&gt;
  DocumentRoot /opt/rt5/share/html&lt;br /&gt;
  ScriptAlias / /opt/rt5/sbin/rt-server.fcgi/&lt;br /&gt;
  # The default mod_fcgid timeout is 40 seconds.&lt;br /&gt;
  # We increase it here to allow for large ticket searches, etc.&lt;br /&gt;
  FcgidIOTimeout 200&lt;br /&gt;
  # mod_fcgid only allows 128KiB requests by default. This is too small for users&lt;br /&gt;
  # to upload files to RT. You can ultimately choose any setting you&#039;re&lt;br /&gt;
  # comfortable with; 70MiB here should allow most requests without being too&lt;br /&gt;
  # open.&lt;br /&gt;
  FcgidMaxRequestLen 73400320&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
### End primary RT VirtualHost&lt;br /&gt;
&lt;br /&gt;
### Optional HTTPS Redirect VirtualHost&lt;br /&gt;
# Most modern servers support HTTPS and want all web traffic to go through it.&lt;br /&gt;
# This VirtualHost redirects normal HTTP traffic to HTTPS.&lt;br /&gt;
# You can delete this whole section if you don&#039;t want or need this.&lt;br /&gt;
&amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
  # You can change both the bind address and/or the port here as required.&lt;br /&gt;
  # This default will listen for HTTP connections on all interfaces.&lt;br /&gt;
  &amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
    SSLEngine off&lt;br /&gt;
    # EDIT HERE both lines below with the domain name of your web server.&lt;br /&gt;
    ServerName rt.yourdomain.example.com&lt;br /&gt;
    Redirect permanent / https://rt.yourdomain.example.com/&lt;br /&gt;
  &amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/IfModule&amp;gt;&lt;br /&gt;
### End optional HTTPS Redirect VirtualHost&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
After you’ve edited the file, load the configuration with:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo systemctl reload apache2&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo systemctl reload httpd&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If this command reports an error, double-check the configuration file for typos, especially in option names, file paths, and the&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;amp;lt;Section&amp;amp;gt;&amp;lt;/code&amp;gt; pairs. Edit again and reload the configuration until it succeeds without output.&lt;br /&gt;
&lt;br /&gt;
=== Verify the web interface ===&lt;br /&gt;
&lt;br /&gt;
You should be able to visit your web server in your browser, and be presented with RT’s login screen. You should be able to log in with username &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; and the password you set previously.&lt;br /&gt;
&lt;br /&gt;
If you run into trouble, the first place to look for more information is by reading Apache’s error log:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo less /var/log/apache2/error.log&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo less /var/log/httpd/error.log&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s mail server ==&lt;br /&gt;
&lt;br /&gt;
RT both can both send and receive ticket updates via email. Unfortunately, there are too many variables to document a useful setup process here: getting this working usually requires creating DNS records, and coordinating with existing mail servers, which will be the main constraint on your setup. Instead this guide provides a brief overview of how the integration works, and where the connection points are that you likely need to work on.&lt;br /&gt;
&lt;br /&gt;
=== Sending Mail ===&lt;br /&gt;
&lt;br /&gt;
RT only knows how to send mail by passing it off to another program on the system. It cannot connect or authenticate directly to external mail servers. In the default configuration, RT runs the standard &amp;lt;code&amp;gt;sendmail&amp;lt;/code&amp;gt; command. There are [https://docs.bestpractical.com/rt/latest/RT_Config.html#Outgoing-mail configuration options to send mail through different commands] if you need.&lt;br /&gt;
&lt;br /&gt;
The most common setup is to install and configure a proper Mail Transfer Agent (MTA) like Postfix or Exim, and then configure it to send mail to the wider Internet as you need. This works well because the MTAs are robust and well-tested; they have flexible configuration to let you send mail out by relaying to other mail servers you specify with optional authentication; and most distributions install one by default anyway. The only hard part is configuring the MTA to send mail following your site’s policies.&lt;br /&gt;
&lt;br /&gt;
Other software is available that provides a slimmer version of the &amp;lt;code&amp;gt;sendmail&amp;lt;/code&amp;gt; command that connects to an external mail server for you, like ssmtp. These programs are usually easier to configure than an MTA, but they often lose email permanently if they can’t connect to the external server at the time it’s sent. (MTAs keep email queued locally until they successfully deliver it to another server.)&lt;br /&gt;
&lt;br /&gt;
=== Receiving email ===&lt;br /&gt;
&lt;br /&gt;
RT installs a command called &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; that receives an email on standard input and posts it to RT’s REST web interface, where it gets saved in the database and added to a ticket. You need to arrange for a way to send incoming email to this command.&lt;br /&gt;
&lt;br /&gt;
The most common setup is to have an MTA on the same box as RT receive email directly, and then set up mail aliases that call this command when mail comes in. Example &amp;lt;code&amp;gt;/etc/aliases&amp;lt;/code&amp;gt; entries look like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rt: &amp;quot;|/opt/rt5/bin/rt-mailgate --queue general --action correspond --url https://rt.yourdomain.example.com/&amp;quot;&lt;br /&gt;
rt-comment: &amp;quot;|/opt/rt5/bin/rt-mailgate --queue general --action comment --url https://rt.yourdomain.example.com/&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
This works well because, again, you’re probably running an MTA anyway; and the MTA can hold and queue mail if it comes in while RT is down for any reason, giving you a buffer against downtime.&lt;br /&gt;
&lt;br /&gt;
Another common option is to periodically run a tool that fetches mail using a protocol like IMAP, like fetchmail or getmail, and passes it on to &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt;. This is less common because it requires setting up another tool to run, and securely storing another set of mail server credentials. But it is useful when local policy prevents the RT server from receiving email directly.&lt;br /&gt;
&lt;br /&gt;
This is much less common, but it might help to know that &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; doesn’t have to run on the same system as RT itself. It just needs to be able to connect to RT’s web interface. If you don’t have any other options, you can install the RT software on a different system that receives email, and configure &#039;&#039;that&#039;&#039; system to run &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; and pass it on to the RT server. To do that, just repeat the installation instructions above, skipping the steps about installing the database and web server.&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s background jobs ==&lt;br /&gt;
&lt;br /&gt;
Create a file &amp;lt;code&amp;gt;/etc/cron.d/rt&amp;lt;/code&amp;gt; with the following content. You may edit all of the time fields as you see fit. Refer to the crontab(5) man page for details about their definitions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Update the fulltext index with new ticket data&lt;br /&gt;
*/3 *   *   *   *   root    /opt/rt5/sbin/rt-fulltext-indexer&lt;br /&gt;
# Email out dashboards that users have subscribed to&lt;br /&gt;
0   *   *   *   *   root    /opt/rt5/sbin/rt-email-dashboards&lt;br /&gt;
# Clean old sessions from the database&lt;br /&gt;
10  3   *   *   *   root    /opt/rt5/sbin/rt-clean-sessions --older 8d&lt;br /&gt;
# Email out weekly digests for users who have requested it&lt;br /&gt;
50  4   *   *   Mon root    /opt/rt5/sbin/rt-email-digest -m weekly&lt;br /&gt;
# Email out daily digests for users who have requested it&lt;br /&gt;
50  5   *   *   *   root    /opt/rt5/sbin/rt-email-digest -m daily&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
You can run all these jobs as the same user that runs your web server, rather than root. Run:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo sed -i &#039;s/\broot\b/www-data/&#039; /etc/cron.d/rt&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo sed -i &#039;s/\broot\b/apache/&#039; /etc/cron.d/rt&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Set up RT ==&lt;br /&gt;
&lt;br /&gt;
If you’ve gotten this far, congratulations, your RT install is really done now. You can start setting up RT with users, groups, queues, and business logic. [[Main Page|Head back to the main page]] to start exploring those topics.&lt;/div&gt;</summary>
		<author><name>Brett</name></author>
	</entry>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=ManualInstallation&amp;diff=27059</id>
		<title>ManualInstallation</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=ManualInstallation&amp;diff=27059"/>
		<updated>2022-01-14T14:29:55Z</updated>

		<summary type="html">&lt;p&gt;Brett: restore lost line break&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Prev: [[ManualRequirements]] — Up: [[UserManual]] — Next: [[ManualApacheConfig]]&lt;br /&gt;
&lt;br /&gt;
This guide walks you through installing RT from source on a modern, popular Linux distro. Specifically, that means a distribution based on Debian or Red Hat that’s been released since around 2020.&lt;br /&gt;
&lt;br /&gt;
This guide assumes:&lt;br /&gt;
&lt;br /&gt;
* You can install packages generally available in Debian/Ubuntu or Red Hat/Fedora/CentOS.&lt;br /&gt;
* You want to install RT, and all of its Perl dependencies, from source to get the latest versions. (This is a trade-off. It means the boundaries of your install will be very clear, but you won’t get security updates for RT or Perl modules from your distribution.)&lt;br /&gt;
* You are willing to install a couple of extra tools to manage the RT installation similarly to how you would in other packaging systems (like PyPI, npm, etc.).&lt;br /&gt;
* You are willing to do a relatively maximal install of RT, enabling all the options during installation and then setting what you need in the configuration. (You could save a little space and time by being pickier about your options, but then that complicates the guide and makes it harder to turn those options on later if you want.)&lt;br /&gt;
* You are using a regular user account on the Linux system that can get superuser privileges with sudo.&lt;br /&gt;
&lt;br /&gt;
== Install the base dependencies ==&lt;br /&gt;
&lt;br /&gt;
These are required by RT, either to run or to install the dependencies.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install autoconf build-essential cpanminus curl libexpat-dev libgd-dev libssl-dev libz-dev gnupg graphviz lynx openssl perl&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf config-manager --set-enabled powertools&lt;br /&gt;
sudo dnf install patch tar which gcc gcc-c++ perl-core perl-App-cpanminus graphviz expat-devel gd-devel lynx openssl openssl-devel&lt;br /&gt;
sudo setenforce 0&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
(Turning off SELinux enforcement is required on Red Hat-based distributions because, as of October 2021, nobody has written a policy for RT.)&lt;br /&gt;
&lt;br /&gt;
== Install a database ==&lt;br /&gt;
&lt;br /&gt;
You need access to a database server. It can be remote, or you can install a database server alongside RT. RT supports a few different databases, but the best supported options are PostgreSQL and MariaDB.&lt;br /&gt;
&lt;br /&gt;
=== Installing and configuring the PostgreSQL server ===&lt;br /&gt;
&lt;br /&gt;
If you want to install a fresh PostgreSQL database server alongside RT:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install postgresql&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install postgresql-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In order to set up RT’s database, you will need a PostgreSQL account that can create databases and roles and be authenticated with a password. If you don’t have that, you can create it by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo createuser --createdb --createrole --login --pwprompt rt_admin&amp;lt;/pre&amp;gt;&lt;br /&gt;
Set the password when prompted. Record this; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
=== Enable password authentication in PostgreSQL ===&lt;br /&gt;
&lt;br /&gt;
You need to consider this step whether you install the database locally, or use an existing one already running. RT supports connecting to PostgreSQL a few different ways, but authenticating with a username and password is simplest, and this guide is written based on that. Not all PostgreSQL installations allow this authentication method by default. You need to review your &amp;lt;code&amp;gt;pg_hba.conf&amp;lt;/code&amp;gt; file located at:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;/etc/postgresql/VERSION/main/pg_hba.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;/var/lib/pgsql/VERSION/data/pg_hba.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Replace &amp;lt;code&amp;gt;VERSION&amp;lt;/code&amp;gt; with the version of your PostgreSQL database. Add these two lines &#039;&#039;&#039;above&#039;&#039;&#039; any other lines that start with &amp;lt;code&amp;gt;host&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;host  rt5  rt_user   all  md5&lt;br /&gt;
host  rt5  rt_admin  all  md5&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This configuration will let &amp;lt;code&amp;gt;rt_user&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;rt_admin&amp;lt;/code&amp;gt; authorize themselves for the &amp;lt;code&amp;gt;rt5&amp;lt;/code&amp;gt; database using an &amp;lt;code&amp;gt;md5&amp;lt;/code&amp;gt; crypted password over a network connection (possibly using the localhost loopback network). You might be able to further restrict some of these fields for improved security, but doing so is outside the scope of this install guide. Refer to [https://www.postgresql.org/docs/current/auth-pg-hba-conf.html the pg_hba.conf documentation] for more details.&lt;br /&gt;
&lt;br /&gt;
Save your changes and reload the database:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo systemctl reload postgresql&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Installing the PostgreSQL client libraries ===&lt;br /&gt;
&lt;br /&gt;
These are required for RT to be able to talk to any PostgreSQL server.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install libpq-dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install postgresql-devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Once this is done you can skip ahead to installing a web server.&lt;br /&gt;
&lt;br /&gt;
=== Installing and configuring the MariaDB server ===&lt;br /&gt;
&lt;br /&gt;
If you want to install a fresh MariaDB database server alongside RT:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install mariadb-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install mariadb-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In order to set up RT’s database, you will need a MySQL superuser account. To stay consistent with PostgreSQL, I suggest setting a password for it. You can do that by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo mysql&lt;br /&gt;
mysql# GRANT ALL PRIVELEGES WITH GRANT OPTION ON rt5 TO rt_admin@localhost IDENTIFIED BY &#039;YourPassphraseHere&#039;;&amp;lt;/pre&amp;gt;&lt;br /&gt;
Record your passphrase; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
=== Adjust MariaDB’s max_allowed_packet setting ===&lt;br /&gt;
&lt;br /&gt;
You need to consider this step whether you install the database locally, or use an existing one already running. [https://mariadb.com/kb/en/server-system-variables/#max_allowed_packet MariaDB’s &amp;lt;code&amp;gt;max_allowed_packet&amp;lt;/code&amp;gt; setting] functionally limits the size of attachments in RT. The default is 16MiB, which is too small for most installations. You can ultimately choose any setting you’re comfortable with; 64MiB here should allow most requests without being too open.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;echo -e &#039;[client-server]\nmax_allowed_packet=64M\n&#039; | sudo tee /etc/mysql/conf.d/max_allowed_packet.cnf&lt;br /&gt;
sudo systemctl reload mariadb&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;echo -e &#039;[client-server]\nmax_allowed_packet=64M\n&#039; | sudo tee /etc/my.cnf.d/max_allowed_packet.cnf&lt;br /&gt;
sudo systemctl reload mariadb&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Installing the MariaDB client libraries ===&lt;br /&gt;
&lt;br /&gt;
These are required for RT to be able to talk to any MariaDB server.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install libmariadb-dev libmariadb-dev-compat&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install mariadb-devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Install a web server with FastCGI ==&lt;br /&gt;
&lt;br /&gt;
FastCGI is the best way to host RT’s web interface today. Installing the web server before RT makes the installation process simpler, because RT will be able to automatically some details about your web server like what user it runs as.&lt;br /&gt;
&lt;br /&gt;
=== Installing Apache ===&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install apache2 libapache2-mod-fcgid&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install httpd mod_fcgid mod_ssl&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ### Installing nginx --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Install RT ==&lt;br /&gt;
&lt;br /&gt;
=== Get and unpack the RT source code ===&lt;br /&gt;
&lt;br /&gt;
Download the latest source code using the link on the [https://bestpractical.com/download-page RT download page], extract it using &amp;lt;code&amp;gt;tar -xf&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt; into the source code directory to run the rest of the commands in this section. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;curl -O https://download.bestpractical.com/pub/rt/release/rt-5.0.2.tar.gz&lt;br /&gt;
tar -xf rt-5.0.2.tar.gz&lt;br /&gt;
cd rt-5.0.2&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Pre-configure RT ===&lt;br /&gt;
&lt;br /&gt;
This command will detect some information about your system in order to install RT properly, and decide which set of dependencies to install. Here’s what the different parts of our command are doing:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;--with-db-type=TYPE&amp;lt;/code&amp;gt; - Replace &amp;lt;code&amp;gt;TYPE&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;Pg&amp;lt;/code&amp;gt; for PostgreSQL, or &amp;lt;code&amp;gt;mysql&amp;lt;/code&amp;gt; for MariaDB.&lt;br /&gt;
* &amp;lt;code&amp;gt;--prefix=/opt/rt5&amp;lt;/code&amp;gt; sets the directory where RT will install all of its libraries, tools, and supporting files. You can choose another path if you like.&lt;br /&gt;
* The rest of the options tell RT to install additional dependencies for optional features.&lt;br /&gt;
&lt;br /&gt;
Make sure you have &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt;ed into the RT source directory, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;./configure --with-db-type=TYPE --prefix=/opt/rt5 --with-attachment-store=disk --enable-externalauth --enable-gd --enable-graphviz --enable-gpg --enable-smime&amp;lt;/pre&amp;gt;&lt;br /&gt;
For more background, [https://docs.bestpractical.com/rt/latest/configure.html refer to the RT configure options documentation].&lt;br /&gt;
&lt;br /&gt;
=== Install RT and its Perl dependencies ===&lt;br /&gt;
&lt;br /&gt;
This command will download, build, and install all of the Perl modules necessary to run RT with the configuration you set above. Here’s what the different parts of the command are doing:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;make dirs&amp;lt;/code&amp;gt; sets up RT&#039;s directory structure. We do this first to install dependencies under it.&lt;br /&gt;
* &amp;lt;code&amp;gt;make fixdeps&amp;lt;/code&amp;gt; actually installs those dependencies.&lt;br /&gt;
* &amp;lt;code&amp;gt;RT_FIX_DEPS_CMD=&#039;cpanm …&#039;&amp;lt;/code&amp;gt; tells RT to use cpanminus to install dependencies (instead of the older, default &amp;lt;code&amp;gt;cpan&amp;lt;/code&amp;gt; command), and to install them where RT will automatically load them.&lt;br /&gt;
* &amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt; installs all of RT’s files under &amp;lt;code&amp;gt;/opt/rt5&amp;lt;/code&amp;gt; (or the prefix directory you set in the previous step). It will only run if &amp;lt;code&amp;gt;fixdeps&amp;lt;/code&amp;gt; succeeds. Setting &amp;lt;code&amp;gt;PERL5LIB&amp;lt;/code&amp;gt; tells it where you installed those dependencies.&lt;br /&gt;
&lt;br /&gt;
Make sure you have &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt;ed into the RT source directory, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo make dirs&lt;br /&gt;
sudo ln -s . /opt/rt5/local/lib/perl5&lt;br /&gt;
make fixdeps RT_FIX_DEPS_CMD=&#039;cpanm --sudo --quiet --local-lib=/opt/rt5/local&#039;&lt;br /&gt;
sudo make install PERL5LIB=/opt/rt5/local/lib&amp;lt;/pre&amp;gt;&lt;br /&gt;
If it works, the command will eventually output a message that says “Congratulations. RT is now installed.” followed by instructions about configuring and setting up the database. We’ll do that next.&lt;br /&gt;
&lt;br /&gt;
=== Configure RT ===&lt;br /&gt;
&lt;br /&gt;
[https://docs.bestpractical.com/rt/latest/RT_Config.html RT has many configuration options.] You can put configuration options in the file &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/code&amp;gt;, or in individual files under &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.d/&amp;lt;/code&amp;gt;. Use an editor to save all the text below to &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/code&amp;gt; (you can just overwrite the existing file, or add this to the bottom of what’s there) and then fill in settings for your site everywhere the text &amp;lt;code&amp;gt;EDIT WITH&amp;lt;/code&amp;gt; appears.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Single-quote all values EXCEPT the special value `undef`&lt;br /&gt;
# that turns off a setting.&lt;br /&gt;
&lt;br /&gt;
# rtname appears in ticket email subjects. It needs to be globally unique,&lt;br /&gt;
# so use your organization&#039;s domain name.&lt;br /&gt;
Set($rtname, &#039;EDIT WITH yourdomain.example.com&#039;);&lt;br /&gt;
# Organization is used in the database for ticket links, etc. It also needs to&lt;br /&gt;
# be globally unique, so use your organization&#039;s domain name.&lt;br /&gt;
Set($Organization, &#039;EDIT WITH yourdomain.example.com&#039;);&lt;br /&gt;
# WebDomain is domain name of the RT web server. RT uses it to construct links&lt;br /&gt;
# and defend against CSRFs.&lt;br /&gt;
Set($WebDomain, &#039;EDIT WITH rt.yourdomain.example.com&#039;);&lt;br /&gt;
# WebPort is the port where the RT web server runs. Edit the number below if&lt;br /&gt;
# you&#039;re not using the standard HTTPS port.&lt;br /&gt;
Set($WebPort, &#039;443&#039;);&lt;br /&gt;
&lt;br /&gt;
# DatabaseUser is the name of the database account RT uses to read and store&lt;br /&gt;
# data. &#039;rt_user&#039; is the default but you can change it if you like.&lt;br /&gt;
# DO NOT use the &#039;rt_admin&#039; superuser created in the instructions above.&lt;br /&gt;
Set($DatabaseUser, &#039;rt_user&#039;);&lt;br /&gt;
# DatabasePassword is the password for DatabaseUser.&lt;br /&gt;
Set($DatabasePassword, &#039;EDIT WITH SomePassphraseHere&#039;);&lt;br /&gt;
# DatabaseHost is the hostname of the database server RT should use.&lt;br /&gt;
# Change &#039;localhost&#039; if it lives on a different server.&lt;br /&gt;
Set($DatabaseHost, &#039;localhost&#039;);&lt;br /&gt;
# DatabasePort is the port number of the database server RT should use.&lt;br /&gt;
# `undef` means the default for that database. Change it if you&#039;re not&lt;br /&gt;
# using the standard port.&lt;br /&gt;
Set($DatabasePort, undef);&lt;br /&gt;
# DatabaseName is the name of RT&#039;s database hosted on DatabaseHost.&lt;br /&gt;
# &#039;rt5&#039; is the default but you can change it if you like.&lt;br /&gt;
Set($DatabaseName, &#039;rt5&#039;);&lt;br /&gt;
# DatabaseAdmin is the name of the user in the database used to perform&lt;br /&gt;
# major administrative tasks. Change &#039;rt_admin&#039; if you&#039;re using a user&lt;br /&gt;
# besides the one created in this guide.&lt;br /&gt;
Set($DatabaseAdmin, &#039;rt_admin&#039;);&lt;br /&gt;
&lt;br /&gt;
# RT can log to syslog, stderr, and/or a dedicated file.&lt;br /&gt;
# Log settings are used both by the primary server and by command line&lt;br /&gt;
# tools like rt-crontool, rt-ldapimport, etc.&lt;br /&gt;
# You set all of RT&#039;s $LogTo* paramaters to a standard log level: &#039;debug&#039;,&lt;br /&gt;
# &#039;info&#039;, &#039;notice&#039;, &#039;warning&#039;, &#039;error&#039;, &#039;critical&#039;, &#039;alert&#039;, or &#039;emergency&#039;.&lt;br /&gt;
# For a modern install, I recommend logging primarily to syslog, so it goes&lt;br /&gt;
# to journald where it&#039;s easy to query and automatically gets rotated.&lt;br /&gt;
Set($LogToSyslog, &#039;info&#039;);&lt;br /&gt;
&lt;br /&gt;
# When the RT server logs to stderr, that usually goes to your web server&#039;s&lt;br /&gt;
# error log. Command line tools log to their own stderr. Setting this to&lt;br /&gt;
# &#039;warning&#039; or &#039;error&#039; helps ensure you get notified if RT&#039;s cron jobs&lt;br /&gt;
# encounter problems.&lt;br /&gt;
Set($LogToSTDERR, &#039;warning&#039;);&lt;br /&gt;
&lt;br /&gt;
# Turn off optional features that require additional configuration.&lt;br /&gt;
# If you want to use these, refer to the RT_Config documentation for&lt;br /&gt;
# instructions on how to set them up.&lt;br /&gt;
Set(%GnuPG, &#039;Enable&#039; =&amp;gt; &#039;0&#039;);&lt;br /&gt;
Set(%SMIME, &#039;Enable&#039; =&amp;gt; &#039;0&#039;);&lt;br /&gt;
&lt;br /&gt;
# Perl expects to find this 1 at the end of the file.&lt;br /&gt;
1;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;RT_SiteConfig.pm&amp;lt;/code&amp;gt; is actually Perl code. RT runs the code directly to load the configuration. Any time you finish editing it, you can check that you didn’t make any syntax errors by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;perl -c /opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Set up RT’s database ===&lt;br /&gt;
&lt;br /&gt;
RT includes a tool to help you set up its database. By default, it connects to the database as an administrator to create the database and user that you configured in the previous step.&lt;br /&gt;
&lt;br /&gt;
(The instructions from &amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt; and RT’s README file tell you to run &amp;lt;code&amp;gt;make initialize-database&amp;lt;/code&amp;gt;. That just runs &amp;lt;code&amp;gt;rt-setup-database&amp;lt;/code&amp;gt; for you. Running the tool directly makes it easier to pass the options you need.)&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;--action=init&amp;lt;/code&amp;gt; tells the tool to create the user, the database, the tables inside it, and insert core data RT needs to function.&lt;br /&gt;
* &#039;&#039;&#039;If&#039;&#039;&#039; you are using an existing database server and the database adminstrator has already created the user account and database for RT, then you can add the &amp;lt;code&amp;gt;--skip-create&amp;lt;/code&amp;gt; option.&lt;br /&gt;
* &#039;&#039;&#039;If&#039;&#039;&#039; you have a less common database setup, this tool has additional options to give you finer-grained control over what steps are run and how. Refer to [https://docs.bestpractical.com/rt/latest/rt-setup-database.html the full rt-setup-database documentation] to learn more about those.&lt;br /&gt;
* The command reads files from RT’s &amp;lt;code&amp;gt;etc/&amp;lt;/code&amp;gt; directory by default, so the easiest way to run it is to &amp;lt;code&amp;gt;cd /opt/rt5&amp;lt;/code&amp;gt; first, and then it will find the necessary files automatically.&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /opt/rt5&lt;br /&gt;
sudo sbin/rt-setup-database --action=init&amp;lt;/pre&amp;gt;&lt;br /&gt;
Enter the password for your database administrator account when prompted.&lt;br /&gt;
&lt;br /&gt;
=== Set up fulltext indexing ===&lt;br /&gt;
&lt;br /&gt;
Fulltext indexing speeds up searches for ticket content, which makes RT a lot nicer to use.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;--noask&amp;lt;/code&amp;gt; uses the default names for the index, which will be fine for a new install and simplifies the setup.&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo /opt/rt5/sbin/rt-setup-fulltext-index --noask&amp;lt;/pre&amp;gt;&lt;br /&gt;
Enter the password for your database administrator account when prompted. The end of the process will output some RT configuration that looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;### EXAMPLE OUTPUT ONLY - Don&#039;t use this directly!&lt;br /&gt;
Set( %FullTextSearch,&lt;br /&gt;
    Enable     =&amp;gt; 1,&lt;br /&gt;
    Indexed    =&amp;gt; 1,&lt;br /&gt;
    # Additional output from rt-setup-fulltext-index should be here.&lt;br /&gt;
    # The configuration varies by database type.&lt;br /&gt;
);&amp;lt;/pre&amp;gt;&lt;br /&gt;
Copy the output generated when you run &amp;lt;code&amp;gt;rt-setup-fulltext-index&amp;lt;/code&amp;gt; and save it to the file &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.d/FulltextIndex.pm&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Set permissions ===&lt;br /&gt;
&lt;br /&gt;
All of RT’s configuration files should be readable by the user that runs the web server, and no other users, in order to protect sensitive information like the database password. RT provides a command to set permissions appropriately according to your distribution and configuration. &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt; to the directory where you extracted the RT source code, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd rt-5.0.2&lt;br /&gt;
sudo make fixperms&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Verify the installation ===&lt;br /&gt;
&lt;br /&gt;
If everything has gone well, then you should be able to set a password for RT’s &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; user. You’ll use this later to log in to the web interface and continue setting up your system. Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo /opt/rt5/sbin/rt-passwd root&amp;lt;/pre&amp;gt;&lt;br /&gt;
Set the password when prompted. Record this; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s web server ==&lt;br /&gt;
&lt;br /&gt;
=== Configure Apache modules ===&lt;br /&gt;
&lt;br /&gt;
You will need to have the following modules enabled in Apache to run RT. You should already have these installed if you followed the instructions above.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;alias&amp;lt;/code&amp;gt; (required to map URLs to RT)&lt;br /&gt;
* &amp;lt;code&amp;gt;fcgid&amp;lt;/code&amp;gt; (required for Apache to talk to RT)&lt;br /&gt;
* &amp;lt;code&amp;gt;mpm_prefork&amp;lt;/code&amp;gt; (Apache requires you to select an MPM. RT is designed to work with the prefork module.)&lt;br /&gt;
* &amp;lt;code&amp;gt;ssl&amp;lt;/code&amp;gt; (required to serve HTTPS; optional otherwise)&lt;br /&gt;
&lt;br /&gt;
Enable them following these instructions:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo a2dismod mpm_event&lt;br /&gt;
sudo a2enmod fcgid&lt;br /&gt;
sudo a2enmod mpm_prefork&lt;br /&gt;
sudo a2enmod ssl&amp;lt;/pre&amp;gt;&lt;br /&gt;
| &amp;lt;pre&amp;gt;echo LoadModule mpm_prefork_module modules/mod_mpm_prefork.so | sudo tee /etc/httpd/conf.modules.d/00-mpm.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Disable default VirtualHosts (optional) ===&lt;br /&gt;
&lt;br /&gt;
If this web server is dedicated to RT, then you should disable the VirtualHosts that are included with the stock configuration. Run:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo a2dissite 000-default&lt;br /&gt;
sudo a2dissite default-ssl&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo sed -i~ &#039;/^&amp;lt;VirtualHost\b/ , /^&amp;lt;\/VirtualHost\b/ d&#039; /etc/httpd/conf.d/ssl.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Configure an Apache VirtualHost ===&lt;br /&gt;
&lt;br /&gt;
Create a file at the following location. You can change the &amp;lt;code&amp;gt;RT&amp;lt;/code&amp;gt; part of the filename if you like, but the file must exist in this directory and have a &amp;lt;code&amp;gt;.conf&amp;lt;/code&amp;gt; suffix.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;/etc/apache2/sites-available/RT.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
Then after you create the file, run: &amp;lt;code&amp;gt;sudo a2ensite RT&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;/etc/httpd/conf.d/vhost_RT.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
(This filename needs to come after &amp;lt;code&amp;gt;ssl.conf&amp;lt;/code&amp;gt; in the directory listing.)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Use an editor to save all the text below to the new &amp;lt;code&amp;gt;RT.conf&amp;lt;/code&amp;gt; and then fill in settings for your site everywhere the text &amp;lt;code&amp;gt;EDIT WITH&amp;lt;/code&amp;gt; appears.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### Primary RT VirtualHost&lt;br /&gt;
# You can change both the bind address and/or the port here as required.&lt;br /&gt;
# This default will listen for HTTPS connections on all interfaces.&lt;br /&gt;
&amp;lt;VirtualHost *:443&amp;gt;&lt;br /&gt;
  # EDIT HERE with the domain name of the web server.&lt;br /&gt;
  ServerName rt.yourdomain.example.com&lt;br /&gt;
  &amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
    SSLEngine on&lt;br /&gt;
    # These specify the paths to the SSL certificate and private key Apache&lt;br /&gt;
    # should use. These example paths are common for Let&#039;s Encrypt. If you&lt;br /&gt;
    # don&#039;t use Let&#039;s Encrypt, the standard location for these files is under&lt;br /&gt;
    # (Debian/Ubuntu) /etc/ssl&lt;br /&gt;
    # (Red Hat/Fedora/CentOS) /etc/pki/tls&lt;br /&gt;
    # EDIT HERE with the appropriate paths for your server&lt;br /&gt;
    SSLCertificateFile /etc/letsencrypt/live/example.com/fullchain.pem&lt;br /&gt;
    SSLCertificateKeyFile /etc/letsencrypt/live/example.com/privkey.pem&lt;br /&gt;
  &amp;lt;/IfModule&amp;gt;&lt;br /&gt;
  &amp;lt;Location /&amp;gt;&lt;br /&gt;
    Require all granted&lt;br /&gt;
    Options +ExecCGI&lt;br /&gt;
    AddHandler fcgid-script fcgi&lt;br /&gt;
  &amp;lt;/Location&amp;gt;&lt;br /&gt;
  AddDefaultCharset UTF-8&lt;br /&gt;
  DocumentRoot /opt/rt5/share/html&lt;br /&gt;
  ScriptAlias / /opt/rt5/sbin/rt-server.fcgi/&lt;br /&gt;
  # The default mod_fcgid timeout is 40 seconds.&lt;br /&gt;
  # We increase it here to allow for large ticket searches, etc.&lt;br /&gt;
  FcgidIOTimeout 200&lt;br /&gt;
  # mod_fcgid only allows 128KiB requests by default. This is too small for users&lt;br /&gt;
  # to upload files to RT. You can ultimately choose any setting you&#039;re&lt;br /&gt;
  # comfortable with; 70MiB here should allow most requests without being too&lt;br /&gt;
  # open.&lt;br /&gt;
  FcgidMaxRequestLen 73400320&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
### End primary RT VirtualHost&lt;br /&gt;
&lt;br /&gt;
### Optional HTTPS Redirect VirtualHost&lt;br /&gt;
# Most modern servers support HTTPS and want all web traffic to go through it.&lt;br /&gt;
# This VirtualHost redirects normal HTTP traffic to HTTPS.&lt;br /&gt;
# You can delete this whole section if you don&#039;t want or need this.&lt;br /&gt;
&amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
  # You can change both the bind address and/or the port here as required.&lt;br /&gt;
  # This default will listen for HTTP connections on all interfaces.&lt;br /&gt;
  &amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
    SSLEngine off&lt;br /&gt;
    # EDIT HERE both lines below with the domain name of your web server.&lt;br /&gt;
    ServerName rt.yourdomain.example.com&lt;br /&gt;
    Redirect permanent / https://rt.yourdomain.example.com/&lt;br /&gt;
  &amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/IfModule&amp;gt;&lt;br /&gt;
### End optional HTTPS Redirect VirtualHost&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
After you’ve edited the file, load the configuration with:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo systemctl reload apache2&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo systemctl reload httpd&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If this command reports an error, double-check the configuration file for typos, especially in option names, file paths, and the&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;amp;lt;Section&amp;amp;gt;&amp;lt;/code&amp;gt; pairs. Edit again and reload the configuration until it succeeds without output.&lt;br /&gt;
&lt;br /&gt;
=== Verify the web interface ===&lt;br /&gt;
&lt;br /&gt;
You should be able to visit your web server in your browser, and be presented with RT’s login screen. You should be able to log in with username &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; and the password you set previously.&lt;br /&gt;
&lt;br /&gt;
If you run into trouble, the first place to look for more information is by reading Apache’s error log:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo less /var/log/apache2/error.log&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo less /var/log/httpd/error.log&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s mail server ==&lt;br /&gt;
&lt;br /&gt;
RT both can both send and receive ticket updates via email. Unfortunately, there are too many variables to document a useful setup process here: getting this working usually requires creating DNS records, and coordinating with existing mail servers, which will be the main constraint on your setup. Instead this guide provides a brief overview of how the integration works, and where the connection points are that you likely need to work on.&lt;br /&gt;
&lt;br /&gt;
=== Sending Mail ===&lt;br /&gt;
&lt;br /&gt;
RT only knows how to send mail by passing it off to another program on the system. It cannot connect or authenticate directly to external mail servers. In the default configuration, RT runs the standard &amp;lt;code&amp;gt;sendmail&amp;lt;/code&amp;gt; command. There are [https://docs.bestpractical.com/rt/latest/RT_Config.html#Outgoing-mail configuration options to send mail through different commands] if you need.&lt;br /&gt;
&lt;br /&gt;
The most common setup is to install and configure a proper Mail Transfer Agent (MTA) like Postfix or Exim, and then configure it to send mail to the wider Internet as you need. This works well because the MTAs are robust and well-tested; they have flexible configuration to let you send mail out by relaying to other mail servers you specify with optional authentication; and most distributions install one by default anyway. The only hard part is configuring the MTA to send mail following your site’s policies.&lt;br /&gt;
&lt;br /&gt;
Other software is available that provides a slimmer version of the &amp;lt;code&amp;gt;sendmail&amp;lt;/code&amp;gt; command that connects to an external mail server for you, like ssmtp. These programs are usually easier to configure than an MTA, but they often lose email permanently if they can’t connect to the external server at the time it’s sent. (MTAs keep email queued locally until they successfully deliver it to another server.)&lt;br /&gt;
&lt;br /&gt;
=== Receiving email ===&lt;br /&gt;
&lt;br /&gt;
RT installs a command called &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; that receives an email on standard input and posts it to RT’s REST web interface, where it gets saved in the database and added to a ticket. You need to arrange for a way to send incoming email to this command.&lt;br /&gt;
&lt;br /&gt;
The most common setup is to have an MTA on the same box as RT receive email directly, and then set up mail aliases that call this command when mail comes in. Example &amp;lt;code&amp;gt;/etc/aliases&amp;lt;/code&amp;gt; entries look like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rt: &amp;quot;|/opt/rt5/bin/rt-mailgate --queue general --action correspond --url https://rt.yourdomain.example.com/&amp;quot;&lt;br /&gt;
rt-comment: &amp;quot;|/opt/rt5/bin/rt-mailgate --queue general --action comment --url https://rt.yourdomain.example.com/&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
This works well because, again, you’re probably running an MTA anyway; and the MTA can hold and queue mail if it comes in while RT is down for any reason, giving you a buffer against downtime.&lt;br /&gt;
&lt;br /&gt;
Another common option is to periodically run a tool that fetches mail using a protocol like IMAP, like fetchmail or getmail, and passes it on to &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt;. This is less common because it requires setting up another tool to run, and securely storing another set of mail server credentials. But it is useful when local policy prevents the RT server from receiving email directly.&lt;br /&gt;
&lt;br /&gt;
This is much less common, but it might help to know that &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; doesn’t have to run on the same system as RT itself. It just needs to be able to connect to RT’s web interface. If you don’t have any other options, you can install the RT software on a different system that receives email, and configure &#039;&#039;that&#039;&#039; system to run &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; and pass it on to the RT server. To do that, just repeat the installation instructions above, skipping the steps about installing the database and web server.&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s background jobs ==&lt;br /&gt;
&lt;br /&gt;
Create a file &amp;lt;code&amp;gt;/etc/cron.d/rt&amp;lt;/code&amp;gt; with the following content. You may edit all of the time fields as you see fit. Refer to the crontab(5) man page for details about their definitions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Update the fulltext index with new ticket data&lt;br /&gt;
*/3 *   *   *   *   root    /opt/rt5/sbin/rt-fulltext-indexer&lt;br /&gt;
# Email out dashboards that users have subscribed to&lt;br /&gt;
0   *   *   *   *   root    /opt/rt5/sbin/rt-email-dashboards&lt;br /&gt;
# Clean old sessions from the database&lt;br /&gt;
10  3   *   *   *   root    /opt/rt5/sbin/rt-clean-sessions --older 8d&lt;br /&gt;
# Email out weekly digests for users who have requested it&lt;br /&gt;
50  4   *   *   Mon root    /opt/rt5/sbin/rt-email-digest -m weekly&lt;br /&gt;
# Email out daily digests for users who have requested it&lt;br /&gt;
50  5   *   *   *   root    /opt/rt5/sbin/rt-email-digest -m daily&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
You can run all these jobs as the same user that runs your web server, rather than root. Run:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo sed -i &#039;s/\broot\b/www-data/&#039; /etc/cron.d/rt&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo sed -i &#039;s/\broot\b/apache/&#039; /etc/cron.d/rt&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Set up RT ==&lt;br /&gt;
&lt;br /&gt;
If you’ve gotten this far, congratulations, your RT install is really done now. You can start setting up RT with users, groups, queues, and business logic. [[Main Page|Head back to the main page]] to start exploring those topics.&lt;/div&gt;</summary>
		<author><name>Brett</name></author>
	</entry>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=ManualInstallation&amp;diff=27058</id>
		<title>ManualInstallation</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=ManualInstallation&amp;diff=27058"/>
		<updated>2022-01-14T14:29:03Z</updated>

		<summary type="html">&lt;p&gt;Brett: wording clarification&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Prev: [[ManualRequirements]] — Up: [[UserManual]] — Next: [[ManualApacheConfig]]&lt;br /&gt;
&lt;br /&gt;
This guide walks you through installing RT from source on a modern, popular Linux distro. Specifically, that means a distribution based on Debian or Red Hat that’s been released since around 2020.&lt;br /&gt;
&lt;br /&gt;
This guide assumes:&lt;br /&gt;
&lt;br /&gt;
* You can install packages generally available in Debian/Ubuntu or Red Hat/Fedora/CentOS.&lt;br /&gt;
* You want to install RT, and all of its Perl dependencies, from source to get the latest versions. (This is a trade-off. It means the boundaries of your install will be very clear, but you won’t get security updates for RT or Perl modules from your distribution.)&lt;br /&gt;
* You are willing to install a couple of extra tools to manage the RT installation similarly to how you would in other packaging systems (like PyPI, npm, etc.).&lt;br /&gt;
* You are willing to do a relatively maximal install of RT, enabling all the options during installation and then setting what you need in the configuration. (You could save a little space and time by being pickier about your options, but then that complicates the guide and makes it harder to turn those options on later if you want.)&lt;br /&gt;
* You are using a regular user account on the Linux system that can get superuser privileges with sudo.&lt;br /&gt;
&lt;br /&gt;
== Install the base dependencies ==&lt;br /&gt;
&lt;br /&gt;
These are required by RT, either to run or to install the dependencies.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install autoconf build-essential cpanminus curl libexpat-dev libgd-dev libssl-dev libz-dev gnupg graphviz lynx openssl perl&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf config-manager --set-enabled powertools&lt;br /&gt;
sudo dnf install patch tar which gcc gcc-c++ perl-core perl-App-cpanminus graphviz expat-devel gd-devel lynx openssl openssl-devel&lt;br /&gt;
sudo setenforce 0&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
(Turning off SELinux enforcement is required on Red Hat-based distributions because, as of October 2021, nobody has written a policy for RT.)&lt;br /&gt;
&lt;br /&gt;
== Install a database ==&lt;br /&gt;
&lt;br /&gt;
You need access to a database server. It can be remote, or you can install a database server alongside RT. RT supports a few different databases, but the best supported options are PostgreSQL and MariaDB.&lt;br /&gt;
&lt;br /&gt;
=== Installing and configuring the PostgreSQL server ===&lt;br /&gt;
&lt;br /&gt;
If you want to install a fresh PostgreSQL database server alongside RT:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install postgresql&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install postgresql-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In order to set up RT’s database, you will need a PostgreSQL account that can create databases and roles and be authenticated with a password. If you don’t have that, you can create it by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo createuser --createdb --createrole --login --pwprompt rt_admin&amp;lt;/pre&amp;gt;&lt;br /&gt;
Set the password when prompted. Record this; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
=== Enable password authentication in PostgreSQL ===&lt;br /&gt;
&lt;br /&gt;
You need to consider this step whether you install the database locally, or use an existing one already running. RT supports connecting to PostgreSQL a few different ways, but authenticating with a username and password is simplest, and this guide is written based on that. Not all PostgreSQL installations allow this authentication method by default. You need to review your &amp;lt;code&amp;gt;pg_hba.conf&amp;lt;/code&amp;gt; file located at:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;/etc/postgresql/VERSION/main/pg_hba.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;/var/lib/pgsql/VERSION/data/pg_hba.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Replace &amp;lt;code&amp;gt;VERSION&amp;lt;/code&amp;gt; with the version of your PostgreSQL database. Add these two lines &#039;&#039;&#039;above&#039;&#039;&#039; any other lines that start with &amp;lt;code&amp;gt;host&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;host  rt5  rt_user   all  md5&lt;br /&gt;
host  rt5  rt_admin  all  md5&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This configuration will let &amp;lt;code&amp;gt;rt_user&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;rt_admin&amp;lt;/code&amp;gt; authorize themselves for the &amp;lt;code&amp;gt;rt5&amp;lt;/code&amp;gt; database using an &amp;lt;code&amp;gt;md5&amp;lt;/code&amp;gt; crypted password over a network connection (possibly using the localhost loopback network). You might be able to further restrict some of these fields for improved security, but doing so is outside the scope of this install guide. Refer to [https://www.postgresql.org/docs/current/auth-pg-hba-conf.html the pg_hba.conf documentation] for more details.&lt;br /&gt;
&lt;br /&gt;
Save your changes and reload the database:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo systemctl reload postgresql&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Installing the PostgreSQL client libraries ===&lt;br /&gt;
&lt;br /&gt;
These are required for RT to be able to talk to any PostgreSQL server.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install libpq-dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install postgresql-devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Once this is done you can skip ahead to installing a web server.&lt;br /&gt;
&lt;br /&gt;
=== Installing and configuring the MariaDB server ===&lt;br /&gt;
&lt;br /&gt;
If you want to install a fresh MariaDB database server alongside RT:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install mariadb-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install mariadb-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In order to set up RT’s database, you will need a MySQL superuser account. To stay consistent with PostgreSQL, I suggest setting a password for it. You can do that by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo mysql&lt;br /&gt;
mysql# GRANT ALL PRIVELEGES WITH GRANT OPTION ON rt5 TO rt_admin@localhost IDENTIFIED BY &#039;YourPassphraseHere&#039;;&amp;lt;/pre&amp;gt;&lt;br /&gt;
Record your passphrase; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
=== Adjust MariaDB’s max_allowed_packet setting ===&lt;br /&gt;
&lt;br /&gt;
You need to consider this step whether you install the database locally, or use an existing one already running. [https://mariadb.com/kb/en/server-system-variables/#max_allowed_packet MariaDB’s &amp;lt;code&amp;gt;max_allowed_packet&amp;lt;/code&amp;gt; setting] functionally limits the size of attachments in RT. The default is 16MiB, which is too small for most installations. You can ultimately choose any setting you’re comfortable with; 64MiB here should allow most requests without being too open.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;echo -e &#039;[client-server]\nmax_allowed_packet=64M\n&#039; | sudo tee /etc/mysql/conf.d/max_allowed_packet.cnf&lt;br /&gt;
sudo systemctl reload mariadb&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;echo -e &#039;[client-server]\nmax_allowed_packet=64M\n&#039; | sudo tee /etc/my.cnf.d/max_allowed_packet.cnf&lt;br /&gt;
sudo systemctl reload mariadb&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Installing the MariaDB client libraries ===&lt;br /&gt;
&lt;br /&gt;
These are required for RT to be able to talk to any MariaDB server.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install libmariadb-dev libmariadb-dev-compat&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install mariadb-devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Install a web server with FastCGI ==&lt;br /&gt;
&lt;br /&gt;
FastCGI is the best way to host RT’s web interface today. Installing the web server before RT makes the installation process simpler, because RT will be able to automatically some details about your web server like what user it runs as.&lt;br /&gt;
&lt;br /&gt;
=== Installing Apache ===&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install apache2 libapache2-mod-fcgid&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install httpd mod_fcgid mod_ssl&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ### Installing nginx --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Install RT ==&lt;br /&gt;
&lt;br /&gt;
=== Get and unpack the RT source code ===&lt;br /&gt;
&lt;br /&gt;
Download the latest source code using the link on the [https://bestpractical.com/download-page RT download page], extract it using &amp;lt;code&amp;gt;tar -xf&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt; into the source code directory to run the rest of the commands in this section. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;curl -O https://download.bestpractical.com/pub/rt/release/rt-5.0.2.tar.gz&lt;br /&gt;
tar -xf rt-5.0.2.tar.gz&lt;br /&gt;
cd rt-5.0.2&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Pre-configure RT ===&lt;br /&gt;
&lt;br /&gt;
This command will detect some information about your system in order to install RT properly, and decide which set of dependencies to install. Here’s what the different parts of our command are doing:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;--with-db-type=TYPE&amp;lt;/code&amp;gt; - Replace &amp;lt;code&amp;gt;TYPE&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;Pg&amp;lt;/code&amp;gt; for PostgreSQL, or &amp;lt;code&amp;gt;mysql&amp;lt;/code&amp;gt; for MariaDB.&lt;br /&gt;
* &amp;lt;code&amp;gt;--prefix=/opt/rt5&amp;lt;/code&amp;gt; sets the directory where RT will install all of its libraries, tools, and supporting files. You can choose another path if you like.&lt;br /&gt;
* The rest of the options tell RT to install additional dependencies for optional features.&lt;br /&gt;
&lt;br /&gt;
Make sure you have &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt;ed into the RT source directory, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;./configure --with-db-type=TYPE --prefix=/opt/rt5 --with-attachment-store=disk --enable-externalauth --enable-gd --enable-graphviz --enable-gpg --enable-smime&amp;lt;/pre&amp;gt;&lt;br /&gt;
For more background, [https://docs.bestpractical.com/rt/latest/configure.html refer to the RT configure options documentation].&lt;br /&gt;
&lt;br /&gt;
=== Install RT and its Perl dependencies ===&lt;br /&gt;
&lt;br /&gt;
This command will download, build, and install all of the Perl modules necessary to run RT with the configuration you set above. Here’s what the different parts of the command are doing:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;make dirs&amp;lt;/code&amp;gt; sets up RT&#039;s directory structure. We do this first to install dependencies under it.&lt;br /&gt;
* &amp;lt;code&amp;gt;make fixdeps&amp;lt;/code&amp;gt; actually installs those dependencies.&lt;br /&gt;
* &amp;lt;code&amp;gt;RT_FIX_DEPS_CMD=&#039;cpanm …&#039;&amp;lt;/code&amp;gt; tells RT to use cpanminus to install dependencies (instead of the older, default &amp;lt;code&amp;gt;cpan&amp;lt;/code&amp;gt; command), and to install them where RT will automatically load them.&lt;br /&gt;
* &amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt; installs all of RT’s files under &amp;lt;code&amp;gt;/opt/rt5&amp;lt;/code&amp;gt; (or the prefix directory you set in the previous step). It will only run if &amp;lt;code&amp;gt;fixdeps&amp;lt;/code&amp;gt; succeeds. Setting &amp;lt;code&amp;gt;PERL5LIB&amp;lt;/code&amp;gt; tells it where you installed those dependencies.&lt;br /&gt;
&lt;br /&gt;
Make sure you have &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt;ed into the RT source directory, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo make dirs&lt;br /&gt;
sudo ln -s . /opt/rt5/local/lib/perl5&lt;br /&gt;
make fixdeps RT_FIX_DEPS_CMD=&#039;cpanm --sudo --quiet --local-lib=/opt/rt5/local&#039;&lt;br /&gt;
sudo make install PERL5LIB=/opt/rt5/local/lib&amp;lt;/pre&amp;gt;&lt;br /&gt;
If it works, the command will eventually output a message that says “Congratulations. RT is now installed.” followed by instructions about configuring and setting up the database. We’ll do that next.&lt;br /&gt;
&lt;br /&gt;
=== Configure RT ===&lt;br /&gt;
&lt;br /&gt;
[https://docs.bestpractical.com/rt/latest/RT_Config.html RT has many configuration options.] You can put configuration options in the file &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/code&amp;gt;, or in individual files under &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.d/&amp;lt;/code&amp;gt;. Use an editor to save all the text below to &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/code&amp;gt; (you can just overwrite the existing file, or add this to the bottom of what’s there) and then fill in settings for your site everywhere the text &amp;lt;code&amp;gt;EDIT WITH&amp;lt;/code&amp;gt; appears.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Single-quote all values EXCEPT the special value `undef`&lt;br /&gt;
# that turns off a setting.&lt;br /&gt;
&lt;br /&gt;
# rtname appears in ticket email subjects. It needs to be globally unique,&lt;br /&gt;
# so use your organization&#039;s domain name.&lt;br /&gt;
Set($rtname, &#039;EDIT WITH yourdomain.example.com&#039;);&lt;br /&gt;
# Organization is used in the database for ticket links, etc. It also needs to&lt;br /&gt;
# be globally unique, so use your organization&#039;s domain name.&lt;br /&gt;
Set($Organization, &#039;EDIT WITH yourdomain.example.com&#039;);&lt;br /&gt;
# WebDomain is domain name of the RT web server. RT uses it to construct links&lt;br /&gt;
# and defend against CSRFs.&lt;br /&gt;
Set($WebDomain, &#039;EDIT WITH rt.yourdomain.example.com&#039;);&lt;br /&gt;
# WebPort is the port where the RT web server runs. Edit the number below if&lt;br /&gt;
# you&#039;re not using the standard HTTPS port.&lt;br /&gt;
Set($WebPort, &#039;443&#039;);&lt;br /&gt;
&lt;br /&gt;
# DatabaseUser is the name of the database account RT uses to read and store&lt;br /&gt;
# data. &#039;rt_user&#039; is the default but you can change it if you like.&lt;br /&gt;
# DO NOT use the &#039;rt_admin&#039; superuser created in the instructions above.&lt;br /&gt;
Set($DatabaseUser, &#039;rt_user&#039;);&lt;br /&gt;
# DatabasePassword is the password for DatabaseUser.&lt;br /&gt;
Set($DatabasePassword, &#039;EDIT WITH SomePassphraseHere&#039;);&lt;br /&gt;
# DatabaseHost is the hostname of the database server RT should use.&lt;br /&gt;
# Change &#039;localhost&#039; if it lives on a different server.&lt;br /&gt;
Set($DatabaseHost, &#039;localhost&#039;);&lt;br /&gt;
# DatabasePort is the port number of the database server RT should use.&lt;br /&gt;
# `undef` means the default for that database. Change it if you&#039;re not&lt;br /&gt;
# using the standard port.&lt;br /&gt;
Set($DatabasePort, undef);&lt;br /&gt;
# DatabaseName is the name of RT&#039;s database hosted on DatabaseHost.&lt;br /&gt;
# &#039;rt5&#039; is the default but you can change it if you like.&lt;br /&gt;
Set($DatabaseName, &#039;rt5&#039;);&lt;br /&gt;
# DatabaseAdmin is the name of the user in the database used to perform&lt;br /&gt;
# major administrative tasks. Change &#039;rt_admin&#039; if you&#039;re using a user&lt;br /&gt;
# besides the one created in this guide.&lt;br /&gt;
Set($DatabaseAdmin, &#039;rt_admin&#039;);&lt;br /&gt;
&lt;br /&gt;
# RT can log to syslog, stderr, and/or a dedicated file.&lt;br /&gt;
# Log settings are used both by the primary server and by command line&lt;br /&gt;
# tools like rt-crontool, rt-ldapimport, etc.&lt;br /&gt;
# You set all of RT&#039;s $LogTo* paramaters to a standard log level: &#039;debug&#039;,&lt;br /&gt;
# &#039;info&#039;, &#039;notice&#039;, &#039;warning&#039;, &#039;error&#039;, &#039;critical&#039;, &#039;alert&#039;, or &#039;emergency&#039;.&lt;br /&gt;
# For a modern install, I recommend logging primarily to syslog, so it goes&lt;br /&gt;
# to journald where it&#039;s easy to query and automatically gets rotated.&lt;br /&gt;
Set($LogToSyslog, &#039;info&#039;);&lt;br /&gt;
&lt;br /&gt;
# When the RT server logs to stderr, that usually goes to your web server&#039;s&lt;br /&gt;
# error log. Command line tools log to their own stderr. Setting this to&lt;br /&gt;
# &#039;warning&#039; or &#039;error&#039; helps ensure you get notified if RT&#039;s cron jobs&lt;br /&gt;
# encounter problems.&lt;br /&gt;
Set($LogToSTDERR, &#039;warning&#039;);&lt;br /&gt;
&lt;br /&gt;
# Turn off optional features that require additional configuration.&lt;br /&gt;
# If you want to use these, refer to the RT_Config documentation for&lt;br /&gt;
# instructions on how to set them up.&lt;br /&gt;
Set(%GnuPG, &#039;Enable&#039; =&amp;gt; &#039;0&#039;);&lt;br /&gt;
Set(%SMIME, &#039;Enable&#039; =&amp;gt; &#039;0&#039;);&lt;br /&gt;
&lt;br /&gt;
# Perl expects to find this 1 at the end of the file.&lt;br /&gt;
1;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;RT_SiteConfig.pm&amp;lt;/code&amp;gt; is actually Perl code. RT runs the code directly to load the configuration. Any time you finish editing it, you can check that you didn’t make any syntax errors by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;perl -c /opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Set up RT’s database ===&lt;br /&gt;
&lt;br /&gt;
RT includes a tool to help you set up its database. By default, it connects to the database as an administrator to create the database and user that you configured in the previous step.&lt;br /&gt;
&lt;br /&gt;
(The instructions from &amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt; and RT’s README file tell you to run &amp;lt;code&amp;gt;make initialize-database&amp;lt;/code&amp;gt;. That just runs &amp;lt;code&amp;gt;rt-setup-database&amp;lt;/code&amp;gt; for you. Running the tool directly makes it easier to pass the options you need.)&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;--action=init&amp;lt;/code&amp;gt; tells the tool to create the user, the database, the tables inside it, and insert core data RT needs to function.&lt;br /&gt;
* &#039;&#039;&#039;If&#039;&#039;&#039; you are using an existing database server and the database adminstrator has already created the user account and database for RT, then you can add the &amp;lt;code&amp;gt;--skip-create&amp;lt;/code&amp;gt; option.&lt;br /&gt;
* &#039;&#039;&#039;If&#039;&#039;&#039; you have a less common database setup, this tool has additional options to give you finer-grained control over what steps are run and how. Refer to [https://docs.bestpractical.com/rt/latest/rt-setup-database.html the full rt-setup-database documentation] to learn more about those.&lt;br /&gt;
* The command reads files from RT’s &amp;lt;code&amp;gt;etc/&amp;lt;/code&amp;gt; directory by default, so the easiest way to run it is to &amp;lt;code&amp;gt;cd /opt/rt5&amp;lt;/code&amp;gt; first, and then it will find the necessary files automatically.&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /opt/rt5&lt;br /&gt;
sudo sbin/rt-setup-database --action=init&amp;lt;/pre&amp;gt;&lt;br /&gt;
Enter the password for your database administrator account when prompted.&lt;br /&gt;
&lt;br /&gt;
=== Set up fulltext indexing ===&lt;br /&gt;
&lt;br /&gt;
Fulltext indexing speeds up searches for ticket content, which makes RT a lot nicer to use.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;--noask&amp;lt;/code&amp;gt; uses the default names for the index, which will be fine for a new install and simplifies the setup.&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo /opt/rt5/sbin/rt-setup-fulltext-index --noask&amp;lt;/pre&amp;gt;&lt;br /&gt;
Enter the password for your database administrator account when prompted. The end of the process will output some RT configuration that looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;### EXAMPLE OUTPUT ONLY - Don&#039;t use this directly!&lt;br /&gt;
Set( %FullTextSearch,&lt;br /&gt;
    Enable     =&amp;gt; 1,&lt;br /&gt;
    Indexed    =&amp;gt; 1,&lt;br /&gt;
    # Additional output from rt-setup-fulltext-index should be here.&lt;br /&gt;
    # The configuration varies by database type.&lt;br /&gt;
);&amp;lt;/pre&amp;gt;&lt;br /&gt;
Copy the output generated when you run &amp;lt;code&amp;gt;rt-setup-fulltext-index&amp;lt;/code&amp;gt; and save it to the file &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.d/FulltextIndex.pm&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Set permissions ===&lt;br /&gt;
&lt;br /&gt;
All of RT’s configuration files should be readable by the user that runs the web server, and no other users, in order to protect sensitive information like the database password. RT provides a command to set permissions appropriately according to your distribution and configuration. &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt; to the directory where you extracted the RT source code, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd rt-5.0.2&lt;br /&gt;
sudo make fixperms&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Verify the installation ===&lt;br /&gt;
&lt;br /&gt;
If everything has gone well, then you should be able to set a password for RT’s &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; user. You’ll use this later to log in to the web interface and continue setting up your system. Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo /opt/rt5/sbin/rt-passwd root&amp;lt;/pre&amp;gt;&lt;br /&gt;
Set the password when prompted. Record this; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s web server ==&lt;br /&gt;
&lt;br /&gt;
=== Configure Apache modules ===&lt;br /&gt;
&lt;br /&gt;
You will need to have the following modules enabled in Apache to run RT. You should already have these installed if you followed the instructions above.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;alias&amp;lt;/code&amp;gt; (required to map URLs to RT)&lt;br /&gt;
* &amp;lt;code&amp;gt;fcgid&amp;lt;/code&amp;gt; (required for Apache to talk to RT)&lt;br /&gt;
* &amp;lt;code&amp;gt;mpm_prefork&amp;lt;/code&amp;gt; (Apache requires you to select an MPM. RT is designed to work with the prefork module.)&lt;br /&gt;
* &amp;lt;code&amp;gt;ssl&amp;lt;/code&amp;gt; (required to serve HTTPS; optional otherwise)&lt;br /&gt;
&lt;br /&gt;
Enable them following these instructions:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo a2dismod mpm_event&lt;br /&gt;
sudo a2enmod fcgid&lt;br /&gt;
sudo a2enmod mpm_prefork&lt;br /&gt;
sudo a2enmod ssl&amp;lt;/pre&amp;gt;&lt;br /&gt;
| &amp;lt;pre&amp;gt;echo LoadModule mpm_prefork_module modules/mod_mpm_prefork.so | sudo tee /etc/httpd/conf.modules.d/00-mpm.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Disable default VirtualHosts (optional) ===&lt;br /&gt;
&lt;br /&gt;
If this web server is dedicated to RT, then you should disable the VirtualHosts that are included with the stock configuration. Run:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo a2dissite 000-default&lt;br /&gt;
sudo a2dissite default-ssl&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo sed -i~ &#039;/^&amp;lt;VirtualHost\b/ , /^&amp;lt;\/VirtualHost\b/ d&#039; /etc/httpd/conf.d/ssl.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Configure an Apache VirtualHost ===&lt;br /&gt;
&lt;br /&gt;
Create a file at the following location. You can change the &amp;lt;code&amp;gt;RT&amp;lt;/code&amp;gt; part of the filename if you like, but the file must exist in this directory and have a &amp;lt;code&amp;gt;.conf&amp;lt;/code&amp;gt; suffix.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;/etc/apache2/sites-available/RT.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
Then after you create the file, run: &amp;lt;code&amp;gt;sudo a2ensite RT&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;/etc/httpd/conf.d/vhost_RT.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
(This filename needs to come after &amp;lt;code&amp;gt;ssl.conf&amp;lt;/code&amp;gt; in the directory listing.)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Use an editor to save all the text below to the new &amp;lt;code&amp;gt;RT.conf&amp;lt;/code&amp;gt; and then fill in settings for your site everywhere the text &amp;lt;code&amp;gt;EDIT WITH&amp;lt;/code&amp;gt; appears.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### Primary RT VirtualHost&lt;br /&gt;
# You can change both the bind address and/or the port here as required.&lt;br /&gt;
# This default will listen for HTTPS connections on all interfaces.&lt;br /&gt;
&amp;lt;VirtualHost *:443&amp;gt;&lt;br /&gt;
  # EDIT HERE with the domain name of the web server.&lt;br /&gt;
  ServerName rt.yourdomain.example.com&lt;br /&gt;
  &amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
    SSLEngine on&lt;br /&gt;
    # These specify the paths to the SSL certificate and private key Apache&lt;br /&gt;
    # should use. These example paths are common for Let&#039;s Encrypt. If you&lt;br /&gt;
    # don&#039;t use Let&#039;s Encrypt, the standard location for these files is under&lt;br /&gt;
    # (Debian/Ubuntu) /etc/ssl&lt;br /&gt;
    # (Red Hat/Fedora/CentOS) /etc/pki/tls&lt;br /&gt;
    # EDIT HERE with the appropriate paths for your server&lt;br /&gt;
    SSLCertificateFile /etc/letsencrypt/live/example.com/fullchain.pem&lt;br /&gt;
    SSLCertificateKeyFile /etc/letsencrypt/live/example.com/privkey.pem&lt;br /&gt;
  &amp;lt;/IfModule&amp;gt;&lt;br /&gt;
  &amp;lt;Location /&amp;gt;&lt;br /&gt;
    Require all granted&lt;br /&gt;
    Options +ExecCGI&lt;br /&gt;
    AddHandler fcgid-script fcgi&lt;br /&gt;
  &amp;lt;/Location&amp;gt;&lt;br /&gt;
  AddDefaultCharset UTF-8&lt;br /&gt;
  DocumentRoot /opt/rt5/share/html&lt;br /&gt;
  ScriptAlias / /opt/rt5/sbin/rt-server.fcgi/&lt;br /&gt;
  # The default mod_fcgid timeout is 40 seconds.&lt;br /&gt;
  # We increase it here to allow for large ticket searches, etc.&lt;br /&gt;
  FcgidIOTimeout 200   # mod_fcgid only allows 128KiB requests by default. This is too small for users&lt;br /&gt;
  # to upload files to RT. You can ultimately choose any setting you&#039;re&lt;br /&gt;
  # comfortable with; 70MiB here should allow most requests without being too&lt;br /&gt;
  # open.&lt;br /&gt;
  FcgidMaxRequestLen 73400320&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
### End primary RT VirtualHost&lt;br /&gt;
&lt;br /&gt;
### Optional HTTPS Redirect VirtualHost&lt;br /&gt;
# Most modern servers support HTTPS and want all web traffic to go through it.&lt;br /&gt;
# This VirtualHost redirects normal HTTP traffic to HTTPS.&lt;br /&gt;
# You can delete this whole section if you don&#039;t want or need this.&lt;br /&gt;
&amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
  # You can change both the bind address and/or the port here as required.&lt;br /&gt;
  # This default will listen for HTTP connections on all interfaces.&lt;br /&gt;
  &amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
    SSLEngine off&lt;br /&gt;
    # EDIT HERE both lines below with the domain name of your web server.&lt;br /&gt;
    ServerName rt.yourdomain.example.com&lt;br /&gt;
    Redirect permanent / https://rt.yourdomain.example.com/&lt;br /&gt;
  &amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/IfModule&amp;gt;&lt;br /&gt;
### End optional HTTPS Redirect VirtualHost&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
After you’ve edited the file, load the configuration with:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo systemctl reload apache2&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo systemctl reload httpd&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If this command reports an error, double-check the configuration file for typos, especially in option names, file paths, and the&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;amp;lt;Section&amp;amp;gt;&amp;lt;/code&amp;gt; pairs. Edit again and reload the configuration until it succeeds without output.&lt;br /&gt;
&lt;br /&gt;
=== Verify the web interface ===&lt;br /&gt;
&lt;br /&gt;
You should be able to visit your web server in your browser, and be presented with RT’s login screen. You should be able to log in with username &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; and the password you set previously.&lt;br /&gt;
&lt;br /&gt;
If you run into trouble, the first place to look for more information is by reading Apache’s error log:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo less /var/log/apache2/error.log&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo less /var/log/httpd/error.log&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s mail server ==&lt;br /&gt;
&lt;br /&gt;
RT both can both send and receive ticket updates via email. Unfortunately, there are too many variables to document a useful setup process here: getting this working usually requires creating DNS records, and coordinating with existing mail servers, which will be the main constraint on your setup. Instead this guide provides a brief overview of how the integration works, and where the connection points are that you likely need to work on.&lt;br /&gt;
&lt;br /&gt;
=== Sending Mail ===&lt;br /&gt;
&lt;br /&gt;
RT only knows how to send mail by passing it off to another program on the system. It cannot connect or authenticate directly to external mail servers. In the default configuration, RT runs the standard &amp;lt;code&amp;gt;sendmail&amp;lt;/code&amp;gt; command. There are [https://docs.bestpractical.com/rt/latest/RT_Config.html#Outgoing-mail configuration options to send mail through different commands] if you need.&lt;br /&gt;
&lt;br /&gt;
The most common setup is to install and configure a proper Mail Transfer Agent (MTA) like Postfix or Exim, and then configure it to send mail to the wider Internet as you need. This works well because the MTAs are robust and well-tested; they have flexible configuration to let you send mail out by relaying to other mail servers you specify with optional authentication; and most distributions install one by default anyway. The only hard part is configuring the MTA to send mail following your site’s policies.&lt;br /&gt;
&lt;br /&gt;
Other software is available that provides a slimmer version of the &amp;lt;code&amp;gt;sendmail&amp;lt;/code&amp;gt; command that connects to an external mail server for you, like ssmtp. These programs are usually easier to configure than an MTA, but they often lose email permanently if they can’t connect to the external server at the time it’s sent. (MTAs keep email queued locally until they successfully deliver it to another server.)&lt;br /&gt;
&lt;br /&gt;
=== Receiving email ===&lt;br /&gt;
&lt;br /&gt;
RT installs a command called &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; that receives an email on standard input and posts it to RT’s REST web interface, where it gets saved in the database and added to a ticket. You need to arrange for a way to send incoming email to this command.&lt;br /&gt;
&lt;br /&gt;
The most common setup is to have an MTA on the same box as RT receive email directly, and then set up mail aliases that call this command when mail comes in. Example &amp;lt;code&amp;gt;/etc/aliases&amp;lt;/code&amp;gt; entries look like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rt: &amp;quot;|/opt/rt5/bin/rt-mailgate --queue general --action correspond --url https://rt.yourdomain.example.com/&amp;quot;&lt;br /&gt;
rt-comment: &amp;quot;|/opt/rt5/bin/rt-mailgate --queue general --action comment --url https://rt.yourdomain.example.com/&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
This works well because, again, you’re probably running an MTA anyway; and the MTA can hold and queue mail if it comes in while RT is down for any reason, giving you a buffer against downtime.&lt;br /&gt;
&lt;br /&gt;
Another common option is to periodically run a tool that fetches mail using a protocol like IMAP, like fetchmail or getmail, and passes it on to &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt;. This is less common because it requires setting up another tool to run, and securely storing another set of mail server credentials. But it is useful when local policy prevents the RT server from receiving email directly.&lt;br /&gt;
&lt;br /&gt;
This is much less common, but it might help to know that &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; doesn’t have to run on the same system as RT itself. It just needs to be able to connect to RT’s web interface. If you don’t have any other options, you can install the RT software on a different system that receives email, and configure &#039;&#039;that&#039;&#039; system to run &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; and pass it on to the RT server. To do that, just repeat the installation instructions above, skipping the steps about installing the database and web server.&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s background jobs ==&lt;br /&gt;
&lt;br /&gt;
Create a file &amp;lt;code&amp;gt;/etc/cron.d/rt&amp;lt;/code&amp;gt; with the following content. You may edit all of the time fields as you see fit. Refer to the crontab(5) man page for details about their definitions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Update the fulltext index with new ticket data&lt;br /&gt;
*/3 *   *   *   *   root    /opt/rt5/sbin/rt-fulltext-indexer&lt;br /&gt;
# Email out dashboards that users have subscribed to&lt;br /&gt;
0   *   *   *   *   root    /opt/rt5/sbin/rt-email-dashboards&lt;br /&gt;
# Clean old sessions from the database&lt;br /&gt;
10  3   *   *   *   root    /opt/rt5/sbin/rt-clean-sessions --older 8d&lt;br /&gt;
# Email out weekly digests for users who have requested it&lt;br /&gt;
50  4   *   *   Mon root    /opt/rt5/sbin/rt-email-digest -m weekly&lt;br /&gt;
# Email out daily digests for users who have requested it&lt;br /&gt;
50  5   *   *   *   root    /opt/rt5/sbin/rt-email-digest -m daily&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
You can run all these jobs as the same user that runs your web server, rather than root. Run:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo sed -i &#039;s/\broot\b/www-data/&#039; /etc/cron.d/rt&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo sed -i &#039;s/\broot\b/apache/&#039; /etc/cron.d/rt&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Set up RT ==&lt;br /&gt;
&lt;br /&gt;
If you’ve gotten this far, congratulations, your RT install is really done now. You can start setting up RT with users, groups, queues, and business logic. [[Main Page|Head back to the main page]] to start exploring those topics.&lt;/div&gt;</summary>
		<author><name>Brett</name></author>
	</entry>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=ManualInstallation&amp;diff=27057</id>
		<title>ManualInstallation</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=ManualInstallation&amp;diff=27057"/>
		<updated>2022-01-14T14:28:03Z</updated>

		<summary type="html">&lt;p&gt;Brett: improve Red Hat VirtualHost filename&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Prev: [[ManualRequirements]] — Up: [[UserManual]] — Next: [[ManualApacheConfig]]&lt;br /&gt;
&lt;br /&gt;
This guide walks you through installing RT from source on a modern, popular Linux distro. Specifically, that means a distribution based on Debian or Red Hat that’s been released since around 2020.&lt;br /&gt;
&lt;br /&gt;
This guide assumes:&lt;br /&gt;
&lt;br /&gt;
* You can install packages generally available in Debian/Ubuntu or Red Hat/Fedora/CentOS.&lt;br /&gt;
* You want to install RT, and all of its Perl dependencies, from source to get the latest versions. (This is a trade-off. It means the boundaries of your install will be very clear, but you won’t get security updates for RT or Perl modules from your distribution.)&lt;br /&gt;
* You are willing to install a couple of extra tools to manage the RT installation similarly to how you would in other packaging systems (like PyPI, npm, etc.).&lt;br /&gt;
* You are willing to do a relatively maximal install of RT, enabling all the options during installation and then setting what you need in the configuration. (You could save a little space and time by being pickier about your options, but then that complicates the guide and makes it harder to turn those options on later if you want.)&lt;br /&gt;
* You are using a regular user account on the Linux system that can get superuser privileges with sudo.&lt;br /&gt;
&lt;br /&gt;
== Install the base dependencies ==&lt;br /&gt;
&lt;br /&gt;
These are required by RT, either to run or to install the dependencies.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install autoconf build-essential cpanminus curl libexpat-dev libgd-dev libssl-dev libz-dev gnupg graphviz lynx openssl perl&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf config-manager --set-enabled powertools&lt;br /&gt;
sudo dnf install patch tar which gcc gcc-c++ perl-core perl-App-cpanminus graphviz expat-devel gd-devel lynx openssl openssl-devel&lt;br /&gt;
sudo setenforce 0&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
(Turning off SELinux enforcement is required on Red Hat-based distributions because, as of October 2021, nobody has written a policy for RT.)&lt;br /&gt;
&lt;br /&gt;
== Install a database ==&lt;br /&gt;
&lt;br /&gt;
You need access to a database server. It can be remote, or you can install a database server alongside RT. RT supports a few different databases, but the best supported options are PostgreSQL and MariaDB.&lt;br /&gt;
&lt;br /&gt;
=== Installing and configuring the PostgreSQL server ===&lt;br /&gt;
&lt;br /&gt;
If you want to install a fresh PostgreSQL database server alongside RT:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install postgresql&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install postgresql-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In order to set up RT’s database, you will need a PostgreSQL account that can create databases and roles and be authenticated with a password. If you don’t have that, you can create it by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo createuser --createdb --createrole --login --pwprompt rt_admin&amp;lt;/pre&amp;gt;&lt;br /&gt;
Set the password when prompted. Record this; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
=== Enable password authentication in PostgreSQL ===&lt;br /&gt;
&lt;br /&gt;
You need to consider this step whether you install the database locally, or use an existing one already running. RT supports connecting to PostgreSQL a few different ways, but authenticating with a username and password is simplest, and this guide is written based on that. Not all PostgreSQL installations allow this authentication method by default. You need to review your &amp;lt;code&amp;gt;pg_hba.conf&amp;lt;/code&amp;gt; file located at:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;/etc/postgresql/VERSION/main/pg_hba.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;/var/lib/pgsql/VERSION/data/pg_hba.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Replace &amp;lt;code&amp;gt;VERSION&amp;lt;/code&amp;gt; with the version of your PostgreSQL database. Add these two lines &#039;&#039;&#039;above&#039;&#039;&#039; any other lines that start with &amp;lt;code&amp;gt;host&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;host  rt5  rt_user   all  md5&lt;br /&gt;
host  rt5  rt_admin  all  md5&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This configuration will let &amp;lt;code&amp;gt;rt_user&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;rt_admin&amp;lt;/code&amp;gt; authorize themselves for the &amp;lt;code&amp;gt;rt5&amp;lt;/code&amp;gt; database using an &amp;lt;code&amp;gt;md5&amp;lt;/code&amp;gt; crypted password over a network connection (possibly using the localhost loopback network). You might be able to further restrict some of these fields for improved security, but doing so is outside the scope of this install guide. Refer to [https://www.postgresql.org/docs/current/auth-pg-hba-conf.html the pg_hba.conf documentation] for more details.&lt;br /&gt;
&lt;br /&gt;
Save your changes and reload the database:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo systemctl reload postgresql&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Installing the PostgreSQL client libraries ===&lt;br /&gt;
&lt;br /&gt;
These are required for RT to be able to talk to any PostgreSQL server.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install libpq-dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install postgresql-devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Once this is done you can skip ahead to installing a web server.&lt;br /&gt;
&lt;br /&gt;
=== Installing and configuring the MariaDB server ===&lt;br /&gt;
&lt;br /&gt;
If you want to install a fresh MariaDB database server alongside RT:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install mariadb-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install mariadb-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In order to set up RT’s database, you will need a MySQL superuser account. To stay consistent with PostgreSQL, I suggest setting a password for it. You can do that by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo mysql&lt;br /&gt;
mysql# GRANT ALL PRIVELEGES WITH GRANT OPTION ON rt5 TO rt_admin@localhost IDENTIFIED BY &#039;YourPassphraseHere&#039;;&amp;lt;/pre&amp;gt;&lt;br /&gt;
Record your passphrase; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
=== Adjust MariaDB’s max_allowed_packet setting ===&lt;br /&gt;
&lt;br /&gt;
You need to consider this step whether you install the database locally, or use an existing one already running. [https://mariadb.com/kb/en/server-system-variables/#max_allowed_packet MariaDB’s &amp;lt;code&amp;gt;max_allowed_packet&amp;lt;/code&amp;gt; setting] functionally limits the size of attachments in RT. The default is 16MiB, which is too small for most installations. You can ultimately choose any setting you’re comfortable with; 64MiB here should allow most requests without being too open.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;echo -e &#039;[client-server]\nmax_allowed_packet=64M\n&#039; | sudo tee /etc/mysql/conf.d/max_allowed_packet.cnf&lt;br /&gt;
sudo systemctl reload mariadb&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;echo -e &#039;[client-server]\nmax_allowed_packet=64M\n&#039; | sudo tee /etc/my.cnf.d/max_allowed_packet.cnf&lt;br /&gt;
sudo systemctl reload mariadb&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Installing the MariaDB client libraries ===&lt;br /&gt;
&lt;br /&gt;
These are required for RT to be able to talk to any MariaDB server.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install libmariadb-dev libmariadb-dev-compat&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install mariadb-devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Install a web server with FastCGI ==&lt;br /&gt;
&lt;br /&gt;
FastCGI is the best way to host RT’s web interface today. Installing the web server before RT makes the installation process simpler, because RT will be able to automatically some details about your web server like what user it runs as.&lt;br /&gt;
&lt;br /&gt;
=== Installing Apache ===&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install apache2 libapache2-mod-fcgid&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install httpd mod_fcgid mod_ssl&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ### Installing nginx --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Install RT ==&lt;br /&gt;
&lt;br /&gt;
=== Get and unpack the RT source code ===&lt;br /&gt;
&lt;br /&gt;
Download the latest source code using the link on the [https://bestpractical.com/download-page RT download page], extract it using &amp;lt;code&amp;gt;tar -xf&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt; into the source code directory to run the rest of the commands in this section. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;curl -O https://download.bestpractical.com/pub/rt/release/rt-5.0.2.tar.gz&lt;br /&gt;
tar -xf rt-5.0.2.tar.gz&lt;br /&gt;
cd rt-5.0.2&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Pre-configure RT ===&lt;br /&gt;
&lt;br /&gt;
This command will detect some information about your system in order to install RT properly, and decide which set of dependencies to install. Here’s what the different parts of our command are doing:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;--with-db-type=TYPE&amp;lt;/code&amp;gt; - Replace &amp;lt;code&amp;gt;TYPE&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;Pg&amp;lt;/code&amp;gt; for PostgreSQL, or &amp;lt;code&amp;gt;mysql&amp;lt;/code&amp;gt; for MariaDB.&lt;br /&gt;
* &amp;lt;code&amp;gt;--prefix=/opt/rt5&amp;lt;/code&amp;gt; sets the directory where RT will install all of its libraries, tools, and supporting files. You can choose another path if you like.&lt;br /&gt;
* The rest of the options tell RT to install additional dependencies for optional features.&lt;br /&gt;
&lt;br /&gt;
Make sure you have &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt;ed into the RT source directory, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;./configure --with-db-type=TYPE --prefix=/opt/rt5 --with-attachment-store=disk --enable-externalauth --enable-gd --enable-graphviz --enable-gpg --enable-smime&amp;lt;/pre&amp;gt;&lt;br /&gt;
For more background, [https://docs.bestpractical.com/rt/latest/configure.html refer to the RT configure options documentation].&lt;br /&gt;
&lt;br /&gt;
=== Install RT and its Perl dependencies ===&lt;br /&gt;
&lt;br /&gt;
This command will download, build, and install all of the Perl modules necessary to run RT with the configuration you set above. Here’s what the different parts of the command are doing:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;make dirs&amp;lt;/code&amp;gt; sets up RT&#039;s directory structure. We do this first to install dependencies under it.&lt;br /&gt;
* &amp;lt;code&amp;gt;make fixdeps&amp;lt;/code&amp;gt; actually installs those dependencies.&lt;br /&gt;
* &amp;lt;code&amp;gt;RT_FIX_DEPS_CMD=&#039;cpanm …&#039;&amp;lt;/code&amp;gt; tells RT to use cpanminus to install dependencies (instead of the older, default &amp;lt;code&amp;gt;cpan&amp;lt;/code&amp;gt; command), and to install them where RT will automatically load them.&lt;br /&gt;
* &amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt; installs all of RT’s files under &amp;lt;code&amp;gt;/opt/rt5&amp;lt;/code&amp;gt; (or the prefix directory you set in the previous step). It will only run if &amp;lt;code&amp;gt;fixdeps&amp;lt;/code&amp;gt; succeeds. Setting &amp;lt;code&amp;gt;PERL5LIB&amp;lt;/code&amp;gt; tells it where you installed those dependencies.&lt;br /&gt;
&lt;br /&gt;
Make sure you have &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt;ed into the RT source directory, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo make dirs&lt;br /&gt;
sudo ln -s . /opt/rt5/local/lib/perl5&lt;br /&gt;
make fixdeps RT_FIX_DEPS_CMD=&#039;cpanm --sudo --quiet --local-lib=/opt/rt5/local&#039;&lt;br /&gt;
sudo make install PERL5LIB=/opt/rt5/local/lib&amp;lt;/pre&amp;gt;&lt;br /&gt;
If it works, the command will eventually output a message that says “Congratulations. RT is now installed.” followed by instructions about configuring and setting up the database. We’ll do that next.&lt;br /&gt;
&lt;br /&gt;
=== Configure RT ===&lt;br /&gt;
&lt;br /&gt;
[https://docs.bestpractical.com/rt/latest/RT_Config.html RT has many configuration options.] You can put configuration options in the file &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/code&amp;gt;, or in individual files under &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.d/&amp;lt;/code&amp;gt;. Use an editor to save all the text below to &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/code&amp;gt; (you can just overwrite the existing file, or add this to the bottom of what’s there) and then fill in settings for your site everywhere the text &amp;lt;code&amp;gt;EDIT WITH&amp;lt;/code&amp;gt; appears.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Single-quote all values EXCEPT the special value `undef`&lt;br /&gt;
# that turns off a setting.&lt;br /&gt;
&lt;br /&gt;
# rtname appears in ticket email subjects. It needs to be globally unique,&lt;br /&gt;
# so use your organization&#039;s domain name.&lt;br /&gt;
Set($rtname, &#039;EDIT WITH yourdomain.example.com&#039;);&lt;br /&gt;
# Organization is used in the database for ticket links, etc. It also needs to&lt;br /&gt;
# be globally unique, so use your organization&#039;s domain name.&lt;br /&gt;
Set($Organization, &#039;EDIT WITH yourdomain.example.com&#039;);&lt;br /&gt;
# WebDomain is domain name of the RT web server. RT uses it to construct links&lt;br /&gt;
# and defend against CSRFs.&lt;br /&gt;
Set($WebDomain, &#039;EDIT WITH rt.yourdomain.example.com&#039;);&lt;br /&gt;
# WebPort is the port where the RT web server runs. Edit the number below if&lt;br /&gt;
# you&#039;re not using the standard HTTPS port.&lt;br /&gt;
Set($WebPort, &#039;443&#039;);&lt;br /&gt;
&lt;br /&gt;
# DatabaseUser is the name of the database account RT uses to read and store&lt;br /&gt;
# data. &#039;rt_user&#039; is the default but you can change it if you like.&lt;br /&gt;
# DO NOT use the &#039;rt_admin&#039; superuser created in the instructions above.&lt;br /&gt;
Set($DatabaseUser, &#039;rt_user&#039;);&lt;br /&gt;
# DatabasePassword is the password for DatabaseUser.&lt;br /&gt;
Set($DatabasePassword, &#039;EDIT WITH SomePassphraseHere&#039;);&lt;br /&gt;
# DatabaseHost is the hostname of the database server RT should use.&lt;br /&gt;
# Change &#039;localhost&#039; if it lives on a different server.&lt;br /&gt;
Set($DatabaseHost, &#039;localhost&#039;);&lt;br /&gt;
# DatabasePort is the port number of the database server RT should use.&lt;br /&gt;
# `undef` means the default for that database. Change it if you&#039;re not&lt;br /&gt;
# using the standard port.&lt;br /&gt;
Set($DatabasePort, undef);&lt;br /&gt;
# DatabaseName is the name of RT&#039;s database hosted on DatabaseHost.&lt;br /&gt;
# &#039;rt5&#039; is the default but you can change it if you like.&lt;br /&gt;
Set($DatabaseName, &#039;rt5&#039;);&lt;br /&gt;
# DatabaseAdmin is the name of the user in the database used to perform&lt;br /&gt;
# major administrative tasks. Change &#039;rt_admin&#039; if you&#039;re using a user&lt;br /&gt;
# besides the one created in this guide.&lt;br /&gt;
Set($DatabaseAdmin, &#039;rt_admin&#039;);&lt;br /&gt;
&lt;br /&gt;
# RT can log to syslog, stderr, and/or a dedicated file.&lt;br /&gt;
# Log settings are used both by the primary server and by command line&lt;br /&gt;
# tools like rt-crontool, rt-ldapimport, etc.&lt;br /&gt;
# You set all of RT&#039;s $LogTo* paramaters to a standard log level: &#039;debug&#039;,&lt;br /&gt;
# &#039;info&#039;, &#039;notice&#039;, &#039;warning&#039;, &#039;error&#039;, &#039;critical&#039;, &#039;alert&#039;, or &#039;emergency&#039;.&lt;br /&gt;
# For a modern install, I recommend logging primarily to syslog, so it goes&lt;br /&gt;
# to journald where it&#039;s easy to query and automatically gets rotated.&lt;br /&gt;
Set($LogToSyslog, &#039;info&#039;);&lt;br /&gt;
&lt;br /&gt;
# When the RT server logs to stderr, that usually goes to your web server&#039;s&lt;br /&gt;
# error log. Command line tools log to their own stderr. Setting this to&lt;br /&gt;
# &#039;warning&#039; or &#039;error&#039; helps ensure you get notified if RT&#039;s cron jobs&lt;br /&gt;
# encounter problems.&lt;br /&gt;
Set($LogToSTDERR, &#039;warning&#039;);&lt;br /&gt;
&lt;br /&gt;
# Turn off optional features that require additional configuration.&lt;br /&gt;
# If you want to use these, refer to the RT_Config documentation for&lt;br /&gt;
# instructions on how to set them up.&lt;br /&gt;
Set(%GnuPG, &#039;Enable&#039; =&amp;gt; &#039;0&#039;);&lt;br /&gt;
Set(%SMIME, &#039;Enable&#039; =&amp;gt; &#039;0&#039;);&lt;br /&gt;
&lt;br /&gt;
# Perl expects to find this 1 at the end of the file.&lt;br /&gt;
1;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;RT_SiteConfig.pm&amp;lt;/code&amp;gt; is actually Perl code. RT runs the code directly to load the configuration. Any time you finish editing it, you can check that you didn’t make any syntax errors by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;perl -c /opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Set up RT’s database ===&lt;br /&gt;
&lt;br /&gt;
RT includes a tool to help you set up its database. By default, it connects to the database as an administrator to create the database and user that you configured in the previous step.&lt;br /&gt;
&lt;br /&gt;
(The instructions from &amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt; and RT’s README file tell you to run &amp;lt;code&amp;gt;make initialize-database&amp;lt;/code&amp;gt;. That just runs &amp;lt;code&amp;gt;rt-setup-database&amp;lt;/code&amp;gt; for you. Running the tool directly makes it easier to pass the options you need.)&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;--action=init&amp;lt;/code&amp;gt; tells the tool to create the user, the database, the tables inside it, and insert core data RT needs to function.&lt;br /&gt;
* &#039;&#039;&#039;If&#039;&#039;&#039; you are using an existing database server and the database adminstrator has already created the user account and database for RT, then you can add the &amp;lt;code&amp;gt;--skip-create&amp;lt;/code&amp;gt; option.&lt;br /&gt;
* &#039;&#039;&#039;If&#039;&#039;&#039; you have a less common database setup, this tool has additional options to give you finer-grained control over what steps are run and how. Refer to [https://docs.bestpractical.com/rt/latest/rt-setup-database.html the full rt-setup-database documentation] to learn more about those.&lt;br /&gt;
* The command reads files from RT’s &amp;lt;code&amp;gt;etc/&amp;lt;/code&amp;gt; directory by default, so the easiest way to run it is to &amp;lt;code&amp;gt;cd /opt/rt5&amp;lt;/code&amp;gt; first, and then it will find the necessary files automatically.&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /opt/rt5&lt;br /&gt;
sudo sbin/rt-setup-database --action=init&amp;lt;/pre&amp;gt;&lt;br /&gt;
Enter the password for your database administrator account when prompted.&lt;br /&gt;
&lt;br /&gt;
=== Set up fulltext indexing ===&lt;br /&gt;
&lt;br /&gt;
Fulltext indexing speeds up searches for ticket content, which makes RT a lot nicer to use.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;--noask&amp;lt;/code&amp;gt; uses the default names for the index, which will be fine for a new install and simplifies the setup.&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo /opt/rt5/sbin/rt-setup-fulltext-index --noask&amp;lt;/pre&amp;gt;&lt;br /&gt;
Enter the password for your database administrator account when prompted. The end of the process will output some RT configuration that looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;### EXAMPLE OUTPUT ONLY - Don&#039;t use this directly!&lt;br /&gt;
Set( %FullTextSearch,&lt;br /&gt;
    Enable     =&amp;gt; 1,&lt;br /&gt;
    Indexed    =&amp;gt; 1,&lt;br /&gt;
    # Additional output from rt-setup-fulltext-index should be here.&lt;br /&gt;
    # The configuration varies by database type.&lt;br /&gt;
);&amp;lt;/pre&amp;gt;&lt;br /&gt;
Copy the output generated when you run &amp;lt;code&amp;gt;rt-setup-fulltext-index&amp;lt;/code&amp;gt; and save it to the file &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.d/FulltextIndex.pm&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Set permissions ===&lt;br /&gt;
&lt;br /&gt;
All of RT’s configuration files should be readable by the user that runs the web server, and no other users, in order to protect sensitive information like the database password. RT provides a command to set permissions appropriately according to your distribution and configuration. &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt; to the directory where you extracted the RT source code, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd rt-5.0.2&lt;br /&gt;
sudo make fixperms&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Verify the installation ===&lt;br /&gt;
&lt;br /&gt;
If everything has gone well, then you should be able to set a password for RT’s &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; user. You’ll use this later to log in to the web interface and continue setting up your system. Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo /opt/rt5/sbin/rt-passwd root&amp;lt;/pre&amp;gt;&lt;br /&gt;
Set the password when prompted. Record this; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s web server ==&lt;br /&gt;
&lt;br /&gt;
=== Configure Apache modules ===&lt;br /&gt;
&lt;br /&gt;
You will need to have the following modules enabled in Apache to run RT. You should already have these installed if you followed the instructions above.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;alias&amp;lt;/code&amp;gt; (required to map URLs to RT)&lt;br /&gt;
* &amp;lt;code&amp;gt;fcgid&amp;lt;/code&amp;gt; (required for Apache to talk to RT)&lt;br /&gt;
* &amp;lt;code&amp;gt;mpm_prefork&amp;lt;/code&amp;gt; (Apache requires you to select an MPM. RT is designed to work with the prefork module.)&lt;br /&gt;
* &amp;lt;code&amp;gt;ssl&amp;lt;/code&amp;gt; (required to serve HTTPS; optional otherwise)&lt;br /&gt;
&lt;br /&gt;
Enable them following these instructions:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo a2dismod mpm_event&lt;br /&gt;
sudo a2enmod fcgid&lt;br /&gt;
sudo a2enmod mpm_prefork&lt;br /&gt;
sudo a2enmod ssl&amp;lt;/pre&amp;gt;&lt;br /&gt;
| &amp;lt;pre&amp;gt;echo LoadModule mpm_prefork_module modules/mod_mpm_prefork.so | sudo tee /etc/httpd/conf.modules.d/00-mpm.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Disable default VirtualHosts (optional) ===&lt;br /&gt;
&lt;br /&gt;
If this web server is dedicated to RT, then you should disable the VirtualHosts that are included with the stock configuration. Run:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo a2dissite 000-default&lt;br /&gt;
sudo a2dissite default-ssl&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo sed -i~ &#039;/^&amp;lt;VirtualHost\b/ , /^&amp;lt;\/VirtualHost\b/ d&#039; /etc/httpd/conf.d/ssl.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Configure an Apache VirtualHost ===&lt;br /&gt;
&lt;br /&gt;
Create a file at the following location. You can change the &amp;lt;code&amp;gt;RT&amp;lt;/code&amp;gt; part of the filename if you like, but the file must exist in this directory and have a &amp;lt;code&amp;gt;.conf&amp;lt;/code&amp;gt; suffix.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;/etc/apache2/sites-available/RT.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
Then after you create the file, run: &amp;lt;code&amp;gt;sudo a2ensite RT&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;/etc/httpd/conf.d/vhost_RT.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
(This filename needs to come after &amp;lt;code&amp;gt;ssl.conf&amp;lt;/code&amp;gt; in the listing.)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Use an editor to save all the text below to the new &amp;lt;code&amp;gt;RT.conf&amp;lt;/code&amp;gt; and then fill in settings for your site everywhere the text &amp;lt;code&amp;gt;EDIT WITH&amp;lt;/code&amp;gt; appears.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### Primary RT VirtualHost&lt;br /&gt;
# You can change both the bind address and/or the port here as required.&lt;br /&gt;
# This default will listen for HTTPS connections on all interfaces.&lt;br /&gt;
&amp;lt;VirtualHost *:443&amp;gt;&lt;br /&gt;
  # EDIT HERE with the domain name of the web server.&lt;br /&gt;
  ServerName rt.yourdomain.example.com&lt;br /&gt;
  &amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
    SSLEngine on&lt;br /&gt;
    # These specify the paths to the SSL certificate and private key Apache&lt;br /&gt;
    # should use. These example paths are common for Let&#039;s Encrypt. If you&lt;br /&gt;
    # don&#039;t use Let&#039;s Encrypt, the standard location for these files is under&lt;br /&gt;
    # (Debian/Ubuntu) /etc/ssl&lt;br /&gt;
    # (Red Hat/Fedora/CentOS) /etc/pki/tls&lt;br /&gt;
    # EDIT HERE with the appropriate paths for your server&lt;br /&gt;
    SSLCertificateFile /etc/letsencrypt/live/example.com/fullchain.pem&lt;br /&gt;
    SSLCertificateKeyFile /etc/letsencrypt/live/example.com/privkey.pem&lt;br /&gt;
  &amp;lt;/IfModule&amp;gt;&lt;br /&gt;
  &amp;lt;Location /&amp;gt;&lt;br /&gt;
    Require all granted&lt;br /&gt;
    Options +ExecCGI&lt;br /&gt;
    AddHandler fcgid-script fcgi&lt;br /&gt;
  &amp;lt;/Location&amp;gt;&lt;br /&gt;
  AddDefaultCharset UTF-8&lt;br /&gt;
  DocumentRoot /opt/rt5/share/html&lt;br /&gt;
  ScriptAlias / /opt/rt5/sbin/rt-server.fcgi/&lt;br /&gt;
  # The default mod_fcgid timeout is 40 seconds.&lt;br /&gt;
  # We increase it here to allow for large ticket searches, etc.&lt;br /&gt;
  FcgidIOTimeout 200   # mod_fcgid only allows 128KiB requests by default. This is too small for users&lt;br /&gt;
  # to upload files to RT. You can ultimately choose any setting you&#039;re&lt;br /&gt;
  # comfortable with; 70MiB here should allow most requests without being too&lt;br /&gt;
  # open.&lt;br /&gt;
  FcgidMaxRequestLen 73400320&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
### End primary RT VirtualHost&lt;br /&gt;
&lt;br /&gt;
### Optional HTTPS Redirect VirtualHost&lt;br /&gt;
# Most modern servers support HTTPS and want all web traffic to go through it.&lt;br /&gt;
# This VirtualHost redirects normal HTTP traffic to HTTPS.&lt;br /&gt;
# You can delete this whole section if you don&#039;t want or need this.&lt;br /&gt;
&amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
  # You can change both the bind address and/or the port here as required.&lt;br /&gt;
  # This default will listen for HTTP connections on all interfaces.&lt;br /&gt;
  &amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
    SSLEngine off&lt;br /&gt;
    # EDIT HERE both lines below with the domain name of your web server.&lt;br /&gt;
    ServerName rt.yourdomain.example.com&lt;br /&gt;
    Redirect permanent / https://rt.yourdomain.example.com/&lt;br /&gt;
  &amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/IfModule&amp;gt;&lt;br /&gt;
### End optional HTTPS Redirect VirtualHost&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
After you’ve edited the file, load the configuration with:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo systemctl reload apache2&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo systemctl reload httpd&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If this command reports an error, double-check the configuration file for typos, especially in option names, file paths, and the&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;amp;lt;Section&amp;amp;gt;&amp;lt;/code&amp;gt; pairs. Edit again and reload the configuration until it succeeds without output.&lt;br /&gt;
&lt;br /&gt;
=== Verify the web interface ===&lt;br /&gt;
&lt;br /&gt;
You should be able to visit your web server in your browser, and be presented with RT’s login screen. You should be able to log in with username &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; and the password you set previously.&lt;br /&gt;
&lt;br /&gt;
If you run into trouble, the first place to look for more information is by reading Apache’s error log:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo less /var/log/apache2/error.log&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo less /var/log/httpd/error.log&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s mail server ==&lt;br /&gt;
&lt;br /&gt;
RT both can both send and receive ticket updates via email. Unfortunately, there are too many variables to document a useful setup process here: getting this working usually requires creating DNS records, and coordinating with existing mail servers, which will be the main constraint on your setup. Instead this guide provides a brief overview of how the integration works, and where the connection points are that you likely need to work on.&lt;br /&gt;
&lt;br /&gt;
=== Sending Mail ===&lt;br /&gt;
&lt;br /&gt;
RT only knows how to send mail by passing it off to another program on the system. It cannot connect or authenticate directly to external mail servers. In the default configuration, RT runs the standard &amp;lt;code&amp;gt;sendmail&amp;lt;/code&amp;gt; command. There are [https://docs.bestpractical.com/rt/latest/RT_Config.html#Outgoing-mail configuration options to send mail through different commands] if you need.&lt;br /&gt;
&lt;br /&gt;
The most common setup is to install and configure a proper Mail Transfer Agent (MTA) like Postfix or Exim, and then configure it to send mail to the wider Internet as you need. This works well because the MTAs are robust and well-tested; they have flexible configuration to let you send mail out by relaying to other mail servers you specify with optional authentication; and most distributions install one by default anyway. The only hard part is configuring the MTA to send mail following your site’s policies.&lt;br /&gt;
&lt;br /&gt;
Other software is available that provides a slimmer version of the &amp;lt;code&amp;gt;sendmail&amp;lt;/code&amp;gt; command that connects to an external mail server for you, like ssmtp. These programs are usually easier to configure than an MTA, but they often lose email permanently if they can’t connect to the external server at the time it’s sent. (MTAs keep email queued locally until they successfully deliver it to another server.)&lt;br /&gt;
&lt;br /&gt;
=== Receiving email ===&lt;br /&gt;
&lt;br /&gt;
RT installs a command called &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; that receives an email on standard input and posts it to RT’s REST web interface, where it gets saved in the database and added to a ticket. You need to arrange for a way to send incoming email to this command.&lt;br /&gt;
&lt;br /&gt;
The most common setup is to have an MTA on the same box as RT receive email directly, and then set up mail aliases that call this command when mail comes in. Example &amp;lt;code&amp;gt;/etc/aliases&amp;lt;/code&amp;gt; entries look like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rt: &amp;quot;|/opt/rt5/bin/rt-mailgate --queue general --action correspond --url https://rt.yourdomain.example.com/&amp;quot;&lt;br /&gt;
rt-comment: &amp;quot;|/opt/rt5/bin/rt-mailgate --queue general --action comment --url https://rt.yourdomain.example.com/&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
This works well because, again, you’re probably running an MTA anyway; and the MTA can hold and queue mail if it comes in while RT is down for any reason, giving you a buffer against downtime.&lt;br /&gt;
&lt;br /&gt;
Another common option is to periodically run a tool that fetches mail using a protocol like IMAP, like fetchmail or getmail, and passes it on to &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt;. This is less common because it requires setting up another tool to run, and securely storing another set of mail server credentials. But it is useful when local policy prevents the RT server from receiving email directly.&lt;br /&gt;
&lt;br /&gt;
This is much less common, but it might help to know that &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; doesn’t have to run on the same system as RT itself. It just needs to be able to connect to RT’s web interface. If you don’t have any other options, you can install the RT software on a different system that receives email, and configure &#039;&#039;that&#039;&#039; system to run &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; and pass it on to the RT server. To do that, just repeat the installation instructions above, skipping the steps about installing the database and web server.&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s background jobs ==&lt;br /&gt;
&lt;br /&gt;
Create a file &amp;lt;code&amp;gt;/etc/cron.d/rt&amp;lt;/code&amp;gt; with the following content. You may edit all of the time fields as you see fit. Refer to the crontab(5) man page for details about their definitions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Update the fulltext index with new ticket data&lt;br /&gt;
*/3 *   *   *   *   root    /opt/rt5/sbin/rt-fulltext-indexer&lt;br /&gt;
# Email out dashboards that users have subscribed to&lt;br /&gt;
0   *   *   *   *   root    /opt/rt5/sbin/rt-email-dashboards&lt;br /&gt;
# Clean old sessions from the database&lt;br /&gt;
10  3   *   *   *   root    /opt/rt5/sbin/rt-clean-sessions --older 8d&lt;br /&gt;
# Email out weekly digests for users who have requested it&lt;br /&gt;
50  4   *   *   Mon root    /opt/rt5/sbin/rt-email-digest -m weekly&lt;br /&gt;
# Email out daily digests for users who have requested it&lt;br /&gt;
50  5   *   *   *   root    /opt/rt5/sbin/rt-email-digest -m daily&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
You can run all these jobs as the same user that runs your web server, rather than root. Run:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo sed -i &#039;s/\broot\b/www-data/&#039; /etc/cron.d/rt&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo sed -i &#039;s/\broot\b/apache/&#039; /etc/cron.d/rt&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Set up RT ==&lt;br /&gt;
&lt;br /&gt;
If you’ve gotten this far, congratulations, your RT install is really done now. You can start setting up RT with users, groups, queues, and business logic. [[Main Page|Head back to the main page]] to start exploring those topics.&lt;/div&gt;</summary>
		<author><name>Brett</name></author>
	</entry>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=ManualInstallation&amp;diff=27056</id>
		<title>ManualInstallation</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=ManualInstallation&amp;diff=27056"/>
		<updated>2022-01-13T22:14:48Z</updated>

		<summary type="html">&lt;p&gt;Brett: rt_admin needs createrole on PostgreSQL too&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Prev: [[ManualRequirements]] — Up: [[UserManual]] — Next: [[ManualApacheConfig]]&lt;br /&gt;
&lt;br /&gt;
This guide walks you through installing RT from source on a modern, popular Linux distro. Specifically, that means a distribution based on Debian or Red Hat that’s been released since around 2020.&lt;br /&gt;
&lt;br /&gt;
This guide assumes:&lt;br /&gt;
&lt;br /&gt;
* You can install packages generally available in Debian/Ubuntu or Red Hat/Fedora/CentOS.&lt;br /&gt;
* You want to install RT, and all of its Perl dependencies, from source to get the latest versions. (This is a trade-off. It means the boundaries of your install will be very clear, but you won’t get security updates for RT or Perl modules from your distribution.)&lt;br /&gt;
* You are willing to install a couple of extra tools to manage the RT installation similarly to how you would in other packaging systems (like PyPI, npm, etc.).&lt;br /&gt;
* You are willing to do a relatively maximal install of RT, enabling all the options during installation and then setting what you need in the configuration. (You could save a little space and time by being pickier about your options, but then that complicates the guide and makes it harder to turn those options on later if you want.)&lt;br /&gt;
* You are using a regular user account on the Linux system that can get superuser privileges with sudo.&lt;br /&gt;
&lt;br /&gt;
== Install the base dependencies ==&lt;br /&gt;
&lt;br /&gt;
These are required by RT, either to run or to install the dependencies.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install autoconf build-essential cpanminus curl libexpat-dev libgd-dev libssl-dev libz-dev gnupg graphviz lynx openssl perl&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf config-manager --set-enabled powertools&lt;br /&gt;
sudo dnf install patch tar which gcc gcc-c++ perl-core perl-App-cpanminus graphviz expat-devel gd-devel lynx openssl openssl-devel&lt;br /&gt;
sudo setenforce 0&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
(Turning off SELinux enforcement is required on Red Hat-based distributions because, as of October 2021, nobody has written a policy for RT.)&lt;br /&gt;
&lt;br /&gt;
== Install a database ==&lt;br /&gt;
&lt;br /&gt;
You need access to a database server. It can be remote, or you can install a database server alongside RT. RT supports a few different databases, but the best supported options are PostgreSQL and MariaDB.&lt;br /&gt;
&lt;br /&gt;
=== Installing and configuring the PostgreSQL server ===&lt;br /&gt;
&lt;br /&gt;
If you want to install a fresh PostgreSQL database server alongside RT:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install postgresql&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install postgresql-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In order to set up RT’s database, you will need a PostgreSQL account that can create databases and roles and be authenticated with a password. If you don’t have that, you can create it by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo createuser --createdb --createrole --login --pwprompt rt_admin&amp;lt;/pre&amp;gt;&lt;br /&gt;
Set the password when prompted. Record this; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
=== Enable password authentication in PostgreSQL ===&lt;br /&gt;
&lt;br /&gt;
You need to consider this step whether you install the database locally, or use an existing one already running. RT supports connecting to PostgreSQL a few different ways, but authenticating with a username and password is simplest, and this guide is written based on that. Not all PostgreSQL installations allow this authentication method by default. You need to review your &amp;lt;code&amp;gt;pg_hba.conf&amp;lt;/code&amp;gt; file located at:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;/etc/postgresql/VERSION/main/pg_hba.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;/var/lib/pgsql/VERSION/data/pg_hba.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Replace &amp;lt;code&amp;gt;VERSION&amp;lt;/code&amp;gt; with the version of your PostgreSQL database. Add these two lines &#039;&#039;&#039;above&#039;&#039;&#039; any other lines that start with &amp;lt;code&amp;gt;host&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;host  rt5  rt_user   all  md5&lt;br /&gt;
host  rt5  rt_admin  all  md5&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This configuration will let &amp;lt;code&amp;gt;rt_user&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;rt_admin&amp;lt;/code&amp;gt; authorize themselves for the &amp;lt;code&amp;gt;rt5&amp;lt;/code&amp;gt; database using an &amp;lt;code&amp;gt;md5&amp;lt;/code&amp;gt; crypted password over a network connection (possibly using the localhost loopback network). You might be able to further restrict some of these fields for improved security, but doing so is outside the scope of this install guide. Refer to [https://www.postgresql.org/docs/current/auth-pg-hba-conf.html the pg_hba.conf documentation] for more details.&lt;br /&gt;
&lt;br /&gt;
Save your changes and reload the database:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo systemctl reload postgresql&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Installing the PostgreSQL client libraries ===&lt;br /&gt;
&lt;br /&gt;
These are required for RT to be able to talk to any PostgreSQL server.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install libpq-dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install postgresql-devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Once this is done you can skip ahead to installing a web server.&lt;br /&gt;
&lt;br /&gt;
=== Installing and configuring the MariaDB server ===&lt;br /&gt;
&lt;br /&gt;
If you want to install a fresh MariaDB database server alongside RT:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install mariadb-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install mariadb-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In order to set up RT’s database, you will need a MySQL superuser account. To stay consistent with PostgreSQL, I suggest setting a password for it. You can do that by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo mysql&lt;br /&gt;
mysql# GRANT ALL PRIVELEGES WITH GRANT OPTION ON rt5 TO rt_admin@localhost IDENTIFIED BY &#039;YourPassphraseHere&#039;;&amp;lt;/pre&amp;gt;&lt;br /&gt;
Record your passphrase; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
=== Adjust MariaDB’s max_allowed_packet setting ===&lt;br /&gt;
&lt;br /&gt;
You need to consider this step whether you install the database locally, or use an existing one already running. [https://mariadb.com/kb/en/server-system-variables/#max_allowed_packet MariaDB’s &amp;lt;code&amp;gt;max_allowed_packet&amp;lt;/code&amp;gt; setting] functionally limits the size of attachments in RT. The default is 16MiB, which is too small for most installations. You can ultimately choose any setting you’re comfortable with; 64MiB here should allow most requests without being too open.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;echo -e &#039;[client-server]\nmax_allowed_packet=64M\n&#039; | sudo tee /etc/mysql/conf.d/max_allowed_packet.cnf&lt;br /&gt;
sudo systemctl reload mariadb&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;echo -e &#039;[client-server]\nmax_allowed_packet=64M\n&#039; | sudo tee /etc/my.cnf.d/max_allowed_packet.cnf&lt;br /&gt;
sudo systemctl reload mariadb&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Installing the MariaDB client libraries ===&lt;br /&gt;
&lt;br /&gt;
These are required for RT to be able to talk to any MariaDB server.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install libmariadb-dev libmariadb-dev-compat&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install mariadb-devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Install a web server with FastCGI ==&lt;br /&gt;
&lt;br /&gt;
FastCGI is the best way to host RT’s web interface today. Installing the web server before RT makes the installation process simpler, because RT will be able to automatically some details about your web server like what user it runs as.&lt;br /&gt;
&lt;br /&gt;
=== Installing Apache ===&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install apache2 libapache2-mod-fcgid&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install httpd mod_fcgid mod_ssl&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ### Installing nginx --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Install RT ==&lt;br /&gt;
&lt;br /&gt;
=== Get and unpack the RT source code ===&lt;br /&gt;
&lt;br /&gt;
Download the latest source code using the link on the [https://bestpractical.com/download-page RT download page], extract it using &amp;lt;code&amp;gt;tar -xf&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt; into the source code directory to run the rest of the commands in this section. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;curl -O https://download.bestpractical.com/pub/rt/release/rt-5.0.2.tar.gz&lt;br /&gt;
tar -xf rt-5.0.2.tar.gz&lt;br /&gt;
cd rt-5.0.2&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Pre-configure RT ===&lt;br /&gt;
&lt;br /&gt;
This command will detect some information about your system in order to install RT properly, and decide which set of dependencies to install. Here’s what the different parts of our command are doing:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;--with-db-type=TYPE&amp;lt;/code&amp;gt; - Replace &amp;lt;code&amp;gt;TYPE&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;Pg&amp;lt;/code&amp;gt; for PostgreSQL, or &amp;lt;code&amp;gt;mysql&amp;lt;/code&amp;gt; for MariaDB.&lt;br /&gt;
* &amp;lt;code&amp;gt;--prefix=/opt/rt5&amp;lt;/code&amp;gt; sets the directory where RT will install all of its libraries, tools, and supporting files. You can choose another path if you like.&lt;br /&gt;
* The rest of the options tell RT to install additional dependencies for optional features.&lt;br /&gt;
&lt;br /&gt;
Make sure you have &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt;ed into the RT source directory, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;./configure --with-db-type=TYPE --prefix=/opt/rt5 --with-attachment-store=disk --enable-externalauth --enable-gd --enable-graphviz --enable-gpg --enable-smime&amp;lt;/pre&amp;gt;&lt;br /&gt;
For more background, [https://docs.bestpractical.com/rt/latest/configure.html refer to the RT configure options documentation].&lt;br /&gt;
&lt;br /&gt;
=== Install RT and its Perl dependencies ===&lt;br /&gt;
&lt;br /&gt;
This command will download, build, and install all of the Perl modules necessary to run RT with the configuration you set above. Here’s what the different parts of the command are doing:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;make dirs&amp;lt;/code&amp;gt; sets up RT&#039;s directory structure. We do this first to install dependencies under it.&lt;br /&gt;
* &amp;lt;code&amp;gt;make fixdeps&amp;lt;/code&amp;gt; actually installs those dependencies.&lt;br /&gt;
* &amp;lt;code&amp;gt;RT_FIX_DEPS_CMD=&#039;cpanm …&#039;&amp;lt;/code&amp;gt; tells RT to use cpanminus to install dependencies (instead of the older, default &amp;lt;code&amp;gt;cpan&amp;lt;/code&amp;gt; command), and to install them where RT will automatically load them.&lt;br /&gt;
* &amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt; installs all of RT’s files under &amp;lt;code&amp;gt;/opt/rt5&amp;lt;/code&amp;gt; (or the prefix directory you set in the previous step). It will only run if &amp;lt;code&amp;gt;fixdeps&amp;lt;/code&amp;gt; succeeds. Setting &amp;lt;code&amp;gt;PERL5LIB&amp;lt;/code&amp;gt; tells it where you installed those dependencies.&lt;br /&gt;
&lt;br /&gt;
Make sure you have &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt;ed into the RT source directory, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo make dirs&lt;br /&gt;
sudo ln -s . /opt/rt5/local/lib/perl5&lt;br /&gt;
make fixdeps RT_FIX_DEPS_CMD=&#039;cpanm --sudo --quiet --local-lib=/opt/rt5/local&#039;&lt;br /&gt;
sudo make install PERL5LIB=/opt/rt5/local/lib&amp;lt;/pre&amp;gt;&lt;br /&gt;
If it works, the command will eventually output a message that says “Congratulations. RT is now installed.” followed by instructions about configuring and setting up the database. We’ll do that next.&lt;br /&gt;
&lt;br /&gt;
=== Configure RT ===&lt;br /&gt;
&lt;br /&gt;
[https://docs.bestpractical.com/rt/latest/RT_Config.html RT has many configuration options.] You can put configuration options in the file &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/code&amp;gt;, or in individual files under &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.d/&amp;lt;/code&amp;gt;. Use an editor to save all the text below to &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/code&amp;gt; (you can just overwrite the existing file, or add this to the bottom of what’s there) and then fill in settings for your site everywhere the text &amp;lt;code&amp;gt;EDIT WITH&amp;lt;/code&amp;gt; appears.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Single-quote all values EXCEPT the special value `undef`&lt;br /&gt;
# that turns off a setting.&lt;br /&gt;
&lt;br /&gt;
# rtname appears in ticket email subjects. It needs to be globally unique,&lt;br /&gt;
# so use your organization&#039;s domain name.&lt;br /&gt;
Set($rtname, &#039;EDIT WITH yourdomain.example.com&#039;);&lt;br /&gt;
# Organization is used in the database for ticket links, etc. It also needs to&lt;br /&gt;
# be globally unique, so use your organization&#039;s domain name.&lt;br /&gt;
Set($Organization, &#039;EDIT WITH yourdomain.example.com&#039;);&lt;br /&gt;
# WebDomain is domain name of the RT web server. RT uses it to construct links&lt;br /&gt;
# and defend against CSRFs.&lt;br /&gt;
Set($WebDomain, &#039;EDIT WITH rt.yourdomain.example.com&#039;);&lt;br /&gt;
# WebPort is the port where the RT web server runs. Edit the number below if&lt;br /&gt;
# you&#039;re not using the standard HTTPS port.&lt;br /&gt;
Set($WebPort, &#039;443&#039;);&lt;br /&gt;
&lt;br /&gt;
# DatabaseUser is the name of the database account RT uses to read and store&lt;br /&gt;
# data. &#039;rt_user&#039; is the default but you can change it if you like.&lt;br /&gt;
# DO NOT use the &#039;rt_admin&#039; superuser created in the instructions above.&lt;br /&gt;
Set($DatabaseUser, &#039;rt_user&#039;);&lt;br /&gt;
# DatabasePassword is the password for DatabaseUser.&lt;br /&gt;
Set($DatabasePassword, &#039;EDIT WITH SomePassphraseHere&#039;);&lt;br /&gt;
# DatabaseHost is the hostname of the database server RT should use.&lt;br /&gt;
# Change &#039;localhost&#039; if it lives on a different server.&lt;br /&gt;
Set($DatabaseHost, &#039;localhost&#039;);&lt;br /&gt;
# DatabasePort is the port number of the database server RT should use.&lt;br /&gt;
# `undef` means the default for that database. Change it if you&#039;re not&lt;br /&gt;
# using the standard port.&lt;br /&gt;
Set($DatabasePort, undef);&lt;br /&gt;
# DatabaseName is the name of RT&#039;s database hosted on DatabaseHost.&lt;br /&gt;
# &#039;rt5&#039; is the default but you can change it if you like.&lt;br /&gt;
Set($DatabaseName, &#039;rt5&#039;);&lt;br /&gt;
# DatabaseAdmin is the name of the user in the database used to perform&lt;br /&gt;
# major administrative tasks. Change &#039;rt_admin&#039; if you&#039;re using a user&lt;br /&gt;
# besides the one created in this guide.&lt;br /&gt;
Set($DatabaseAdmin, &#039;rt_admin&#039;);&lt;br /&gt;
&lt;br /&gt;
# RT can log to syslog, stderr, and/or a dedicated file.&lt;br /&gt;
# Log settings are used both by the primary server and by command line&lt;br /&gt;
# tools like rt-crontool, rt-ldapimport, etc.&lt;br /&gt;
# You set all of RT&#039;s $LogTo* paramaters to a standard log level: &#039;debug&#039;,&lt;br /&gt;
# &#039;info&#039;, &#039;notice&#039;, &#039;warning&#039;, &#039;error&#039;, &#039;critical&#039;, &#039;alert&#039;, or &#039;emergency&#039;.&lt;br /&gt;
# For a modern install, I recommend logging primarily to syslog, so it goes&lt;br /&gt;
# to journald where it&#039;s easy to query and automatically gets rotated.&lt;br /&gt;
Set($LogToSyslog, &#039;info&#039;);&lt;br /&gt;
&lt;br /&gt;
# When the RT server logs to stderr, that usually goes to your web server&#039;s&lt;br /&gt;
# error log. Command line tools log to their own stderr. Setting this to&lt;br /&gt;
# &#039;warning&#039; or &#039;error&#039; helps ensure you get notified if RT&#039;s cron jobs&lt;br /&gt;
# encounter problems.&lt;br /&gt;
Set($LogToSTDERR, &#039;warning&#039;);&lt;br /&gt;
&lt;br /&gt;
# Turn off optional features that require additional configuration.&lt;br /&gt;
# If you want to use these, refer to the RT_Config documentation for&lt;br /&gt;
# instructions on how to set them up.&lt;br /&gt;
Set(%GnuPG, &#039;Enable&#039; =&amp;gt; &#039;0&#039;);&lt;br /&gt;
Set(%SMIME, &#039;Enable&#039; =&amp;gt; &#039;0&#039;);&lt;br /&gt;
&lt;br /&gt;
# Perl expects to find this 1 at the end of the file.&lt;br /&gt;
1;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;RT_SiteConfig.pm&amp;lt;/code&amp;gt; is actually Perl code. RT runs the code directly to load the configuration. Any time you finish editing it, you can check that you didn’t make any syntax errors by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;perl -c /opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Set up RT’s database ===&lt;br /&gt;
&lt;br /&gt;
RT includes a tool to help you set up its database. By default, it connects to the database as an administrator to create the database and user that you configured in the previous step.&lt;br /&gt;
&lt;br /&gt;
(The instructions from &amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt; and RT’s README file tell you to run &amp;lt;code&amp;gt;make initialize-database&amp;lt;/code&amp;gt;. That just runs &amp;lt;code&amp;gt;rt-setup-database&amp;lt;/code&amp;gt; for you. Running the tool directly makes it easier to pass the options you need.)&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;--action=init&amp;lt;/code&amp;gt; tells the tool to create the user, the database, the tables inside it, and insert core data RT needs to function.&lt;br /&gt;
* &#039;&#039;&#039;If&#039;&#039;&#039; you are using an existing database server and the database adminstrator has already created the user account and database for RT, then you can add the &amp;lt;code&amp;gt;--skip-create&amp;lt;/code&amp;gt; option.&lt;br /&gt;
* &#039;&#039;&#039;If&#039;&#039;&#039; you have a less common database setup, this tool has additional options to give you finer-grained control over what steps are run and how. Refer to [https://docs.bestpractical.com/rt/latest/rt-setup-database.html the full rt-setup-database documentation] to learn more about those.&lt;br /&gt;
* The command reads files from RT’s &amp;lt;code&amp;gt;etc/&amp;lt;/code&amp;gt; directory by default, so the easiest way to run it is to &amp;lt;code&amp;gt;cd /opt/rt5&amp;lt;/code&amp;gt; first, and then it will find the necessary files automatically.&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /opt/rt5&lt;br /&gt;
sudo sbin/rt-setup-database --action=init&amp;lt;/pre&amp;gt;&lt;br /&gt;
Enter the password for your database administrator account when prompted.&lt;br /&gt;
&lt;br /&gt;
=== Set up fulltext indexing ===&lt;br /&gt;
&lt;br /&gt;
Fulltext indexing speeds up searches for ticket content, which makes RT a lot nicer to use.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;--noask&amp;lt;/code&amp;gt; uses the default names for the index, which will be fine for a new install and simplifies the setup.&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo /opt/rt5/sbin/rt-setup-fulltext-index --noask&amp;lt;/pre&amp;gt;&lt;br /&gt;
Enter the password for your database administrator account when prompted. The end of the process will output some RT configuration that looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;### EXAMPLE OUTPUT ONLY - Don&#039;t use this directly!&lt;br /&gt;
Set( %FullTextSearch,&lt;br /&gt;
    Enable     =&amp;gt; 1,&lt;br /&gt;
    Indexed    =&amp;gt; 1,&lt;br /&gt;
    # Additional output from rt-setup-fulltext-index should be here.&lt;br /&gt;
    # The configuration varies by database type.&lt;br /&gt;
);&amp;lt;/pre&amp;gt;&lt;br /&gt;
Copy the output generated when you run &amp;lt;code&amp;gt;rt-setup-fulltext-index&amp;lt;/code&amp;gt; and save it to the file &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.d/FulltextIndex.pm&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Set permissions ===&lt;br /&gt;
&lt;br /&gt;
All of RT’s configuration files should be readable by the user that runs the web server, and no other users, in order to protect sensitive information like the database password. RT provides a command to set permissions appropriately according to your distribution and configuration. &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt; to the directory where you extracted the RT source code, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd rt-5.0.2&lt;br /&gt;
sudo make fixperms&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Verify the installation ===&lt;br /&gt;
&lt;br /&gt;
If everything has gone well, then you should be able to set a password for RT’s &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; user. You’ll use this later to log in to the web interface and continue setting up your system. Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo /opt/rt5/sbin/rt-passwd root&amp;lt;/pre&amp;gt;&lt;br /&gt;
Set the password when prompted. Record this; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s web server ==&lt;br /&gt;
&lt;br /&gt;
=== Configure Apache modules ===&lt;br /&gt;
&lt;br /&gt;
You will need to have the following modules enabled in Apache to run RT. You should already have these installed if you followed the instructions above.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;alias&amp;lt;/code&amp;gt; (required to map URLs to RT)&lt;br /&gt;
* &amp;lt;code&amp;gt;fcgid&amp;lt;/code&amp;gt; (required for Apache to talk to RT)&lt;br /&gt;
* &amp;lt;code&amp;gt;mpm_prefork&amp;lt;/code&amp;gt; (Apache requires you to select an MPM. RT is designed to work with the prefork module.)&lt;br /&gt;
* &amp;lt;code&amp;gt;ssl&amp;lt;/code&amp;gt; (required to serve HTTPS; optional otherwise)&lt;br /&gt;
&lt;br /&gt;
Enable them following these instructions:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo a2dismod mpm_event&lt;br /&gt;
sudo a2enmod fcgid&lt;br /&gt;
sudo a2enmod mpm_prefork&lt;br /&gt;
sudo a2enmod ssl&amp;lt;/pre&amp;gt;&lt;br /&gt;
| &amp;lt;pre&amp;gt;echo LoadModule mpm_prefork_module modules/mod_mpm_prefork.so | sudo tee /etc/httpd/conf.modules.d/00-mpm.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Disable default VirtualHosts (optional) ===&lt;br /&gt;
&lt;br /&gt;
If this web server is dedicated to RT, then you should disable the VirtualHosts that are included with the stock configuration. Run:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo a2dissite 000-default&lt;br /&gt;
sudo a2dissite default-ssl&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo sed -i~ &#039;/^&amp;lt;VirtualHost\b/ , /^&amp;lt;\/VirtualHost\b/ d&#039; /etc/httpd/conf.d/ssl.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Configure an Apache VirtualHost ===&lt;br /&gt;
&lt;br /&gt;
Create a file at the following location. You can change the &amp;lt;code&amp;gt;RT&amp;lt;/code&amp;gt; part of the filename if you like, but the file must exist in this directory and have a &amp;lt;code&amp;gt;.conf&amp;lt;/code&amp;gt; suffix.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;/etc/apache2/sites-available/RT.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
Then after you create the file, run: &amp;lt;code&amp;gt;sudo a2ensite RT&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;/etc/httpd/conf.d/zz_RT.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Use an editor to save all the text below to the new &amp;lt;code&amp;gt;RT.conf&amp;lt;/code&amp;gt; and then fill in settings for your site everywhere the text &amp;lt;code&amp;gt;EDIT WITH&amp;lt;/code&amp;gt; appears.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### Primary RT VirtualHost&lt;br /&gt;
# You can change both the bind address and/or the port here as required.&lt;br /&gt;
# This default will listen for HTTPS connections on all interfaces.&lt;br /&gt;
&amp;lt;VirtualHost *:443&amp;gt;&lt;br /&gt;
  # EDIT HERE with the domain name of the web server.&lt;br /&gt;
  ServerName rt.yourdomain.example.com&lt;br /&gt;
  &amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
    SSLEngine on&lt;br /&gt;
    # These specify the paths to the SSL certificate and private key Apache&lt;br /&gt;
    # should use. These example paths are common for Let&#039;s Encrypt. If you&lt;br /&gt;
    # don&#039;t use Let&#039;s Encrypt, the standard location for these files is under&lt;br /&gt;
    # (Debian/Ubuntu) /etc/ssl&lt;br /&gt;
    # (Red Hat/Fedora/CentOS) /etc/pki/tls&lt;br /&gt;
    # EDIT HERE with the appropriate paths for your server&lt;br /&gt;
    SSLCertificateFile /etc/letsencrypt/live/example.com/fullchain.pem&lt;br /&gt;
    SSLCertificateKeyFile /etc/letsencrypt/live/example.com/privkey.pem&lt;br /&gt;
  &amp;lt;/IfModule&amp;gt;&lt;br /&gt;
  &amp;lt;Location /&amp;gt;&lt;br /&gt;
    Require all granted&lt;br /&gt;
    Options +ExecCGI&lt;br /&gt;
    AddHandler fcgid-script fcgi&lt;br /&gt;
  &amp;lt;/Location&amp;gt;&lt;br /&gt;
  AddDefaultCharset UTF-8&lt;br /&gt;
  DocumentRoot /opt/rt5/share/html&lt;br /&gt;
  ScriptAlias / /opt/rt5/sbin/rt-server.fcgi/&lt;br /&gt;
  # The default mod_fcgid timeout is 40 seconds.&lt;br /&gt;
  # We increase it here to allow for large ticket searches, etc.&lt;br /&gt;
  FcgidIOTimeout 200   # mod_fcgid only allows 128KiB requests by default. This is too small for users&lt;br /&gt;
  # to upload files to RT. You can ultimately choose any setting you&#039;re&lt;br /&gt;
  # comfortable with; 70MiB here should allow most requests without being too&lt;br /&gt;
  # open.&lt;br /&gt;
  FcgidMaxRequestLen 73400320&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
### End primary RT VirtualHost&lt;br /&gt;
&lt;br /&gt;
### Optional HTTPS Redirect VirtualHost&lt;br /&gt;
# Most modern servers support HTTPS and want all web traffic to go through it.&lt;br /&gt;
# This VirtualHost redirects normal HTTP traffic to HTTPS.&lt;br /&gt;
# You can delete this whole section if you don&#039;t want or need this.&lt;br /&gt;
&amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
  # You can change both the bind address and/or the port here as required.&lt;br /&gt;
  # This default will listen for HTTP connections on all interfaces.&lt;br /&gt;
  &amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
    SSLEngine off&lt;br /&gt;
    # EDIT HERE both lines below with the domain name of your web server.&lt;br /&gt;
    ServerName rt.yourdomain.example.com&lt;br /&gt;
    Redirect permanent / https://rt.yourdomain.example.com/&lt;br /&gt;
  &amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/IfModule&amp;gt;&lt;br /&gt;
### End optional HTTPS Redirect VirtualHost&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
After you’ve edited the file, load the configuration with:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo systemctl reload apache2&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo systemctl reload httpd&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If this command reports an error, double-check the configuration file for typos, especially in option names, file paths, and the&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;amp;lt;Section&amp;amp;gt;&amp;lt;/code&amp;gt; pairs. Edit again and reload the configuration until it succeeds without output.&lt;br /&gt;
&lt;br /&gt;
=== Verify the web interface ===&lt;br /&gt;
&lt;br /&gt;
You should be able to visit your web server in your browser, and be presented with RT’s login screen. You should be able to log in with username &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; and the password you set previously.&lt;br /&gt;
&lt;br /&gt;
If you run into trouble, the first place to look for more information is by reading Apache’s error log:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo less /var/log/apache2/error.log&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo less /var/log/httpd/error.log&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s mail server ==&lt;br /&gt;
&lt;br /&gt;
RT both can both send and receive ticket updates via email. Unfortunately, there are too many variables to document a useful setup process here: getting this working usually requires creating DNS records, and coordinating with existing mail servers, which will be the main constraint on your setup. Instead this guide provides a brief overview of how the integration works, and where the connection points are that you likely need to work on.&lt;br /&gt;
&lt;br /&gt;
=== Sending Mail ===&lt;br /&gt;
&lt;br /&gt;
RT only knows how to send mail by passing it off to another program on the system. It cannot connect or authenticate directly to external mail servers. In the default configuration, RT runs the standard &amp;lt;code&amp;gt;sendmail&amp;lt;/code&amp;gt; command. There are [https://docs.bestpractical.com/rt/latest/RT_Config.html#Outgoing-mail configuration options to send mail through different commands] if you need.&lt;br /&gt;
&lt;br /&gt;
The most common setup is to install and configure a proper Mail Transfer Agent (MTA) like Postfix or Exim, and then configure it to send mail to the wider Internet as you need. This works well because the MTAs are robust and well-tested; they have flexible configuration to let you send mail out by relaying to other mail servers you specify with optional authentication; and most distributions install one by default anyway. The only hard part is configuring the MTA to send mail following your site’s policies.&lt;br /&gt;
&lt;br /&gt;
Other software is available that provides a slimmer version of the &amp;lt;code&amp;gt;sendmail&amp;lt;/code&amp;gt; command that connects to an external mail server for you, like ssmtp. These programs are usually easier to configure than an MTA, but they often lose email permanently if they can’t connect to the external server at the time it’s sent. (MTAs keep email queued locally until they successfully deliver it to another server.)&lt;br /&gt;
&lt;br /&gt;
=== Receiving email ===&lt;br /&gt;
&lt;br /&gt;
RT installs a command called &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; that receives an email on standard input and posts it to RT’s REST web interface, where it gets saved in the database and added to a ticket. You need to arrange for a way to send incoming email to this command.&lt;br /&gt;
&lt;br /&gt;
The most common setup is to have an MTA on the same box as RT receive email directly, and then set up mail aliases that call this command when mail comes in. Example &amp;lt;code&amp;gt;/etc/aliases&amp;lt;/code&amp;gt; entries look like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rt: &amp;quot;|/opt/rt5/bin/rt-mailgate --queue general --action correspond --url https://rt.yourdomain.example.com/&amp;quot;&lt;br /&gt;
rt-comment: &amp;quot;|/opt/rt5/bin/rt-mailgate --queue general --action comment --url https://rt.yourdomain.example.com/&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
This works well because, again, you’re probably running an MTA anyway; and the MTA can hold and queue mail if it comes in while RT is down for any reason, giving you a buffer against downtime.&lt;br /&gt;
&lt;br /&gt;
Another common option is to periodically run a tool that fetches mail using a protocol like IMAP, like fetchmail or getmail, and passes it on to &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt;. This is less common because it requires setting up another tool to run, and securely storing another set of mail server credentials. But it is useful when local policy prevents the RT server from receiving email directly.&lt;br /&gt;
&lt;br /&gt;
This is much less common, but it might help to know that &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; doesn’t have to run on the same system as RT itself. It just needs to be able to connect to RT’s web interface. If you don’t have any other options, you can install the RT software on a different system that receives email, and configure &#039;&#039;that&#039;&#039; system to run &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; and pass it on to the RT server. To do that, just repeat the installation instructions above, skipping the steps about installing the database and web server.&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s background jobs ==&lt;br /&gt;
&lt;br /&gt;
Create a file &amp;lt;code&amp;gt;/etc/cron.d/rt&amp;lt;/code&amp;gt; with the following content. You may edit all of the time fields as you see fit. Refer to the crontab(5) man page for details about their definitions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Update the fulltext index with new ticket data&lt;br /&gt;
*/3 *   *   *   *   root    /opt/rt5/sbin/rt-fulltext-indexer&lt;br /&gt;
# Email out dashboards that users have subscribed to&lt;br /&gt;
0   *   *   *   *   root    /opt/rt5/sbin/rt-email-dashboards&lt;br /&gt;
# Clean old sessions from the database&lt;br /&gt;
10  3   *   *   *   root    /opt/rt5/sbin/rt-clean-sessions --older 8d&lt;br /&gt;
# Email out weekly digests for users who have requested it&lt;br /&gt;
50  4   *   *   Mon root    /opt/rt5/sbin/rt-email-digest -m weekly&lt;br /&gt;
# Email out daily digests for users who have requested it&lt;br /&gt;
50  5   *   *   *   root    /opt/rt5/sbin/rt-email-digest -m daily&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
You can run all these jobs as the same user that runs your web server, rather than root. Run:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo sed -i &#039;s/\broot\b/www-data/&#039; /etc/cron.d/rt&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo sed -i &#039;s/\broot\b/apache/&#039; /etc/cron.d/rt&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Set up RT ==&lt;br /&gt;
&lt;br /&gt;
If you’ve gotten this far, congratulations, your RT install is really done now. You can start setting up RT with users, groups, queues, and business logic. [[Main Page|Head back to the main page]] to start exploring those topics.&lt;/div&gt;</summary>
		<author><name>Brett</name></author>
	</entry>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=ManualInstallation&amp;diff=27055</id>
		<title>ManualInstallation</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=ManualInstallation&amp;diff=27055"/>
		<updated>2022-01-13T22:13:57Z</updated>

		<summary type="html">&lt;p&gt;Brett: improve PostgreSQL createuser options&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Prev: [[ManualRequirements]] — Up: [[UserManual]] — Next: [[ManualApacheConfig]]&lt;br /&gt;
&lt;br /&gt;
This guide walks you through installing RT from source on a modern, popular Linux distro. Specifically, that means a distribution based on Debian or Red Hat that’s been released since around 2020.&lt;br /&gt;
&lt;br /&gt;
This guide assumes:&lt;br /&gt;
&lt;br /&gt;
* You can install packages generally available in Debian/Ubuntu or Red Hat/Fedora/CentOS.&lt;br /&gt;
* You want to install RT, and all of its Perl dependencies, from source to get the latest versions. (This is a trade-off. It means the boundaries of your install will be very clear, but you won’t get security updates for RT or Perl modules from your distribution.)&lt;br /&gt;
* You are willing to install a couple of extra tools to manage the RT installation similarly to how you would in other packaging systems (like PyPI, npm, etc.).&lt;br /&gt;
* You are willing to do a relatively maximal install of RT, enabling all the options during installation and then setting what you need in the configuration. (You could save a little space and time by being pickier about your options, but then that complicates the guide and makes it harder to turn those options on later if you want.)&lt;br /&gt;
* You are using a regular user account on the Linux system that can get superuser privileges with sudo.&lt;br /&gt;
&lt;br /&gt;
== Install the base dependencies ==&lt;br /&gt;
&lt;br /&gt;
These are required by RT, either to run or to install the dependencies.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install autoconf build-essential cpanminus curl libexpat-dev libgd-dev libssl-dev libz-dev gnupg graphviz lynx openssl perl&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf config-manager --set-enabled powertools&lt;br /&gt;
sudo dnf install patch tar which gcc gcc-c++ perl-core perl-App-cpanminus graphviz expat-devel gd-devel lynx openssl openssl-devel&lt;br /&gt;
sudo setenforce 0&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
(Turning off SELinux enforcement is required on Red Hat-based distributions because, as of October 2021, nobody has written a policy for RT.)&lt;br /&gt;
&lt;br /&gt;
== Install a database ==&lt;br /&gt;
&lt;br /&gt;
You need access to a database server. It can be remote, or you can install a database server alongside RT. RT supports a few different databases, but the best supported options are PostgreSQL and MariaDB.&lt;br /&gt;
&lt;br /&gt;
=== Installing and configuring the PostgreSQL server ===&lt;br /&gt;
&lt;br /&gt;
If you want to install a fresh PostgreSQL database server alongside RT:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install postgresql&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install postgresql-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In order to set up RT’s database, you will need a PostgreSQL account that can create databases and be authenticated with a password. If you don’t have that, you can create it by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo createuser --createdb --login --pwprompt rt_admin&amp;lt;/pre&amp;gt;&lt;br /&gt;
Set the password when prompted. Record this; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
=== Enable password authentication in PostgreSQL ===&lt;br /&gt;
&lt;br /&gt;
You need to consider this step whether you install the database locally, or use an existing one already running. RT supports connecting to PostgreSQL a few different ways, but authenticating with a username and password is simplest, and this guide is written based on that. Not all PostgreSQL installations allow this authentication method by default. You need to review your &amp;lt;code&amp;gt;pg_hba.conf&amp;lt;/code&amp;gt; file located at:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;/etc/postgresql/VERSION/main/pg_hba.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;/var/lib/pgsql/VERSION/data/pg_hba.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Replace &amp;lt;code&amp;gt;VERSION&amp;lt;/code&amp;gt; with the version of your PostgreSQL database. Add these two lines &#039;&#039;&#039;above&#039;&#039;&#039; any other lines that start with &amp;lt;code&amp;gt;host&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;host  rt5  rt_user   all  md5&lt;br /&gt;
host  rt5  rt_admin  all  md5&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This configuration will let &amp;lt;code&amp;gt;rt_user&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;rt_admin&amp;lt;/code&amp;gt; authorize themselves for the &amp;lt;code&amp;gt;rt5&amp;lt;/code&amp;gt; database using an &amp;lt;code&amp;gt;md5&amp;lt;/code&amp;gt; crypted password over a network connection (possibly using the localhost loopback network). You might be able to further restrict some of these fields for improved security, but doing so is outside the scope of this install guide. Refer to [https://www.postgresql.org/docs/current/auth-pg-hba-conf.html the pg_hba.conf documentation] for more details.&lt;br /&gt;
&lt;br /&gt;
Save your changes and reload the database:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo systemctl reload postgresql&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Installing the PostgreSQL client libraries ===&lt;br /&gt;
&lt;br /&gt;
These are required for RT to be able to talk to any PostgreSQL server.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install libpq-dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install postgresql-devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Once this is done you can skip ahead to installing a web server.&lt;br /&gt;
&lt;br /&gt;
=== Installing and configuring the MariaDB server ===&lt;br /&gt;
&lt;br /&gt;
If you want to install a fresh MariaDB database server alongside RT:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install mariadb-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install mariadb-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In order to set up RT’s database, you will need a MySQL superuser account. To stay consistent with PostgreSQL, I suggest setting a password for it. You can do that by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo mysql&lt;br /&gt;
mysql# GRANT ALL PRIVELEGES WITH GRANT OPTION ON rt5 TO rt_admin@localhost IDENTIFIED BY &#039;YourPassphraseHere&#039;;&amp;lt;/pre&amp;gt;&lt;br /&gt;
Record your passphrase; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
=== Adjust MariaDB’s max_allowed_packet setting ===&lt;br /&gt;
&lt;br /&gt;
You need to consider this step whether you install the database locally, or use an existing one already running. [https://mariadb.com/kb/en/server-system-variables/#max_allowed_packet MariaDB’s &amp;lt;code&amp;gt;max_allowed_packet&amp;lt;/code&amp;gt; setting] functionally limits the size of attachments in RT. The default is 16MiB, which is too small for most installations. You can ultimately choose any setting you’re comfortable with; 64MiB here should allow most requests without being too open.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;echo -e &#039;[client-server]\nmax_allowed_packet=64M\n&#039; | sudo tee /etc/mysql/conf.d/max_allowed_packet.cnf&lt;br /&gt;
sudo systemctl reload mariadb&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;echo -e &#039;[client-server]\nmax_allowed_packet=64M\n&#039; | sudo tee /etc/my.cnf.d/max_allowed_packet.cnf&lt;br /&gt;
sudo systemctl reload mariadb&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Installing the MariaDB client libraries ===&lt;br /&gt;
&lt;br /&gt;
These are required for RT to be able to talk to any MariaDB server.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install libmariadb-dev libmariadb-dev-compat&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install mariadb-devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Install a web server with FastCGI ==&lt;br /&gt;
&lt;br /&gt;
FastCGI is the best way to host RT’s web interface today. Installing the web server before RT makes the installation process simpler, because RT will be able to automatically some details about your web server like what user it runs as.&lt;br /&gt;
&lt;br /&gt;
=== Installing Apache ===&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install apache2 libapache2-mod-fcgid&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install httpd mod_fcgid mod_ssl&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ### Installing nginx --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Install RT ==&lt;br /&gt;
&lt;br /&gt;
=== Get and unpack the RT source code ===&lt;br /&gt;
&lt;br /&gt;
Download the latest source code using the link on the [https://bestpractical.com/download-page RT download page], extract it using &amp;lt;code&amp;gt;tar -xf&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt; into the source code directory to run the rest of the commands in this section. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;curl -O https://download.bestpractical.com/pub/rt/release/rt-5.0.2.tar.gz&lt;br /&gt;
tar -xf rt-5.0.2.tar.gz&lt;br /&gt;
cd rt-5.0.2&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Pre-configure RT ===&lt;br /&gt;
&lt;br /&gt;
This command will detect some information about your system in order to install RT properly, and decide which set of dependencies to install. Here’s what the different parts of our command are doing:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;--with-db-type=TYPE&amp;lt;/code&amp;gt; - Replace &amp;lt;code&amp;gt;TYPE&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;Pg&amp;lt;/code&amp;gt; for PostgreSQL, or &amp;lt;code&amp;gt;mysql&amp;lt;/code&amp;gt; for MariaDB.&lt;br /&gt;
* &amp;lt;code&amp;gt;--prefix=/opt/rt5&amp;lt;/code&amp;gt; sets the directory where RT will install all of its libraries, tools, and supporting files. You can choose another path if you like.&lt;br /&gt;
* The rest of the options tell RT to install additional dependencies for optional features.&lt;br /&gt;
&lt;br /&gt;
Make sure you have &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt;ed into the RT source directory, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;./configure --with-db-type=TYPE --prefix=/opt/rt5 --with-attachment-store=disk --enable-externalauth --enable-gd --enable-graphviz --enable-gpg --enable-smime&amp;lt;/pre&amp;gt;&lt;br /&gt;
For more background, [https://docs.bestpractical.com/rt/latest/configure.html refer to the RT configure options documentation].&lt;br /&gt;
&lt;br /&gt;
=== Install RT and its Perl dependencies ===&lt;br /&gt;
&lt;br /&gt;
This command will download, build, and install all of the Perl modules necessary to run RT with the configuration you set above. Here’s what the different parts of the command are doing:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;make dirs&amp;lt;/code&amp;gt; sets up RT&#039;s directory structure. We do this first to install dependencies under it.&lt;br /&gt;
* &amp;lt;code&amp;gt;make fixdeps&amp;lt;/code&amp;gt; actually installs those dependencies.&lt;br /&gt;
* &amp;lt;code&amp;gt;RT_FIX_DEPS_CMD=&#039;cpanm …&#039;&amp;lt;/code&amp;gt; tells RT to use cpanminus to install dependencies (instead of the older, default &amp;lt;code&amp;gt;cpan&amp;lt;/code&amp;gt; command), and to install them where RT will automatically load them.&lt;br /&gt;
* &amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt; installs all of RT’s files under &amp;lt;code&amp;gt;/opt/rt5&amp;lt;/code&amp;gt; (or the prefix directory you set in the previous step). It will only run if &amp;lt;code&amp;gt;fixdeps&amp;lt;/code&amp;gt; succeeds. Setting &amp;lt;code&amp;gt;PERL5LIB&amp;lt;/code&amp;gt; tells it where you installed those dependencies.&lt;br /&gt;
&lt;br /&gt;
Make sure you have &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt;ed into the RT source directory, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo make dirs&lt;br /&gt;
sudo ln -s . /opt/rt5/local/lib/perl5&lt;br /&gt;
make fixdeps RT_FIX_DEPS_CMD=&#039;cpanm --sudo --quiet --local-lib=/opt/rt5/local&#039;&lt;br /&gt;
sudo make install PERL5LIB=/opt/rt5/local/lib&amp;lt;/pre&amp;gt;&lt;br /&gt;
If it works, the command will eventually output a message that says “Congratulations. RT is now installed.” followed by instructions about configuring and setting up the database. We’ll do that next.&lt;br /&gt;
&lt;br /&gt;
=== Configure RT ===&lt;br /&gt;
&lt;br /&gt;
[https://docs.bestpractical.com/rt/latest/RT_Config.html RT has many configuration options.] You can put configuration options in the file &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/code&amp;gt;, or in individual files under &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.d/&amp;lt;/code&amp;gt;. Use an editor to save all the text below to &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/code&amp;gt; (you can just overwrite the existing file, or add this to the bottom of what’s there) and then fill in settings for your site everywhere the text &amp;lt;code&amp;gt;EDIT WITH&amp;lt;/code&amp;gt; appears.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Single-quote all values EXCEPT the special value `undef`&lt;br /&gt;
# that turns off a setting.&lt;br /&gt;
&lt;br /&gt;
# rtname appears in ticket email subjects. It needs to be globally unique,&lt;br /&gt;
# so use your organization&#039;s domain name.&lt;br /&gt;
Set($rtname, &#039;EDIT WITH yourdomain.example.com&#039;);&lt;br /&gt;
# Organization is used in the database for ticket links, etc. It also needs to&lt;br /&gt;
# be globally unique, so use your organization&#039;s domain name.&lt;br /&gt;
Set($Organization, &#039;EDIT WITH yourdomain.example.com&#039;);&lt;br /&gt;
# WebDomain is domain name of the RT web server. RT uses it to construct links&lt;br /&gt;
# and defend against CSRFs.&lt;br /&gt;
Set($WebDomain, &#039;EDIT WITH rt.yourdomain.example.com&#039;);&lt;br /&gt;
# WebPort is the port where the RT web server runs. Edit the number below if&lt;br /&gt;
# you&#039;re not using the standard HTTPS port.&lt;br /&gt;
Set($WebPort, &#039;443&#039;);&lt;br /&gt;
&lt;br /&gt;
# DatabaseUser is the name of the database account RT uses to read and store&lt;br /&gt;
# data. &#039;rt_user&#039; is the default but you can change it if you like.&lt;br /&gt;
# DO NOT use the &#039;rt_admin&#039; superuser created in the instructions above.&lt;br /&gt;
Set($DatabaseUser, &#039;rt_user&#039;);&lt;br /&gt;
# DatabasePassword is the password for DatabaseUser.&lt;br /&gt;
Set($DatabasePassword, &#039;EDIT WITH SomePassphraseHere&#039;);&lt;br /&gt;
# DatabaseHost is the hostname of the database server RT should use.&lt;br /&gt;
# Change &#039;localhost&#039; if it lives on a different server.&lt;br /&gt;
Set($DatabaseHost, &#039;localhost&#039;);&lt;br /&gt;
# DatabasePort is the port number of the database server RT should use.&lt;br /&gt;
# `undef` means the default for that database. Change it if you&#039;re not&lt;br /&gt;
# using the standard port.&lt;br /&gt;
Set($DatabasePort, undef);&lt;br /&gt;
# DatabaseName is the name of RT&#039;s database hosted on DatabaseHost.&lt;br /&gt;
# &#039;rt5&#039; is the default but you can change it if you like.&lt;br /&gt;
Set($DatabaseName, &#039;rt5&#039;);&lt;br /&gt;
# DatabaseAdmin is the name of the user in the database used to perform&lt;br /&gt;
# major administrative tasks. Change &#039;rt_admin&#039; if you&#039;re using a user&lt;br /&gt;
# besides the one created in this guide.&lt;br /&gt;
Set($DatabaseAdmin, &#039;rt_admin&#039;);&lt;br /&gt;
&lt;br /&gt;
# RT can log to syslog, stderr, and/or a dedicated file.&lt;br /&gt;
# Log settings are used both by the primary server and by command line&lt;br /&gt;
# tools like rt-crontool, rt-ldapimport, etc.&lt;br /&gt;
# You set all of RT&#039;s $LogTo* paramaters to a standard log level: &#039;debug&#039;,&lt;br /&gt;
# &#039;info&#039;, &#039;notice&#039;, &#039;warning&#039;, &#039;error&#039;, &#039;critical&#039;, &#039;alert&#039;, or &#039;emergency&#039;.&lt;br /&gt;
# For a modern install, I recommend logging primarily to syslog, so it goes&lt;br /&gt;
# to journald where it&#039;s easy to query and automatically gets rotated.&lt;br /&gt;
Set($LogToSyslog, &#039;info&#039;);&lt;br /&gt;
&lt;br /&gt;
# When the RT server logs to stderr, that usually goes to your web server&#039;s&lt;br /&gt;
# error log. Command line tools log to their own stderr. Setting this to&lt;br /&gt;
# &#039;warning&#039; or &#039;error&#039; helps ensure you get notified if RT&#039;s cron jobs&lt;br /&gt;
# encounter problems.&lt;br /&gt;
Set($LogToSTDERR, &#039;warning&#039;);&lt;br /&gt;
&lt;br /&gt;
# Turn off optional features that require additional configuration.&lt;br /&gt;
# If you want to use these, refer to the RT_Config documentation for&lt;br /&gt;
# instructions on how to set them up.&lt;br /&gt;
Set(%GnuPG, &#039;Enable&#039; =&amp;gt; &#039;0&#039;);&lt;br /&gt;
Set(%SMIME, &#039;Enable&#039; =&amp;gt; &#039;0&#039;);&lt;br /&gt;
&lt;br /&gt;
# Perl expects to find this 1 at the end of the file.&lt;br /&gt;
1;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;RT_SiteConfig.pm&amp;lt;/code&amp;gt; is actually Perl code. RT runs the code directly to load the configuration. Any time you finish editing it, you can check that you didn’t make any syntax errors by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;perl -c /opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Set up RT’s database ===&lt;br /&gt;
&lt;br /&gt;
RT includes a tool to help you set up its database. By default, it connects to the database as an administrator to create the database and user that you configured in the previous step.&lt;br /&gt;
&lt;br /&gt;
(The instructions from &amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt; and RT’s README file tell you to run &amp;lt;code&amp;gt;make initialize-database&amp;lt;/code&amp;gt;. That just runs &amp;lt;code&amp;gt;rt-setup-database&amp;lt;/code&amp;gt; for you. Running the tool directly makes it easier to pass the options you need.)&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;--action=init&amp;lt;/code&amp;gt; tells the tool to create the user, the database, the tables inside it, and insert core data RT needs to function.&lt;br /&gt;
* &#039;&#039;&#039;If&#039;&#039;&#039; you are using an existing database server and the database adminstrator has already created the user account and database for RT, then you can add the &amp;lt;code&amp;gt;--skip-create&amp;lt;/code&amp;gt; option.&lt;br /&gt;
* &#039;&#039;&#039;If&#039;&#039;&#039; you have a less common database setup, this tool has additional options to give you finer-grained control over what steps are run and how. Refer to [https://docs.bestpractical.com/rt/latest/rt-setup-database.html the full rt-setup-database documentation] to learn more about those.&lt;br /&gt;
* The command reads files from RT’s &amp;lt;code&amp;gt;etc/&amp;lt;/code&amp;gt; directory by default, so the easiest way to run it is to &amp;lt;code&amp;gt;cd /opt/rt5&amp;lt;/code&amp;gt; first, and then it will find the necessary files automatically.&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /opt/rt5&lt;br /&gt;
sudo sbin/rt-setup-database --action=init&amp;lt;/pre&amp;gt;&lt;br /&gt;
Enter the password for your database administrator account when prompted.&lt;br /&gt;
&lt;br /&gt;
=== Set up fulltext indexing ===&lt;br /&gt;
&lt;br /&gt;
Fulltext indexing speeds up searches for ticket content, which makes RT a lot nicer to use.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;--noask&amp;lt;/code&amp;gt; uses the default names for the index, which will be fine for a new install and simplifies the setup.&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo /opt/rt5/sbin/rt-setup-fulltext-index --noask&amp;lt;/pre&amp;gt;&lt;br /&gt;
Enter the password for your database administrator account when prompted. The end of the process will output some RT configuration that looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;### EXAMPLE OUTPUT ONLY - Don&#039;t use this directly!&lt;br /&gt;
Set( %FullTextSearch,&lt;br /&gt;
    Enable     =&amp;gt; 1,&lt;br /&gt;
    Indexed    =&amp;gt; 1,&lt;br /&gt;
    # Additional output from rt-setup-fulltext-index should be here.&lt;br /&gt;
    # The configuration varies by database type.&lt;br /&gt;
);&amp;lt;/pre&amp;gt;&lt;br /&gt;
Copy the output generated when you run &amp;lt;code&amp;gt;rt-setup-fulltext-index&amp;lt;/code&amp;gt; and save it to the file &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.d/FulltextIndex.pm&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Set permissions ===&lt;br /&gt;
&lt;br /&gt;
All of RT’s configuration files should be readable by the user that runs the web server, and no other users, in order to protect sensitive information like the database password. RT provides a command to set permissions appropriately according to your distribution and configuration. &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt; to the directory where you extracted the RT source code, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd rt-5.0.2&lt;br /&gt;
sudo make fixperms&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Verify the installation ===&lt;br /&gt;
&lt;br /&gt;
If everything has gone well, then you should be able to set a password for RT’s &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; user. You’ll use this later to log in to the web interface and continue setting up your system. Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo /opt/rt5/sbin/rt-passwd root&amp;lt;/pre&amp;gt;&lt;br /&gt;
Set the password when prompted. Record this; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s web server ==&lt;br /&gt;
&lt;br /&gt;
=== Configure Apache modules ===&lt;br /&gt;
&lt;br /&gt;
You will need to have the following modules enabled in Apache to run RT. You should already have these installed if you followed the instructions above.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;alias&amp;lt;/code&amp;gt; (required to map URLs to RT)&lt;br /&gt;
* &amp;lt;code&amp;gt;fcgid&amp;lt;/code&amp;gt; (required for Apache to talk to RT)&lt;br /&gt;
* &amp;lt;code&amp;gt;mpm_prefork&amp;lt;/code&amp;gt; (Apache requires you to select an MPM. RT is designed to work with the prefork module.)&lt;br /&gt;
* &amp;lt;code&amp;gt;ssl&amp;lt;/code&amp;gt; (required to serve HTTPS; optional otherwise)&lt;br /&gt;
&lt;br /&gt;
Enable them following these instructions:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo a2dismod mpm_event&lt;br /&gt;
sudo a2enmod fcgid&lt;br /&gt;
sudo a2enmod mpm_prefork&lt;br /&gt;
sudo a2enmod ssl&amp;lt;/pre&amp;gt;&lt;br /&gt;
| &amp;lt;pre&amp;gt;echo LoadModule mpm_prefork_module modules/mod_mpm_prefork.so | sudo tee /etc/httpd/conf.modules.d/00-mpm.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Disable default VirtualHosts (optional) ===&lt;br /&gt;
&lt;br /&gt;
If this web server is dedicated to RT, then you should disable the VirtualHosts that are included with the stock configuration. Run:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo a2dissite 000-default&lt;br /&gt;
sudo a2dissite default-ssl&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo sed -i~ &#039;/^&amp;lt;VirtualHost\b/ , /^&amp;lt;\/VirtualHost\b/ d&#039; /etc/httpd/conf.d/ssl.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Configure an Apache VirtualHost ===&lt;br /&gt;
&lt;br /&gt;
Create a file at the following location. You can change the &amp;lt;code&amp;gt;RT&amp;lt;/code&amp;gt; part of the filename if you like, but the file must exist in this directory and have a &amp;lt;code&amp;gt;.conf&amp;lt;/code&amp;gt; suffix.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;/etc/apache2/sites-available/RT.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
Then after you create the file, run: &amp;lt;code&amp;gt;sudo a2ensite RT&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;/etc/httpd/conf.d/zz_RT.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Use an editor to save all the text below to the new &amp;lt;code&amp;gt;RT.conf&amp;lt;/code&amp;gt; and then fill in settings for your site everywhere the text &amp;lt;code&amp;gt;EDIT WITH&amp;lt;/code&amp;gt; appears.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### Primary RT VirtualHost&lt;br /&gt;
# You can change both the bind address and/or the port here as required.&lt;br /&gt;
# This default will listen for HTTPS connections on all interfaces.&lt;br /&gt;
&amp;lt;VirtualHost *:443&amp;gt;&lt;br /&gt;
  # EDIT HERE with the domain name of the web server.&lt;br /&gt;
  ServerName rt.yourdomain.example.com&lt;br /&gt;
  &amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
    SSLEngine on&lt;br /&gt;
    # These specify the paths to the SSL certificate and private key Apache&lt;br /&gt;
    # should use. These example paths are common for Let&#039;s Encrypt. If you&lt;br /&gt;
    # don&#039;t use Let&#039;s Encrypt, the standard location for these files is under&lt;br /&gt;
    # (Debian/Ubuntu) /etc/ssl&lt;br /&gt;
    # (Red Hat/Fedora/CentOS) /etc/pki/tls&lt;br /&gt;
    # EDIT HERE with the appropriate paths for your server&lt;br /&gt;
    SSLCertificateFile /etc/letsencrypt/live/example.com/fullchain.pem&lt;br /&gt;
    SSLCertificateKeyFile /etc/letsencrypt/live/example.com/privkey.pem&lt;br /&gt;
  &amp;lt;/IfModule&amp;gt;&lt;br /&gt;
  &amp;lt;Location /&amp;gt;&lt;br /&gt;
    Require all granted&lt;br /&gt;
    Options +ExecCGI&lt;br /&gt;
    AddHandler fcgid-script fcgi&lt;br /&gt;
  &amp;lt;/Location&amp;gt;&lt;br /&gt;
  AddDefaultCharset UTF-8&lt;br /&gt;
  DocumentRoot /opt/rt5/share/html&lt;br /&gt;
  ScriptAlias / /opt/rt5/sbin/rt-server.fcgi/&lt;br /&gt;
  # The default mod_fcgid timeout is 40 seconds.&lt;br /&gt;
  # We increase it here to allow for large ticket searches, etc.&lt;br /&gt;
  FcgidIOTimeout 200   # mod_fcgid only allows 128KiB requests by default. This is too small for users&lt;br /&gt;
  # to upload files to RT. You can ultimately choose any setting you&#039;re&lt;br /&gt;
  # comfortable with; 70MiB here should allow most requests without being too&lt;br /&gt;
  # open.&lt;br /&gt;
  FcgidMaxRequestLen 73400320&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
### End primary RT VirtualHost&lt;br /&gt;
&lt;br /&gt;
### Optional HTTPS Redirect VirtualHost&lt;br /&gt;
# Most modern servers support HTTPS and want all web traffic to go through it.&lt;br /&gt;
# This VirtualHost redirects normal HTTP traffic to HTTPS.&lt;br /&gt;
# You can delete this whole section if you don&#039;t want or need this.&lt;br /&gt;
&amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
  # You can change both the bind address and/or the port here as required.&lt;br /&gt;
  # This default will listen for HTTP connections on all interfaces.&lt;br /&gt;
  &amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
    SSLEngine off&lt;br /&gt;
    # EDIT HERE both lines below with the domain name of your web server.&lt;br /&gt;
    ServerName rt.yourdomain.example.com&lt;br /&gt;
    Redirect permanent / https://rt.yourdomain.example.com/&lt;br /&gt;
  &amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/IfModule&amp;gt;&lt;br /&gt;
### End optional HTTPS Redirect VirtualHost&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
After you’ve edited the file, load the configuration with:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo systemctl reload apache2&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo systemctl reload httpd&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If this command reports an error, double-check the configuration file for typos, especially in option names, file paths, and the&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;amp;lt;Section&amp;amp;gt;&amp;lt;/code&amp;gt; pairs. Edit again and reload the configuration until it succeeds without output.&lt;br /&gt;
&lt;br /&gt;
=== Verify the web interface ===&lt;br /&gt;
&lt;br /&gt;
You should be able to visit your web server in your browser, and be presented with RT’s login screen. You should be able to log in with username &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; and the password you set previously.&lt;br /&gt;
&lt;br /&gt;
If you run into trouble, the first place to look for more information is by reading Apache’s error log:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo less /var/log/apache2/error.log&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo less /var/log/httpd/error.log&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s mail server ==&lt;br /&gt;
&lt;br /&gt;
RT both can both send and receive ticket updates via email. Unfortunately, there are too many variables to document a useful setup process here: getting this working usually requires creating DNS records, and coordinating with existing mail servers, which will be the main constraint on your setup. Instead this guide provides a brief overview of how the integration works, and where the connection points are that you likely need to work on.&lt;br /&gt;
&lt;br /&gt;
=== Sending Mail ===&lt;br /&gt;
&lt;br /&gt;
RT only knows how to send mail by passing it off to another program on the system. It cannot connect or authenticate directly to external mail servers. In the default configuration, RT runs the standard &amp;lt;code&amp;gt;sendmail&amp;lt;/code&amp;gt; command. There are [https://docs.bestpractical.com/rt/latest/RT_Config.html#Outgoing-mail configuration options to send mail through different commands] if you need.&lt;br /&gt;
&lt;br /&gt;
The most common setup is to install and configure a proper Mail Transfer Agent (MTA) like Postfix or Exim, and then configure it to send mail to the wider Internet as you need. This works well because the MTAs are robust and well-tested; they have flexible configuration to let you send mail out by relaying to other mail servers you specify with optional authentication; and most distributions install one by default anyway. The only hard part is configuring the MTA to send mail following your site’s policies.&lt;br /&gt;
&lt;br /&gt;
Other software is available that provides a slimmer version of the &amp;lt;code&amp;gt;sendmail&amp;lt;/code&amp;gt; command that connects to an external mail server for you, like ssmtp. These programs are usually easier to configure than an MTA, but they often lose email permanently if they can’t connect to the external server at the time it’s sent. (MTAs keep email queued locally until they successfully deliver it to another server.)&lt;br /&gt;
&lt;br /&gt;
=== Receiving email ===&lt;br /&gt;
&lt;br /&gt;
RT installs a command called &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; that receives an email on standard input and posts it to RT’s REST web interface, where it gets saved in the database and added to a ticket. You need to arrange for a way to send incoming email to this command.&lt;br /&gt;
&lt;br /&gt;
The most common setup is to have an MTA on the same box as RT receive email directly, and then set up mail aliases that call this command when mail comes in. Example &amp;lt;code&amp;gt;/etc/aliases&amp;lt;/code&amp;gt; entries look like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rt: &amp;quot;|/opt/rt5/bin/rt-mailgate --queue general --action correspond --url https://rt.yourdomain.example.com/&amp;quot;&lt;br /&gt;
rt-comment: &amp;quot;|/opt/rt5/bin/rt-mailgate --queue general --action comment --url https://rt.yourdomain.example.com/&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
This works well because, again, you’re probably running an MTA anyway; and the MTA can hold and queue mail if it comes in while RT is down for any reason, giving you a buffer against downtime.&lt;br /&gt;
&lt;br /&gt;
Another common option is to periodically run a tool that fetches mail using a protocol like IMAP, like fetchmail or getmail, and passes it on to &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt;. This is less common because it requires setting up another tool to run, and securely storing another set of mail server credentials. But it is useful when local policy prevents the RT server from receiving email directly.&lt;br /&gt;
&lt;br /&gt;
This is much less common, but it might help to know that &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; doesn’t have to run on the same system as RT itself. It just needs to be able to connect to RT’s web interface. If you don’t have any other options, you can install the RT software on a different system that receives email, and configure &#039;&#039;that&#039;&#039; system to run &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; and pass it on to the RT server. To do that, just repeat the installation instructions above, skipping the steps about installing the database and web server.&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s background jobs ==&lt;br /&gt;
&lt;br /&gt;
Create a file &amp;lt;code&amp;gt;/etc/cron.d/rt&amp;lt;/code&amp;gt; with the following content. You may edit all of the time fields as you see fit. Refer to the crontab(5) man page for details about their definitions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Update the fulltext index with new ticket data&lt;br /&gt;
*/3 *   *   *   *   root    /opt/rt5/sbin/rt-fulltext-indexer&lt;br /&gt;
# Email out dashboards that users have subscribed to&lt;br /&gt;
0   *   *   *   *   root    /opt/rt5/sbin/rt-email-dashboards&lt;br /&gt;
# Clean old sessions from the database&lt;br /&gt;
10  3   *   *   *   root    /opt/rt5/sbin/rt-clean-sessions --older 8d&lt;br /&gt;
# Email out weekly digests for users who have requested it&lt;br /&gt;
50  4   *   *   Mon root    /opt/rt5/sbin/rt-email-digest -m weekly&lt;br /&gt;
# Email out daily digests for users who have requested it&lt;br /&gt;
50  5   *   *   *   root    /opt/rt5/sbin/rt-email-digest -m daily&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
You can run all these jobs as the same user that runs your web server, rather than root. Run:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo sed -i &#039;s/\broot\b/www-data/&#039; /etc/cron.d/rt&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo sed -i &#039;s/\broot\b/apache/&#039; /etc/cron.d/rt&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Set up RT ==&lt;br /&gt;
&lt;br /&gt;
If you’ve gotten this far, congratulations, your RT install is really done now. You can start setting up RT with users, groups, queues, and business logic. [[Main Page|Head back to the main page]] to start exploring those topics.&lt;/div&gt;</summary>
		<author><name>Brett</name></author>
	</entry>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=ManualInstallation&amp;diff=27054</id>
		<title>ManualInstallation</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=ManualInstallation&amp;diff=27054"/>
		<updated>2022-01-13T22:12:29Z</updated>

		<summary type="html">&lt;p&gt;Brett: fix markup typo&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Prev: [[ManualRequirements]] — Up: [[UserManual]] — Next: [[ManualApacheConfig]]&lt;br /&gt;
&lt;br /&gt;
This guide walks you through installing RT from source on a modern, popular Linux distro. Specifically, that means a distribution based on Debian or Red Hat that’s been released since around 2020.&lt;br /&gt;
&lt;br /&gt;
This guide assumes:&lt;br /&gt;
&lt;br /&gt;
* You can install packages generally available in Debian/Ubuntu or Red Hat/Fedora/CentOS.&lt;br /&gt;
* You want to install RT, and all of its Perl dependencies, from source to get the latest versions. (This is a trade-off. It means the boundaries of your install will be very clear, but you won’t get security updates for RT or Perl modules from your distribution.)&lt;br /&gt;
* You are willing to install a couple of extra tools to manage the RT installation similarly to how you would in other packaging systems (like PyPI, npm, etc.).&lt;br /&gt;
* You are willing to do a relatively maximal install of RT, enabling all the options during installation and then setting what you need in the configuration. (You could save a little space and time by being pickier about your options, but then that complicates the guide and makes it harder to turn those options on later if you want.)&lt;br /&gt;
* You are using a regular user account on the Linux system that can get superuser privileges with sudo.&lt;br /&gt;
&lt;br /&gt;
== Install the base dependencies ==&lt;br /&gt;
&lt;br /&gt;
These are required by RT, either to run or to install the dependencies.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install autoconf build-essential cpanminus curl libexpat-dev libgd-dev libssl-dev libz-dev gnupg graphviz lynx openssl perl&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf config-manager --set-enabled powertools&lt;br /&gt;
sudo dnf install patch tar which gcc gcc-c++ perl-core perl-App-cpanminus graphviz expat-devel gd-devel lynx openssl openssl-devel&lt;br /&gt;
sudo setenforce 0&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
(Turning off SELinux enforcement is required on Red Hat-based distributions because, as of October 2021, nobody has written a policy for RT.)&lt;br /&gt;
&lt;br /&gt;
== Install a database ==&lt;br /&gt;
&lt;br /&gt;
You need access to a database server. It can be remote, or you can install a database server alongside RT. RT supports a few different databases, but the best supported options are PostgreSQL and MariaDB.&lt;br /&gt;
&lt;br /&gt;
=== Installing and configuring the PostgreSQL server ===&lt;br /&gt;
&lt;br /&gt;
If you want to install a fresh PostgreSQL database server alongside RT:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install postgresql&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install postgresql-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In order to set up RT’s database, you will need a PostgreSQL superuser account that can be authenticated with a password. If you don’t have that, you can create it by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo createuser -sP rt_admin&amp;lt;/pre&amp;gt;&lt;br /&gt;
Set the password when prompted. Record this; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
=== Enable password authentication in PostgreSQL ===&lt;br /&gt;
&lt;br /&gt;
You need to consider this step whether you install the database locally, or use an existing one already running. RT supports connecting to PostgreSQL a few different ways, but authenticating with a username and password is simplest, and this guide is written based on that. Not all PostgreSQL installations allow this authentication method by default. You need to review your &amp;lt;code&amp;gt;pg_hba.conf&amp;lt;/code&amp;gt; file located at:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;/etc/postgresql/VERSION/main/pg_hba.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;/var/lib/pgsql/VERSION/data/pg_hba.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Replace &amp;lt;code&amp;gt;VERSION&amp;lt;/code&amp;gt; with the version of your PostgreSQL database. Add these two lines &#039;&#039;&#039;above&#039;&#039;&#039; any other lines that start with &amp;lt;code&amp;gt;host&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;host  rt5  rt_user   all  md5&lt;br /&gt;
host  rt5  rt_admin  all  md5&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This configuration will let &amp;lt;code&amp;gt;rt_user&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;rt_admin&amp;lt;/code&amp;gt; authorize themselves for the &amp;lt;code&amp;gt;rt5&amp;lt;/code&amp;gt; database using an &amp;lt;code&amp;gt;md5&amp;lt;/code&amp;gt; crypted password over a network connection (possibly using the localhost loopback network). You might be able to further restrict some of these fields for improved security, but doing so is outside the scope of this install guide. Refer to [https://www.postgresql.org/docs/current/auth-pg-hba-conf.html the pg_hba.conf documentation] for more details.&lt;br /&gt;
&lt;br /&gt;
Save your changes and reload the database:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo systemctl reload postgresql&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Installing the PostgreSQL client libraries ===&lt;br /&gt;
&lt;br /&gt;
These are required for RT to be able to talk to any PostgreSQL server.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install libpq-dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install postgresql-devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Once this is done you can skip ahead to installing a web server.&lt;br /&gt;
&lt;br /&gt;
=== Installing and configuring the MariaDB server ===&lt;br /&gt;
&lt;br /&gt;
If you want to install a fresh MariaDB database server alongside RT:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install mariadb-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install mariadb-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In order to set up RT’s database, you will need a MySQL superuser account. To stay consistent with PostgreSQL, I suggest setting a password for it. You can do that by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo mysql&lt;br /&gt;
mysql# GRANT ALL PRIVELEGES WITH GRANT OPTION ON rt5 TO rt_admin@localhost IDENTIFIED BY &#039;YourPassphraseHere&#039;;&amp;lt;/pre&amp;gt;&lt;br /&gt;
Record your passphrase; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
=== Adjust MariaDB’s max_allowed_packet setting ===&lt;br /&gt;
&lt;br /&gt;
You need to consider this step whether you install the database locally, or use an existing one already running. [https://mariadb.com/kb/en/server-system-variables/#max_allowed_packet MariaDB’s &amp;lt;code&amp;gt;max_allowed_packet&amp;lt;/code&amp;gt; setting] functionally limits the size of attachments in RT. The default is 16MiB, which is too small for most installations. You can ultimately choose any setting you’re comfortable with; 64MiB here should allow most requests without being too open.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;echo -e &#039;[client-server]\nmax_allowed_packet=64M\n&#039; | sudo tee /etc/mysql/conf.d/max_allowed_packet.cnf&lt;br /&gt;
sudo systemctl reload mariadb&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;echo -e &#039;[client-server]\nmax_allowed_packet=64M\n&#039; | sudo tee /etc/my.cnf.d/max_allowed_packet.cnf&lt;br /&gt;
sudo systemctl reload mariadb&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Installing the MariaDB client libraries ===&lt;br /&gt;
&lt;br /&gt;
These are required for RT to be able to talk to any MariaDB server.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install libmariadb-dev libmariadb-dev-compat&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install mariadb-devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Install a web server with FastCGI ==&lt;br /&gt;
&lt;br /&gt;
FastCGI is the best way to host RT’s web interface today. Installing the web server before RT makes the installation process simpler, because RT will be able to automatically some details about your web server like what user it runs as.&lt;br /&gt;
&lt;br /&gt;
=== Installing Apache ===&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install apache2 libapache2-mod-fcgid&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install httpd mod_fcgid mod_ssl&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ### Installing nginx --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Install RT ==&lt;br /&gt;
&lt;br /&gt;
=== Get and unpack the RT source code ===&lt;br /&gt;
&lt;br /&gt;
Download the latest source code using the link on the [https://bestpractical.com/download-page RT download page], extract it using &amp;lt;code&amp;gt;tar -xf&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt; into the source code directory to run the rest of the commands in this section. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;curl -O https://download.bestpractical.com/pub/rt/release/rt-5.0.2.tar.gz&lt;br /&gt;
tar -xf rt-5.0.2.tar.gz&lt;br /&gt;
cd rt-5.0.2&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Pre-configure RT ===&lt;br /&gt;
&lt;br /&gt;
This command will detect some information about your system in order to install RT properly, and decide which set of dependencies to install. Here’s what the different parts of our command are doing:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;--with-db-type=TYPE&amp;lt;/code&amp;gt; - Replace &amp;lt;code&amp;gt;TYPE&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;Pg&amp;lt;/code&amp;gt; for PostgreSQL, or &amp;lt;code&amp;gt;mysql&amp;lt;/code&amp;gt; for MariaDB.&lt;br /&gt;
* &amp;lt;code&amp;gt;--prefix=/opt/rt5&amp;lt;/code&amp;gt; sets the directory where RT will install all of its libraries, tools, and supporting files. You can choose another path if you like.&lt;br /&gt;
* The rest of the options tell RT to install additional dependencies for optional features.&lt;br /&gt;
&lt;br /&gt;
Make sure you have &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt;ed into the RT source directory, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;./configure --with-db-type=TYPE --prefix=/opt/rt5 --with-attachment-store=disk --enable-externalauth --enable-gd --enable-graphviz --enable-gpg --enable-smime&amp;lt;/pre&amp;gt;&lt;br /&gt;
For more background, [https://docs.bestpractical.com/rt/latest/configure.html refer to the RT configure options documentation].&lt;br /&gt;
&lt;br /&gt;
=== Install RT and its Perl dependencies ===&lt;br /&gt;
&lt;br /&gt;
This command will download, build, and install all of the Perl modules necessary to run RT with the configuration you set above. Here’s what the different parts of the command are doing:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;make dirs&amp;lt;/code&amp;gt; sets up RT&#039;s directory structure. We do this first to install dependencies under it.&lt;br /&gt;
* &amp;lt;code&amp;gt;make fixdeps&amp;lt;/code&amp;gt; actually installs those dependencies.&lt;br /&gt;
* &amp;lt;code&amp;gt;RT_FIX_DEPS_CMD=&#039;cpanm …&#039;&amp;lt;/code&amp;gt; tells RT to use cpanminus to install dependencies (instead of the older, default &amp;lt;code&amp;gt;cpan&amp;lt;/code&amp;gt; command), and to install them where RT will automatically load them.&lt;br /&gt;
* &amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt; installs all of RT’s files under &amp;lt;code&amp;gt;/opt/rt5&amp;lt;/code&amp;gt; (or the prefix directory you set in the previous step). It will only run if &amp;lt;code&amp;gt;fixdeps&amp;lt;/code&amp;gt; succeeds. Setting &amp;lt;code&amp;gt;PERL5LIB&amp;lt;/code&amp;gt; tells it where you installed those dependencies.&lt;br /&gt;
&lt;br /&gt;
Make sure you have &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt;ed into the RT source directory, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo make dirs&lt;br /&gt;
sudo ln -s . /opt/rt5/local/lib/perl5&lt;br /&gt;
make fixdeps RT_FIX_DEPS_CMD=&#039;cpanm --sudo --quiet --local-lib=/opt/rt5/local&#039;&lt;br /&gt;
sudo make install PERL5LIB=/opt/rt5/local/lib&amp;lt;/pre&amp;gt;&lt;br /&gt;
If it works, the command will eventually output a message that says “Congratulations. RT is now installed.” followed by instructions about configuring and setting up the database. We’ll do that next.&lt;br /&gt;
&lt;br /&gt;
=== Configure RT ===&lt;br /&gt;
&lt;br /&gt;
[https://docs.bestpractical.com/rt/latest/RT_Config.html RT has many configuration options.] You can put configuration options in the file &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/code&amp;gt;, or in individual files under &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.d/&amp;lt;/code&amp;gt;. Use an editor to save all the text below to &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/code&amp;gt; (you can just overwrite the existing file, or add this to the bottom of what’s there) and then fill in settings for your site everywhere the text &amp;lt;code&amp;gt;EDIT WITH&amp;lt;/code&amp;gt; appears.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Single-quote all values EXCEPT the special value `undef`&lt;br /&gt;
# that turns off a setting.&lt;br /&gt;
&lt;br /&gt;
# rtname appears in ticket email subjects. It needs to be globally unique,&lt;br /&gt;
# so use your organization&#039;s domain name.&lt;br /&gt;
Set($rtname, &#039;EDIT WITH yourdomain.example.com&#039;);&lt;br /&gt;
# Organization is used in the database for ticket links, etc. It also needs to&lt;br /&gt;
# be globally unique, so use your organization&#039;s domain name.&lt;br /&gt;
Set($Organization, &#039;EDIT WITH yourdomain.example.com&#039;);&lt;br /&gt;
# WebDomain is domain name of the RT web server. RT uses it to construct links&lt;br /&gt;
# and defend against CSRFs.&lt;br /&gt;
Set($WebDomain, &#039;EDIT WITH rt.yourdomain.example.com&#039;);&lt;br /&gt;
# WebPort is the port where the RT web server runs. Edit the number below if&lt;br /&gt;
# you&#039;re not using the standard HTTPS port.&lt;br /&gt;
Set($WebPort, &#039;443&#039;);&lt;br /&gt;
&lt;br /&gt;
# DatabaseUser is the name of the database account RT uses to read and store&lt;br /&gt;
# data. &#039;rt_user&#039; is the default but you can change it if you like.&lt;br /&gt;
# DO NOT use the &#039;rt_admin&#039; superuser created in the instructions above.&lt;br /&gt;
Set($DatabaseUser, &#039;rt_user&#039;);&lt;br /&gt;
# DatabasePassword is the password for DatabaseUser.&lt;br /&gt;
Set($DatabasePassword, &#039;EDIT WITH SomePassphraseHere&#039;);&lt;br /&gt;
# DatabaseHost is the hostname of the database server RT should use.&lt;br /&gt;
# Change &#039;localhost&#039; if it lives on a different server.&lt;br /&gt;
Set($DatabaseHost, &#039;localhost&#039;);&lt;br /&gt;
# DatabasePort is the port number of the database server RT should use.&lt;br /&gt;
# `undef` means the default for that database. Change it if you&#039;re not&lt;br /&gt;
# using the standard port.&lt;br /&gt;
Set($DatabasePort, undef);&lt;br /&gt;
# DatabaseName is the name of RT&#039;s database hosted on DatabaseHost.&lt;br /&gt;
# &#039;rt5&#039; is the default but you can change it if you like.&lt;br /&gt;
Set($DatabaseName, &#039;rt5&#039;);&lt;br /&gt;
# DatabaseAdmin is the name of the user in the database used to perform&lt;br /&gt;
# major administrative tasks. Change &#039;rt_admin&#039; if you&#039;re using a user&lt;br /&gt;
# besides the one created in this guide.&lt;br /&gt;
Set($DatabaseAdmin, &#039;rt_admin&#039;);&lt;br /&gt;
&lt;br /&gt;
# RT can log to syslog, stderr, and/or a dedicated file.&lt;br /&gt;
# Log settings are used both by the primary server and by command line&lt;br /&gt;
# tools like rt-crontool, rt-ldapimport, etc.&lt;br /&gt;
# You set all of RT&#039;s $LogTo* paramaters to a standard log level: &#039;debug&#039;,&lt;br /&gt;
# &#039;info&#039;, &#039;notice&#039;, &#039;warning&#039;, &#039;error&#039;, &#039;critical&#039;, &#039;alert&#039;, or &#039;emergency&#039;.&lt;br /&gt;
# For a modern install, I recommend logging primarily to syslog, so it goes&lt;br /&gt;
# to journald where it&#039;s easy to query and automatically gets rotated.&lt;br /&gt;
Set($LogToSyslog, &#039;info&#039;);&lt;br /&gt;
&lt;br /&gt;
# When the RT server logs to stderr, that usually goes to your web server&#039;s&lt;br /&gt;
# error log. Command line tools log to their own stderr. Setting this to&lt;br /&gt;
# &#039;warning&#039; or &#039;error&#039; helps ensure you get notified if RT&#039;s cron jobs&lt;br /&gt;
# encounter problems.&lt;br /&gt;
Set($LogToSTDERR, &#039;warning&#039;);&lt;br /&gt;
&lt;br /&gt;
# Turn off optional features that require additional configuration.&lt;br /&gt;
# If you want to use these, refer to the RT_Config documentation for&lt;br /&gt;
# instructions on how to set them up.&lt;br /&gt;
Set(%GnuPG, &#039;Enable&#039; =&amp;gt; &#039;0&#039;);&lt;br /&gt;
Set(%SMIME, &#039;Enable&#039; =&amp;gt; &#039;0&#039;);&lt;br /&gt;
&lt;br /&gt;
# Perl expects to find this 1 at the end of the file.&lt;br /&gt;
1;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;RT_SiteConfig.pm&amp;lt;/code&amp;gt; is actually Perl code. RT runs the code directly to load the configuration. Any time you finish editing it, you can check that you didn’t make any syntax errors by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;perl -c /opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Set up RT’s database ===&lt;br /&gt;
&lt;br /&gt;
RT includes a tool to help you set up its database. By default, it connects to the database as an administrator to create the database and user that you configured in the previous step.&lt;br /&gt;
&lt;br /&gt;
(The instructions from &amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt; and RT’s README file tell you to run &amp;lt;code&amp;gt;make initialize-database&amp;lt;/code&amp;gt;. That just runs &amp;lt;code&amp;gt;rt-setup-database&amp;lt;/code&amp;gt; for you. Running the tool directly makes it easier to pass the options you need.)&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;--action=init&amp;lt;/code&amp;gt; tells the tool to create the user, the database, the tables inside it, and insert core data RT needs to function.&lt;br /&gt;
* &#039;&#039;&#039;If&#039;&#039;&#039; you are using an existing database server and the database adminstrator has already created the user account and database for RT, then you can add the &amp;lt;code&amp;gt;--skip-create&amp;lt;/code&amp;gt; option.&lt;br /&gt;
* &#039;&#039;&#039;If&#039;&#039;&#039; you have a less common database setup, this tool has additional options to give you finer-grained control over what steps are run and how. Refer to [https://docs.bestpractical.com/rt/latest/rt-setup-database.html the full rt-setup-database documentation] to learn more about those.&lt;br /&gt;
* The command reads files from RT’s &amp;lt;code&amp;gt;etc/&amp;lt;/code&amp;gt; directory by default, so the easiest way to run it is to &amp;lt;code&amp;gt;cd /opt/rt5&amp;lt;/code&amp;gt; first, and then it will find the necessary files automatically.&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /opt/rt5&lt;br /&gt;
sudo sbin/rt-setup-database --action=init&amp;lt;/pre&amp;gt;&lt;br /&gt;
Enter the password for your database administrator account when prompted.&lt;br /&gt;
&lt;br /&gt;
=== Set up fulltext indexing ===&lt;br /&gt;
&lt;br /&gt;
Fulltext indexing speeds up searches for ticket content, which makes RT a lot nicer to use.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;--noask&amp;lt;/code&amp;gt; uses the default names for the index, which will be fine for a new install and simplifies the setup.&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo /opt/rt5/sbin/rt-setup-fulltext-index --noask&amp;lt;/pre&amp;gt;&lt;br /&gt;
Enter the password for your database administrator account when prompted. The end of the process will output some RT configuration that looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;### EXAMPLE OUTPUT ONLY - Don&#039;t use this directly!&lt;br /&gt;
Set( %FullTextSearch,&lt;br /&gt;
    Enable     =&amp;gt; 1,&lt;br /&gt;
    Indexed    =&amp;gt; 1,&lt;br /&gt;
    # Additional output from rt-setup-fulltext-index should be here.&lt;br /&gt;
    # The configuration varies by database type.&lt;br /&gt;
);&amp;lt;/pre&amp;gt;&lt;br /&gt;
Copy the output generated when you run &amp;lt;code&amp;gt;rt-setup-fulltext-index&amp;lt;/code&amp;gt; and save it to the file &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.d/FulltextIndex.pm&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Set permissions ===&lt;br /&gt;
&lt;br /&gt;
All of RT’s configuration files should be readable by the user that runs the web server, and no other users, in order to protect sensitive information like the database password. RT provides a command to set permissions appropriately according to your distribution and configuration. &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt; to the directory where you extracted the RT source code, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd rt-5.0.2&lt;br /&gt;
sudo make fixperms&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Verify the installation ===&lt;br /&gt;
&lt;br /&gt;
If everything has gone well, then you should be able to set a password for RT’s &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; user. You’ll use this later to log in to the web interface and continue setting up your system. Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo /opt/rt5/sbin/rt-passwd root&amp;lt;/pre&amp;gt;&lt;br /&gt;
Set the password when prompted. Record this; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s web server ==&lt;br /&gt;
&lt;br /&gt;
=== Configure Apache modules ===&lt;br /&gt;
&lt;br /&gt;
You will need to have the following modules enabled in Apache to run RT. You should already have these installed if you followed the instructions above.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;alias&amp;lt;/code&amp;gt; (required to map URLs to RT)&lt;br /&gt;
* &amp;lt;code&amp;gt;fcgid&amp;lt;/code&amp;gt; (required for Apache to talk to RT)&lt;br /&gt;
* &amp;lt;code&amp;gt;mpm_prefork&amp;lt;/code&amp;gt; (Apache requires you to select an MPM. RT is designed to work with the prefork module.)&lt;br /&gt;
* &amp;lt;code&amp;gt;ssl&amp;lt;/code&amp;gt; (required to serve HTTPS; optional otherwise)&lt;br /&gt;
&lt;br /&gt;
Enable them following these instructions:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo a2dismod mpm_event&lt;br /&gt;
sudo a2enmod fcgid&lt;br /&gt;
sudo a2enmod mpm_prefork&lt;br /&gt;
sudo a2enmod ssl&amp;lt;/pre&amp;gt;&lt;br /&gt;
| &amp;lt;pre&amp;gt;echo LoadModule mpm_prefork_module modules/mod_mpm_prefork.so | sudo tee /etc/httpd/conf.modules.d/00-mpm.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Disable default VirtualHosts (optional) ===&lt;br /&gt;
&lt;br /&gt;
If this web server is dedicated to RT, then you should disable the VirtualHosts that are included with the stock configuration. Run:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo a2dissite 000-default&lt;br /&gt;
sudo a2dissite default-ssl&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo sed -i~ &#039;/^&amp;lt;VirtualHost\b/ , /^&amp;lt;\/VirtualHost\b/ d&#039; /etc/httpd/conf.d/ssl.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Configure an Apache VirtualHost ===&lt;br /&gt;
&lt;br /&gt;
Create a file at the following location. You can change the &amp;lt;code&amp;gt;RT&amp;lt;/code&amp;gt; part of the filename if you like, but the file must exist in this directory and have a &amp;lt;code&amp;gt;.conf&amp;lt;/code&amp;gt; suffix.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;/etc/apache2/sites-available/RT.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
Then after you create the file, run: &amp;lt;code&amp;gt;sudo a2ensite RT&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;/etc/httpd/conf.d/zz_RT.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Use an editor to save all the text below to the new &amp;lt;code&amp;gt;RT.conf&amp;lt;/code&amp;gt; and then fill in settings for your site everywhere the text &amp;lt;code&amp;gt;EDIT WITH&amp;lt;/code&amp;gt; appears.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### Primary RT VirtualHost&lt;br /&gt;
# You can change both the bind address and/or the port here as required.&lt;br /&gt;
# This default will listen for HTTPS connections on all interfaces.&lt;br /&gt;
&amp;lt;VirtualHost *:443&amp;gt;&lt;br /&gt;
  # EDIT HERE with the domain name of the web server.&lt;br /&gt;
  ServerName rt.yourdomain.example.com&lt;br /&gt;
  &amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
    SSLEngine on&lt;br /&gt;
    # These specify the paths to the SSL certificate and private key Apache&lt;br /&gt;
    # should use. These example paths are common for Let&#039;s Encrypt. If you&lt;br /&gt;
    # don&#039;t use Let&#039;s Encrypt, the standard location for these files is under&lt;br /&gt;
    # (Debian/Ubuntu) /etc/ssl&lt;br /&gt;
    # (Red Hat/Fedora/CentOS) /etc/pki/tls&lt;br /&gt;
    # EDIT HERE with the appropriate paths for your server&lt;br /&gt;
    SSLCertificateFile /etc/letsencrypt/live/example.com/fullchain.pem&lt;br /&gt;
    SSLCertificateKeyFile /etc/letsencrypt/live/example.com/privkey.pem&lt;br /&gt;
  &amp;lt;/IfModule&amp;gt;&lt;br /&gt;
  &amp;lt;Location /&amp;gt;&lt;br /&gt;
    Require all granted&lt;br /&gt;
    Options +ExecCGI&lt;br /&gt;
    AddHandler fcgid-script fcgi&lt;br /&gt;
  &amp;lt;/Location&amp;gt;&lt;br /&gt;
  AddDefaultCharset UTF-8&lt;br /&gt;
  DocumentRoot /opt/rt5/share/html&lt;br /&gt;
  ScriptAlias / /opt/rt5/sbin/rt-server.fcgi/&lt;br /&gt;
  # The default mod_fcgid timeout is 40 seconds.&lt;br /&gt;
  # We increase it here to allow for large ticket searches, etc.&lt;br /&gt;
  FcgidIOTimeout 200   # mod_fcgid only allows 128KiB requests by default. This is too small for users&lt;br /&gt;
  # to upload files to RT. You can ultimately choose any setting you&#039;re&lt;br /&gt;
  # comfortable with; 70MiB here should allow most requests without being too&lt;br /&gt;
  # open.&lt;br /&gt;
  FcgidMaxRequestLen 73400320&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
### End primary RT VirtualHost&lt;br /&gt;
&lt;br /&gt;
### Optional HTTPS Redirect VirtualHost&lt;br /&gt;
# Most modern servers support HTTPS and want all web traffic to go through it.&lt;br /&gt;
# This VirtualHost redirects normal HTTP traffic to HTTPS.&lt;br /&gt;
# You can delete this whole section if you don&#039;t want or need this.&lt;br /&gt;
&amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
  # You can change both the bind address and/or the port here as required.&lt;br /&gt;
  # This default will listen for HTTP connections on all interfaces.&lt;br /&gt;
  &amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
    SSLEngine off&lt;br /&gt;
    # EDIT HERE both lines below with the domain name of your web server.&lt;br /&gt;
    ServerName rt.yourdomain.example.com&lt;br /&gt;
    Redirect permanent / https://rt.yourdomain.example.com/&lt;br /&gt;
  &amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/IfModule&amp;gt;&lt;br /&gt;
### End optional HTTPS Redirect VirtualHost&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
After you’ve edited the file, load the configuration with:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo systemctl reload apache2&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo systemctl reload httpd&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If this command reports an error, double-check the configuration file for typos, especially in option names, file paths, and the&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;amp;lt;Section&amp;amp;gt;&amp;lt;/code&amp;gt; pairs. Edit again and reload the configuration until it succeeds without output.&lt;br /&gt;
&lt;br /&gt;
=== Verify the web interface ===&lt;br /&gt;
&lt;br /&gt;
You should be able to visit your web server in your browser, and be presented with RT’s login screen. You should be able to log in with username &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; and the password you set previously.&lt;br /&gt;
&lt;br /&gt;
If you run into trouble, the first place to look for more information is by reading Apache’s error log:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo less /var/log/apache2/error.log&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo less /var/log/httpd/error.log&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s mail server ==&lt;br /&gt;
&lt;br /&gt;
RT both can both send and receive ticket updates via email. Unfortunately, there are too many variables to document a useful setup process here: getting this working usually requires creating DNS records, and coordinating with existing mail servers, which will be the main constraint on your setup. Instead this guide provides a brief overview of how the integration works, and where the connection points are that you likely need to work on.&lt;br /&gt;
&lt;br /&gt;
=== Sending Mail ===&lt;br /&gt;
&lt;br /&gt;
RT only knows how to send mail by passing it off to another program on the system. It cannot connect or authenticate directly to external mail servers. In the default configuration, RT runs the standard &amp;lt;code&amp;gt;sendmail&amp;lt;/code&amp;gt; command. There are [https://docs.bestpractical.com/rt/latest/RT_Config.html#Outgoing-mail configuration options to send mail through different commands] if you need.&lt;br /&gt;
&lt;br /&gt;
The most common setup is to install and configure a proper Mail Transfer Agent (MTA) like Postfix or Exim, and then configure it to send mail to the wider Internet as you need. This works well because the MTAs are robust and well-tested; they have flexible configuration to let you send mail out by relaying to other mail servers you specify with optional authentication; and most distributions install one by default anyway. The only hard part is configuring the MTA to send mail following your site’s policies.&lt;br /&gt;
&lt;br /&gt;
Other software is available that provides a slimmer version of the &amp;lt;code&amp;gt;sendmail&amp;lt;/code&amp;gt; command that connects to an external mail server for you, like ssmtp. These programs are usually easier to configure than an MTA, but they often lose email permanently if they can’t connect to the external server at the time it’s sent. (MTAs keep email queued locally until they successfully deliver it to another server.)&lt;br /&gt;
&lt;br /&gt;
=== Receiving email ===&lt;br /&gt;
&lt;br /&gt;
RT installs a command called &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; that receives an email on standard input and posts it to RT’s REST web interface, where it gets saved in the database and added to a ticket. You need to arrange for a way to send incoming email to this command.&lt;br /&gt;
&lt;br /&gt;
The most common setup is to have an MTA on the same box as RT receive email directly, and then set up mail aliases that call this command when mail comes in. Example &amp;lt;code&amp;gt;/etc/aliases&amp;lt;/code&amp;gt; entries look like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rt: &amp;quot;|/opt/rt5/bin/rt-mailgate --queue general --action correspond --url https://rt.yourdomain.example.com/&amp;quot;&lt;br /&gt;
rt-comment: &amp;quot;|/opt/rt5/bin/rt-mailgate --queue general --action comment --url https://rt.yourdomain.example.com/&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
This works well because, again, you’re probably running an MTA anyway; and the MTA can hold and queue mail if it comes in while RT is down for any reason, giving you a buffer against downtime.&lt;br /&gt;
&lt;br /&gt;
Another common option is to periodically run a tool that fetches mail using a protocol like IMAP, like fetchmail or getmail, and passes it on to &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt;. This is less common because it requires setting up another tool to run, and securely storing another set of mail server credentials. But it is useful when local policy prevents the RT server from receiving email directly.&lt;br /&gt;
&lt;br /&gt;
This is much less common, but it might help to know that &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; doesn’t have to run on the same system as RT itself. It just needs to be able to connect to RT’s web interface. If you don’t have any other options, you can install the RT software on a different system that receives email, and configure &#039;&#039;that&#039;&#039; system to run &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; and pass it on to the RT server. To do that, just repeat the installation instructions above, skipping the steps about installing the database and web server.&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s background jobs ==&lt;br /&gt;
&lt;br /&gt;
Create a file &amp;lt;code&amp;gt;/etc/cron.d/rt&amp;lt;/code&amp;gt; with the following content. You may edit all of the time fields as you see fit. Refer to the crontab(5) man page for details about their definitions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Update the fulltext index with new ticket data&lt;br /&gt;
*/3 *   *   *   *   root    /opt/rt5/sbin/rt-fulltext-indexer&lt;br /&gt;
# Email out dashboards that users have subscribed to&lt;br /&gt;
0   *   *   *   *   root    /opt/rt5/sbin/rt-email-dashboards&lt;br /&gt;
# Clean old sessions from the database&lt;br /&gt;
10  3   *   *   *   root    /opt/rt5/sbin/rt-clean-sessions --older 8d&lt;br /&gt;
# Email out weekly digests for users who have requested it&lt;br /&gt;
50  4   *   *   Mon root    /opt/rt5/sbin/rt-email-digest -m weekly&lt;br /&gt;
# Email out daily digests for users who have requested it&lt;br /&gt;
50  5   *   *   *   root    /opt/rt5/sbin/rt-email-digest -m daily&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
You can run all these jobs as the same user that runs your web server, rather than root. Run:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo sed -i &#039;s/\broot\b/www-data/&#039; /etc/cron.d/rt&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo sed -i &#039;s/\broot\b/apache/&#039; /etc/cron.d/rt&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Set up RT ==&lt;br /&gt;
&lt;br /&gt;
If you’ve gotten this far, congratulations, your RT install is really done now. You can start setting up RT with users, groups, queues, and business logic. [[Main Page|Head back to the main page]] to start exploring those topics.&lt;/div&gt;</summary>
		<author><name>Brett</name></author>
	</entry>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=ManualInstallation&amp;diff=27053</id>
		<title>ManualInstallation</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=ManualInstallation&amp;diff=27053"/>
		<updated>2022-01-13T20:38:26Z</updated>

		<summary type="html">&lt;p&gt;Brett: set FcgidIOTimeout&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Prev: [[ManualRequirements]] — Up: [[UserManual]] — Next: [[ManualApacheConfig]]&lt;br /&gt;
&lt;br /&gt;
This guide walks you through installing RT from source on a modern, popular Linux distro. Specifically, that means a distribution based on Debian or Red Hat that’s been released since around 2020.&lt;br /&gt;
&lt;br /&gt;
This guide assumes:&lt;br /&gt;
&lt;br /&gt;
* You can install packages generally available in Debian/Ubuntu or Red Hat/Fedora/CentOS.&lt;br /&gt;
* You want to install RT, and all of its Perl dependencies, from source to get the latest versions. (This is a trade-off. It means the boundaries of your install will be very clear, but you won’t get security updates for RT or Perl modules from your distribution.)&lt;br /&gt;
* You are willing to install a couple of extra tools to manage the RT installation similarly to how you would in other packaging systems (like PyPI, npm, etc.).&lt;br /&gt;
* You are willing to do a relatively maximal install of RT, enabling all the options during installation and then setting what you need in the configuration. (You could save a little space and time by being pickier about your options, but then that complicates the guide and makes it harder to turn those options on later if you want.)&lt;br /&gt;
* You are using a regular user account on the Linux system that can get superuser privileges with sudo.&lt;br /&gt;
&lt;br /&gt;
== Install the base dependencies ==&lt;br /&gt;
&lt;br /&gt;
These are required by RT, either to run or to install the dependencies.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install autoconf build-essential cpanminus curl libexpat-dev libgd-dev libssl-dev libz-dev gnupg graphviz lynx openssl perl&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf config-manager --set-enabled powertools&lt;br /&gt;
sudo dnf install patch tar which gcc gcc-c++ perl-core perl-App-cpanminus graphviz expat-devel gd-devel lynx openssl openssl-devel&lt;br /&gt;
sudo setenforce 0&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
(Turning off SELinux enforcement is required on Red Hat-based distributions because, as of October 2021, nobody has written a policy for RT.)&lt;br /&gt;
&lt;br /&gt;
== Install a database ==&lt;br /&gt;
&lt;br /&gt;
You need access to a database server. It can be remote, or you can install a database server alongside RT. RT supports a few different databases, but the best supported options are PostgreSQL and MariaDB.&lt;br /&gt;
&lt;br /&gt;
=== Installing and configuring the PostgreSQL server ===&lt;br /&gt;
&lt;br /&gt;
If you want to install a fresh PostgreSQL database server alongside RT:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install postgresql&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install postgresql-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In order to set up RT’s database, you will need a PostgreSQL superuser account that can be authenticated with a password. If you don’t have that, you can create it by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo createuser -sP rt_admin&amp;lt;/pre&amp;gt;&lt;br /&gt;
Set the password when prompted. Record this; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
=== Enable password authentication in PostgreSQL ===&lt;br /&gt;
&lt;br /&gt;
You need to consider this step whether you install the database locally, or use an existing one already running. RT supports connecting to PostgreSQL a few different ways, but authenticating with a username and password is simplest, and this guide is written based on that. Not all PostgreSQL installations allow this authentication method by default. You need to review your &amp;lt;code&amp;gt;pg_hba.conf&amp;lt;/code&amp;gt; file located at:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;/etc/postgresql/VERSION/main/pg_hba.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;/var/lib/pgsql/VERSION/data/pg_hba.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Replace &amp;lt;code&amp;gt;VERSION&amp;lt;/code&amp;gt; with the version of your PostgreSQL database. Add these two lines &#039;&#039;&#039;above&#039;&#039;&#039; any other lines that start with &amp;lt;code&amp;gt;host&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;host  rt5  rt_user   all  md5&lt;br /&gt;
host  rt5  rt_admin  all  md5&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This configuration will let &amp;lt;code&amp;gt;rt_user&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;rt_admin&amp;lt;/code&amp;gt; authorize themselves for the &amp;lt;code&amp;gt;rt5&amp;lt;/code&amp;gt; database using an &amp;lt;code&amp;gt;md5&amp;lt;/code&amp;gt; crypted password over a network connection (possibly using the localhost loopback network). You might be able to further restrict some of these fields for improved security, but doing so is outside the scope of this install guide. Refer to [https://www.postgresql.org/docs/current/auth-pg-hba-conf.html the pg_hba.conf documentation] for more details.&lt;br /&gt;
&lt;br /&gt;
Save your changes and reload the database:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo systemctl reload postgresql&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Installing the PostgreSQL client libraries ===&lt;br /&gt;
&lt;br /&gt;
These are required for RT to be able to talk to any PostgreSQL server.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install libpq-dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install postgresql-devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Once this is done you can skip ahead to installing a web server.&lt;br /&gt;
&lt;br /&gt;
=== Installing and configuring the MariaDB server ===&lt;br /&gt;
&lt;br /&gt;
If you want to install a fresh MariaDB database server alongside RT:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install mariadb-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install mariadb-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In order to set up RT’s database, you will need a MySQL superuser account. To stay consistent with PostgreSQL, I suggest setting a password for it. You can do that by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo mysql&lt;br /&gt;
mysql# GRANT ALL PRIVELEGES WITH GRANT OPTION ON rt5 TO rt_admin@localhost IDENTIFIED BY &#039;YourPassphraseHere&#039;;&amp;lt;/pre&amp;gt;&lt;br /&gt;
Record your passphrase; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
=== Adjust MariaDB’s max_allowed_packet setting ===&lt;br /&gt;
&lt;br /&gt;
You need to consider this step whether you install the database locally, or use an existing one already running. [https://mariadb.com/kb/en/server-system-variables/#max_allowed_packet MariaDB’s &amp;lt;code&amp;gt;max_allowed_packet&amp;lt;/code&amp;gt; setting] functionally limits the size of attachments in RT. The default is 16MiB, which is too small for most installations. You can ultimately choose any setting you’re comfortable with; 64MiB here should allow most requests without being too open.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;echo -e &#039;[client-server]\nmax_allowed_packet=64M\n&#039; | sudo tee /etc/mysql/conf.d/max_allowed_packet.cnf&lt;br /&gt;
sudo systemctl reload mariadb&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;echo -e &#039;[client-server]\nmax_allowed_packet=64M\n&#039; | sudo tee /etc/my.cnf.d/max_allowed_packet.cnf&lt;br /&gt;
sudo systemctl reload mariadb&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Installing the MariaDB client libraries ===&lt;br /&gt;
&lt;br /&gt;
These are required for RT to be able to talk to any MariaDB server.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install libmariadb-dev libmariadb-dev-compat&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install mariadb-devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Install a web server with FastCGI ==&lt;br /&gt;
&lt;br /&gt;
FastCGI is the best way to host RT’s web interface today. Installing the web server before RT makes the installation process simpler, because RT will be able to automatically some details about your web server like what user it runs as.&lt;br /&gt;
&lt;br /&gt;
=== Installing Apache ===&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install apache2 libapache2-mod-fcgid&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install httpd mod_fcgid mod_ssl&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ### Installing nginx --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Install RT ==&lt;br /&gt;
&lt;br /&gt;
=== Get and unpack the RT source code ===&lt;br /&gt;
&lt;br /&gt;
Download the latest source code using the link on the [https://bestpractical.com/download-page RT download page], extract it using &amp;lt;code&amp;gt;tar -xf&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt; into the source code directory to run the rest of the commands in this section. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;curl -O https://download.bestpractical.com/pub/rt/release/rt-5.0.2.tar.gz&lt;br /&gt;
tar -xf rt-5.0.2.tar.gz&lt;br /&gt;
cd rt-5.0.2&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Pre-configure RT ===&lt;br /&gt;
&lt;br /&gt;
This command will detect some information about your system in order to install RT properly, and decide which set of dependencies to install. Here’s what the different parts of our command are doing:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;--with-db-type=TYPE&amp;lt;/code&amp;gt; - Replace &amp;lt;code&amp;gt;TYPE&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;Pg&amp;lt;/code&amp;gt; for PostgreSQL, or &amp;lt;code&amp;gt;mysql&amp;lt;/code&amp;gt; for MariaDB.&lt;br /&gt;
* &amp;lt;code&amp;gt;--prefix=/opt/rt5&amp;lt;/code&amp;gt; sets the directory where RT will install all of its libraries, tools, and supporting files. You can choose another path if you like.&lt;br /&gt;
* The rest of the options tell RT to install additional dependencies for optional features.&lt;br /&gt;
&lt;br /&gt;
Make sure you have &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt;ed into the RT source directory, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;./configure --with-db-type=TYPE --prefix=/opt/rt5 --with-attachment-store=disk --enable-externalauth --enable-gd --enable-graphviz --enable-gpg --enable-smime&amp;lt;/pre&amp;gt;&lt;br /&gt;
For more background, [https://docs.bestpractical.com/rt/latest/configure.html refer to the RT configure options documentation].&lt;br /&gt;
&lt;br /&gt;
=== Install RT and its Perl dependencies ===&lt;br /&gt;
&lt;br /&gt;
This command will download, build, and install all of the Perl modules necessary to run RT with the configuration you set above. Here’s what the different parts of the command are doing:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;make dirs&amp;lt;/code&amp;gt; sets up RT&#039;s directory structure. We do this first to install dependencies under it.&lt;br /&gt;
* &amp;lt;code&amp;gt;make fixdeps&amp;lt;/code&amp;gt; actually installs those dependencies.&lt;br /&gt;
* &amp;lt;code&amp;gt;RT_FIX_DEPS_CMD=&#039;cpanm …&#039;&amp;lt;/code&amp;gt; tells RT to use cpanminus to install dependencies (instead of the older, default &amp;lt;code&amp;gt;cpan&amp;lt;/code&amp;gt; command), and to install them where RT will automatically load them.&lt;br /&gt;
* &amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt; installs all of RT’s files under &amp;lt;code&amp;gt;/opt/rt5&amp;lt;/code&amp;gt; (or the prefix directory you set in the previous step). It will only run if &amp;lt;code&amp;gt;fixdeps&amp;lt;/code&amp;gt; succeeds. Setting &amp;lt;code&amp;gt;PERL5LIB&amp;lt;/code&amp;gt; tells it where you installed those dependencies.&lt;br /&gt;
&lt;br /&gt;
Make sure you have &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt;ed into the RT source directory, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo make dirs&lt;br /&gt;
sudo ln -s . /opt/rt5/local/lib/perl5&lt;br /&gt;
make fixdeps RT_FIX_DEPS_CMD=&#039;cpanm --sudo --quiet --local-lib=/opt/rt5/local&#039;&lt;br /&gt;
sudo make install PERL5LIB=/opt/rt5/local/lib&amp;lt;/pre&amp;gt;&lt;br /&gt;
If it works, the command will eventually output a message that says “Congratulations. RT is now installed.” followed by instructions about configuring and setting up the database. We’ll do that next.&lt;br /&gt;
&lt;br /&gt;
=== Configure RT ===&lt;br /&gt;
&lt;br /&gt;
[https://docs.bestpractical.com/rt/latest/RT_Config.html RT has many configuration options.] You can put configuration options in the file &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/code&amp;gt;, or in individual files under &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.d/&amp;lt;/code&amp;gt;. Use an editor to save all the text below to &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/code&amp;gt; (you can just overwrite the existing file, or add this to the bottom of what’s there) and then fill in settings for your site everywhere the text &amp;lt;code&amp;gt;EDIT WITH&amp;lt;/code&amp;gt; appears.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Single-quote all values EXCEPT the special value `undef`&lt;br /&gt;
# that turns off a setting.&lt;br /&gt;
&lt;br /&gt;
# rtname appears in ticket email subjects. It needs to be globally unique,&lt;br /&gt;
# so use your organization&#039;s domain name.&lt;br /&gt;
Set($rtname, &#039;EDIT WITH yourdomain.example.com&#039;);&lt;br /&gt;
# Organization is used in the database for ticket links, etc. It also needs to&lt;br /&gt;
# be globally unique, so use your organization&#039;s domain name.&lt;br /&gt;
Set($Organization, &#039;EDIT WITH yourdomain.example.com&#039;);&lt;br /&gt;
# WebDomain is domain name of the RT web server. RT uses it to construct links&lt;br /&gt;
# and defend against CSRFs.&lt;br /&gt;
Set($WebDomain, &#039;EDIT WITH rt.yourdomain.example.com&#039;);&lt;br /&gt;
# WebPort is the port where the RT web server runs. Edit the number below if&lt;br /&gt;
# you&#039;re not using the standard HTTPS port.&lt;br /&gt;
Set($WebPort, &#039;443&#039;);&lt;br /&gt;
&lt;br /&gt;
# DatabaseUser is the name of the database account RT uses to read and store&lt;br /&gt;
# data. &#039;rt_user&#039; is the default but you can change it if you like.&lt;br /&gt;
# DO NOT use the &#039;rt_admin&#039; superuser created in the instructions above.&lt;br /&gt;
Set($DatabaseUser, &#039;rt_user&#039;);&lt;br /&gt;
# DatabasePassword is the password for DatabaseUser.&lt;br /&gt;
Set($DatabasePassword, &#039;EDIT WITH SomePassphraseHere&#039;);&lt;br /&gt;
# DatabaseHost is the hostname of the database server RT should use.&lt;br /&gt;
# Change &#039;localhost&#039; if it lives on a different server.&lt;br /&gt;
Set($DatabaseHost, &#039;localhost&#039;);&lt;br /&gt;
# DatabasePort is the port number of the database server RT should use.&lt;br /&gt;
# `undef` means the default for that database. Change it if you&#039;re not&lt;br /&gt;
# using the standard port.&lt;br /&gt;
Set($DatabasePort, undef);&lt;br /&gt;
# DatabaseName is the name of RT&#039;s database hosted on DatabaseHost.&lt;br /&gt;
# &#039;rt5&#039; is the default but you can change it if you like.&lt;br /&gt;
Set($DatabaseName, &#039;rt5&#039;);&lt;br /&gt;
# DatabaseAdmin is the name of the user in the database used to perform&lt;br /&gt;
# major administrative tasks. Change &#039;rt_admin&#039; if you&#039;re using a user&lt;br /&gt;
# besides the one created in this guide.&lt;br /&gt;
Set($DatabaseAdmin, &#039;rt_admin&#039;);&lt;br /&gt;
&lt;br /&gt;
# RT can log to syslog, stderr, and/or a dedicated file.&lt;br /&gt;
# Log settings are used both by the primary server and by command line&lt;br /&gt;
# tools like rt-crontool, rt-ldapimport, etc.&lt;br /&gt;
# You set all of RT&#039;s $LogTo* paramaters to a standard log level: &#039;debug&#039;,&lt;br /&gt;
# &#039;info&#039;, &#039;notice&#039;, &#039;warning&#039;, &#039;error&#039;, &#039;critical&#039;, &#039;alert&#039;, or &#039;emergency&#039;.&lt;br /&gt;
# For a modern install, I recommend logging primarily to syslog, so it goes&lt;br /&gt;
# to journald where it&#039;s easy to query and automatically gets rotated.&lt;br /&gt;
Set($LogToSyslog, &#039;info&#039;);&lt;br /&gt;
&lt;br /&gt;
# When the RT server logs to stderr, that usually goes to your web server&#039;s&lt;br /&gt;
# error log. Command line tools log to their own stderr. Setting this to&lt;br /&gt;
# &#039;warning&#039; or &#039;error&#039; helps ensure you get notified if RT&#039;s cron jobs&lt;br /&gt;
# encounter problems.&lt;br /&gt;
Set($LogToSTDERR, &#039;warning&#039;);&lt;br /&gt;
&lt;br /&gt;
# Turn off optional features that require additional configuration.&lt;br /&gt;
# If you want to use these, refer to the RT_Config documentation for&lt;br /&gt;
# instructions on how to set them up.&lt;br /&gt;
Set(%GnuPG, &#039;Enable&#039; =&amp;gt; &#039;0&#039;);&lt;br /&gt;
Set(%SMIME, &#039;Enable&#039; =&amp;gt; &#039;0&#039;);&lt;br /&gt;
&lt;br /&gt;
# Perl expects to find this 1 at the end of the file.&lt;br /&gt;
1;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;RT_SiteConfig.pm&amp;lt;/code&amp;gt; is actually Perl code. RT runs the code directly to load the configuration. Any time you finish editing it, you can check that you didn’t make any syntax errors by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;perl -c /opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Set up RT’s database ===&lt;br /&gt;
&lt;br /&gt;
RT includes a tool to help you set up its database. By default, it connects to the database as an administrator to create the database and user that you configured in the previous step.&lt;br /&gt;
&lt;br /&gt;
(The instructions from &amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt; and RT’s README file tell you to run &amp;lt;code&amp;gt;make initialize-database&amp;lt;/code&amp;gt;. That just runs &amp;lt;code&amp;gt;rt-setup-database&amp;lt;/code&amp;gt; for you. Running the tool directly makes it easier to pass the options you need.)&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;--action=init&amp;lt;/code&amp;gt; tells the tool to create the user, the database, the tables inside it, and insert core data RT needs to function.&lt;br /&gt;
* &#039;&#039;&#039;If&#039;&#039;&#039; you are using an existing database server and the database adminstrator has already created the user account and database for RT, then you can add the &amp;lt;code&amp;gt;--skip-create&amp;lt;/code&amp;gt; option.&lt;br /&gt;
* &#039;&#039;&#039;If&#039;&#039;&#039; you have a less common database setup, this tool has additional options to give you finer-grained control over what steps are run and how. Refer to [https://docs.bestpractical.com/rt/latest/rt-setup-database.html the full rt-setup-database documentation] to learn more about those.&lt;br /&gt;
* The command reads files from RT’s &amp;lt;code&amp;gt;etc/&amp;lt;/code&amp;gt; directory by default, so the easiest way to run it is to &amp;lt;code&amp;gt;cd /opt/rt5&amp;lt;/code&amp;gt; first, and then it will find the necessary files automatically.&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /opt/rt5&lt;br /&gt;
sudo sbin/rt-setup-database --action=init&amp;lt;/pre&amp;gt;&lt;br /&gt;
Enter the password for your database administrator account when prompted.&lt;br /&gt;
&lt;br /&gt;
=== Set up fulltext indexing ===&lt;br /&gt;
&lt;br /&gt;
Fulltext indexing speeds up searches for ticket content, which makes RT a lot nicer to use.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;--noask&amp;lt;/code&amp;gt; uses the default names for the index, which will be fine for a new install and simplifies the setup.&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo /opt/rt5/sbin/rt-setup-fulltext-index --noask&amp;lt;/pre&amp;gt;&lt;br /&gt;
Enter the password for your database administrator account when prompted. The end of the process will output some RT configuration that looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;### EXAMPLE OUTPUT ONLY - Don&#039;t use this directly!&lt;br /&gt;
Set( %FullTextSearch,&lt;br /&gt;
    Enable     =&amp;gt; 1,&lt;br /&gt;
    Indexed    =&amp;gt; 1,&lt;br /&gt;
    # Additional output from rt-setup-fulltext-index should be here.&lt;br /&gt;
    # The configuration varies by database type.&lt;br /&gt;
);&amp;lt;/pre&amp;gt;&lt;br /&gt;
Copy the output generated when you run &amp;lt;code&amp;gt;rt-setup-fulltext-index&amp;lt;/code&amp;gt; and save it to the file &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.d/FulltextIndex.pm&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Set permissions ===&lt;br /&gt;
&lt;br /&gt;
All of RT’s configuration files should be readable by the user that runs the web server, and no other users, in order to protect sensitive information like the database password. RT provides a command to set permissions appropriately according to your distribution and configuration. &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt; to the directory where you extracted the RT source code, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd rt-5.0.2&lt;br /&gt;
sudo make fixperms&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Verify the installation ===&lt;br /&gt;
&lt;br /&gt;
If everything has gone well, then you should be able to set a password for RT’s &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; user. You’ll use this later to log in to the web interface and continue setting up your system. Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo /opt/rt5/sbin/rt-passwd root&amp;lt;/pre&amp;gt;&lt;br /&gt;
Set the password when prompted. Record this; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s web server ==&lt;br /&gt;
&lt;br /&gt;
=== Configure Apache modules ===&lt;br /&gt;
&lt;br /&gt;
You will need to have the following modules enabled in Apache to run RT. You should already have these installed if you followed the instructions above.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;alias&amp;lt;/code&amp;gt; (required to map URLs to RT)&lt;br /&gt;
* &amp;lt;code&amp;gt;fcgid&amp;lt;/code&amp;gt; (required for Apache to talk to RT)&lt;br /&gt;
* &amp;lt;code&amp;gt;mpm_prefork&amp;lt;/code&amp;gt; (Apache requires you to select an MPM. RT is designed to work with the prefork module.)&lt;br /&gt;
* &amp;lt;code&amp;gt;ssl&amp;lt;/code&amp;gt; (required to serve HTTPS; optional otherwise)&lt;br /&gt;
&lt;br /&gt;
Enable them following these instructions:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo a2dismod mpm_event&lt;br /&gt;
sudo a2enmod fcgid&lt;br /&gt;
sudo a2enmod mpm_prefork&lt;br /&gt;
sudo a2enmod ssl&amp;lt;/pre&amp;gt;&lt;br /&gt;
| &amp;lt;pre&amp;gt;echo LoadModule mpm_prefork_module modules/mod_mpm_prefork.so | sudo tee /etc/httpd/conf.modules.d/00-mpm.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Disable default VirtualHosts (optional) ===&lt;br /&gt;
&lt;br /&gt;
If this web server is dedicated to RT, then you should disable the VirtualHosts that are included with the stock configuration. Run:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo a2dissite 000-default&lt;br /&gt;
sudo a2dissite default-ssl&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo sed -i~ &#039;/^&amp;lt;VirtualHost\b/ , /^&amp;lt;\/VirtualHost\b/ d&#039; /etc/httpd/conf.d/ssl.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Configure an Apache VirtualHost ===&lt;br /&gt;
&lt;br /&gt;
Create a file at the following location. You can change the &amp;lt;code&amp;gt;RT&amp;lt;/code&amp;gt; part of the filename if you like, but the file must exist in this directory and have a &amp;lt;code&amp;gt;.conf&amp;lt;/code&amp;gt; suffix.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;/etc/apache2/sites-available/RT.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
Then after you create the file, run: &amp;lt;code&amp;gt;sudo a2ensite RT&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;/etc/httpd/conf.d/zz_RT.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Use an editor to save all the text below to the new &amp;lt;code&amp;gt;RT.conf&amp;lt;/code&amp;gt; and then fill in settings for your site everywhere the text &amp;lt;code&amp;gt;EDIT WITH&amp;lt;/code&amp;gt; appears.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### Primary RT VirtualHost&lt;br /&gt;
# You can change both the bind address and/or the port here as required.&lt;br /&gt;
# This default will listen for HTTPS connections on all interfaces.&lt;br /&gt;
&amp;lt;VirtualHost *:443&amp;gt;&lt;br /&gt;
  # EDIT HERE with the domain name of the web server.&lt;br /&gt;
  ServerName rt.yourdomain.example.com&lt;br /&gt;
  &amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
    SSLEngine on&lt;br /&gt;
    # These specify the paths to the SSL certificate and private key Apache&lt;br /&gt;
    # should use. These example paths are common for Let&#039;s Encrypt. If you&lt;br /&gt;
    # don&#039;t use Let&#039;s Encrypt, the standard location for these files is under&lt;br /&gt;
    # (Debian/Ubuntu) /etc/ssl&lt;br /&gt;
    # (Red Hat/Fedora/CentOS) /etc/pki/tls&lt;br /&gt;
    # EDIT HERE with the appropriate paths for your server&lt;br /&gt;
    SSLCertificateFile /etc/letsencrypt/live/example.com/fullchain.pem&lt;br /&gt;
    SSLCertificateKeyFile /etc/letsencrypt/live/example.com/privkey.pem&lt;br /&gt;
  &amp;lt;/IfModule&amp;gt;&lt;br /&gt;
  &amp;lt;Location /&amp;gt;&lt;br /&gt;
    Require all granted&lt;br /&gt;
    Options +ExecCGI&lt;br /&gt;
    AddHandler fcgid-script fcgi&lt;br /&gt;
  &amp;lt;/Location&amp;gt;&lt;br /&gt;
  AddDefaultCharset UTF-8&lt;br /&gt;
  DocumentRoot /opt/rt5/share/html&lt;br /&gt;
  ScriptAlias / /opt/rt5/sbin/rt-server.fcgi/&lt;br /&gt;
  # The default mod_fcgid timeout is 40 seconds.&lt;br /&gt;
  # We increase it here to allow for large ticket searches, etc.&lt;br /&gt;
  FcgidIOTimeout 200   # mod_fcgid only allows 128KiB requests by default. This is too small for users&lt;br /&gt;
  # to upload files to RT. You can ultimately choose any setting you&#039;re&lt;br /&gt;
  # comfortable with; 70MiB here should allow most requests without being too&lt;br /&gt;
  # open.&lt;br /&gt;
  FcgidMaxRequestLen 73400320&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
### End primary RT VirtualHost&lt;br /&gt;
&lt;br /&gt;
### Optional HTTPS Redirect VirtualHost&lt;br /&gt;
# Most modern servers support HTTPS and want all web traffic to go through it.&lt;br /&gt;
# This VirtualHost redirects normal HTTP traffic to HTTPS.&lt;br /&gt;
# You can delete this whole section if you don&#039;t want or need this.&lt;br /&gt;
&amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
  # You can change both the bind address and/or the port here as required.&lt;br /&gt;
  # This default will listen for HTTP connections on all interfaces.&lt;br /&gt;
  &amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
    SSLEngine off&lt;br /&gt;
    # EDIT HERE both lines below with the domain name of your web server.&lt;br /&gt;
    ServerName rt.yourdomain.example.com&lt;br /&gt;
    Redirect permanent / https://rt.yourdomain.example.com/&lt;br /&gt;
  &amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/IfModule&amp;gt;&lt;br /&gt;
### End optional HTTPS Redirect VirtualHost&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
After you’ve edited the file, load the configuration with:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo systemctl reload apache2&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo systemctl reload httpd&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If this command reports an error, double-check the configuration file for typos, especially in option names, file paths, and the&lt;br /&gt;
&amp;lt;Section&amp;gt;&lt;br /&gt;
pairs. Edit again and reload the configuration until it succeeds without output.&lt;br /&gt;
&lt;br /&gt;
=== Verify the web interface ===&lt;br /&gt;
&lt;br /&gt;
You should be able to visit your web server in your browser, and be presented with RT’s login screen. You should be able to log in with username &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; and the password you set previously.&lt;br /&gt;
&lt;br /&gt;
If you run into trouble, the first place to look for more information is by reading Apache’s error log:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo less /var/log/apache2/error.log&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo less /var/log/httpd/error.log&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s mail server ==&lt;br /&gt;
&lt;br /&gt;
RT both can both send and receive ticket updates via email. Unfortunately, there are too many variables to document a useful setup process here: getting this working usually requires creating DNS records, and coordinating with existing mail servers, which will be the main constraint on your setup. Instead this guide provides a brief overview of how the integration works, and where the connection points are that you likely need to work on.&lt;br /&gt;
&lt;br /&gt;
=== Sending Mail ===&lt;br /&gt;
&lt;br /&gt;
RT only knows how to send mail by passing it off to another program on the system. It cannot connect or authenticate directly to external mail servers. In the default configuration, RT runs the standard &amp;lt;code&amp;gt;sendmail&amp;lt;/code&amp;gt; command. There are [https://docs.bestpractical.com/rt/latest/RT_Config.html#Outgoing-mail configuration options to send mail through different commands] if you need.&lt;br /&gt;
&lt;br /&gt;
The most common setup is to install and configure a proper Mail Transfer Agent (MTA) like Postfix or Exim, and then configure it to send mail to the wider Internet as you need. This works well because the MTAs are robust and well-tested; they have flexible configuration to let you send mail out by relaying to other mail servers you specify with optional authentication; and most distributions install one by default anyway. The only hard part is configuring the MTA to send mail following your site’s policies.&lt;br /&gt;
&lt;br /&gt;
Other software is available that provides a slimmer version of the &amp;lt;code&amp;gt;sendmail&amp;lt;/code&amp;gt; command that connects to an external mail server for you, like ssmtp. These programs are usually easier to configure than an MTA, but they often lose email permanently if they can’t connect to the external server at the time it’s sent. (MTAs keep email queued locally until they successfully deliver it to another server.)&lt;br /&gt;
&lt;br /&gt;
=== Receiving email ===&lt;br /&gt;
&lt;br /&gt;
RT installs a command called &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; that receives an email on standard input and posts it to RT’s REST web interface, where it gets saved in the database and added to a ticket. You need to arrange for a way to send incoming email to this command.&lt;br /&gt;
&lt;br /&gt;
The most common setup is to have an MTA on the same box as RT receive email directly, and then set up mail aliases that call this command when mail comes in. Example &amp;lt;code&amp;gt;/etc/aliases&amp;lt;/code&amp;gt; entries look like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rt: &amp;quot;|/opt/rt5/bin/rt-mailgate --queue general --action correspond --url https://rt.yourdomain.example.com/&amp;quot;&lt;br /&gt;
rt-comment: &amp;quot;|/opt/rt5/bin/rt-mailgate --queue general --action comment --url https://rt.yourdomain.example.com/&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
This works well because, again, you’re probably running an MTA anyway; and the MTA can hold and queue mail if it comes in while RT is down for any reason, giving you a buffer against downtime.&lt;br /&gt;
&lt;br /&gt;
Another common option is to periodically run a tool that fetches mail using a protocol like IMAP, like fetchmail or getmail, and passes it on to &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt;. This is less common because it requires setting up another tool to run, and securely storing another set of mail server credentials. But it is useful when local policy prevents the RT server from receiving email directly.&lt;br /&gt;
&lt;br /&gt;
This is much less common, but it might help to know that &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; doesn’t have to run on the same system as RT itself. It just needs to be able to connect to RT’s web interface. If you don’t have any other options, you can install the RT software on a different system that receives email, and configure &#039;&#039;that&#039;&#039; system to run &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; and pass it on to the RT server. To do that, just repeat the installation instructions above, skipping the steps about installing the database and web server.&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s background jobs ==&lt;br /&gt;
&lt;br /&gt;
Create a file &amp;lt;code&amp;gt;/etc/cron.d/rt&amp;lt;/code&amp;gt; with the following content. You may edit all of the time fields as you see fit. Refer to the crontab(5) man page for details about their definitions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Update the fulltext index with new ticket data&lt;br /&gt;
*/3 *   *   *   *   root    /opt/rt5/sbin/rt-fulltext-indexer&lt;br /&gt;
# Email out dashboards that users have subscribed to&lt;br /&gt;
0   *   *   *   *   root    /opt/rt5/sbin/rt-email-dashboards&lt;br /&gt;
# Clean old sessions from the database&lt;br /&gt;
10  3   *   *   *   root    /opt/rt5/sbin/rt-clean-sessions --older 8d&lt;br /&gt;
# Email out weekly digests for users who have requested it&lt;br /&gt;
50  4   *   *   Mon root    /opt/rt5/sbin/rt-email-digest -m weekly&lt;br /&gt;
# Email out daily digests for users who have requested it&lt;br /&gt;
50  5   *   *   *   root    /opt/rt5/sbin/rt-email-digest -m daily&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
You can run all these jobs as the same user that runs your web server, rather than root. Run:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo sed -i &#039;s/\broot\b/www-data/&#039; /etc/cron.d/rt&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo sed -i &#039;s/\broot\b/apache/&#039; /etc/cron.d/rt&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Set up RT ==&lt;br /&gt;
&lt;br /&gt;
If you’ve gotten this far, congratulations, your RT install is really done now. You can start setting up RT with users, groups, queues, and business logic. [[Main Page|Head back to the main page]] to start exploring those topics.&lt;/div&gt;</summary>
		<author><name>Brett</name></author>
	</entry>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=ManualInstallation&amp;diff=27052</id>
		<title>ManualInstallation</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=ManualInstallation&amp;diff=27052"/>
		<updated>2022-01-13T20:38:09Z</updated>

		<summary type="html">&lt;p&gt;Brett: move mod_fcgid settings inside the VirtualHost&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Prev: [[ManualRequirements]] — Up: [[UserManual]] — Next: [[ManualApacheConfig]]&lt;br /&gt;
&lt;br /&gt;
This guide walks you through installing RT from source on a modern, popular Linux distro. Specifically, that means a distribution based on Debian or Red Hat that’s been released since around 2020.&lt;br /&gt;
&lt;br /&gt;
This guide assumes:&lt;br /&gt;
&lt;br /&gt;
* You can install packages generally available in Debian/Ubuntu or Red Hat/Fedora/CentOS.&lt;br /&gt;
* You want to install RT, and all of its Perl dependencies, from source to get the latest versions. (This is a trade-off. It means the boundaries of your install will be very clear, but you won’t get security updates for RT or Perl modules from your distribution.)&lt;br /&gt;
* You are willing to install a couple of extra tools to manage the RT installation similarly to how you would in other packaging systems (like PyPI, npm, etc.).&lt;br /&gt;
* You are willing to do a relatively maximal install of RT, enabling all the options during installation and then setting what you need in the configuration. (You could save a little space and time by being pickier about your options, but then that complicates the guide and makes it harder to turn those options on later if you want.)&lt;br /&gt;
* You are using a regular user account on the Linux system that can get superuser privileges with sudo.&lt;br /&gt;
&lt;br /&gt;
== Install the base dependencies ==&lt;br /&gt;
&lt;br /&gt;
These are required by RT, either to run or to install the dependencies.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install autoconf build-essential cpanminus curl libexpat-dev libgd-dev libssl-dev libz-dev gnupg graphviz lynx openssl perl&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf config-manager --set-enabled powertools&lt;br /&gt;
sudo dnf install patch tar which gcc gcc-c++ perl-core perl-App-cpanminus graphviz expat-devel gd-devel lynx openssl openssl-devel&lt;br /&gt;
sudo setenforce 0&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
(Turning off SELinux enforcement is required on Red Hat-based distributions because, as of October 2021, nobody has written a policy for RT.)&lt;br /&gt;
&lt;br /&gt;
== Install a database ==&lt;br /&gt;
&lt;br /&gt;
You need access to a database server. It can be remote, or you can install a database server alongside RT. RT supports a few different databases, but the best supported options are PostgreSQL and MariaDB.&lt;br /&gt;
&lt;br /&gt;
=== Installing and configuring the PostgreSQL server ===&lt;br /&gt;
&lt;br /&gt;
If you want to install a fresh PostgreSQL database server alongside RT:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install postgresql&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install postgresql-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In order to set up RT’s database, you will need a PostgreSQL superuser account that can be authenticated with a password. If you don’t have that, you can create it by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo createuser -sP rt_admin&amp;lt;/pre&amp;gt;&lt;br /&gt;
Set the password when prompted. Record this; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
=== Enable password authentication in PostgreSQL ===&lt;br /&gt;
&lt;br /&gt;
You need to consider this step whether you install the database locally, or use an existing one already running. RT supports connecting to PostgreSQL a few different ways, but authenticating with a username and password is simplest, and this guide is written based on that. Not all PostgreSQL installations allow this authentication method by default. You need to review your &amp;lt;code&amp;gt;pg_hba.conf&amp;lt;/code&amp;gt; file located at:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;/etc/postgresql/VERSION/main/pg_hba.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;/var/lib/pgsql/VERSION/data/pg_hba.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Replace &amp;lt;code&amp;gt;VERSION&amp;lt;/code&amp;gt; with the version of your PostgreSQL database. Add these two lines &#039;&#039;&#039;above&#039;&#039;&#039; any other lines that start with &amp;lt;code&amp;gt;host&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;host  rt5  rt_user   all  md5&lt;br /&gt;
host  rt5  rt_admin  all  md5&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This configuration will let &amp;lt;code&amp;gt;rt_user&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;rt_admin&amp;lt;/code&amp;gt; authorize themselves for the &amp;lt;code&amp;gt;rt5&amp;lt;/code&amp;gt; database using an &amp;lt;code&amp;gt;md5&amp;lt;/code&amp;gt; crypted password over a network connection (possibly using the localhost loopback network). You might be able to further restrict some of these fields for improved security, but doing so is outside the scope of this install guide. Refer to [https://www.postgresql.org/docs/current/auth-pg-hba-conf.html the pg_hba.conf documentation] for more details.&lt;br /&gt;
&lt;br /&gt;
Save your changes and reload the database:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo systemctl reload postgresql&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Installing the PostgreSQL client libraries ===&lt;br /&gt;
&lt;br /&gt;
These are required for RT to be able to talk to any PostgreSQL server.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install libpq-dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install postgresql-devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Once this is done you can skip ahead to installing a web server.&lt;br /&gt;
&lt;br /&gt;
=== Installing and configuring the MariaDB server ===&lt;br /&gt;
&lt;br /&gt;
If you want to install a fresh MariaDB database server alongside RT:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install mariadb-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install mariadb-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In order to set up RT’s database, you will need a MySQL superuser account. To stay consistent with PostgreSQL, I suggest setting a password for it. You can do that by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo mysql&lt;br /&gt;
mysql# GRANT ALL PRIVELEGES WITH GRANT OPTION ON rt5 TO rt_admin@localhost IDENTIFIED BY &#039;YourPassphraseHere&#039;;&amp;lt;/pre&amp;gt;&lt;br /&gt;
Record your passphrase; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
=== Adjust MariaDB’s max_allowed_packet setting ===&lt;br /&gt;
&lt;br /&gt;
You need to consider this step whether you install the database locally, or use an existing one already running. [https://mariadb.com/kb/en/server-system-variables/#max_allowed_packet MariaDB’s &amp;lt;code&amp;gt;max_allowed_packet&amp;lt;/code&amp;gt; setting] functionally limits the size of attachments in RT. The default is 16MiB, which is too small for most installations. You can ultimately choose any setting you’re comfortable with; 64MiB here should allow most requests without being too open.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;echo -e &#039;[client-server]\nmax_allowed_packet=64M\n&#039; | sudo tee /etc/mysql/conf.d/max_allowed_packet.cnf&lt;br /&gt;
sudo systemctl reload mariadb&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;echo -e &#039;[client-server]\nmax_allowed_packet=64M\n&#039; | sudo tee /etc/my.cnf.d/max_allowed_packet.cnf&lt;br /&gt;
sudo systemctl reload mariadb&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Installing the MariaDB client libraries ===&lt;br /&gt;
&lt;br /&gt;
These are required for RT to be able to talk to any MariaDB server.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install libmariadb-dev libmariadb-dev-compat&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install mariadb-devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Install a web server with FastCGI ==&lt;br /&gt;
&lt;br /&gt;
FastCGI is the best way to host RT’s web interface today. Installing the web server before RT makes the installation process simpler, because RT will be able to automatically some details about your web server like what user it runs as.&lt;br /&gt;
&lt;br /&gt;
=== Installing Apache ===&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install apache2 libapache2-mod-fcgid&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install httpd mod_fcgid mod_ssl&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ### Installing nginx --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Install RT ==&lt;br /&gt;
&lt;br /&gt;
=== Get and unpack the RT source code ===&lt;br /&gt;
&lt;br /&gt;
Download the latest source code using the link on the [https://bestpractical.com/download-page RT download page], extract it using &amp;lt;code&amp;gt;tar -xf&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt; into the source code directory to run the rest of the commands in this section. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;curl -O https://download.bestpractical.com/pub/rt/release/rt-5.0.2.tar.gz&lt;br /&gt;
tar -xf rt-5.0.2.tar.gz&lt;br /&gt;
cd rt-5.0.2&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Pre-configure RT ===&lt;br /&gt;
&lt;br /&gt;
This command will detect some information about your system in order to install RT properly, and decide which set of dependencies to install. Here’s what the different parts of our command are doing:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;--with-db-type=TYPE&amp;lt;/code&amp;gt; - Replace &amp;lt;code&amp;gt;TYPE&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;Pg&amp;lt;/code&amp;gt; for PostgreSQL, or &amp;lt;code&amp;gt;mysql&amp;lt;/code&amp;gt; for MariaDB.&lt;br /&gt;
* &amp;lt;code&amp;gt;--prefix=/opt/rt5&amp;lt;/code&amp;gt; sets the directory where RT will install all of its libraries, tools, and supporting files. You can choose another path if you like.&lt;br /&gt;
* The rest of the options tell RT to install additional dependencies for optional features.&lt;br /&gt;
&lt;br /&gt;
Make sure you have &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt;ed into the RT source directory, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;./configure --with-db-type=TYPE --prefix=/opt/rt5 --with-attachment-store=disk --enable-externalauth --enable-gd --enable-graphviz --enable-gpg --enable-smime&amp;lt;/pre&amp;gt;&lt;br /&gt;
For more background, [https://docs.bestpractical.com/rt/latest/configure.html refer to the RT configure options documentation].&lt;br /&gt;
&lt;br /&gt;
=== Install RT and its Perl dependencies ===&lt;br /&gt;
&lt;br /&gt;
This command will download, build, and install all of the Perl modules necessary to run RT with the configuration you set above. Here’s what the different parts of the command are doing:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;make dirs&amp;lt;/code&amp;gt; sets up RT&#039;s directory structure. We do this first to install dependencies under it.&lt;br /&gt;
* &amp;lt;code&amp;gt;make fixdeps&amp;lt;/code&amp;gt; actually installs those dependencies.&lt;br /&gt;
* &amp;lt;code&amp;gt;RT_FIX_DEPS_CMD=&#039;cpanm …&#039;&amp;lt;/code&amp;gt; tells RT to use cpanminus to install dependencies (instead of the older, default &amp;lt;code&amp;gt;cpan&amp;lt;/code&amp;gt; command), and to install them where RT will automatically load them.&lt;br /&gt;
* &amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt; installs all of RT’s files under &amp;lt;code&amp;gt;/opt/rt5&amp;lt;/code&amp;gt; (or the prefix directory you set in the previous step). It will only run if &amp;lt;code&amp;gt;fixdeps&amp;lt;/code&amp;gt; succeeds. Setting &amp;lt;code&amp;gt;PERL5LIB&amp;lt;/code&amp;gt; tells it where you installed those dependencies.&lt;br /&gt;
&lt;br /&gt;
Make sure you have &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt;ed into the RT source directory, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo make dirs&lt;br /&gt;
sudo ln -s . /opt/rt5/local/lib/perl5&lt;br /&gt;
make fixdeps RT_FIX_DEPS_CMD=&#039;cpanm --sudo --quiet --local-lib=/opt/rt5/local&#039;&lt;br /&gt;
sudo make install PERL5LIB=/opt/rt5/local/lib&amp;lt;/pre&amp;gt;&lt;br /&gt;
If it works, the command will eventually output a message that says “Congratulations. RT is now installed.” followed by instructions about configuring and setting up the database. We’ll do that next.&lt;br /&gt;
&lt;br /&gt;
=== Configure RT ===&lt;br /&gt;
&lt;br /&gt;
[https://docs.bestpractical.com/rt/latest/RT_Config.html RT has many configuration options.] You can put configuration options in the file &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/code&amp;gt;, or in individual files under &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.d/&amp;lt;/code&amp;gt;. Use an editor to save all the text below to &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/code&amp;gt; (you can just overwrite the existing file, or add this to the bottom of what’s there) and then fill in settings for your site everywhere the text &amp;lt;code&amp;gt;EDIT WITH&amp;lt;/code&amp;gt; appears.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Single-quote all values EXCEPT the special value `undef`&lt;br /&gt;
# that turns off a setting.&lt;br /&gt;
&lt;br /&gt;
# rtname appears in ticket email subjects. It needs to be globally unique,&lt;br /&gt;
# so use your organization&#039;s domain name.&lt;br /&gt;
Set($rtname, &#039;EDIT WITH yourdomain.example.com&#039;);&lt;br /&gt;
# Organization is used in the database for ticket links, etc. It also needs to&lt;br /&gt;
# be globally unique, so use your organization&#039;s domain name.&lt;br /&gt;
Set($Organization, &#039;EDIT WITH yourdomain.example.com&#039;);&lt;br /&gt;
# WebDomain is domain name of the RT web server. RT uses it to construct links&lt;br /&gt;
# and defend against CSRFs.&lt;br /&gt;
Set($WebDomain, &#039;EDIT WITH rt.yourdomain.example.com&#039;);&lt;br /&gt;
# WebPort is the port where the RT web server runs. Edit the number below if&lt;br /&gt;
# you&#039;re not using the standard HTTPS port.&lt;br /&gt;
Set($WebPort, &#039;443&#039;);&lt;br /&gt;
&lt;br /&gt;
# DatabaseUser is the name of the database account RT uses to read and store&lt;br /&gt;
# data. &#039;rt_user&#039; is the default but you can change it if you like.&lt;br /&gt;
# DO NOT use the &#039;rt_admin&#039; superuser created in the instructions above.&lt;br /&gt;
Set($DatabaseUser, &#039;rt_user&#039;);&lt;br /&gt;
# DatabasePassword is the password for DatabaseUser.&lt;br /&gt;
Set($DatabasePassword, &#039;EDIT WITH SomePassphraseHere&#039;);&lt;br /&gt;
# DatabaseHost is the hostname of the database server RT should use.&lt;br /&gt;
# Change &#039;localhost&#039; if it lives on a different server.&lt;br /&gt;
Set($DatabaseHost, &#039;localhost&#039;);&lt;br /&gt;
# DatabasePort is the port number of the database server RT should use.&lt;br /&gt;
# `undef` means the default for that database. Change it if you&#039;re not&lt;br /&gt;
# using the standard port.&lt;br /&gt;
Set($DatabasePort, undef);&lt;br /&gt;
# DatabaseName is the name of RT&#039;s database hosted on DatabaseHost.&lt;br /&gt;
# &#039;rt5&#039; is the default but you can change it if you like.&lt;br /&gt;
Set($DatabaseName, &#039;rt5&#039;);&lt;br /&gt;
# DatabaseAdmin is the name of the user in the database used to perform&lt;br /&gt;
# major administrative tasks. Change &#039;rt_admin&#039; if you&#039;re using a user&lt;br /&gt;
# besides the one created in this guide.&lt;br /&gt;
Set($DatabaseAdmin, &#039;rt_admin&#039;);&lt;br /&gt;
&lt;br /&gt;
# RT can log to syslog, stderr, and/or a dedicated file.&lt;br /&gt;
# Log settings are used both by the primary server and by command line&lt;br /&gt;
# tools like rt-crontool, rt-ldapimport, etc.&lt;br /&gt;
# You set all of RT&#039;s $LogTo* paramaters to a standard log level: &#039;debug&#039;,&lt;br /&gt;
# &#039;info&#039;, &#039;notice&#039;, &#039;warning&#039;, &#039;error&#039;, &#039;critical&#039;, &#039;alert&#039;, or &#039;emergency&#039;.&lt;br /&gt;
# For a modern install, I recommend logging primarily to syslog, so it goes&lt;br /&gt;
# to journald where it&#039;s easy to query and automatically gets rotated.&lt;br /&gt;
Set($LogToSyslog, &#039;info&#039;);&lt;br /&gt;
&lt;br /&gt;
# When the RT server logs to stderr, that usually goes to your web server&#039;s&lt;br /&gt;
# error log. Command line tools log to their own stderr. Setting this to&lt;br /&gt;
# &#039;warning&#039; or &#039;error&#039; helps ensure you get notified if RT&#039;s cron jobs&lt;br /&gt;
# encounter problems.&lt;br /&gt;
Set($LogToSTDERR, &#039;warning&#039;);&lt;br /&gt;
&lt;br /&gt;
# Turn off optional features that require additional configuration.&lt;br /&gt;
# If you want to use these, refer to the RT_Config documentation for&lt;br /&gt;
# instructions on how to set them up.&lt;br /&gt;
Set(%GnuPG, &#039;Enable&#039; =&amp;gt; &#039;0&#039;);&lt;br /&gt;
Set(%SMIME, &#039;Enable&#039; =&amp;gt; &#039;0&#039;);&lt;br /&gt;
&lt;br /&gt;
# Perl expects to find this 1 at the end of the file.&lt;br /&gt;
1;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;RT_SiteConfig.pm&amp;lt;/code&amp;gt; is actually Perl code. RT runs the code directly to load the configuration. Any time you finish editing it, you can check that you didn’t make any syntax errors by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;perl -c /opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Set up RT’s database ===&lt;br /&gt;
&lt;br /&gt;
RT includes a tool to help you set up its database. By default, it connects to the database as an administrator to create the database and user that you configured in the previous step.&lt;br /&gt;
&lt;br /&gt;
(The instructions from &amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt; and RT’s README file tell you to run &amp;lt;code&amp;gt;make initialize-database&amp;lt;/code&amp;gt;. That just runs &amp;lt;code&amp;gt;rt-setup-database&amp;lt;/code&amp;gt; for you. Running the tool directly makes it easier to pass the options you need.)&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;--action=init&amp;lt;/code&amp;gt; tells the tool to create the user, the database, the tables inside it, and insert core data RT needs to function.&lt;br /&gt;
* &#039;&#039;&#039;If&#039;&#039;&#039; you are using an existing database server and the database adminstrator has already created the user account and database for RT, then you can add the &amp;lt;code&amp;gt;--skip-create&amp;lt;/code&amp;gt; option.&lt;br /&gt;
* &#039;&#039;&#039;If&#039;&#039;&#039; you have a less common database setup, this tool has additional options to give you finer-grained control over what steps are run and how. Refer to [https://docs.bestpractical.com/rt/latest/rt-setup-database.html the full rt-setup-database documentation] to learn more about those.&lt;br /&gt;
* The command reads files from RT’s &amp;lt;code&amp;gt;etc/&amp;lt;/code&amp;gt; directory by default, so the easiest way to run it is to &amp;lt;code&amp;gt;cd /opt/rt5&amp;lt;/code&amp;gt; first, and then it will find the necessary files automatically.&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /opt/rt5&lt;br /&gt;
sudo sbin/rt-setup-database --action=init&amp;lt;/pre&amp;gt;&lt;br /&gt;
Enter the password for your database administrator account when prompted.&lt;br /&gt;
&lt;br /&gt;
=== Set up fulltext indexing ===&lt;br /&gt;
&lt;br /&gt;
Fulltext indexing speeds up searches for ticket content, which makes RT a lot nicer to use.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;--noask&amp;lt;/code&amp;gt; uses the default names for the index, which will be fine for a new install and simplifies the setup.&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo /opt/rt5/sbin/rt-setup-fulltext-index --noask&amp;lt;/pre&amp;gt;&lt;br /&gt;
Enter the password for your database administrator account when prompted. The end of the process will output some RT configuration that looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;### EXAMPLE OUTPUT ONLY - Don&#039;t use this directly!&lt;br /&gt;
Set( %FullTextSearch,&lt;br /&gt;
    Enable     =&amp;gt; 1,&lt;br /&gt;
    Indexed    =&amp;gt; 1,&lt;br /&gt;
    # Additional output from rt-setup-fulltext-index should be here.&lt;br /&gt;
    # The configuration varies by database type.&lt;br /&gt;
);&amp;lt;/pre&amp;gt;&lt;br /&gt;
Copy the output generated when you run &amp;lt;code&amp;gt;rt-setup-fulltext-index&amp;lt;/code&amp;gt; and save it to the file &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.d/FulltextIndex.pm&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Set permissions ===&lt;br /&gt;
&lt;br /&gt;
All of RT’s configuration files should be readable by the user that runs the web server, and no other users, in order to protect sensitive information like the database password. RT provides a command to set permissions appropriately according to your distribution and configuration. &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt; to the directory where you extracted the RT source code, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd rt-5.0.2&lt;br /&gt;
sudo make fixperms&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Verify the installation ===&lt;br /&gt;
&lt;br /&gt;
If everything has gone well, then you should be able to set a password for RT’s &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; user. You’ll use this later to log in to the web interface and continue setting up your system. Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo /opt/rt5/sbin/rt-passwd root&amp;lt;/pre&amp;gt;&lt;br /&gt;
Set the password when prompted. Record this; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s web server ==&lt;br /&gt;
&lt;br /&gt;
=== Configure Apache modules ===&lt;br /&gt;
&lt;br /&gt;
You will need to have the following modules enabled in Apache to run RT. You should already have these installed if you followed the instructions above.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;alias&amp;lt;/code&amp;gt; (required to map URLs to RT)&lt;br /&gt;
* &amp;lt;code&amp;gt;fcgid&amp;lt;/code&amp;gt; (required for Apache to talk to RT)&lt;br /&gt;
* &amp;lt;code&amp;gt;mpm_prefork&amp;lt;/code&amp;gt; (Apache requires you to select an MPM. RT is designed to work with the prefork module.)&lt;br /&gt;
* &amp;lt;code&amp;gt;ssl&amp;lt;/code&amp;gt; (required to serve HTTPS; optional otherwise)&lt;br /&gt;
&lt;br /&gt;
Enable them following these instructions:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo a2dismod mpm_event&lt;br /&gt;
sudo a2enmod fcgid&lt;br /&gt;
sudo a2enmod mpm_prefork&lt;br /&gt;
sudo a2enmod ssl&amp;lt;/pre&amp;gt;&lt;br /&gt;
| &amp;lt;pre&amp;gt;echo LoadModule mpm_prefork_module modules/mod_mpm_prefork.so | sudo tee /etc/httpd/conf.modules.d/00-mpm.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Disable default VirtualHosts (optional) ===&lt;br /&gt;
&lt;br /&gt;
If this web server is dedicated to RT, then you should disable the VirtualHosts that are included with the stock configuration. Run:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo a2dissite 000-default&lt;br /&gt;
sudo a2dissite default-ssl&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo sed -i~ &#039;/^&amp;lt;VirtualHost\b/ , /^&amp;lt;\/VirtualHost\b/ d&#039; /etc/httpd/conf.d/ssl.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Configure an Apache VirtualHost ===&lt;br /&gt;
&lt;br /&gt;
Create a file at the following location. You can change the &amp;lt;code&amp;gt;RT&amp;lt;/code&amp;gt; part of the filename if you like, but the file must exist in this directory and have a &amp;lt;code&amp;gt;.conf&amp;lt;/code&amp;gt; suffix.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;/etc/apache2/sites-available/RT.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
Then after you create the file, run: &amp;lt;code&amp;gt;sudo a2ensite RT&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;/etc/httpd/conf.d/zz_RT.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Use an editor to save all the text below to the new &amp;lt;code&amp;gt;RT.conf&amp;lt;/code&amp;gt; and then fill in settings for your site everywhere the text &amp;lt;code&amp;gt;EDIT WITH&amp;lt;/code&amp;gt; appears.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### Primary RT VirtualHost&lt;br /&gt;
# You can change both the bind address and/or the port here as required.&lt;br /&gt;
# This default will listen for HTTPS connections on all interfaces.&lt;br /&gt;
&amp;lt;VirtualHost *:443&amp;gt;&lt;br /&gt;
  # EDIT HERE with the domain name of the web server.&lt;br /&gt;
  ServerName rt.yourdomain.example.com&lt;br /&gt;
  &amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
    SSLEngine on&lt;br /&gt;
    # These specify the paths to the SSL certificate and private key Apache&lt;br /&gt;
    # should use. These example paths are common for Let&#039;s Encrypt. If you&lt;br /&gt;
    # don&#039;t use Let&#039;s Encrypt, the standard location for these files is under&lt;br /&gt;
    # (Debian/Ubuntu) /etc/ssl&lt;br /&gt;
    # (Red Hat/Fedora/CentOS) /etc/pki/tls&lt;br /&gt;
    # EDIT HERE with the appropriate paths for your server&lt;br /&gt;
    SSLCertificateFile /etc/letsencrypt/live/example.com/fullchain.pem&lt;br /&gt;
    SSLCertificateKeyFile /etc/letsencrypt/live/example.com/privkey.pem&lt;br /&gt;
  &amp;lt;/IfModule&amp;gt;&lt;br /&gt;
  &amp;lt;Location /&amp;gt;&lt;br /&gt;
    Require all granted&lt;br /&gt;
    Options +ExecCGI&lt;br /&gt;
    AddHandler fcgid-script fcgi&lt;br /&gt;
  &amp;lt;/Location&amp;gt;&lt;br /&gt;
  AddDefaultCharset UTF-8&lt;br /&gt;
  DocumentRoot /opt/rt5/share/html&lt;br /&gt;
  ScriptAlias / /opt/rt5/sbin/rt-server.fcgi/&lt;br /&gt;
  # mod_fcgid only allows 128KiB requests by default. This is too small for users&lt;br /&gt;
  # to upload files to RT. You can ultimately choose any setting you&#039;re&lt;br /&gt;
  # comfortable with; 70MiB here should allow most requests without being too&lt;br /&gt;
  # open.&lt;br /&gt;
  FcgidMaxRequestLen 73400320&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
### End primary RT VirtualHost&lt;br /&gt;
&lt;br /&gt;
### Optional HTTPS Redirect VirtualHost&lt;br /&gt;
# Most modern servers support HTTPS and want all web traffic to go through it.&lt;br /&gt;
# This VirtualHost redirects normal HTTP traffic to HTTPS.&lt;br /&gt;
# You can delete this whole section if you don&#039;t want or need this.&lt;br /&gt;
&amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
  # You can change both the bind address and/or the port here as required.&lt;br /&gt;
  # This default will listen for HTTP connections on all interfaces.&lt;br /&gt;
  &amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
    SSLEngine off&lt;br /&gt;
    # EDIT HERE both lines below with the domain name of your web server.&lt;br /&gt;
    ServerName rt.yourdomain.example.com&lt;br /&gt;
    Redirect permanent / https://rt.yourdomain.example.com/&lt;br /&gt;
  &amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/IfModule&amp;gt;&lt;br /&gt;
### End optional HTTPS Redirect VirtualHost&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
After you’ve edited the file, load the configuration with:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo systemctl reload apache2&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo systemctl reload httpd&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If this command reports an error, double-check the configuration file for typos, especially in option names, file paths, and the&lt;br /&gt;
&amp;lt;Section&amp;gt;&lt;br /&gt;
pairs. Edit again and reload the configuration until it succeeds without output.&lt;br /&gt;
&lt;br /&gt;
=== Verify the web interface ===&lt;br /&gt;
&lt;br /&gt;
You should be able to visit your web server in your browser, and be presented with RT’s login screen. You should be able to log in with username &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; and the password you set previously.&lt;br /&gt;
&lt;br /&gt;
If you run into trouble, the first place to look for more information is by reading Apache’s error log:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo less /var/log/apache2/error.log&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo less /var/log/httpd/error.log&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s mail server ==&lt;br /&gt;
&lt;br /&gt;
RT both can both send and receive ticket updates via email. Unfortunately, there are too many variables to document a useful setup process here: getting this working usually requires creating DNS records, and coordinating with existing mail servers, which will be the main constraint on your setup. Instead this guide provides a brief overview of how the integration works, and where the connection points are that you likely need to work on.&lt;br /&gt;
&lt;br /&gt;
=== Sending Mail ===&lt;br /&gt;
&lt;br /&gt;
RT only knows how to send mail by passing it off to another program on the system. It cannot connect or authenticate directly to external mail servers. In the default configuration, RT runs the standard &amp;lt;code&amp;gt;sendmail&amp;lt;/code&amp;gt; command. There are [https://docs.bestpractical.com/rt/latest/RT_Config.html#Outgoing-mail configuration options to send mail through different commands] if you need.&lt;br /&gt;
&lt;br /&gt;
The most common setup is to install and configure a proper Mail Transfer Agent (MTA) like Postfix or Exim, and then configure it to send mail to the wider Internet as you need. This works well because the MTAs are robust and well-tested; they have flexible configuration to let you send mail out by relaying to other mail servers you specify with optional authentication; and most distributions install one by default anyway. The only hard part is configuring the MTA to send mail following your site’s policies.&lt;br /&gt;
&lt;br /&gt;
Other software is available that provides a slimmer version of the &amp;lt;code&amp;gt;sendmail&amp;lt;/code&amp;gt; command that connects to an external mail server for you, like ssmtp. These programs are usually easier to configure than an MTA, but they often lose email permanently if they can’t connect to the external server at the time it’s sent. (MTAs keep email queued locally until they successfully deliver it to another server.)&lt;br /&gt;
&lt;br /&gt;
=== Receiving email ===&lt;br /&gt;
&lt;br /&gt;
RT installs a command called &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; that receives an email on standard input and posts it to RT’s REST web interface, where it gets saved in the database and added to a ticket. You need to arrange for a way to send incoming email to this command.&lt;br /&gt;
&lt;br /&gt;
The most common setup is to have an MTA on the same box as RT receive email directly, and then set up mail aliases that call this command when mail comes in. Example &amp;lt;code&amp;gt;/etc/aliases&amp;lt;/code&amp;gt; entries look like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rt: &amp;quot;|/opt/rt5/bin/rt-mailgate --queue general --action correspond --url https://rt.yourdomain.example.com/&amp;quot;&lt;br /&gt;
rt-comment: &amp;quot;|/opt/rt5/bin/rt-mailgate --queue general --action comment --url https://rt.yourdomain.example.com/&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
This works well because, again, you’re probably running an MTA anyway; and the MTA can hold and queue mail if it comes in while RT is down for any reason, giving you a buffer against downtime.&lt;br /&gt;
&lt;br /&gt;
Another common option is to periodically run a tool that fetches mail using a protocol like IMAP, like fetchmail or getmail, and passes it on to &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt;. This is less common because it requires setting up another tool to run, and securely storing another set of mail server credentials. But it is useful when local policy prevents the RT server from receiving email directly.&lt;br /&gt;
&lt;br /&gt;
This is much less common, but it might help to know that &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; doesn’t have to run on the same system as RT itself. It just needs to be able to connect to RT’s web interface. If you don’t have any other options, you can install the RT software on a different system that receives email, and configure &#039;&#039;that&#039;&#039; system to run &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; and pass it on to the RT server. To do that, just repeat the installation instructions above, skipping the steps about installing the database and web server.&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s background jobs ==&lt;br /&gt;
&lt;br /&gt;
Create a file &amp;lt;code&amp;gt;/etc/cron.d/rt&amp;lt;/code&amp;gt; with the following content. You may edit all of the time fields as you see fit. Refer to the crontab(5) man page for details about their definitions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Update the fulltext index with new ticket data&lt;br /&gt;
*/3 *   *   *   *   root    /opt/rt5/sbin/rt-fulltext-indexer&lt;br /&gt;
# Email out dashboards that users have subscribed to&lt;br /&gt;
0   *   *   *   *   root    /opt/rt5/sbin/rt-email-dashboards&lt;br /&gt;
# Clean old sessions from the database&lt;br /&gt;
10  3   *   *   *   root    /opt/rt5/sbin/rt-clean-sessions --older 8d&lt;br /&gt;
# Email out weekly digests for users who have requested it&lt;br /&gt;
50  4   *   *   Mon root    /opt/rt5/sbin/rt-email-digest -m weekly&lt;br /&gt;
# Email out daily digests for users who have requested it&lt;br /&gt;
50  5   *   *   *   root    /opt/rt5/sbin/rt-email-digest -m daily&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
You can run all these jobs as the same user that runs your web server, rather than root. Run:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo sed -i &#039;s/\broot\b/www-data/&#039; /etc/cron.d/rt&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo sed -i &#039;s/\broot\b/apache/&#039; /etc/cron.d/rt&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Set up RT ==&lt;br /&gt;
&lt;br /&gt;
If you’ve gotten this far, congratulations, your RT install is really done now. You can start setting up RT with users, groups, queues, and business logic. [[Main Page|Head back to the main page]] to start exploring those topics.&lt;/div&gt;</summary>
		<author><name>Brett</name></author>
	</entry>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=ManualInstallation&amp;diff=27051</id>
		<title>ManualInstallation</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=ManualInstallation&amp;diff=27051"/>
		<updated>2022-01-13T20:33:52Z</updated>

		<summary type="html">&lt;p&gt;Brett: remove unnecessary httpd Listen directive&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Prev: [[ManualRequirements]] — Up: [[UserManual]] — Next: [[ManualApacheConfig]]&lt;br /&gt;
&lt;br /&gt;
This guide walks you through installing RT from source on a modern, popular Linux distro. Specifically, that means a distribution based on Debian or Red Hat that’s been released since around 2020.&lt;br /&gt;
&lt;br /&gt;
This guide assumes:&lt;br /&gt;
&lt;br /&gt;
* You can install packages generally available in Debian/Ubuntu or Red Hat/Fedora/CentOS.&lt;br /&gt;
* You want to install RT, and all of its Perl dependencies, from source to get the latest versions. (This is a trade-off. It means the boundaries of your install will be very clear, but you won’t get security updates for RT or Perl modules from your distribution.)&lt;br /&gt;
* You are willing to install a couple of extra tools to manage the RT installation similarly to how you would in other packaging systems (like PyPI, npm, etc.).&lt;br /&gt;
* You are willing to do a relatively maximal install of RT, enabling all the options during installation and then setting what you need in the configuration. (You could save a little space and time by being pickier about your options, but then that complicates the guide and makes it harder to turn those options on later if you want.)&lt;br /&gt;
* You are using a regular user account on the Linux system that can get superuser privileges with sudo.&lt;br /&gt;
&lt;br /&gt;
== Install the base dependencies ==&lt;br /&gt;
&lt;br /&gt;
These are required by RT, either to run or to install the dependencies.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install autoconf build-essential cpanminus curl libexpat-dev libgd-dev libssl-dev libz-dev gnupg graphviz lynx openssl perl&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf config-manager --set-enabled powertools&lt;br /&gt;
sudo dnf install patch tar which gcc gcc-c++ perl-core perl-App-cpanminus graphviz expat-devel gd-devel lynx openssl openssl-devel&lt;br /&gt;
sudo setenforce 0&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
(Turning off SELinux enforcement is required on Red Hat-based distributions because, as of October 2021, nobody has written a policy for RT.)&lt;br /&gt;
&lt;br /&gt;
== Install a database ==&lt;br /&gt;
&lt;br /&gt;
You need access to a database server. It can be remote, or you can install a database server alongside RT. RT supports a few different databases, but the best supported options are PostgreSQL and MariaDB.&lt;br /&gt;
&lt;br /&gt;
=== Installing and configuring the PostgreSQL server ===&lt;br /&gt;
&lt;br /&gt;
If you want to install a fresh PostgreSQL database server alongside RT:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install postgresql&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install postgresql-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In order to set up RT’s database, you will need a PostgreSQL superuser account that can be authenticated with a password. If you don’t have that, you can create it by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo createuser -sP rt_admin&amp;lt;/pre&amp;gt;&lt;br /&gt;
Set the password when prompted. Record this; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
=== Enable password authentication in PostgreSQL ===&lt;br /&gt;
&lt;br /&gt;
You need to consider this step whether you install the database locally, or use an existing one already running. RT supports connecting to PostgreSQL a few different ways, but authenticating with a username and password is simplest, and this guide is written based on that. Not all PostgreSQL installations allow this authentication method by default. You need to review your &amp;lt;code&amp;gt;pg_hba.conf&amp;lt;/code&amp;gt; file located at:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;/etc/postgresql/VERSION/main/pg_hba.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;/var/lib/pgsql/VERSION/data/pg_hba.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Replace &amp;lt;code&amp;gt;VERSION&amp;lt;/code&amp;gt; with the version of your PostgreSQL database. Add these two lines &#039;&#039;&#039;above&#039;&#039;&#039; any other lines that start with &amp;lt;code&amp;gt;host&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;host  rt5  rt_user   all  md5&lt;br /&gt;
host  rt5  rt_admin  all  md5&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This configuration will let &amp;lt;code&amp;gt;rt_user&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;rt_admin&amp;lt;/code&amp;gt; authorize themselves for the &amp;lt;code&amp;gt;rt5&amp;lt;/code&amp;gt; database using an &amp;lt;code&amp;gt;md5&amp;lt;/code&amp;gt; crypted password over a network connection (possibly using the localhost loopback network). You might be able to further restrict some of these fields for improved security, but doing so is outside the scope of this install guide. Refer to [https://www.postgresql.org/docs/current/auth-pg-hba-conf.html the pg_hba.conf documentation] for more details.&lt;br /&gt;
&lt;br /&gt;
Save your changes and reload the database:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo systemctl reload postgresql&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Installing the PostgreSQL client libraries ===&lt;br /&gt;
&lt;br /&gt;
These are required for RT to be able to talk to any PostgreSQL server.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install libpq-dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install postgresql-devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Once this is done you can skip ahead to installing a web server.&lt;br /&gt;
&lt;br /&gt;
=== Installing and configuring the MariaDB server ===&lt;br /&gt;
&lt;br /&gt;
If you want to install a fresh MariaDB database server alongside RT:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install mariadb-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install mariadb-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In order to set up RT’s database, you will need a MySQL superuser account. To stay consistent with PostgreSQL, I suggest setting a password for it. You can do that by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo mysql&lt;br /&gt;
mysql# GRANT ALL PRIVELEGES WITH GRANT OPTION ON rt5 TO rt_admin@localhost IDENTIFIED BY &#039;YourPassphraseHere&#039;;&amp;lt;/pre&amp;gt;&lt;br /&gt;
Record your passphrase; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
=== Adjust MariaDB’s max_allowed_packet setting ===&lt;br /&gt;
&lt;br /&gt;
You need to consider this step whether you install the database locally, or use an existing one already running. [https://mariadb.com/kb/en/server-system-variables/#max_allowed_packet MariaDB’s &amp;lt;code&amp;gt;max_allowed_packet&amp;lt;/code&amp;gt; setting] functionally limits the size of attachments in RT. The default is 16MiB, which is too small for most installations. You can ultimately choose any setting you’re comfortable with; 64MiB here should allow most requests without being too open.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;echo -e &#039;[client-server]\nmax_allowed_packet=64M\n&#039; | sudo tee /etc/mysql/conf.d/max_allowed_packet.cnf&lt;br /&gt;
sudo systemctl reload mariadb&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;echo -e &#039;[client-server]\nmax_allowed_packet=64M\n&#039; | sudo tee /etc/my.cnf.d/max_allowed_packet.cnf&lt;br /&gt;
sudo systemctl reload mariadb&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Installing the MariaDB client libraries ===&lt;br /&gt;
&lt;br /&gt;
These are required for RT to be able to talk to any MariaDB server.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install libmariadb-dev libmariadb-dev-compat&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install mariadb-devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Install a web server with FastCGI ==&lt;br /&gt;
&lt;br /&gt;
FastCGI is the best way to host RT’s web interface today. Installing the web server before RT makes the installation process simpler, because RT will be able to automatically some details about your web server like what user it runs as.&lt;br /&gt;
&lt;br /&gt;
=== Installing Apache ===&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install apache2 libapache2-mod-fcgid&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install httpd mod_fcgid mod_ssl&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ### Installing nginx --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Install RT ==&lt;br /&gt;
&lt;br /&gt;
=== Get and unpack the RT source code ===&lt;br /&gt;
&lt;br /&gt;
Download the latest source code using the link on the [https://bestpractical.com/download-page RT download page], extract it using &amp;lt;code&amp;gt;tar -xf&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt; into the source code directory to run the rest of the commands in this section. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;curl -O https://download.bestpractical.com/pub/rt/release/rt-5.0.2.tar.gz&lt;br /&gt;
tar -xf rt-5.0.2.tar.gz&lt;br /&gt;
cd rt-5.0.2&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Pre-configure RT ===&lt;br /&gt;
&lt;br /&gt;
This command will detect some information about your system in order to install RT properly, and decide which set of dependencies to install. Here’s what the different parts of our command are doing:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;--with-db-type=TYPE&amp;lt;/code&amp;gt; - Replace &amp;lt;code&amp;gt;TYPE&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;Pg&amp;lt;/code&amp;gt; for PostgreSQL, or &amp;lt;code&amp;gt;mysql&amp;lt;/code&amp;gt; for MariaDB.&lt;br /&gt;
* &amp;lt;code&amp;gt;--prefix=/opt/rt5&amp;lt;/code&amp;gt; sets the directory where RT will install all of its libraries, tools, and supporting files. You can choose another path if you like.&lt;br /&gt;
* The rest of the options tell RT to install additional dependencies for optional features.&lt;br /&gt;
&lt;br /&gt;
Make sure you have &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt;ed into the RT source directory, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;./configure --with-db-type=TYPE --prefix=/opt/rt5 --with-attachment-store=disk --enable-externalauth --enable-gd --enable-graphviz --enable-gpg --enable-smime&amp;lt;/pre&amp;gt;&lt;br /&gt;
For more background, [https://docs.bestpractical.com/rt/latest/configure.html refer to the RT configure options documentation].&lt;br /&gt;
&lt;br /&gt;
=== Install RT and its Perl dependencies ===&lt;br /&gt;
&lt;br /&gt;
This command will download, build, and install all of the Perl modules necessary to run RT with the configuration you set above. Here’s what the different parts of the command are doing:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;make dirs&amp;lt;/code&amp;gt; sets up RT&#039;s directory structure. We do this first to install dependencies under it.&lt;br /&gt;
* &amp;lt;code&amp;gt;make fixdeps&amp;lt;/code&amp;gt; actually installs those dependencies.&lt;br /&gt;
* &amp;lt;code&amp;gt;RT_FIX_DEPS_CMD=&#039;cpanm …&#039;&amp;lt;/code&amp;gt; tells RT to use cpanminus to install dependencies (instead of the older, default &amp;lt;code&amp;gt;cpan&amp;lt;/code&amp;gt; command), and to install them where RT will automatically load them.&lt;br /&gt;
* &amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt; installs all of RT’s files under &amp;lt;code&amp;gt;/opt/rt5&amp;lt;/code&amp;gt; (or the prefix directory you set in the previous step). It will only run if &amp;lt;code&amp;gt;fixdeps&amp;lt;/code&amp;gt; succeeds. Setting &amp;lt;code&amp;gt;PERL5LIB&amp;lt;/code&amp;gt; tells it where you installed those dependencies.&lt;br /&gt;
&lt;br /&gt;
Make sure you have &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt;ed into the RT source directory, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo make dirs&lt;br /&gt;
sudo ln -s . /opt/rt5/local/lib/perl5&lt;br /&gt;
make fixdeps RT_FIX_DEPS_CMD=&#039;cpanm --sudo --quiet --local-lib=/opt/rt5/local&#039;&lt;br /&gt;
sudo make install PERL5LIB=/opt/rt5/local/lib&amp;lt;/pre&amp;gt;&lt;br /&gt;
If it works, the command will eventually output a message that says “Congratulations. RT is now installed.” followed by instructions about configuring and setting up the database. We’ll do that next.&lt;br /&gt;
&lt;br /&gt;
=== Configure RT ===&lt;br /&gt;
&lt;br /&gt;
[https://docs.bestpractical.com/rt/latest/RT_Config.html RT has many configuration options.] You can put configuration options in the file &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/code&amp;gt;, or in individual files under &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.d/&amp;lt;/code&amp;gt;. Use an editor to save all the text below to &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/code&amp;gt; (you can just overwrite the existing file, or add this to the bottom of what’s there) and then fill in settings for your site everywhere the text &amp;lt;code&amp;gt;EDIT WITH&amp;lt;/code&amp;gt; appears.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Single-quote all values EXCEPT the special value `undef`&lt;br /&gt;
# that turns off a setting.&lt;br /&gt;
&lt;br /&gt;
# rtname appears in ticket email subjects. It needs to be globally unique,&lt;br /&gt;
# so use your organization&#039;s domain name.&lt;br /&gt;
Set($rtname, &#039;EDIT WITH yourdomain.example.com&#039;);&lt;br /&gt;
# Organization is used in the database for ticket links, etc. It also needs to&lt;br /&gt;
# be globally unique, so use your organization&#039;s domain name.&lt;br /&gt;
Set($Organization, &#039;EDIT WITH yourdomain.example.com&#039;);&lt;br /&gt;
# WebDomain is domain name of the RT web server. RT uses it to construct links&lt;br /&gt;
# and defend against CSRFs.&lt;br /&gt;
Set($WebDomain, &#039;EDIT WITH rt.yourdomain.example.com&#039;);&lt;br /&gt;
# WebPort is the port where the RT web server runs. Edit the number below if&lt;br /&gt;
# you&#039;re not using the standard HTTPS port.&lt;br /&gt;
Set($WebPort, &#039;443&#039;);&lt;br /&gt;
&lt;br /&gt;
# DatabaseUser is the name of the database account RT uses to read and store&lt;br /&gt;
# data. &#039;rt_user&#039; is the default but you can change it if you like.&lt;br /&gt;
# DO NOT use the &#039;rt_admin&#039; superuser created in the instructions above.&lt;br /&gt;
Set($DatabaseUser, &#039;rt_user&#039;);&lt;br /&gt;
# DatabasePassword is the password for DatabaseUser.&lt;br /&gt;
Set($DatabasePassword, &#039;EDIT WITH SomePassphraseHere&#039;);&lt;br /&gt;
# DatabaseHost is the hostname of the database server RT should use.&lt;br /&gt;
# Change &#039;localhost&#039; if it lives on a different server.&lt;br /&gt;
Set($DatabaseHost, &#039;localhost&#039;);&lt;br /&gt;
# DatabasePort is the port number of the database server RT should use.&lt;br /&gt;
# `undef` means the default for that database. Change it if you&#039;re not&lt;br /&gt;
# using the standard port.&lt;br /&gt;
Set($DatabasePort, undef);&lt;br /&gt;
# DatabaseName is the name of RT&#039;s database hosted on DatabaseHost.&lt;br /&gt;
# &#039;rt5&#039; is the default but you can change it if you like.&lt;br /&gt;
Set($DatabaseName, &#039;rt5&#039;);&lt;br /&gt;
# DatabaseAdmin is the name of the user in the database used to perform&lt;br /&gt;
# major administrative tasks. Change &#039;rt_admin&#039; if you&#039;re using a user&lt;br /&gt;
# besides the one created in this guide.&lt;br /&gt;
Set($DatabaseAdmin, &#039;rt_admin&#039;);&lt;br /&gt;
&lt;br /&gt;
# RT can log to syslog, stderr, and/or a dedicated file.&lt;br /&gt;
# Log settings are used both by the primary server and by command line&lt;br /&gt;
# tools like rt-crontool, rt-ldapimport, etc.&lt;br /&gt;
# You set all of RT&#039;s $LogTo* paramaters to a standard log level: &#039;debug&#039;,&lt;br /&gt;
# &#039;info&#039;, &#039;notice&#039;, &#039;warning&#039;, &#039;error&#039;, &#039;critical&#039;, &#039;alert&#039;, or &#039;emergency&#039;.&lt;br /&gt;
# For a modern install, I recommend logging primarily to syslog, so it goes&lt;br /&gt;
# to journald where it&#039;s easy to query and automatically gets rotated.&lt;br /&gt;
Set($LogToSyslog, &#039;info&#039;);&lt;br /&gt;
&lt;br /&gt;
# When the RT server logs to stderr, that usually goes to your web server&#039;s&lt;br /&gt;
# error log. Command line tools log to their own stderr. Setting this to&lt;br /&gt;
# &#039;warning&#039; or &#039;error&#039; helps ensure you get notified if RT&#039;s cron jobs&lt;br /&gt;
# encounter problems.&lt;br /&gt;
Set($LogToSTDERR, &#039;warning&#039;);&lt;br /&gt;
&lt;br /&gt;
# Turn off optional features that require additional configuration.&lt;br /&gt;
# If you want to use these, refer to the RT_Config documentation for&lt;br /&gt;
# instructions on how to set them up.&lt;br /&gt;
Set(%GnuPG, &#039;Enable&#039; =&amp;gt; &#039;0&#039;);&lt;br /&gt;
Set(%SMIME, &#039;Enable&#039; =&amp;gt; &#039;0&#039;);&lt;br /&gt;
&lt;br /&gt;
# Perl expects to find this 1 at the end of the file.&lt;br /&gt;
1;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;RT_SiteConfig.pm&amp;lt;/code&amp;gt; is actually Perl code. RT runs the code directly to load the configuration. Any time you finish editing it, you can check that you didn’t make any syntax errors by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;perl -c /opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Set up RT’s database ===&lt;br /&gt;
&lt;br /&gt;
RT includes a tool to help you set up its database. By default, it connects to the database as an administrator to create the database and user that you configured in the previous step.&lt;br /&gt;
&lt;br /&gt;
(The instructions from &amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt; and RT’s README file tell you to run &amp;lt;code&amp;gt;make initialize-database&amp;lt;/code&amp;gt;. That just runs &amp;lt;code&amp;gt;rt-setup-database&amp;lt;/code&amp;gt; for you. Running the tool directly makes it easier to pass the options you need.)&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;--action=init&amp;lt;/code&amp;gt; tells the tool to create the user, the database, the tables inside it, and insert core data RT needs to function.&lt;br /&gt;
* &#039;&#039;&#039;If&#039;&#039;&#039; you are using an existing database server and the database adminstrator has already created the user account and database for RT, then you can add the &amp;lt;code&amp;gt;--skip-create&amp;lt;/code&amp;gt; option.&lt;br /&gt;
* &#039;&#039;&#039;If&#039;&#039;&#039; you have a less common database setup, this tool has additional options to give you finer-grained control over what steps are run and how. Refer to [https://docs.bestpractical.com/rt/latest/rt-setup-database.html the full rt-setup-database documentation] to learn more about those.&lt;br /&gt;
* The command reads files from RT’s &amp;lt;code&amp;gt;etc/&amp;lt;/code&amp;gt; directory by default, so the easiest way to run it is to &amp;lt;code&amp;gt;cd /opt/rt5&amp;lt;/code&amp;gt; first, and then it will find the necessary files automatically.&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /opt/rt5&lt;br /&gt;
sudo sbin/rt-setup-database --action=init&amp;lt;/pre&amp;gt;&lt;br /&gt;
Enter the password for your database administrator account when prompted.&lt;br /&gt;
&lt;br /&gt;
=== Set up fulltext indexing ===&lt;br /&gt;
&lt;br /&gt;
Fulltext indexing speeds up searches for ticket content, which makes RT a lot nicer to use.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;--noask&amp;lt;/code&amp;gt; uses the default names for the index, which will be fine for a new install and simplifies the setup.&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo /opt/rt5/sbin/rt-setup-fulltext-index --noask&amp;lt;/pre&amp;gt;&lt;br /&gt;
Enter the password for your database administrator account when prompted. The end of the process will output some RT configuration that looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;### EXAMPLE OUTPUT ONLY - Don&#039;t use this directly!&lt;br /&gt;
Set( %FullTextSearch,&lt;br /&gt;
    Enable     =&amp;gt; 1,&lt;br /&gt;
    Indexed    =&amp;gt; 1,&lt;br /&gt;
    # Additional output from rt-setup-fulltext-index should be here.&lt;br /&gt;
    # The configuration varies by database type.&lt;br /&gt;
);&amp;lt;/pre&amp;gt;&lt;br /&gt;
Copy the output generated when you run &amp;lt;code&amp;gt;rt-setup-fulltext-index&amp;lt;/code&amp;gt; and save it to the file &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.d/FulltextIndex.pm&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Set permissions ===&lt;br /&gt;
&lt;br /&gt;
All of RT’s configuration files should be readable by the user that runs the web server, and no other users, in order to protect sensitive information like the database password. RT provides a command to set permissions appropriately according to your distribution and configuration. &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt; to the directory where you extracted the RT source code, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd rt-5.0.2&lt;br /&gt;
sudo make fixperms&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Verify the installation ===&lt;br /&gt;
&lt;br /&gt;
If everything has gone well, then you should be able to set a password for RT’s &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; user. You’ll use this later to log in to the web interface and continue setting up your system. Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo /opt/rt5/sbin/rt-passwd root&amp;lt;/pre&amp;gt;&lt;br /&gt;
Set the password when prompted. Record this; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s web server ==&lt;br /&gt;
&lt;br /&gt;
=== Configure Apache modules ===&lt;br /&gt;
&lt;br /&gt;
You will need to have the following modules enabled in Apache to run RT. You should already have these installed if you followed the instructions above.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;alias&amp;lt;/code&amp;gt; (required to map URLs to RT)&lt;br /&gt;
* &amp;lt;code&amp;gt;fcgid&amp;lt;/code&amp;gt; (required for Apache to talk to RT)&lt;br /&gt;
* &amp;lt;code&amp;gt;mpm_prefork&amp;lt;/code&amp;gt; (Apache requires you to select an MPM. RT is designed to work with the prefork module.)&lt;br /&gt;
* &amp;lt;code&amp;gt;ssl&amp;lt;/code&amp;gt; (required to serve HTTPS; optional otherwise)&lt;br /&gt;
&lt;br /&gt;
Enable them following these instructions:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo a2dismod mpm_event&lt;br /&gt;
sudo a2enmod fcgid&lt;br /&gt;
sudo a2enmod mpm_prefork&lt;br /&gt;
sudo a2enmod ssl&amp;lt;/pre&amp;gt;&lt;br /&gt;
| &amp;lt;pre&amp;gt;echo LoadModule mpm_prefork_module modules/mod_mpm_prefork.so | sudo tee /etc/httpd/conf.modules.d/00-mpm.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Disable default VirtualHosts (optional) ===&lt;br /&gt;
&lt;br /&gt;
If this web server is dedicated to RT, then you should disable the VirtualHosts that are included with the stock configuration. Run:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo a2dissite 000-default&lt;br /&gt;
sudo a2dissite default-ssl&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo sed -i~ &#039;/^&amp;lt;VirtualHost\b/ , /^&amp;lt;\/VirtualHost\b/ d&#039; /etc/httpd/conf.d/ssl.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Configure an Apache VirtualHost ===&lt;br /&gt;
&lt;br /&gt;
Create a file at the following location. You can change the &amp;lt;code&amp;gt;RT&amp;lt;/code&amp;gt; part of the filename if you like, but the file must exist in this directory and have a &amp;lt;code&amp;gt;.conf&amp;lt;/code&amp;gt; suffix.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;/etc/apache2/sites-available/RT.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
Then after you create the file, run: &amp;lt;code&amp;gt;sudo a2ensite RT&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;/etc/httpd/conf.d/zz_RT.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Use an editor to save all the text below to the new &amp;lt;code&amp;gt;RT.conf&amp;lt;/code&amp;gt; and then fill in settings for your site everywhere the text &amp;lt;code&amp;gt;EDIT WITH&amp;lt;/code&amp;gt; appears.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### Server-level settings&lt;br /&gt;
# These settings affect all of Apache. It is okay to put them here if Apache&lt;br /&gt;
# only hosts RT. If you are hosting other sites in the same Apache instance,&lt;br /&gt;
# you may need to put these settings in another file like&lt;br /&gt;
# (Debian/Ubuntu) /etc/apache2/conf-available/RT.conf&lt;br /&gt;
# (Red Hat/Fedora/CentOS) /etc/httpd/conf.d/RTserver.conf&lt;br /&gt;
# ... and ensure they do not conflict with settings required by other sites.&lt;br /&gt;
&lt;br /&gt;
# mod_fcgid only allows 128KiB requests by default. This is too small for users&lt;br /&gt;
# to upload files to RT. You can ultimately choose any setting you&#039;re&lt;br /&gt;
# comfortable with; 70MiB here should allow most requests without being too&lt;br /&gt;
# open.&lt;br /&gt;
FcgidMaxRequestLen 73400320&lt;br /&gt;
### End server-level settings&lt;br /&gt;
&lt;br /&gt;
### Primary RT VirtualHost&lt;br /&gt;
# You can change both the bind address and/or the port here as required.&lt;br /&gt;
# This default will listen for HTTPS connections on all interfaces.&lt;br /&gt;
&amp;lt;VirtualHost *:443&amp;gt;&lt;br /&gt;
  # EDIT HERE with the domain name of the web server.&lt;br /&gt;
  ServerName rt.yourdomain.example.com&lt;br /&gt;
  &amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
    SSLEngine on&lt;br /&gt;
    # These specify the paths to the SSL certificate and private key Apache&lt;br /&gt;
    # should use. These example paths are common for Let&#039;s Encrypt. If you&lt;br /&gt;
    # don&#039;t use Let&#039;s Encrypt, the standard location for these files is under&lt;br /&gt;
    # (Debian/Ubuntu) /etc/ssl&lt;br /&gt;
    # (Red Hat/Fedora/CentOS) /etc/pki/tls&lt;br /&gt;
    # EDIT HERE with the appropriate paths for your server&lt;br /&gt;
    SSLCertificateFile /etc/letsencrypt/live/example.com/fullchain.pem&lt;br /&gt;
    SSLCertificateKeyFile /etc/letsencrypt/live/example.com/privkey.pem&lt;br /&gt;
  &amp;lt;/IfModule&amp;gt;&lt;br /&gt;
  &amp;lt;Location /&amp;gt;&lt;br /&gt;
    Require all granted&lt;br /&gt;
    Options +ExecCGI&lt;br /&gt;
    AddHandler fcgid-script fcgi&lt;br /&gt;
  &amp;lt;/Location&amp;gt;&lt;br /&gt;
  AddDefaultCharset UTF-8&lt;br /&gt;
  DocumentRoot /opt/rt5/share/html&lt;br /&gt;
  ScriptAlias / /opt/rt5/sbin/rt-server.fcgi/&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
### End primary RT VirtualHost&lt;br /&gt;
&lt;br /&gt;
### Optional HTTPS Redirect VirtualHost&lt;br /&gt;
# Most modern servers support HTTPS and want all web traffic to go through it.&lt;br /&gt;
# This VirtualHost redirects normal HTTP traffic to HTTPS.&lt;br /&gt;
# You can delete this whole section if you don&#039;t want or need this.&lt;br /&gt;
&amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
  # You can change both the bind address and/or the port here as required.&lt;br /&gt;
  # This default will listen for HTTP connections on all interfaces.&lt;br /&gt;
  &amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
    SSLEngine off&lt;br /&gt;
    # EDIT HERE both lines below with the domain name of your web server.&lt;br /&gt;
    ServerName rt.yourdomain.example.com&lt;br /&gt;
    Redirect permanent / https://rt.yourdomain.example.com/&lt;br /&gt;
  &amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/IfModule&amp;gt;&lt;br /&gt;
### End optional HTTPS Redirect VirtualHost&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
After you’ve edited the file, load the configuration with:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo systemctl reload apache2&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo systemctl reload httpd&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If this command reports an error, double-check the configuration file for typos, especially in option names, file paths, and the&lt;br /&gt;
&amp;lt;Section&amp;gt;&lt;br /&gt;
pairs. Edit again and reload the configuration until it succeeds without output.&lt;br /&gt;
&lt;br /&gt;
=== Verify the web interface ===&lt;br /&gt;
&lt;br /&gt;
You should be able to visit your web server in your browser, and be presented with RT’s login screen. You should be able to log in with username &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; and the password you set previously.&lt;br /&gt;
&lt;br /&gt;
If you run into trouble, the first place to look for more information is by reading Apache’s error log:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo less /var/log/apache2/error.log&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo less /var/log/httpd/error.log&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s mail server ==&lt;br /&gt;
&lt;br /&gt;
RT both can both send and receive ticket updates via email. Unfortunately, there are too many variables to document a useful setup process here: getting this working usually requires creating DNS records, and coordinating with existing mail servers, which will be the main constraint on your setup. Instead this guide provides a brief overview of how the integration works, and where the connection points are that you likely need to work on.&lt;br /&gt;
&lt;br /&gt;
=== Sending Mail ===&lt;br /&gt;
&lt;br /&gt;
RT only knows how to send mail by passing it off to another program on the system. It cannot connect or authenticate directly to external mail servers. In the default configuration, RT runs the standard &amp;lt;code&amp;gt;sendmail&amp;lt;/code&amp;gt; command. There are [https://docs.bestpractical.com/rt/latest/RT_Config.html#Outgoing-mail configuration options to send mail through different commands] if you need.&lt;br /&gt;
&lt;br /&gt;
The most common setup is to install and configure a proper Mail Transfer Agent (MTA) like Postfix or Exim, and then configure it to send mail to the wider Internet as you need. This works well because the MTAs are robust and well-tested; they have flexible configuration to let you send mail out by relaying to other mail servers you specify with optional authentication; and most distributions install one by default anyway. The only hard part is configuring the MTA to send mail following your site’s policies.&lt;br /&gt;
&lt;br /&gt;
Other software is available that provides a slimmer version of the &amp;lt;code&amp;gt;sendmail&amp;lt;/code&amp;gt; command that connects to an external mail server for you, like ssmtp. These programs are usually easier to configure than an MTA, but they often lose email permanently if they can’t connect to the external server at the time it’s sent. (MTAs keep email queued locally until they successfully deliver it to another server.)&lt;br /&gt;
&lt;br /&gt;
=== Receiving email ===&lt;br /&gt;
&lt;br /&gt;
RT installs a command called &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; that receives an email on standard input and posts it to RT’s REST web interface, where it gets saved in the database and added to a ticket. You need to arrange for a way to send incoming email to this command.&lt;br /&gt;
&lt;br /&gt;
The most common setup is to have an MTA on the same box as RT receive email directly, and then set up mail aliases that call this command when mail comes in. Example &amp;lt;code&amp;gt;/etc/aliases&amp;lt;/code&amp;gt; entries look like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rt: &amp;quot;|/opt/rt5/bin/rt-mailgate --queue general --action correspond --url https://rt.yourdomain.example.com/&amp;quot;&lt;br /&gt;
rt-comment: &amp;quot;|/opt/rt5/bin/rt-mailgate --queue general --action comment --url https://rt.yourdomain.example.com/&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
This works well because, again, you’re probably running an MTA anyway; and the MTA can hold and queue mail if it comes in while RT is down for any reason, giving you a buffer against downtime.&lt;br /&gt;
&lt;br /&gt;
Another common option is to periodically run a tool that fetches mail using a protocol like IMAP, like fetchmail or getmail, and passes it on to &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt;. This is less common because it requires setting up another tool to run, and securely storing another set of mail server credentials. But it is useful when local policy prevents the RT server from receiving email directly.&lt;br /&gt;
&lt;br /&gt;
This is much less common, but it might help to know that &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; doesn’t have to run on the same system as RT itself. It just needs to be able to connect to RT’s web interface. If you don’t have any other options, you can install the RT software on a different system that receives email, and configure &#039;&#039;that&#039;&#039; system to run &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; and pass it on to the RT server. To do that, just repeat the installation instructions above, skipping the steps about installing the database and web server.&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s background jobs ==&lt;br /&gt;
&lt;br /&gt;
Create a file &amp;lt;code&amp;gt;/etc/cron.d/rt&amp;lt;/code&amp;gt; with the following content. You may edit all of the time fields as you see fit. Refer to the crontab(5) man page for details about their definitions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Update the fulltext index with new ticket data&lt;br /&gt;
*/3 *   *   *   *   root    /opt/rt5/sbin/rt-fulltext-indexer&lt;br /&gt;
# Email out dashboards that users have subscribed to&lt;br /&gt;
0   *   *   *   *   root    /opt/rt5/sbin/rt-email-dashboards&lt;br /&gt;
# Clean old sessions from the database&lt;br /&gt;
10  3   *   *   *   root    /opt/rt5/sbin/rt-clean-sessions --older 8d&lt;br /&gt;
# Email out weekly digests for users who have requested it&lt;br /&gt;
50  4   *   *   Mon root    /opt/rt5/sbin/rt-email-digest -m weekly&lt;br /&gt;
# Email out daily digests for users who have requested it&lt;br /&gt;
50  5   *   *   *   root    /opt/rt5/sbin/rt-email-digest -m daily&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
You can run all these jobs as the same user that runs your web server, rather than root. Run:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo sed -i &#039;s/\broot\b/www-data/&#039; /etc/cron.d/rt&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo sed -i &#039;s/\broot\b/apache/&#039; /etc/cron.d/rt&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Set up RT ==&lt;br /&gt;
&lt;br /&gt;
If you’ve gotten this far, congratulations, your RT install is really done now. You can start setting up RT with users, groups, queues, and business logic. [[Main Page|Head back to the main page]] to start exploring those topics.&lt;/div&gt;</summary>
		<author><name>Brett</name></author>
	</entry>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=ManualInstallation&amp;diff=27050</id>
		<title>ManualInstallation</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=ManualInstallation&amp;diff=27050"/>
		<updated>2022-01-13T20:30:27Z</updated>

		<summary type="html">&lt;p&gt;Brett: add section about disabling default VirtualHosts&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Prev: [[ManualRequirements]] — Up: [[UserManual]] — Next: [[ManualApacheConfig]]&lt;br /&gt;
&lt;br /&gt;
This guide walks you through installing RT from source on a modern, popular Linux distro. Specifically, that means a distribution based on Debian or Red Hat that’s been released since around 2020.&lt;br /&gt;
&lt;br /&gt;
This guide assumes:&lt;br /&gt;
&lt;br /&gt;
* You can install packages generally available in Debian/Ubuntu or Red Hat/Fedora/CentOS.&lt;br /&gt;
* You want to install RT, and all of its Perl dependencies, from source to get the latest versions. (This is a trade-off. It means the boundaries of your install will be very clear, but you won’t get security updates for RT or Perl modules from your distribution.)&lt;br /&gt;
* You are willing to install a couple of extra tools to manage the RT installation similarly to how you would in other packaging systems (like PyPI, npm, etc.).&lt;br /&gt;
* You are willing to do a relatively maximal install of RT, enabling all the options during installation and then setting what you need in the configuration. (You could save a little space and time by being pickier about your options, but then that complicates the guide and makes it harder to turn those options on later if you want.)&lt;br /&gt;
* You are using a regular user account on the Linux system that can get superuser privileges with sudo.&lt;br /&gt;
&lt;br /&gt;
== Install the base dependencies ==&lt;br /&gt;
&lt;br /&gt;
These are required by RT, either to run or to install the dependencies.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install autoconf build-essential cpanminus curl libexpat-dev libgd-dev libssl-dev libz-dev gnupg graphviz lynx openssl perl&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf config-manager --set-enabled powertools&lt;br /&gt;
sudo dnf install patch tar which gcc gcc-c++ perl-core perl-App-cpanminus graphviz expat-devel gd-devel lynx openssl openssl-devel&lt;br /&gt;
sudo setenforce 0&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
(Turning off SELinux enforcement is required on Red Hat-based distributions because, as of October 2021, nobody has written a policy for RT.)&lt;br /&gt;
&lt;br /&gt;
== Install a database ==&lt;br /&gt;
&lt;br /&gt;
You need access to a database server. It can be remote, or you can install a database server alongside RT. RT supports a few different databases, but the best supported options are PostgreSQL and MariaDB.&lt;br /&gt;
&lt;br /&gt;
=== Installing and configuring the PostgreSQL server ===&lt;br /&gt;
&lt;br /&gt;
If you want to install a fresh PostgreSQL database server alongside RT:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install postgresql&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install postgresql-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In order to set up RT’s database, you will need a PostgreSQL superuser account that can be authenticated with a password. If you don’t have that, you can create it by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo createuser -sP rt_admin&amp;lt;/pre&amp;gt;&lt;br /&gt;
Set the password when prompted. Record this; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
=== Enable password authentication in PostgreSQL ===&lt;br /&gt;
&lt;br /&gt;
You need to consider this step whether you install the database locally, or use an existing one already running. RT supports connecting to PostgreSQL a few different ways, but authenticating with a username and password is simplest, and this guide is written based on that. Not all PostgreSQL installations allow this authentication method by default. You need to review your &amp;lt;code&amp;gt;pg_hba.conf&amp;lt;/code&amp;gt; file located at:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;/etc/postgresql/VERSION/main/pg_hba.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;/var/lib/pgsql/VERSION/data/pg_hba.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Replace &amp;lt;code&amp;gt;VERSION&amp;lt;/code&amp;gt; with the version of your PostgreSQL database. Add these two lines &#039;&#039;&#039;above&#039;&#039;&#039; any other lines that start with &amp;lt;code&amp;gt;host&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;host  rt5  rt_user   all  md5&lt;br /&gt;
host  rt5  rt_admin  all  md5&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This configuration will let &amp;lt;code&amp;gt;rt_user&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;rt_admin&amp;lt;/code&amp;gt; authorize themselves for the &amp;lt;code&amp;gt;rt5&amp;lt;/code&amp;gt; database using an &amp;lt;code&amp;gt;md5&amp;lt;/code&amp;gt; crypted password over a network connection (possibly using the localhost loopback network). You might be able to further restrict some of these fields for improved security, but doing so is outside the scope of this install guide. Refer to [https://www.postgresql.org/docs/current/auth-pg-hba-conf.html the pg_hba.conf documentation] for more details.&lt;br /&gt;
&lt;br /&gt;
Save your changes and reload the database:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo systemctl reload postgresql&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Installing the PostgreSQL client libraries ===&lt;br /&gt;
&lt;br /&gt;
These are required for RT to be able to talk to any PostgreSQL server.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install libpq-dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install postgresql-devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Once this is done you can skip ahead to installing a web server.&lt;br /&gt;
&lt;br /&gt;
=== Installing and configuring the MariaDB server ===&lt;br /&gt;
&lt;br /&gt;
If you want to install a fresh MariaDB database server alongside RT:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install mariadb-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install mariadb-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In order to set up RT’s database, you will need a MySQL superuser account. To stay consistent with PostgreSQL, I suggest setting a password for it. You can do that by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo mysql&lt;br /&gt;
mysql# GRANT ALL PRIVELEGES WITH GRANT OPTION ON rt5 TO rt_admin@localhost IDENTIFIED BY &#039;YourPassphraseHere&#039;;&amp;lt;/pre&amp;gt;&lt;br /&gt;
Record your passphrase; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
=== Adjust MariaDB’s max_allowed_packet setting ===&lt;br /&gt;
&lt;br /&gt;
You need to consider this step whether you install the database locally, or use an existing one already running. [https://mariadb.com/kb/en/server-system-variables/#max_allowed_packet MariaDB’s &amp;lt;code&amp;gt;max_allowed_packet&amp;lt;/code&amp;gt; setting] functionally limits the size of attachments in RT. The default is 16MiB, which is too small for most installations. You can ultimately choose any setting you’re comfortable with; 64MiB here should allow most requests without being too open.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;echo -e &#039;[client-server]\nmax_allowed_packet=64M\n&#039; | sudo tee /etc/mysql/conf.d/max_allowed_packet.cnf&lt;br /&gt;
sudo systemctl reload mariadb&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;echo -e &#039;[client-server]\nmax_allowed_packet=64M\n&#039; | sudo tee /etc/my.cnf.d/max_allowed_packet.cnf&lt;br /&gt;
sudo systemctl reload mariadb&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Installing the MariaDB client libraries ===&lt;br /&gt;
&lt;br /&gt;
These are required for RT to be able to talk to any MariaDB server.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install libmariadb-dev libmariadb-dev-compat&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install mariadb-devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Install a web server with FastCGI ==&lt;br /&gt;
&lt;br /&gt;
FastCGI is the best way to host RT’s web interface today. Installing the web server before RT makes the installation process simpler, because RT will be able to automatically some details about your web server like what user it runs as.&lt;br /&gt;
&lt;br /&gt;
=== Installing Apache ===&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install apache2 libapache2-mod-fcgid&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install httpd mod_fcgid mod_ssl&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ### Installing nginx --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Install RT ==&lt;br /&gt;
&lt;br /&gt;
=== Get and unpack the RT source code ===&lt;br /&gt;
&lt;br /&gt;
Download the latest source code using the link on the [https://bestpractical.com/download-page RT download page], extract it using &amp;lt;code&amp;gt;tar -xf&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt; into the source code directory to run the rest of the commands in this section. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;curl -O https://download.bestpractical.com/pub/rt/release/rt-5.0.2.tar.gz&lt;br /&gt;
tar -xf rt-5.0.2.tar.gz&lt;br /&gt;
cd rt-5.0.2&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Pre-configure RT ===&lt;br /&gt;
&lt;br /&gt;
This command will detect some information about your system in order to install RT properly, and decide which set of dependencies to install. Here’s what the different parts of our command are doing:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;--with-db-type=TYPE&amp;lt;/code&amp;gt; - Replace &amp;lt;code&amp;gt;TYPE&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;Pg&amp;lt;/code&amp;gt; for PostgreSQL, or &amp;lt;code&amp;gt;mysql&amp;lt;/code&amp;gt; for MariaDB.&lt;br /&gt;
* &amp;lt;code&amp;gt;--prefix=/opt/rt5&amp;lt;/code&amp;gt; sets the directory where RT will install all of its libraries, tools, and supporting files. You can choose another path if you like.&lt;br /&gt;
* The rest of the options tell RT to install additional dependencies for optional features.&lt;br /&gt;
&lt;br /&gt;
Make sure you have &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt;ed into the RT source directory, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;./configure --with-db-type=TYPE --prefix=/opt/rt5 --with-attachment-store=disk --enable-externalauth --enable-gd --enable-graphviz --enable-gpg --enable-smime&amp;lt;/pre&amp;gt;&lt;br /&gt;
For more background, [https://docs.bestpractical.com/rt/latest/configure.html refer to the RT configure options documentation].&lt;br /&gt;
&lt;br /&gt;
=== Install RT and its Perl dependencies ===&lt;br /&gt;
&lt;br /&gt;
This command will download, build, and install all of the Perl modules necessary to run RT with the configuration you set above. Here’s what the different parts of the command are doing:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;make dirs&amp;lt;/code&amp;gt; sets up RT&#039;s directory structure. We do this first to install dependencies under it.&lt;br /&gt;
* &amp;lt;code&amp;gt;make fixdeps&amp;lt;/code&amp;gt; actually installs those dependencies.&lt;br /&gt;
* &amp;lt;code&amp;gt;RT_FIX_DEPS_CMD=&#039;cpanm …&#039;&amp;lt;/code&amp;gt; tells RT to use cpanminus to install dependencies (instead of the older, default &amp;lt;code&amp;gt;cpan&amp;lt;/code&amp;gt; command), and to install them where RT will automatically load them.&lt;br /&gt;
* &amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt; installs all of RT’s files under &amp;lt;code&amp;gt;/opt/rt5&amp;lt;/code&amp;gt; (or the prefix directory you set in the previous step). It will only run if &amp;lt;code&amp;gt;fixdeps&amp;lt;/code&amp;gt; succeeds. Setting &amp;lt;code&amp;gt;PERL5LIB&amp;lt;/code&amp;gt; tells it where you installed those dependencies.&lt;br /&gt;
&lt;br /&gt;
Make sure you have &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt;ed into the RT source directory, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo make dirs&lt;br /&gt;
sudo ln -s . /opt/rt5/local/lib/perl5&lt;br /&gt;
make fixdeps RT_FIX_DEPS_CMD=&#039;cpanm --sudo --quiet --local-lib=/opt/rt5/local&#039;&lt;br /&gt;
sudo make install PERL5LIB=/opt/rt5/local/lib&amp;lt;/pre&amp;gt;&lt;br /&gt;
If it works, the command will eventually output a message that says “Congratulations. RT is now installed.” followed by instructions about configuring and setting up the database. We’ll do that next.&lt;br /&gt;
&lt;br /&gt;
=== Configure RT ===&lt;br /&gt;
&lt;br /&gt;
[https://docs.bestpractical.com/rt/latest/RT_Config.html RT has many configuration options.] You can put configuration options in the file &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/code&amp;gt;, or in individual files under &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.d/&amp;lt;/code&amp;gt;. Use an editor to save all the text below to &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/code&amp;gt; (you can just overwrite the existing file, or add this to the bottom of what’s there) and then fill in settings for your site everywhere the text &amp;lt;code&amp;gt;EDIT WITH&amp;lt;/code&amp;gt; appears.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Single-quote all values EXCEPT the special value `undef`&lt;br /&gt;
# that turns off a setting.&lt;br /&gt;
&lt;br /&gt;
# rtname appears in ticket email subjects. It needs to be globally unique,&lt;br /&gt;
# so use your organization&#039;s domain name.&lt;br /&gt;
Set($rtname, &#039;EDIT WITH yourdomain.example.com&#039;);&lt;br /&gt;
# Organization is used in the database for ticket links, etc. It also needs to&lt;br /&gt;
# be globally unique, so use your organization&#039;s domain name.&lt;br /&gt;
Set($Organization, &#039;EDIT WITH yourdomain.example.com&#039;);&lt;br /&gt;
# WebDomain is domain name of the RT web server. RT uses it to construct links&lt;br /&gt;
# and defend against CSRFs.&lt;br /&gt;
Set($WebDomain, &#039;EDIT WITH rt.yourdomain.example.com&#039;);&lt;br /&gt;
# WebPort is the port where the RT web server runs. Edit the number below if&lt;br /&gt;
# you&#039;re not using the standard HTTPS port.&lt;br /&gt;
Set($WebPort, &#039;443&#039;);&lt;br /&gt;
&lt;br /&gt;
# DatabaseUser is the name of the database account RT uses to read and store&lt;br /&gt;
# data. &#039;rt_user&#039; is the default but you can change it if you like.&lt;br /&gt;
# DO NOT use the &#039;rt_admin&#039; superuser created in the instructions above.&lt;br /&gt;
Set($DatabaseUser, &#039;rt_user&#039;);&lt;br /&gt;
# DatabasePassword is the password for DatabaseUser.&lt;br /&gt;
Set($DatabasePassword, &#039;EDIT WITH SomePassphraseHere&#039;);&lt;br /&gt;
# DatabaseHost is the hostname of the database server RT should use.&lt;br /&gt;
# Change &#039;localhost&#039; if it lives on a different server.&lt;br /&gt;
Set($DatabaseHost, &#039;localhost&#039;);&lt;br /&gt;
# DatabasePort is the port number of the database server RT should use.&lt;br /&gt;
# `undef` means the default for that database. Change it if you&#039;re not&lt;br /&gt;
# using the standard port.&lt;br /&gt;
Set($DatabasePort, undef);&lt;br /&gt;
# DatabaseName is the name of RT&#039;s database hosted on DatabaseHost.&lt;br /&gt;
# &#039;rt5&#039; is the default but you can change it if you like.&lt;br /&gt;
Set($DatabaseName, &#039;rt5&#039;);&lt;br /&gt;
# DatabaseAdmin is the name of the user in the database used to perform&lt;br /&gt;
# major administrative tasks. Change &#039;rt_admin&#039; if you&#039;re using a user&lt;br /&gt;
# besides the one created in this guide.&lt;br /&gt;
Set($DatabaseAdmin, &#039;rt_admin&#039;);&lt;br /&gt;
&lt;br /&gt;
# RT can log to syslog, stderr, and/or a dedicated file.&lt;br /&gt;
# Log settings are used both by the primary server and by command line&lt;br /&gt;
# tools like rt-crontool, rt-ldapimport, etc.&lt;br /&gt;
# You set all of RT&#039;s $LogTo* paramaters to a standard log level: &#039;debug&#039;,&lt;br /&gt;
# &#039;info&#039;, &#039;notice&#039;, &#039;warning&#039;, &#039;error&#039;, &#039;critical&#039;, &#039;alert&#039;, or &#039;emergency&#039;.&lt;br /&gt;
# For a modern install, I recommend logging primarily to syslog, so it goes&lt;br /&gt;
# to journald where it&#039;s easy to query and automatically gets rotated.&lt;br /&gt;
Set($LogToSyslog, &#039;info&#039;);&lt;br /&gt;
&lt;br /&gt;
# When the RT server logs to stderr, that usually goes to your web server&#039;s&lt;br /&gt;
# error log. Command line tools log to their own stderr. Setting this to&lt;br /&gt;
# &#039;warning&#039; or &#039;error&#039; helps ensure you get notified if RT&#039;s cron jobs&lt;br /&gt;
# encounter problems.&lt;br /&gt;
Set($LogToSTDERR, &#039;warning&#039;);&lt;br /&gt;
&lt;br /&gt;
# Turn off optional features that require additional configuration.&lt;br /&gt;
# If you want to use these, refer to the RT_Config documentation for&lt;br /&gt;
# instructions on how to set them up.&lt;br /&gt;
Set(%GnuPG, &#039;Enable&#039; =&amp;gt; &#039;0&#039;);&lt;br /&gt;
Set(%SMIME, &#039;Enable&#039; =&amp;gt; &#039;0&#039;);&lt;br /&gt;
&lt;br /&gt;
# Perl expects to find this 1 at the end of the file.&lt;br /&gt;
1;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;RT_SiteConfig.pm&amp;lt;/code&amp;gt; is actually Perl code. RT runs the code directly to load the configuration. Any time you finish editing it, you can check that you didn’t make any syntax errors by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;perl -c /opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Set up RT’s database ===&lt;br /&gt;
&lt;br /&gt;
RT includes a tool to help you set up its database. By default, it connects to the database as an administrator to create the database and user that you configured in the previous step.&lt;br /&gt;
&lt;br /&gt;
(The instructions from &amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt; and RT’s README file tell you to run &amp;lt;code&amp;gt;make initialize-database&amp;lt;/code&amp;gt;. That just runs &amp;lt;code&amp;gt;rt-setup-database&amp;lt;/code&amp;gt; for you. Running the tool directly makes it easier to pass the options you need.)&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;--action=init&amp;lt;/code&amp;gt; tells the tool to create the user, the database, the tables inside it, and insert core data RT needs to function.&lt;br /&gt;
* &#039;&#039;&#039;If&#039;&#039;&#039; you are using an existing database server and the database adminstrator has already created the user account and database for RT, then you can add the &amp;lt;code&amp;gt;--skip-create&amp;lt;/code&amp;gt; option.&lt;br /&gt;
* &#039;&#039;&#039;If&#039;&#039;&#039; you have a less common database setup, this tool has additional options to give you finer-grained control over what steps are run and how. Refer to [https://docs.bestpractical.com/rt/latest/rt-setup-database.html the full rt-setup-database documentation] to learn more about those.&lt;br /&gt;
* The command reads files from RT’s &amp;lt;code&amp;gt;etc/&amp;lt;/code&amp;gt; directory by default, so the easiest way to run it is to &amp;lt;code&amp;gt;cd /opt/rt5&amp;lt;/code&amp;gt; first, and then it will find the necessary files automatically.&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /opt/rt5&lt;br /&gt;
sudo sbin/rt-setup-database --action=init&amp;lt;/pre&amp;gt;&lt;br /&gt;
Enter the password for your database administrator account when prompted.&lt;br /&gt;
&lt;br /&gt;
=== Set up fulltext indexing ===&lt;br /&gt;
&lt;br /&gt;
Fulltext indexing speeds up searches for ticket content, which makes RT a lot nicer to use.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;--noask&amp;lt;/code&amp;gt; uses the default names for the index, which will be fine for a new install and simplifies the setup.&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo /opt/rt5/sbin/rt-setup-fulltext-index --noask&amp;lt;/pre&amp;gt;&lt;br /&gt;
Enter the password for your database administrator account when prompted. The end of the process will output some RT configuration that looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;### EXAMPLE OUTPUT ONLY - Don&#039;t use this directly!&lt;br /&gt;
Set( %FullTextSearch,&lt;br /&gt;
    Enable     =&amp;gt; 1,&lt;br /&gt;
    Indexed    =&amp;gt; 1,&lt;br /&gt;
    # Additional output from rt-setup-fulltext-index should be here.&lt;br /&gt;
    # The configuration varies by database type.&lt;br /&gt;
);&amp;lt;/pre&amp;gt;&lt;br /&gt;
Copy the output generated when you run &amp;lt;code&amp;gt;rt-setup-fulltext-index&amp;lt;/code&amp;gt; and save it to the file &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.d/FulltextIndex.pm&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Set permissions ===&lt;br /&gt;
&lt;br /&gt;
All of RT’s configuration files should be readable by the user that runs the web server, and no other users, in order to protect sensitive information like the database password. RT provides a command to set permissions appropriately according to your distribution and configuration. &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt; to the directory where you extracted the RT source code, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd rt-5.0.2&lt;br /&gt;
sudo make fixperms&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Verify the installation ===&lt;br /&gt;
&lt;br /&gt;
If everything has gone well, then you should be able to set a password for RT’s &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; user. You’ll use this later to log in to the web interface and continue setting up your system. Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo /opt/rt5/sbin/rt-passwd root&amp;lt;/pre&amp;gt;&lt;br /&gt;
Set the password when prompted. Record this; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s web server ==&lt;br /&gt;
&lt;br /&gt;
=== Configure Apache modules ===&lt;br /&gt;
&lt;br /&gt;
You will need to have the following modules enabled in Apache to run RT. You should already have these installed if you followed the instructions above.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;alias&amp;lt;/code&amp;gt; (required to map URLs to RT)&lt;br /&gt;
* &amp;lt;code&amp;gt;fcgid&amp;lt;/code&amp;gt; (required for Apache to talk to RT)&lt;br /&gt;
* &amp;lt;code&amp;gt;mpm_prefork&amp;lt;/code&amp;gt; (Apache requires you to select an MPM. RT is designed to work with the prefork module.)&lt;br /&gt;
* &amp;lt;code&amp;gt;ssl&amp;lt;/code&amp;gt; (required to serve HTTPS; optional otherwise)&lt;br /&gt;
&lt;br /&gt;
Enable them following these instructions:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo a2dismod mpm_event&lt;br /&gt;
sudo a2enmod fcgid&lt;br /&gt;
sudo a2enmod mpm_prefork&lt;br /&gt;
sudo a2enmod ssl&amp;lt;/pre&amp;gt;&lt;br /&gt;
| &amp;lt;pre&amp;gt;echo LoadModule mpm_prefork_module modules/mod_mpm_prefork.so | sudo tee /etc/httpd/conf.modules.d/00-mpm.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Disable default VirtualHosts (optional) ===&lt;br /&gt;
&lt;br /&gt;
If this web server is dedicated to RT, then you should disable the VirtualHosts that are included with the stock configuration. Run:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo a2dissite 000-default&lt;br /&gt;
sudo a2dissite default-ssl&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo sed -i~ &#039;/^&amp;lt;VirtualHost\b/ , /^&amp;lt;\/VirtualHost\b/ d&#039; /etc/httpd/conf.d/ssl.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Configure an Apache VirtualHost ===&lt;br /&gt;
&lt;br /&gt;
Create a file at the following location. You can change the &amp;lt;code&amp;gt;RT&amp;lt;/code&amp;gt; part of the filename if you like, but the file must exist in this directory and have a &amp;lt;code&amp;gt;.conf&amp;lt;/code&amp;gt; suffix.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;/etc/apache2/sites-available/RT.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
Then after you create the file, run: &amp;lt;code&amp;gt;sudo a2ensite RT&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;/etc/httpd/conf.d/zz_RT.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Use an editor to save all the text below to the new &amp;lt;code&amp;gt;RT.conf&amp;lt;/code&amp;gt; and then fill in settings for your site everywhere the text &amp;lt;code&amp;gt;EDIT WITH&amp;lt;/code&amp;gt; appears.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### Server-level settings&lt;br /&gt;
# These settings affect all of Apache. It is okay to put them here if Apache&lt;br /&gt;
# only hosts RT. If you are hosting other sites in the same Apache instance,&lt;br /&gt;
# you may need to put these settings in another file like&lt;br /&gt;
# (Debian/Ubuntu) /etc/apache2/conf-available/RT.conf&lt;br /&gt;
# (Red Hat/Fedora/CentOS) /etc/httpd/conf.d/RTserver.conf&lt;br /&gt;
# ... and ensure they do not conflict with settings required by other sites.&lt;br /&gt;
&lt;br /&gt;
# mod_fcgid only allows 128KiB requests by default. This is too small for users&lt;br /&gt;
# to upload files to RT. You can ultimately choose any setting you&#039;re&lt;br /&gt;
# comfortable with; 70MiB here should allow most requests without being too&lt;br /&gt;
# open.&lt;br /&gt;
FcgidMaxRequestLen 73400320&lt;br /&gt;
&lt;br /&gt;
&amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
  # Listen on the standard HTTPS port.&lt;br /&gt;
  # You can change this to a nonstandard port if you must.&lt;br /&gt;
  Listen 443&lt;br /&gt;
&amp;lt;/IfModule&amp;gt;&lt;br /&gt;
### End server-level settings&lt;br /&gt;
&lt;br /&gt;
### Primary RT VirtualHost&lt;br /&gt;
# You can change both the bind address and/or the port here as required.&lt;br /&gt;
# This default will listen for HTTPS connections on all interfaces.&lt;br /&gt;
&amp;lt;VirtualHost *:443&amp;gt;&lt;br /&gt;
  # EDIT HERE with the domain name of the web server.&lt;br /&gt;
  ServerName rt.yourdomain.example.com&lt;br /&gt;
  &amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
    SSLEngine on&lt;br /&gt;
    # These specify the paths to the SSL certificate and private key Apache&lt;br /&gt;
    # should use. These example paths are common for Let&#039;s Encrypt. If you&lt;br /&gt;
    # don&#039;t use Let&#039;s Encrypt, the standard location for these files is under&lt;br /&gt;
    # (Debian/Ubuntu) /etc/ssl&lt;br /&gt;
    # (Red Hat/Fedora/CentOS) /etc/pki/tls&lt;br /&gt;
    # EDIT HERE with the appropriate paths for your server&lt;br /&gt;
    SSLCertificateFile /etc/letsencrypt/live/example.com/fullchain.pem&lt;br /&gt;
    SSLCertificateKeyFile /etc/letsencrypt/live/example.com/privkey.pem&lt;br /&gt;
  &amp;lt;/IfModule&amp;gt;&lt;br /&gt;
  &amp;lt;Location /&amp;gt;&lt;br /&gt;
    Require all granted&lt;br /&gt;
    Options +ExecCGI&lt;br /&gt;
    AddHandler fcgid-script fcgi&lt;br /&gt;
  &amp;lt;/Location&amp;gt;&lt;br /&gt;
  AddDefaultCharset UTF-8&lt;br /&gt;
  DocumentRoot /opt/rt5/share/html&lt;br /&gt;
  ScriptAlias / /opt/rt5/sbin/rt-server.fcgi/&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
### End primary RT VirtualHost&lt;br /&gt;
&lt;br /&gt;
### Optional HTTPS Redirect VirtualHost&lt;br /&gt;
# Most modern servers support HTTPS and want all web traffic to go through it.&lt;br /&gt;
# This VirtualHost redirects normal HTTP traffic to HTTPS.&lt;br /&gt;
# You can delete this whole section if you don&#039;t want or need this.&lt;br /&gt;
&amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
  # You can change both the bind address and/or the port here as required.&lt;br /&gt;
  # This default will listen for HTTP connections on all interfaces.&lt;br /&gt;
  &amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
    SSLEngine off&lt;br /&gt;
    # EDIT HERE both lines below with the domain name of your web server.&lt;br /&gt;
    ServerName rt.yourdomain.example.com&lt;br /&gt;
    Redirect permanent / https://rt.yourdomain.example.com/&lt;br /&gt;
  &amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/IfModule&amp;gt;&lt;br /&gt;
### End optional HTTPS Redirect VirtualHost&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
After you’ve edited the file, load the configuration with:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo systemctl reload apache2&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo systemctl reload httpd&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If this command reports an error, double-check the configuration file for typos, especially in option names, file paths, and the&lt;br /&gt;
&amp;lt;Section&amp;gt;&lt;br /&gt;
pairs. Edit again and reload the configuration until it succeeds without output.&lt;br /&gt;
&lt;br /&gt;
=== Verify the web interface ===&lt;br /&gt;
&lt;br /&gt;
You should be able to visit your web server in your browser, and be presented with RT’s login screen. You should be able to log in with username &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; and the password you set previously.&lt;br /&gt;
&lt;br /&gt;
If you run into trouble, the first place to look for more information is by reading Apache’s error log:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo less /var/log/apache2/error.log&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo less /var/log/httpd/error.log&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s mail server ==&lt;br /&gt;
&lt;br /&gt;
RT both can both send and receive ticket updates via email. Unfortunately, there are too many variables to document a useful setup process here: getting this working usually requires creating DNS records, and coordinating with existing mail servers, which will be the main constraint on your setup. Instead this guide provides a brief overview of how the integration works, and where the connection points are that you likely need to work on.&lt;br /&gt;
&lt;br /&gt;
=== Sending Mail ===&lt;br /&gt;
&lt;br /&gt;
RT only knows how to send mail by passing it off to another program on the system. It cannot connect or authenticate directly to external mail servers. In the default configuration, RT runs the standard &amp;lt;code&amp;gt;sendmail&amp;lt;/code&amp;gt; command. There are [https://docs.bestpractical.com/rt/latest/RT_Config.html#Outgoing-mail configuration options to send mail through different commands] if you need.&lt;br /&gt;
&lt;br /&gt;
The most common setup is to install and configure a proper Mail Transfer Agent (MTA) like Postfix or Exim, and then configure it to send mail to the wider Internet as you need. This works well because the MTAs are robust and well-tested; they have flexible configuration to let you send mail out by relaying to other mail servers you specify with optional authentication; and most distributions install one by default anyway. The only hard part is configuring the MTA to send mail following your site’s policies.&lt;br /&gt;
&lt;br /&gt;
Other software is available that provides a slimmer version of the &amp;lt;code&amp;gt;sendmail&amp;lt;/code&amp;gt; command that connects to an external mail server for you, like ssmtp. These programs are usually easier to configure than an MTA, but they often lose email permanently if they can’t connect to the external server at the time it’s sent. (MTAs keep email queued locally until they successfully deliver it to another server.)&lt;br /&gt;
&lt;br /&gt;
=== Receiving email ===&lt;br /&gt;
&lt;br /&gt;
RT installs a command called &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; that receives an email on standard input and posts it to RT’s REST web interface, where it gets saved in the database and added to a ticket. You need to arrange for a way to send incoming email to this command.&lt;br /&gt;
&lt;br /&gt;
The most common setup is to have an MTA on the same box as RT receive email directly, and then set up mail aliases that call this command when mail comes in. Example &amp;lt;code&amp;gt;/etc/aliases&amp;lt;/code&amp;gt; entries look like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rt: &amp;quot;|/opt/rt5/bin/rt-mailgate --queue general --action correspond --url https://rt.yourdomain.example.com/&amp;quot;&lt;br /&gt;
rt-comment: &amp;quot;|/opt/rt5/bin/rt-mailgate --queue general --action comment --url https://rt.yourdomain.example.com/&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
This works well because, again, you’re probably running an MTA anyway; and the MTA can hold and queue mail if it comes in while RT is down for any reason, giving you a buffer against downtime.&lt;br /&gt;
&lt;br /&gt;
Another common option is to periodically run a tool that fetches mail using a protocol like IMAP, like fetchmail or getmail, and passes it on to &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt;. This is less common because it requires setting up another tool to run, and securely storing another set of mail server credentials. But it is useful when local policy prevents the RT server from receiving email directly.&lt;br /&gt;
&lt;br /&gt;
This is much less common, but it might help to know that &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; doesn’t have to run on the same system as RT itself. It just needs to be able to connect to RT’s web interface. If you don’t have any other options, you can install the RT software on a different system that receives email, and configure &#039;&#039;that&#039;&#039; system to run &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; and pass it on to the RT server. To do that, just repeat the installation instructions above, skipping the steps about installing the database and web server.&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s background jobs ==&lt;br /&gt;
&lt;br /&gt;
Create a file &amp;lt;code&amp;gt;/etc/cron.d/rt&amp;lt;/code&amp;gt; with the following content. You may edit all of the time fields as you see fit. Refer to the crontab(5) man page for details about their definitions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Update the fulltext index with new ticket data&lt;br /&gt;
*/3 *   *   *   *   root    /opt/rt5/sbin/rt-fulltext-indexer&lt;br /&gt;
# Email out dashboards that users have subscribed to&lt;br /&gt;
0   *   *   *   *   root    /opt/rt5/sbin/rt-email-dashboards&lt;br /&gt;
# Clean old sessions from the database&lt;br /&gt;
10  3   *   *   *   root    /opt/rt5/sbin/rt-clean-sessions --older 8d&lt;br /&gt;
# Email out weekly digests for users who have requested it&lt;br /&gt;
50  4   *   *   Mon root    /opt/rt5/sbin/rt-email-digest -m weekly&lt;br /&gt;
# Email out daily digests for users who have requested it&lt;br /&gt;
50  5   *   *   *   root    /opt/rt5/sbin/rt-email-digest -m daily&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
You can run all these jobs as the same user that runs your web server, rather than root. Run:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo sed -i &#039;s/\broot\b/www-data/&#039; /etc/cron.d/rt&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo sed -i &#039;s/\broot\b/apache/&#039; /etc/cron.d/rt&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Set up RT ==&lt;br /&gt;
&lt;br /&gt;
If you’ve gotten this far, congratulations, your RT install is really done now. You can start setting up RT with users, groups, queues, and business logic. [[Main Page|Head back to the main page]] to start exploring those topics.&lt;/div&gt;</summary>
		<author><name>Brett</name></author>
	</entry>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=ManualInstallation&amp;diff=27049</id>
		<title>ManualInstallation</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=ManualInstallation&amp;diff=27049"/>
		<updated>2022-01-13T20:22:59Z</updated>

		<summary type="html">&lt;p&gt;Brett: ensure httpd RT config loads after ssl.conf on Red Hat&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Prev: [[ManualRequirements]] — Up: [[UserManual]] — Next: [[ManualApacheConfig]]&lt;br /&gt;
&lt;br /&gt;
This guide walks you through installing RT from source on a modern, popular Linux distro. Specifically, that means a distribution based on Debian or Red Hat that’s been released since around 2020.&lt;br /&gt;
&lt;br /&gt;
This guide assumes:&lt;br /&gt;
&lt;br /&gt;
* You can install packages generally available in Debian/Ubuntu or Red Hat/Fedora/CentOS.&lt;br /&gt;
* You want to install RT, and all of its Perl dependencies, from source to get the latest versions. (This is a trade-off. It means the boundaries of your install will be very clear, but you won’t get security updates for RT or Perl modules from your distribution.)&lt;br /&gt;
* You are willing to install a couple of extra tools to manage the RT installation similarly to how you would in other packaging systems (like PyPI, npm, etc.).&lt;br /&gt;
* You are willing to do a relatively maximal install of RT, enabling all the options during installation and then setting what you need in the configuration. (You could save a little space and time by being pickier about your options, but then that complicates the guide and makes it harder to turn those options on later if you want.)&lt;br /&gt;
* You are using a regular user account on the Linux system that can get superuser privileges with sudo.&lt;br /&gt;
&lt;br /&gt;
== Install the base dependencies ==&lt;br /&gt;
&lt;br /&gt;
These are required by RT, either to run or to install the dependencies.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install autoconf build-essential cpanminus curl libexpat-dev libgd-dev libssl-dev libz-dev gnupg graphviz lynx openssl perl&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf config-manager --set-enabled powertools&lt;br /&gt;
sudo dnf install patch tar which gcc gcc-c++ perl-core perl-App-cpanminus graphviz expat-devel gd-devel lynx openssl openssl-devel&lt;br /&gt;
sudo setenforce 0&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
(Turning off SELinux enforcement is required on Red Hat-based distributions because, as of October 2021, nobody has written a policy for RT.)&lt;br /&gt;
&lt;br /&gt;
== Install a database ==&lt;br /&gt;
&lt;br /&gt;
You need access to a database server. It can be remote, or you can install a database server alongside RT. RT supports a few different databases, but the best supported options are PostgreSQL and MariaDB.&lt;br /&gt;
&lt;br /&gt;
=== Installing and configuring the PostgreSQL server ===&lt;br /&gt;
&lt;br /&gt;
If you want to install a fresh PostgreSQL database server alongside RT:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install postgresql&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install postgresql-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In order to set up RT’s database, you will need a PostgreSQL superuser account that can be authenticated with a password. If you don’t have that, you can create it by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo createuser -sP rt_admin&amp;lt;/pre&amp;gt;&lt;br /&gt;
Set the password when prompted. Record this; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
=== Enable password authentication in PostgreSQL ===&lt;br /&gt;
&lt;br /&gt;
You need to consider this step whether you install the database locally, or use an existing one already running. RT supports connecting to PostgreSQL a few different ways, but authenticating with a username and password is simplest, and this guide is written based on that. Not all PostgreSQL installations allow this authentication method by default. You need to review your &amp;lt;code&amp;gt;pg_hba.conf&amp;lt;/code&amp;gt; file located at:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;/etc/postgresql/VERSION/main/pg_hba.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;/var/lib/pgsql/VERSION/data/pg_hba.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Replace &amp;lt;code&amp;gt;VERSION&amp;lt;/code&amp;gt; with the version of your PostgreSQL database. Add these two lines &#039;&#039;&#039;above&#039;&#039;&#039; any other lines that start with &amp;lt;code&amp;gt;host&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;host  rt5  rt_user   all  md5&lt;br /&gt;
host  rt5  rt_admin  all  md5&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This configuration will let &amp;lt;code&amp;gt;rt_user&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;rt_admin&amp;lt;/code&amp;gt; authorize themselves for the &amp;lt;code&amp;gt;rt5&amp;lt;/code&amp;gt; database using an &amp;lt;code&amp;gt;md5&amp;lt;/code&amp;gt; crypted password over a network connection (possibly using the localhost loopback network). You might be able to further restrict some of these fields for improved security, but doing so is outside the scope of this install guide. Refer to [https://www.postgresql.org/docs/current/auth-pg-hba-conf.html the pg_hba.conf documentation] for more details.&lt;br /&gt;
&lt;br /&gt;
Save your changes and reload the database:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo systemctl reload postgresql&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Installing the PostgreSQL client libraries ===&lt;br /&gt;
&lt;br /&gt;
These are required for RT to be able to talk to any PostgreSQL server.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install libpq-dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install postgresql-devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Once this is done you can skip ahead to installing a web server.&lt;br /&gt;
&lt;br /&gt;
=== Installing and configuring the MariaDB server ===&lt;br /&gt;
&lt;br /&gt;
If you want to install a fresh MariaDB database server alongside RT:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install mariadb-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install mariadb-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In order to set up RT’s database, you will need a MySQL superuser account. To stay consistent with PostgreSQL, I suggest setting a password for it. You can do that by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo mysql&lt;br /&gt;
mysql# GRANT ALL PRIVELEGES WITH GRANT OPTION ON rt5 TO rt_admin@localhost IDENTIFIED BY &#039;YourPassphraseHere&#039;;&amp;lt;/pre&amp;gt;&lt;br /&gt;
Record your passphrase; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
=== Adjust MariaDB’s max_allowed_packet setting ===&lt;br /&gt;
&lt;br /&gt;
You need to consider this step whether you install the database locally, or use an existing one already running. [https://mariadb.com/kb/en/server-system-variables/#max_allowed_packet MariaDB’s &amp;lt;code&amp;gt;max_allowed_packet&amp;lt;/code&amp;gt; setting] functionally limits the size of attachments in RT. The default is 16MiB, which is too small for most installations. You can ultimately choose any setting you’re comfortable with; 64MiB here should allow most requests without being too open.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;echo -e &#039;[client-server]\nmax_allowed_packet=64M\n&#039; | sudo tee /etc/mysql/conf.d/max_allowed_packet.cnf&lt;br /&gt;
sudo systemctl reload mariadb&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;echo -e &#039;[client-server]\nmax_allowed_packet=64M\n&#039; | sudo tee /etc/my.cnf.d/max_allowed_packet.cnf&lt;br /&gt;
sudo systemctl reload mariadb&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Installing the MariaDB client libraries ===&lt;br /&gt;
&lt;br /&gt;
These are required for RT to be able to talk to any MariaDB server.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install libmariadb-dev libmariadb-dev-compat&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install mariadb-devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Install a web server with FastCGI ==&lt;br /&gt;
&lt;br /&gt;
FastCGI is the best way to host RT’s web interface today. Installing the web server before RT makes the installation process simpler, because RT will be able to automatically some details about your web server like what user it runs as.&lt;br /&gt;
&lt;br /&gt;
=== Installing Apache ===&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install apache2 libapache2-mod-fcgid&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install httpd mod_fcgid mod_ssl&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ### Installing nginx --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Install RT ==&lt;br /&gt;
&lt;br /&gt;
=== Get and unpack the RT source code ===&lt;br /&gt;
&lt;br /&gt;
Download the latest source code using the link on the [https://bestpractical.com/download-page RT download page], extract it using &amp;lt;code&amp;gt;tar -xf&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt; into the source code directory to run the rest of the commands in this section. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;curl -O https://download.bestpractical.com/pub/rt/release/rt-5.0.2.tar.gz&lt;br /&gt;
tar -xf rt-5.0.2.tar.gz&lt;br /&gt;
cd rt-5.0.2&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Pre-configure RT ===&lt;br /&gt;
&lt;br /&gt;
This command will detect some information about your system in order to install RT properly, and decide which set of dependencies to install. Here’s what the different parts of our command are doing:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;--with-db-type=TYPE&amp;lt;/code&amp;gt; - Replace &amp;lt;code&amp;gt;TYPE&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;Pg&amp;lt;/code&amp;gt; for PostgreSQL, or &amp;lt;code&amp;gt;mysql&amp;lt;/code&amp;gt; for MariaDB.&lt;br /&gt;
* &amp;lt;code&amp;gt;--prefix=/opt/rt5&amp;lt;/code&amp;gt; sets the directory where RT will install all of its libraries, tools, and supporting files. You can choose another path if you like.&lt;br /&gt;
* The rest of the options tell RT to install additional dependencies for optional features.&lt;br /&gt;
&lt;br /&gt;
Make sure you have &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt;ed into the RT source directory, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;./configure --with-db-type=TYPE --prefix=/opt/rt5 --with-attachment-store=disk --enable-externalauth --enable-gd --enable-graphviz --enable-gpg --enable-smime&amp;lt;/pre&amp;gt;&lt;br /&gt;
For more background, [https://docs.bestpractical.com/rt/latest/configure.html refer to the RT configure options documentation].&lt;br /&gt;
&lt;br /&gt;
=== Install RT and its Perl dependencies ===&lt;br /&gt;
&lt;br /&gt;
This command will download, build, and install all of the Perl modules necessary to run RT with the configuration you set above. Here’s what the different parts of the command are doing:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;make dirs&amp;lt;/code&amp;gt; sets up RT&#039;s directory structure. We do this first to install dependencies under it.&lt;br /&gt;
* &amp;lt;code&amp;gt;make fixdeps&amp;lt;/code&amp;gt; actually installs those dependencies.&lt;br /&gt;
* &amp;lt;code&amp;gt;RT_FIX_DEPS_CMD=&#039;cpanm …&#039;&amp;lt;/code&amp;gt; tells RT to use cpanminus to install dependencies (instead of the older, default &amp;lt;code&amp;gt;cpan&amp;lt;/code&amp;gt; command), and to install them where RT will automatically load them.&lt;br /&gt;
* &amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt; installs all of RT’s files under &amp;lt;code&amp;gt;/opt/rt5&amp;lt;/code&amp;gt; (or the prefix directory you set in the previous step). It will only run if &amp;lt;code&amp;gt;fixdeps&amp;lt;/code&amp;gt; succeeds. Setting &amp;lt;code&amp;gt;PERL5LIB&amp;lt;/code&amp;gt; tells it where you installed those dependencies.&lt;br /&gt;
&lt;br /&gt;
Make sure you have &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt;ed into the RT source directory, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo make dirs&lt;br /&gt;
sudo ln -s . /opt/rt5/local/lib/perl5&lt;br /&gt;
make fixdeps RT_FIX_DEPS_CMD=&#039;cpanm --sudo --quiet --local-lib=/opt/rt5/local&#039;&lt;br /&gt;
sudo make install PERL5LIB=/opt/rt5/local/lib&amp;lt;/pre&amp;gt;&lt;br /&gt;
If it works, the command will eventually output a message that says “Congratulations. RT is now installed.” followed by instructions about configuring and setting up the database. We’ll do that next.&lt;br /&gt;
&lt;br /&gt;
=== Configure RT ===&lt;br /&gt;
&lt;br /&gt;
[https://docs.bestpractical.com/rt/latest/RT_Config.html RT has many configuration options.] You can put configuration options in the file &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/code&amp;gt;, or in individual files under &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.d/&amp;lt;/code&amp;gt;. Use an editor to save all the text below to &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/code&amp;gt; (you can just overwrite the existing file, or add this to the bottom of what’s there) and then fill in settings for your site everywhere the text &amp;lt;code&amp;gt;EDIT WITH&amp;lt;/code&amp;gt; appears.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Single-quote all values EXCEPT the special value `undef`&lt;br /&gt;
# that turns off a setting.&lt;br /&gt;
&lt;br /&gt;
# rtname appears in ticket email subjects. It needs to be globally unique,&lt;br /&gt;
# so use your organization&#039;s domain name.&lt;br /&gt;
Set($rtname, &#039;EDIT WITH yourdomain.example.com&#039;);&lt;br /&gt;
# Organization is used in the database for ticket links, etc. It also needs to&lt;br /&gt;
# be globally unique, so use your organization&#039;s domain name.&lt;br /&gt;
Set($Organization, &#039;EDIT WITH yourdomain.example.com&#039;);&lt;br /&gt;
# WebDomain is domain name of the RT web server. RT uses it to construct links&lt;br /&gt;
# and defend against CSRFs.&lt;br /&gt;
Set($WebDomain, &#039;EDIT WITH rt.yourdomain.example.com&#039;);&lt;br /&gt;
# WebPort is the port where the RT web server runs. Edit the number below if&lt;br /&gt;
# you&#039;re not using the standard HTTPS port.&lt;br /&gt;
Set($WebPort, &#039;443&#039;);&lt;br /&gt;
&lt;br /&gt;
# DatabaseUser is the name of the database account RT uses to read and store&lt;br /&gt;
# data. &#039;rt_user&#039; is the default but you can change it if you like.&lt;br /&gt;
# DO NOT use the &#039;rt_admin&#039; superuser created in the instructions above.&lt;br /&gt;
Set($DatabaseUser, &#039;rt_user&#039;);&lt;br /&gt;
# DatabasePassword is the password for DatabaseUser.&lt;br /&gt;
Set($DatabasePassword, &#039;EDIT WITH SomePassphraseHere&#039;);&lt;br /&gt;
# DatabaseHost is the hostname of the database server RT should use.&lt;br /&gt;
# Change &#039;localhost&#039; if it lives on a different server.&lt;br /&gt;
Set($DatabaseHost, &#039;localhost&#039;);&lt;br /&gt;
# DatabasePort is the port number of the database server RT should use.&lt;br /&gt;
# `undef` means the default for that database. Change it if you&#039;re not&lt;br /&gt;
# using the standard port.&lt;br /&gt;
Set($DatabasePort, undef);&lt;br /&gt;
# DatabaseName is the name of RT&#039;s database hosted on DatabaseHost.&lt;br /&gt;
# &#039;rt5&#039; is the default but you can change it if you like.&lt;br /&gt;
Set($DatabaseName, &#039;rt5&#039;);&lt;br /&gt;
# DatabaseAdmin is the name of the user in the database used to perform&lt;br /&gt;
# major administrative tasks. Change &#039;rt_admin&#039; if you&#039;re using a user&lt;br /&gt;
# besides the one created in this guide.&lt;br /&gt;
Set($DatabaseAdmin, &#039;rt_admin&#039;);&lt;br /&gt;
&lt;br /&gt;
# RT can log to syslog, stderr, and/or a dedicated file.&lt;br /&gt;
# Log settings are used both by the primary server and by command line&lt;br /&gt;
# tools like rt-crontool, rt-ldapimport, etc.&lt;br /&gt;
# You set all of RT&#039;s $LogTo* paramaters to a standard log level: &#039;debug&#039;,&lt;br /&gt;
# &#039;info&#039;, &#039;notice&#039;, &#039;warning&#039;, &#039;error&#039;, &#039;critical&#039;, &#039;alert&#039;, or &#039;emergency&#039;.&lt;br /&gt;
# For a modern install, I recommend logging primarily to syslog, so it goes&lt;br /&gt;
# to journald where it&#039;s easy to query and automatically gets rotated.&lt;br /&gt;
Set($LogToSyslog, &#039;info&#039;);&lt;br /&gt;
&lt;br /&gt;
# When the RT server logs to stderr, that usually goes to your web server&#039;s&lt;br /&gt;
# error log. Command line tools log to their own stderr. Setting this to&lt;br /&gt;
# &#039;warning&#039; or &#039;error&#039; helps ensure you get notified if RT&#039;s cron jobs&lt;br /&gt;
# encounter problems.&lt;br /&gt;
Set($LogToSTDERR, &#039;warning&#039;);&lt;br /&gt;
&lt;br /&gt;
# Turn off optional features that require additional configuration.&lt;br /&gt;
# If you want to use these, refer to the RT_Config documentation for&lt;br /&gt;
# instructions on how to set them up.&lt;br /&gt;
Set(%GnuPG, &#039;Enable&#039; =&amp;gt; &#039;0&#039;);&lt;br /&gt;
Set(%SMIME, &#039;Enable&#039; =&amp;gt; &#039;0&#039;);&lt;br /&gt;
&lt;br /&gt;
# Perl expects to find this 1 at the end of the file.&lt;br /&gt;
1;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;RT_SiteConfig.pm&amp;lt;/code&amp;gt; is actually Perl code. RT runs the code directly to load the configuration. Any time you finish editing it, you can check that you didn’t make any syntax errors by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;perl -c /opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Set up RT’s database ===&lt;br /&gt;
&lt;br /&gt;
RT includes a tool to help you set up its database. By default, it connects to the database as an administrator to create the database and user that you configured in the previous step.&lt;br /&gt;
&lt;br /&gt;
(The instructions from &amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt; and RT’s README file tell you to run &amp;lt;code&amp;gt;make initialize-database&amp;lt;/code&amp;gt;. That just runs &amp;lt;code&amp;gt;rt-setup-database&amp;lt;/code&amp;gt; for you. Running the tool directly makes it easier to pass the options you need.)&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;--action=init&amp;lt;/code&amp;gt; tells the tool to create the user, the database, the tables inside it, and insert core data RT needs to function.&lt;br /&gt;
* &#039;&#039;&#039;If&#039;&#039;&#039; you are using an existing database server and the database adminstrator has already created the user account and database for RT, then you can add the &amp;lt;code&amp;gt;--skip-create&amp;lt;/code&amp;gt; option.&lt;br /&gt;
* &#039;&#039;&#039;If&#039;&#039;&#039; you have a less common database setup, this tool has additional options to give you finer-grained control over what steps are run and how. Refer to [https://docs.bestpractical.com/rt/latest/rt-setup-database.html the full rt-setup-database documentation] to learn more about those.&lt;br /&gt;
* The command reads files from RT’s &amp;lt;code&amp;gt;etc/&amp;lt;/code&amp;gt; directory by default, so the easiest way to run it is to &amp;lt;code&amp;gt;cd /opt/rt5&amp;lt;/code&amp;gt; first, and then it will find the necessary files automatically.&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /opt/rt5&lt;br /&gt;
sudo sbin/rt-setup-database --action=init&amp;lt;/pre&amp;gt;&lt;br /&gt;
Enter the password for your database administrator account when prompted.&lt;br /&gt;
&lt;br /&gt;
=== Set up fulltext indexing ===&lt;br /&gt;
&lt;br /&gt;
Fulltext indexing speeds up searches for ticket content, which makes RT a lot nicer to use.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;--noask&amp;lt;/code&amp;gt; uses the default names for the index, which will be fine for a new install and simplifies the setup.&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo /opt/rt5/sbin/rt-setup-fulltext-index --noask&amp;lt;/pre&amp;gt;&lt;br /&gt;
Enter the password for your database administrator account when prompted. The end of the process will output some RT configuration that looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;### EXAMPLE OUTPUT ONLY - Don&#039;t use this directly!&lt;br /&gt;
Set( %FullTextSearch,&lt;br /&gt;
    Enable     =&amp;gt; 1,&lt;br /&gt;
    Indexed    =&amp;gt; 1,&lt;br /&gt;
    # Additional output from rt-setup-fulltext-index should be here.&lt;br /&gt;
    # The configuration varies by database type.&lt;br /&gt;
);&amp;lt;/pre&amp;gt;&lt;br /&gt;
Copy the output generated when you run &amp;lt;code&amp;gt;rt-setup-fulltext-index&amp;lt;/code&amp;gt; and save it to the file &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.d/FulltextIndex.pm&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Set permissions ===&lt;br /&gt;
&lt;br /&gt;
All of RT’s configuration files should be readable by the user that runs the web server, and no other users, in order to protect sensitive information like the database password. RT provides a command to set permissions appropriately according to your distribution and configuration. &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt; to the directory where you extracted the RT source code, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd rt-5.0.2&lt;br /&gt;
sudo make fixperms&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Verify the installation ===&lt;br /&gt;
&lt;br /&gt;
If everything has gone well, then you should be able to set a password for RT’s &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; user. You’ll use this later to log in to the web interface and continue setting up your system. Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo /opt/rt5/sbin/rt-passwd root&amp;lt;/pre&amp;gt;&lt;br /&gt;
Set the password when prompted. Record this; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s web server ==&lt;br /&gt;
&lt;br /&gt;
=== Configure Apache modules ===&lt;br /&gt;
&lt;br /&gt;
You will need to have the following modules enabled in Apache to run RT. You should already have these installed if you followed the instructions above.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;alias&amp;lt;/code&amp;gt; (required to map URLs to RT)&lt;br /&gt;
* &amp;lt;code&amp;gt;fcgid&amp;lt;/code&amp;gt; (required for Apache to talk to RT)&lt;br /&gt;
* &amp;lt;code&amp;gt;mpm_prefork&amp;lt;/code&amp;gt; (Apache requires you to select an MPM. RT is designed to work with the prefork module.)&lt;br /&gt;
* &amp;lt;code&amp;gt;ssl&amp;lt;/code&amp;gt; (required to serve HTTPS; optional otherwise)&lt;br /&gt;
&lt;br /&gt;
Enable them following these instructions:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo a2dismod mpm_event&lt;br /&gt;
sudo a2enmod fcgid&lt;br /&gt;
sudo a2enmod mpm_prefork&lt;br /&gt;
sudo a2enmod ssl&amp;lt;/pre&amp;gt;&lt;br /&gt;
| &amp;lt;pre&amp;gt;echo LoadModule mpm_prefork_module modules/mod_mpm_prefork.so | sudo tee /etc/httpd/conf.modules.d/00-mpm.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Configure an Apache VirtualHost ===&lt;br /&gt;
&lt;br /&gt;
Create a file at the following location. You can change the &amp;lt;code&amp;gt;RT&amp;lt;/code&amp;gt; part of the filename if you like, but the file must exist in this directory and have a &amp;lt;code&amp;gt;.conf&amp;lt;/code&amp;gt; suffix.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;/etc/apache2/sites-available/RT.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
Then after you create the file, run: &amp;lt;code&amp;gt;sudo a2ensite RT&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;/etc/httpd/conf.d/zz_RT.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Use an editor to save all the text below to the new &amp;lt;code&amp;gt;RT.conf&amp;lt;/code&amp;gt; and then fill in settings for your site everywhere the text &amp;lt;code&amp;gt;EDIT WITH&amp;lt;/code&amp;gt; appears.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### Server-level settings&lt;br /&gt;
# These settings affect all of Apache. It is okay to put them here if Apache&lt;br /&gt;
# only hosts RT. If you are hosting other sites in the same Apache instance,&lt;br /&gt;
# you may need to put these settings in another file like&lt;br /&gt;
# (Debian/Ubuntu) /etc/apache2/conf-available/RT.conf&lt;br /&gt;
# (Red Hat/Fedora/CentOS) /etc/httpd/conf.d/RTserver.conf&lt;br /&gt;
# ... and ensure they do not conflict with settings required by other sites.&lt;br /&gt;
&lt;br /&gt;
# mod_fcgid only allows 128KiB requests by default. This is too small for users&lt;br /&gt;
# to upload files to RT. You can ultimately choose any setting you&#039;re&lt;br /&gt;
# comfortable with; 70MiB here should allow most requests without being too&lt;br /&gt;
# open.&lt;br /&gt;
FcgidMaxRequestLen 73400320&lt;br /&gt;
&lt;br /&gt;
&amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
  # Listen on the standard HTTPS port.&lt;br /&gt;
  # You can change this to a nonstandard port if you must.&lt;br /&gt;
  Listen 443&lt;br /&gt;
&amp;lt;/IfModule&amp;gt;&lt;br /&gt;
### End server-level settings&lt;br /&gt;
&lt;br /&gt;
### Primary RT VirtualHost&lt;br /&gt;
# You can change both the bind address and/or the port here as required.&lt;br /&gt;
# This default will listen for HTTPS connections on all interfaces.&lt;br /&gt;
&amp;lt;VirtualHost *:443&amp;gt;&lt;br /&gt;
  # EDIT HERE with the domain name of the web server.&lt;br /&gt;
  ServerName rt.yourdomain.example.com&lt;br /&gt;
  &amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
    SSLEngine on&lt;br /&gt;
    # These specify the paths to the SSL certificate and private key Apache&lt;br /&gt;
    # should use. These example paths are common for Let&#039;s Encrypt. If you&lt;br /&gt;
    # don&#039;t use Let&#039;s Encrypt, the standard location for these files is under&lt;br /&gt;
    # (Debian/Ubuntu) /etc/ssl&lt;br /&gt;
    # (Red Hat/Fedora/CentOS) /etc/pki/tls&lt;br /&gt;
    # EDIT HERE with the appropriate paths for your server&lt;br /&gt;
    SSLCertificateFile /etc/letsencrypt/live/example.com/fullchain.pem&lt;br /&gt;
    SSLCertificateKeyFile /etc/letsencrypt/live/example.com/privkey.pem&lt;br /&gt;
  &amp;lt;/IfModule&amp;gt;&lt;br /&gt;
  &amp;lt;Location /&amp;gt;&lt;br /&gt;
    Require all granted&lt;br /&gt;
    Options +ExecCGI&lt;br /&gt;
    AddHandler fcgid-script fcgi&lt;br /&gt;
  &amp;lt;/Location&amp;gt;&lt;br /&gt;
  AddDefaultCharset UTF-8&lt;br /&gt;
  DocumentRoot /opt/rt5/share/html&lt;br /&gt;
  ScriptAlias / /opt/rt5/sbin/rt-server.fcgi/&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
### End primary RT VirtualHost&lt;br /&gt;
&lt;br /&gt;
### Optional HTTPS Redirect VirtualHost&lt;br /&gt;
# Most modern servers support HTTPS and want all web traffic to go through it.&lt;br /&gt;
# This VirtualHost redirects normal HTTP traffic to HTTPS.&lt;br /&gt;
# You can delete this whole section if you don&#039;t want or need this.&lt;br /&gt;
&amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
  # You can change both the bind address and/or the port here as required.&lt;br /&gt;
  # This default will listen for HTTP connections on all interfaces.&lt;br /&gt;
  &amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
    SSLEngine off&lt;br /&gt;
    # EDIT HERE both lines below with the domain name of your web server.&lt;br /&gt;
    ServerName rt.yourdomain.example.com&lt;br /&gt;
    Redirect permanent / https://rt.yourdomain.example.com/&lt;br /&gt;
  &amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/IfModule&amp;gt;&lt;br /&gt;
### End optional HTTPS Redirect VirtualHost&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
After you’ve edited the file, load the configuration with:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo systemctl reload apache2&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo systemctl reload httpd&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If this command reports an error, double-check the configuration file for typos, especially in option names, file paths, and the&lt;br /&gt;
&amp;lt;Section&amp;gt;&lt;br /&gt;
pairs. Edit again and reload the configuration until it succeeds without output.&lt;br /&gt;
&lt;br /&gt;
=== Verify the web interface ===&lt;br /&gt;
&lt;br /&gt;
You should be able to visit your web server in your browser, and be presented with RT’s login screen. You should be able to log in with username &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; and the password you set previously.&lt;br /&gt;
&lt;br /&gt;
If you run into trouble, the first place to look for more information is by reading Apache’s error log:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo less /var/log/apache2/error.log&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo less /var/log/httpd/error.log&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s mail server ==&lt;br /&gt;
&lt;br /&gt;
RT both can both send and receive ticket updates via email. Unfortunately, there are too many variables to document a useful setup process here: getting this working usually requires creating DNS records, and coordinating with existing mail servers, which will be the main constraint on your setup. Instead this guide provides a brief overview of how the integration works, and where the connection points are that you likely need to work on.&lt;br /&gt;
&lt;br /&gt;
=== Sending Mail ===&lt;br /&gt;
&lt;br /&gt;
RT only knows how to send mail by passing it off to another program on the system. It cannot connect or authenticate directly to external mail servers. In the default configuration, RT runs the standard &amp;lt;code&amp;gt;sendmail&amp;lt;/code&amp;gt; command. There are [https://docs.bestpractical.com/rt/latest/RT_Config.html#Outgoing-mail configuration options to send mail through different commands] if you need.&lt;br /&gt;
&lt;br /&gt;
The most common setup is to install and configure a proper Mail Transfer Agent (MTA) like Postfix or Exim, and then configure it to send mail to the wider Internet as you need. This works well because the MTAs are robust and well-tested; they have flexible configuration to let you send mail out by relaying to other mail servers you specify with optional authentication; and most distributions install one by default anyway. The only hard part is configuring the MTA to send mail following your site’s policies.&lt;br /&gt;
&lt;br /&gt;
Other software is available that provides a slimmer version of the &amp;lt;code&amp;gt;sendmail&amp;lt;/code&amp;gt; command that connects to an external mail server for you, like ssmtp. These programs are usually easier to configure than an MTA, but they often lose email permanently if they can’t connect to the external server at the time it’s sent. (MTAs keep email queued locally until they successfully deliver it to another server.)&lt;br /&gt;
&lt;br /&gt;
=== Receiving email ===&lt;br /&gt;
&lt;br /&gt;
RT installs a command called &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; that receives an email on standard input and posts it to RT’s REST web interface, where it gets saved in the database and added to a ticket. You need to arrange for a way to send incoming email to this command.&lt;br /&gt;
&lt;br /&gt;
The most common setup is to have an MTA on the same box as RT receive email directly, and then set up mail aliases that call this command when mail comes in. Example &amp;lt;code&amp;gt;/etc/aliases&amp;lt;/code&amp;gt; entries look like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rt: &amp;quot;|/opt/rt5/bin/rt-mailgate --queue general --action correspond --url https://rt.yourdomain.example.com/&amp;quot;&lt;br /&gt;
rt-comment: &amp;quot;|/opt/rt5/bin/rt-mailgate --queue general --action comment --url https://rt.yourdomain.example.com/&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
This works well because, again, you’re probably running an MTA anyway; and the MTA can hold and queue mail if it comes in while RT is down for any reason, giving you a buffer against downtime.&lt;br /&gt;
&lt;br /&gt;
Another common option is to periodically run a tool that fetches mail using a protocol like IMAP, like fetchmail or getmail, and passes it on to &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt;. This is less common because it requires setting up another tool to run, and securely storing another set of mail server credentials. But it is useful when local policy prevents the RT server from receiving email directly.&lt;br /&gt;
&lt;br /&gt;
This is much less common, but it might help to know that &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; doesn’t have to run on the same system as RT itself. It just needs to be able to connect to RT’s web interface. If you don’t have any other options, you can install the RT software on a different system that receives email, and configure &#039;&#039;that&#039;&#039; system to run &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; and pass it on to the RT server. To do that, just repeat the installation instructions above, skipping the steps about installing the database and web server.&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s background jobs ==&lt;br /&gt;
&lt;br /&gt;
Create a file &amp;lt;code&amp;gt;/etc/cron.d/rt&amp;lt;/code&amp;gt; with the following content. You may edit all of the time fields as you see fit. Refer to the crontab(5) man page for details about their definitions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Update the fulltext index with new ticket data&lt;br /&gt;
*/3 *   *   *   *   root    /opt/rt5/sbin/rt-fulltext-indexer&lt;br /&gt;
# Email out dashboards that users have subscribed to&lt;br /&gt;
0   *   *   *   *   root    /opt/rt5/sbin/rt-email-dashboards&lt;br /&gt;
# Clean old sessions from the database&lt;br /&gt;
10  3   *   *   *   root    /opt/rt5/sbin/rt-clean-sessions --older 8d&lt;br /&gt;
# Email out weekly digests for users who have requested it&lt;br /&gt;
50  4   *   *   Mon root    /opt/rt5/sbin/rt-email-digest -m weekly&lt;br /&gt;
# Email out daily digests for users who have requested it&lt;br /&gt;
50  5   *   *   *   root    /opt/rt5/sbin/rt-email-digest -m daily&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
You can run all these jobs as the same user that runs your web server, rather than root. Run:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo sed -i &#039;s/\broot\b/www-data/&#039; /etc/cron.d/rt&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo sed -i &#039;s/\broot\b/apache/&#039; /etc/cron.d/rt&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Set up RT ==&lt;br /&gt;
&lt;br /&gt;
If you’ve gotten this far, congratulations, your RT install is really done now. You can start setting up RT with users, groups, queues, and business logic. [[Main Page|Head back to the main page]] to start exploring those topics.&lt;/div&gt;</summary>
		<author><name>Brett</name></author>
	</entry>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=ManualInstallation&amp;diff=27048</id>
		<title>ManualInstallation</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=ManualInstallation&amp;diff=27048"/>
		<updated>2022-01-07T22:36:56Z</updated>

		<summary type="html">&lt;p&gt;Brett: `make install` needs to know PERL5LIB&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Prev: [[ManualRequirements]] — Up: [[UserManual]] — Next: [[ManualApacheConfig]]&lt;br /&gt;
&lt;br /&gt;
This guide walks you through installing RT from source on a modern, popular Linux distro. Specifically, that means a distribution based on Debian or Red Hat that’s been released since around 2020.&lt;br /&gt;
&lt;br /&gt;
This guide assumes:&lt;br /&gt;
&lt;br /&gt;
* You can install packages generally available in Debian/Ubuntu or Red Hat/Fedora/CentOS.&lt;br /&gt;
* You want to install RT, and all of its Perl dependencies, from source to get the latest versions. (This is a trade-off. It means the boundaries of your install will be very clear, but you won’t get security updates for RT or Perl modules from your distribution.)&lt;br /&gt;
* You are willing to install a couple of extra tools to manage the RT installation similarly to how you would in other packaging systems (like PyPI, npm, etc.).&lt;br /&gt;
* You are willing to do a relatively maximal install of RT, enabling all the options during installation and then setting what you need in the configuration. (You could save a little space and time by being pickier about your options, but then that complicates the guide and makes it harder to turn those options on later if you want.)&lt;br /&gt;
* You are using a regular user account on the Linux system that can get superuser privileges with sudo.&lt;br /&gt;
&lt;br /&gt;
== Install the base dependencies ==&lt;br /&gt;
&lt;br /&gt;
These are required by RT, either to run or to install the dependencies.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install autoconf build-essential cpanminus curl libexpat-dev libgd-dev libssl-dev libz-dev gnupg graphviz lynx openssl perl&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf config-manager --set-enabled powertools&lt;br /&gt;
sudo dnf install patch tar which gcc gcc-c++ perl-core perl-App-cpanminus graphviz expat-devel gd-devel lynx openssl openssl-devel&lt;br /&gt;
sudo setenforce 0&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
(Turning off SELinux enforcement is required on Red Hat-based distributions because, as of October 2021, nobody has written a policy for RT.)&lt;br /&gt;
&lt;br /&gt;
== Install a database ==&lt;br /&gt;
&lt;br /&gt;
You need access to a database server. It can be remote, or you can install a database server alongside RT. RT supports a few different databases, but the best supported options are PostgreSQL and MariaDB.&lt;br /&gt;
&lt;br /&gt;
=== Installing and configuring the PostgreSQL server ===&lt;br /&gt;
&lt;br /&gt;
If you want to install a fresh PostgreSQL database server alongside RT:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install postgresql&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install postgresql-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In order to set up RT’s database, you will need a PostgreSQL superuser account that can be authenticated with a password. If you don’t have that, you can create it by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo createuser -sP rt_admin&amp;lt;/pre&amp;gt;&lt;br /&gt;
Set the password when prompted. Record this; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
=== Enable password authentication in PostgreSQL ===&lt;br /&gt;
&lt;br /&gt;
You need to consider this step whether you install the database locally, or use an existing one already running. RT supports connecting to PostgreSQL a few different ways, but authenticating with a username and password is simplest, and this guide is written based on that. Not all PostgreSQL installations allow this authentication method by default. You need to review your &amp;lt;code&amp;gt;pg_hba.conf&amp;lt;/code&amp;gt; file located at:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;/etc/postgresql/VERSION/main/pg_hba.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;/var/lib/pgsql/VERSION/data/pg_hba.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Replace &amp;lt;code&amp;gt;VERSION&amp;lt;/code&amp;gt; with the version of your PostgreSQL database. Add these two lines &#039;&#039;&#039;above&#039;&#039;&#039; any other lines that start with &amp;lt;code&amp;gt;host&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;host  rt5  rt_user   all  md5&lt;br /&gt;
host  rt5  rt_admin  all  md5&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This configuration will let &amp;lt;code&amp;gt;rt_user&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;rt_admin&amp;lt;/code&amp;gt; authorize themselves for the &amp;lt;code&amp;gt;rt5&amp;lt;/code&amp;gt; database using an &amp;lt;code&amp;gt;md5&amp;lt;/code&amp;gt; crypted password over a network connection (possibly using the localhost loopback network). You might be able to further restrict some of these fields for improved security, but doing so is outside the scope of this install guide. Refer to [https://www.postgresql.org/docs/current/auth-pg-hba-conf.html the pg_hba.conf documentation] for more details.&lt;br /&gt;
&lt;br /&gt;
Save your changes and reload the database:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo systemctl reload postgresql&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Installing the PostgreSQL client libraries ===&lt;br /&gt;
&lt;br /&gt;
These are required for RT to be able to talk to any PostgreSQL server.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install libpq-dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install postgresql-devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Once this is done you can skip ahead to installing a web server.&lt;br /&gt;
&lt;br /&gt;
=== Installing and configuring the MariaDB server ===&lt;br /&gt;
&lt;br /&gt;
If you want to install a fresh MariaDB database server alongside RT:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install mariadb-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install mariadb-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In order to set up RT’s database, you will need a MySQL superuser account. To stay consistent with PostgreSQL, I suggest setting a password for it. You can do that by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo mysql&lt;br /&gt;
mysql# GRANT ALL PRIVELEGES WITH GRANT OPTION ON rt5 TO rt_admin@localhost IDENTIFIED BY &#039;YourPassphraseHere&#039;;&amp;lt;/pre&amp;gt;&lt;br /&gt;
Record your passphrase; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
=== Adjust MariaDB’s max_allowed_packet setting ===&lt;br /&gt;
&lt;br /&gt;
You need to consider this step whether you install the database locally, or use an existing one already running. [https://mariadb.com/kb/en/server-system-variables/#max_allowed_packet MariaDB’s &amp;lt;code&amp;gt;max_allowed_packet&amp;lt;/code&amp;gt; setting] functionally limits the size of attachments in RT. The default is 16MiB, which is too small for most installations. You can ultimately choose any setting you’re comfortable with; 64MiB here should allow most requests without being too open.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;echo -e &#039;[client-server]\nmax_allowed_packet=64M\n&#039; | sudo tee /etc/mysql/conf.d/max_allowed_packet.cnf&lt;br /&gt;
sudo systemctl reload mariadb&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;echo -e &#039;[client-server]\nmax_allowed_packet=64M\n&#039; | sudo tee /etc/my.cnf.d/max_allowed_packet.cnf&lt;br /&gt;
sudo systemctl reload mariadb&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Installing the MariaDB client libraries ===&lt;br /&gt;
&lt;br /&gt;
These are required for RT to be able to talk to any MariaDB server.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install libmariadb-dev libmariadb-dev-compat&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install mariadb-devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Install a web server with FastCGI ==&lt;br /&gt;
&lt;br /&gt;
FastCGI is the best way to host RT’s web interface today. Installing the web server before RT makes the installation process simpler, because RT will be able to automatically some details about your web server like what user it runs as.&lt;br /&gt;
&lt;br /&gt;
=== Installing Apache ===&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install apache2 libapache2-mod-fcgid&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install httpd mod_fcgid mod_ssl&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ### Installing nginx --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Install RT ==&lt;br /&gt;
&lt;br /&gt;
=== Get and unpack the RT source code ===&lt;br /&gt;
&lt;br /&gt;
Download the latest source code using the link on the [https://bestpractical.com/download-page RT download page], extract it using &amp;lt;code&amp;gt;tar -xf&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt; into the source code directory to run the rest of the commands in this section. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;curl -O https://download.bestpractical.com/pub/rt/release/rt-5.0.2.tar.gz&lt;br /&gt;
tar -xf rt-5.0.2.tar.gz&lt;br /&gt;
cd rt-5.0.2&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Pre-configure RT ===&lt;br /&gt;
&lt;br /&gt;
This command will detect some information about your system in order to install RT properly, and decide which set of dependencies to install. Here’s what the different parts of our command are doing:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;--with-db-type=TYPE&amp;lt;/code&amp;gt; - Replace &amp;lt;code&amp;gt;TYPE&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;Pg&amp;lt;/code&amp;gt; for PostgreSQL, or &amp;lt;code&amp;gt;mysql&amp;lt;/code&amp;gt; for MariaDB.&lt;br /&gt;
* &amp;lt;code&amp;gt;--prefix=/opt/rt5&amp;lt;/code&amp;gt; sets the directory where RT will install all of its libraries, tools, and supporting files. You can choose another path if you like.&lt;br /&gt;
* The rest of the options tell RT to install additional dependencies for optional features.&lt;br /&gt;
&lt;br /&gt;
Make sure you have &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt;ed into the RT source directory, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;./configure --with-db-type=TYPE --prefix=/opt/rt5 --with-attachment-store=disk --enable-externalauth --enable-gd --enable-graphviz --enable-gpg --enable-smime&amp;lt;/pre&amp;gt;&lt;br /&gt;
For more background, [https://docs.bestpractical.com/rt/latest/configure.html refer to the RT configure options documentation].&lt;br /&gt;
&lt;br /&gt;
=== Install RT and its Perl dependencies ===&lt;br /&gt;
&lt;br /&gt;
This command will download, build, and install all of the Perl modules necessary to run RT with the configuration you set above. Here’s what the different parts of the command are doing:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;make dirs&amp;lt;/code&amp;gt; sets up RT&#039;s directory structure. We do this first to install dependencies under it.&lt;br /&gt;
* &amp;lt;code&amp;gt;make fixdeps&amp;lt;/code&amp;gt; actually installs those dependencies.&lt;br /&gt;
* &amp;lt;code&amp;gt;RT_FIX_DEPS_CMD=&#039;cpanm …&#039;&amp;lt;/code&amp;gt; tells RT to use cpanminus to install dependencies (instead of the older, default &amp;lt;code&amp;gt;cpan&amp;lt;/code&amp;gt; command), and to install them where RT will automatically load them.&lt;br /&gt;
* &amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt; installs all of RT’s files under &amp;lt;code&amp;gt;/opt/rt5&amp;lt;/code&amp;gt; (or the prefix directory you set in the previous step). It will only run if &amp;lt;code&amp;gt;fixdeps&amp;lt;/code&amp;gt; succeeds. Setting &amp;lt;code&amp;gt;PERL5LIB&amp;lt;/code&amp;gt; tells it where you installed those dependencies.&lt;br /&gt;
&lt;br /&gt;
Make sure you have &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt;ed into the RT source directory, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo make dirs&lt;br /&gt;
sudo ln -s . /opt/rt5/local/lib/perl5&lt;br /&gt;
make fixdeps RT_FIX_DEPS_CMD=&#039;cpanm --sudo --quiet --local-lib=/opt/rt5/local&#039;&lt;br /&gt;
sudo make install PERL5LIB=/opt/rt5/local/lib&amp;lt;/pre&amp;gt;&lt;br /&gt;
If it works, the command will eventually output a message that says “Congratulations. RT is now installed.” followed by instructions about configuring and setting up the database. We’ll do that next.&lt;br /&gt;
&lt;br /&gt;
=== Configure RT ===&lt;br /&gt;
&lt;br /&gt;
[https://docs.bestpractical.com/rt/latest/RT_Config.html RT has many configuration options.] You can put configuration options in the file &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/code&amp;gt;, or in individual files under &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.d/&amp;lt;/code&amp;gt;. Use an editor to save all the text below to &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/code&amp;gt; (you can just overwrite the existing file, or add this to the bottom of what’s there) and then fill in settings for your site everywhere the text &amp;lt;code&amp;gt;EDIT WITH&amp;lt;/code&amp;gt; appears.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Single-quote all values EXCEPT the special value `undef`&lt;br /&gt;
# that turns off a setting.&lt;br /&gt;
&lt;br /&gt;
# rtname appears in ticket email subjects. It needs to be globally unique,&lt;br /&gt;
# so use your organization&#039;s domain name.&lt;br /&gt;
Set($rtname, &#039;EDIT WITH yourdomain.example.com&#039;);&lt;br /&gt;
# Organization is used in the database for ticket links, etc. It also needs to&lt;br /&gt;
# be globally unique, so use your organization&#039;s domain name.&lt;br /&gt;
Set($Organization, &#039;EDIT WITH yourdomain.example.com&#039;);&lt;br /&gt;
# WebDomain is domain name of the RT web server. RT uses it to construct links&lt;br /&gt;
# and defend against CSRFs.&lt;br /&gt;
Set($WebDomain, &#039;EDIT WITH rt.yourdomain.example.com&#039;);&lt;br /&gt;
# WebPort is the port where the RT web server runs. Edit the number below if&lt;br /&gt;
# you&#039;re not using the standard HTTPS port.&lt;br /&gt;
Set($WebPort, &#039;443&#039;);&lt;br /&gt;
&lt;br /&gt;
# DatabaseUser is the name of the database account RT uses to read and store&lt;br /&gt;
# data. &#039;rt_user&#039; is the default but you can change it if you like.&lt;br /&gt;
# DO NOT use the &#039;rt_admin&#039; superuser created in the instructions above.&lt;br /&gt;
Set($DatabaseUser, &#039;rt_user&#039;);&lt;br /&gt;
# DatabasePassword is the password for DatabaseUser.&lt;br /&gt;
Set($DatabasePassword, &#039;EDIT WITH SomePassphraseHere&#039;);&lt;br /&gt;
# DatabaseHost is the hostname of the database server RT should use.&lt;br /&gt;
# Change &#039;localhost&#039; if it lives on a different server.&lt;br /&gt;
Set($DatabaseHost, &#039;localhost&#039;);&lt;br /&gt;
# DatabasePort is the port number of the database server RT should use.&lt;br /&gt;
# `undef` means the default for that database. Change it if you&#039;re not&lt;br /&gt;
# using the standard port.&lt;br /&gt;
Set($DatabasePort, undef);&lt;br /&gt;
# DatabaseName is the name of RT&#039;s database hosted on DatabaseHost.&lt;br /&gt;
# &#039;rt5&#039; is the default but you can change it if you like.&lt;br /&gt;
Set($DatabaseName, &#039;rt5&#039;);&lt;br /&gt;
# DatabaseAdmin is the name of the user in the database used to perform&lt;br /&gt;
# major administrative tasks. Change &#039;rt_admin&#039; if you&#039;re using a user&lt;br /&gt;
# besides the one created in this guide.&lt;br /&gt;
Set($DatabaseAdmin, &#039;rt_admin&#039;);&lt;br /&gt;
&lt;br /&gt;
# RT can log to syslog, stderr, and/or a dedicated file.&lt;br /&gt;
# Log settings are used both by the primary server and by command line&lt;br /&gt;
# tools like rt-crontool, rt-ldapimport, etc.&lt;br /&gt;
# You set all of RT&#039;s $LogTo* paramaters to a standard log level: &#039;debug&#039;,&lt;br /&gt;
# &#039;info&#039;, &#039;notice&#039;, &#039;warning&#039;, &#039;error&#039;, &#039;critical&#039;, &#039;alert&#039;, or &#039;emergency&#039;.&lt;br /&gt;
# For a modern install, I recommend logging primarily to syslog, so it goes&lt;br /&gt;
# to journald where it&#039;s easy to query and automatically gets rotated.&lt;br /&gt;
Set($LogToSyslog, &#039;info&#039;);&lt;br /&gt;
&lt;br /&gt;
# When the RT server logs to stderr, that usually goes to your web server&#039;s&lt;br /&gt;
# error log. Command line tools log to their own stderr. Setting this to&lt;br /&gt;
# &#039;warning&#039; or &#039;error&#039; helps ensure you get notified if RT&#039;s cron jobs&lt;br /&gt;
# encounter problems.&lt;br /&gt;
Set($LogToSTDERR, &#039;warning&#039;);&lt;br /&gt;
&lt;br /&gt;
# Turn off optional features that require additional configuration.&lt;br /&gt;
# If you want to use these, refer to the RT_Config documentation for&lt;br /&gt;
# instructions on how to set them up.&lt;br /&gt;
Set(%GnuPG, &#039;Enable&#039; =&amp;gt; &#039;0&#039;);&lt;br /&gt;
Set(%SMIME, &#039;Enable&#039; =&amp;gt; &#039;0&#039;);&lt;br /&gt;
&lt;br /&gt;
# Perl expects to find this 1 at the end of the file.&lt;br /&gt;
1;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;RT_SiteConfig.pm&amp;lt;/code&amp;gt; is actually Perl code. RT runs the code directly to load the configuration. Any time you finish editing it, you can check that you didn’t make any syntax errors by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;perl -c /opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Set up RT’s database ===&lt;br /&gt;
&lt;br /&gt;
RT includes a tool to help you set up its database. By default, it connects to the database as an administrator to create the database and user that you configured in the previous step.&lt;br /&gt;
&lt;br /&gt;
(The instructions from &amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt; and RT’s README file tell you to run &amp;lt;code&amp;gt;make initialize-database&amp;lt;/code&amp;gt;. That just runs &amp;lt;code&amp;gt;rt-setup-database&amp;lt;/code&amp;gt; for you. Running the tool directly makes it easier to pass the options you need.)&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;--action=init&amp;lt;/code&amp;gt; tells the tool to create the user, the database, the tables inside it, and insert core data RT needs to function.&lt;br /&gt;
* &#039;&#039;&#039;If&#039;&#039;&#039; you are using an existing database server and the database adminstrator has already created the user account and database for RT, then you can add the &amp;lt;code&amp;gt;--skip-create&amp;lt;/code&amp;gt; option.&lt;br /&gt;
* &#039;&#039;&#039;If&#039;&#039;&#039; you have a less common database setup, this tool has additional options to give you finer-grained control over what steps are run and how. Refer to [https://docs.bestpractical.com/rt/latest/rt-setup-database.html the full rt-setup-database documentation] to learn more about those.&lt;br /&gt;
* The command reads files from RT’s &amp;lt;code&amp;gt;etc/&amp;lt;/code&amp;gt; directory by default, so the easiest way to run it is to &amp;lt;code&amp;gt;cd /opt/rt5&amp;lt;/code&amp;gt; first, and then it will find the necessary files automatically.&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /opt/rt5&lt;br /&gt;
sudo sbin/rt-setup-database --action=init&amp;lt;/pre&amp;gt;&lt;br /&gt;
Enter the password for your database administrator account when prompted.&lt;br /&gt;
&lt;br /&gt;
=== Set up fulltext indexing ===&lt;br /&gt;
&lt;br /&gt;
Fulltext indexing speeds up searches for ticket content, which makes RT a lot nicer to use.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;--noask&amp;lt;/code&amp;gt; uses the default names for the index, which will be fine for a new install and simplifies the setup.&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo /opt/rt5/sbin/rt-setup-fulltext-index --noask&amp;lt;/pre&amp;gt;&lt;br /&gt;
Enter the password for your database administrator account when prompted. The end of the process will output some RT configuration that looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;### EXAMPLE OUTPUT ONLY - Don&#039;t use this directly!&lt;br /&gt;
Set( %FullTextSearch,&lt;br /&gt;
    Enable     =&amp;gt; 1,&lt;br /&gt;
    Indexed    =&amp;gt; 1,&lt;br /&gt;
    # Additional output from rt-setup-fulltext-index should be here.&lt;br /&gt;
    # The configuration varies by database type.&lt;br /&gt;
);&amp;lt;/pre&amp;gt;&lt;br /&gt;
Copy the output generated when you run &amp;lt;code&amp;gt;rt-setup-fulltext-index&amp;lt;/code&amp;gt; and save it to the file &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.d/FulltextIndex.pm&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Set permissions ===&lt;br /&gt;
&lt;br /&gt;
All of RT’s configuration files should be readable by the user that runs the web server, and no other users, in order to protect sensitive information like the database password. RT provides a command to set permissions appropriately according to your distribution and configuration. &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt; to the directory where you extracted the RT source code, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd rt-5.0.2&lt;br /&gt;
sudo make fixperms&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Verify the installation ===&lt;br /&gt;
&lt;br /&gt;
If everything has gone well, then you should be able to set a password for RT’s &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; user. You’ll use this later to log in to the web interface and continue setting up your system. Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo /opt/rt5/sbin/rt-passwd root&amp;lt;/pre&amp;gt;&lt;br /&gt;
Set the password when prompted. Record this; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s web server ==&lt;br /&gt;
&lt;br /&gt;
=== Configure Apache modules ===&lt;br /&gt;
&lt;br /&gt;
You will need to have the following modules enabled in Apache to run RT. You should already have these installed if you followed the instructions above.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;alias&amp;lt;/code&amp;gt; (required to map URLs to RT)&lt;br /&gt;
* &amp;lt;code&amp;gt;fcgid&amp;lt;/code&amp;gt; (required for Apache to talk to RT)&lt;br /&gt;
* &amp;lt;code&amp;gt;mpm_prefork&amp;lt;/code&amp;gt; (Apache requires you to select an MPM. RT is designed to work with the prefork module.)&lt;br /&gt;
* &amp;lt;code&amp;gt;ssl&amp;lt;/code&amp;gt; (required to serve HTTPS; optional otherwise)&lt;br /&gt;
&lt;br /&gt;
Enable them following these instructions:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo a2dismod mpm_event&lt;br /&gt;
sudo a2enmod fcgid&lt;br /&gt;
sudo a2enmod mpm_prefork&lt;br /&gt;
sudo a2enmod ssl&amp;lt;/pre&amp;gt;&lt;br /&gt;
| &amp;lt;pre&amp;gt;echo LoadModule mpm_prefork_module modules/mod_mpm_prefork.so | sudo tee /etc/httpd/conf.modules.d/00-mpm.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Configure an Apache VirtualHost ===&lt;br /&gt;
&lt;br /&gt;
Create a file at the following location. You can change the &amp;lt;code&amp;gt;RT&amp;lt;/code&amp;gt; part of the filename if you like, but the file must exist in this directory and have a &amp;lt;code&amp;gt;.conf&amp;lt;/code&amp;gt; suffix.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;/etc/apache2/sites-available/RT.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
Then after you create the file, run: &amp;lt;code&amp;gt;sudo a2ensite RT&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;/etc/httpd/conf.d/RT.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Use an editor to save all the text below to the new &amp;lt;code&amp;gt;RT.conf&amp;lt;/code&amp;gt; and then fill in settings for your site everywhere the text &amp;lt;code&amp;gt;EDIT WITH&amp;lt;/code&amp;gt; appears.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### Server-level settings&lt;br /&gt;
# These settings affect all of Apache. It is okay to put them here if Apache&lt;br /&gt;
# only hosts RT. If you are hosting other sites in the same Apache instance,&lt;br /&gt;
# you may need to put these settings in another file like&lt;br /&gt;
# (Debian/Ubuntu) /etc/apache2/conf-available/RT.conf&lt;br /&gt;
# (Red Hat/Fedora/CentOS) /etc/httpd/conf.d/RTserver.conf&lt;br /&gt;
# ... and ensure they do not conflict with settings required by other sites.&lt;br /&gt;
&lt;br /&gt;
# mod_fcgid only allows 128KiB requests by default. This is too small for users&lt;br /&gt;
# to upload files to RT. You can ultimately choose any setting you&#039;re&lt;br /&gt;
# comfortable with; 70MiB here should allow most requests without being too&lt;br /&gt;
# open.&lt;br /&gt;
FcgidMaxRequestLen 73400320&lt;br /&gt;
&lt;br /&gt;
&amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
  # Listen on the standard HTTPS port.&lt;br /&gt;
  # You can change this to a nonstandard port if you must.&lt;br /&gt;
  Listen 443&lt;br /&gt;
&amp;lt;/IfModule&amp;gt;&lt;br /&gt;
### End server-level settings&lt;br /&gt;
&lt;br /&gt;
### Primary RT VirtualHost&lt;br /&gt;
# You can change both the bind address and/or the port here as required.&lt;br /&gt;
# This default will listen for HTTPS connections on all interfaces.&lt;br /&gt;
&amp;lt;VirtualHost *:443&amp;gt;&lt;br /&gt;
  # EDIT HERE with the domain name of the web server.&lt;br /&gt;
  ServerName rt.yourdomain.example.com&lt;br /&gt;
  &amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
    SSLEngine on&lt;br /&gt;
    # These specify the paths to the SSL certificate and private key Apache&lt;br /&gt;
    # should use. These example paths are common for Let&#039;s Encrypt. If you&lt;br /&gt;
    # don&#039;t use Let&#039;s Encrypt, the standard location for these files is under&lt;br /&gt;
    # (Debian/Ubuntu) /etc/ssl&lt;br /&gt;
    # (Red Hat/Fedora/CentOS) /etc/pki/tls&lt;br /&gt;
    # EDIT HERE with the appropriate paths for your server&lt;br /&gt;
    SSLCertificateFile /etc/letsencrypt/live/example.com/fullchain.pem&lt;br /&gt;
    SSLCertificateKeyFile /etc/letsencrypt/live/example.com/privkey.pem&lt;br /&gt;
  &amp;lt;/IfModule&amp;gt;&lt;br /&gt;
  &amp;lt;Location /&amp;gt;&lt;br /&gt;
    Require all granted&lt;br /&gt;
    Options +ExecCGI&lt;br /&gt;
    AddHandler fcgid-script fcgi&lt;br /&gt;
  &amp;lt;/Location&amp;gt;&lt;br /&gt;
  AddDefaultCharset UTF-8&lt;br /&gt;
  DocumentRoot /opt/rt5/share/html&lt;br /&gt;
  ScriptAlias / /opt/rt5/sbin/rt-server.fcgi/&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
### End primary RT VirtualHost&lt;br /&gt;
&lt;br /&gt;
### Optional HTTPS Redirect VirtualHost&lt;br /&gt;
# Most modern servers support HTTPS and want all web traffic to go through it.&lt;br /&gt;
# This VirtualHost redirects normal HTTP traffic to HTTPS.&lt;br /&gt;
# You can delete this whole section if you don&#039;t want or need this.&lt;br /&gt;
&amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
  # You can change both the bind address and/or the port here as required.&lt;br /&gt;
  # This default will listen for HTTP connections on all interfaces.&lt;br /&gt;
  &amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
    SSLEngine off&lt;br /&gt;
    # EDIT HERE both lines below with the domain name of your web server.&lt;br /&gt;
    ServerName rt.yourdomain.example.com&lt;br /&gt;
    Redirect permanent / https://rt.yourdomain.example.com/&lt;br /&gt;
  &amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/IfModule&amp;gt;&lt;br /&gt;
### End optional HTTPS Redirect VirtualHost&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
After you’ve edited the file, load the configuration with:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo systemctl reload apache2&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo systemctl reload httpd&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If this command reports an error, double-check the configuration file for typos, especially in option names, file paths, and the&lt;br /&gt;
&amp;lt;Section&amp;gt;&lt;br /&gt;
pairs. Edit again and reload the configuration until it succeeds without output.&lt;br /&gt;
&lt;br /&gt;
=== Verify the web interface ===&lt;br /&gt;
&lt;br /&gt;
You should be able to visit your web server in your browser, and be presented with RT’s login screen. You should be able to log in with username &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; and the password you set previously.&lt;br /&gt;
&lt;br /&gt;
If you run into trouble, the first place to look for more information is by reading Apache’s error log:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo less /var/log/apache2/error.log&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo less /var/log/httpd/error.log&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s mail server ==&lt;br /&gt;
&lt;br /&gt;
RT both can both send and receive ticket updates via email. Unfortunately, there are too many variables to document a useful setup process here: getting this working usually requires creating DNS records, and coordinating with existing mail servers, which will be the main constraint on your setup. Instead this guide provides a brief overview of how the integration works, and where the connection points are that you likely need to work on.&lt;br /&gt;
&lt;br /&gt;
=== Sending Mail ===&lt;br /&gt;
&lt;br /&gt;
RT only knows how to send mail by passing it off to another program on the system. It cannot connect or authenticate directly to external mail servers. In the default configuration, RT runs the standard &amp;lt;code&amp;gt;sendmail&amp;lt;/code&amp;gt; command. There are [https://docs.bestpractical.com/rt/latest/RT_Config.html#Outgoing-mail configuration options to send mail through different commands] if you need.&lt;br /&gt;
&lt;br /&gt;
The most common setup is to install and configure a proper Mail Transfer Agent (MTA) like Postfix or Exim, and then configure it to send mail to the wider Internet as you need. This works well because the MTAs are robust and well-tested; they have flexible configuration to let you send mail out by relaying to other mail servers you specify with optional authentication; and most distributions install one by default anyway. The only hard part is configuring the MTA to send mail following your site’s policies.&lt;br /&gt;
&lt;br /&gt;
Other software is available that provides a slimmer version of the &amp;lt;code&amp;gt;sendmail&amp;lt;/code&amp;gt; command that connects to an external mail server for you, like ssmtp. These programs are usually easier to configure than an MTA, but they often lose email permanently if they can’t connect to the external server at the time it’s sent. (MTAs keep email queued locally until they successfully deliver it to another server.)&lt;br /&gt;
&lt;br /&gt;
=== Receiving email ===&lt;br /&gt;
&lt;br /&gt;
RT installs a command called &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; that receives an email on standard input and posts it to RT’s REST web interface, where it gets saved in the database and added to a ticket. You need to arrange for a way to send incoming email to this command.&lt;br /&gt;
&lt;br /&gt;
The most common setup is to have an MTA on the same box as RT receive email directly, and then set up mail aliases that call this command when mail comes in. Example &amp;lt;code&amp;gt;/etc/aliases&amp;lt;/code&amp;gt; entries look like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rt: &amp;quot;|/opt/rt5/bin/rt-mailgate --queue general --action correspond --url https://rt.yourdomain.example.com/&amp;quot;&lt;br /&gt;
rt-comment: &amp;quot;|/opt/rt5/bin/rt-mailgate --queue general --action comment --url https://rt.yourdomain.example.com/&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
This works well because, again, you’re probably running an MTA anyway; and the MTA can hold and queue mail if it comes in while RT is down for any reason, giving you a buffer against downtime.&lt;br /&gt;
&lt;br /&gt;
Another common option is to periodically run a tool that fetches mail using a protocol like IMAP, like fetchmail or getmail, and passes it on to &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt;. This is less common because it requires setting up another tool to run, and securely storing another set of mail server credentials. But it is useful when local policy prevents the RT server from receiving email directly.&lt;br /&gt;
&lt;br /&gt;
This is much less common, but it might help to know that &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; doesn’t have to run on the same system as RT itself. It just needs to be able to connect to RT’s web interface. If you don’t have any other options, you can install the RT software on a different system that receives email, and configure &#039;&#039;that&#039;&#039; system to run &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; and pass it on to the RT server. To do that, just repeat the installation instructions above, skipping the steps about installing the database and web server.&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s background jobs ==&lt;br /&gt;
&lt;br /&gt;
Create a file &amp;lt;code&amp;gt;/etc/cron.d/rt&amp;lt;/code&amp;gt; with the following content. You may edit all of the time fields as you see fit. Refer to the crontab(5) man page for details about their definitions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Update the fulltext index with new ticket data&lt;br /&gt;
*/3 *   *   *   *   root    /opt/rt5/sbin/rt-fulltext-indexer&lt;br /&gt;
# Email out dashboards that users have subscribed to&lt;br /&gt;
0   *   *   *   *   root    /opt/rt5/sbin/rt-email-dashboards&lt;br /&gt;
# Clean old sessions from the database&lt;br /&gt;
10  3   *   *   *   root    /opt/rt5/sbin/rt-clean-sessions --older 8d&lt;br /&gt;
# Email out weekly digests for users who have requested it&lt;br /&gt;
50  4   *   *   Mon root    /opt/rt5/sbin/rt-email-digest -m weekly&lt;br /&gt;
# Email out daily digests for users who have requested it&lt;br /&gt;
50  5   *   *   *   root    /opt/rt5/sbin/rt-email-digest -m daily&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
You can run all these jobs as the same user that runs your web server, rather than root. Run:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo sed -i &#039;s/\broot\b/www-data/&#039; /etc/cron.d/rt&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo sed -i &#039;s/\broot\b/apache/&#039; /etc/cron.d/rt&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Set up RT ==&lt;br /&gt;
&lt;br /&gt;
If you’ve gotten this far, congratulations, your RT install is really done now. You can start setting up RT with users, groups, queues, and business logic. [[Main Page|Head back to the main page]] to start exploring those topics.&lt;/div&gt;</summary>
		<author><name>Brett</name></author>
	</entry>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=ManualInstallation&amp;diff=27047</id>
		<title>ManualInstallation</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=ManualInstallation&amp;diff=27047"/>
		<updated>2022-01-07T22:35:35Z</updated>

		<summary type="html">&lt;p&gt;Brett: enable powertools repo required for some dependencies&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Prev: [[ManualRequirements]] — Up: [[UserManual]] — Next: [[ManualApacheConfig]]&lt;br /&gt;
&lt;br /&gt;
This guide walks you through installing RT from source on a modern, popular Linux distro. Specifically, that means a distribution based on Debian or Red Hat that’s been released since around 2020.&lt;br /&gt;
&lt;br /&gt;
This guide assumes:&lt;br /&gt;
&lt;br /&gt;
* You can install packages generally available in Debian/Ubuntu or Red Hat/Fedora/CentOS.&lt;br /&gt;
* You want to install RT, and all of its Perl dependencies, from source to get the latest versions. (This is a trade-off. It means the boundaries of your install will be very clear, but you won’t get security updates for RT or Perl modules from your distribution.)&lt;br /&gt;
* You are willing to install a couple of extra tools to manage the RT installation similarly to how you would in other packaging systems (like PyPI, npm, etc.).&lt;br /&gt;
* You are willing to do a relatively maximal install of RT, enabling all the options during installation and then setting what you need in the configuration. (You could save a little space and time by being pickier about your options, but then that complicates the guide and makes it harder to turn those options on later if you want.)&lt;br /&gt;
* You are using a regular user account on the Linux system that can get superuser privileges with sudo.&lt;br /&gt;
&lt;br /&gt;
== Install the base dependencies ==&lt;br /&gt;
&lt;br /&gt;
These are required by RT, either to run or to install the dependencies.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install autoconf build-essential cpanminus curl libexpat-dev libgd-dev libssl-dev libz-dev gnupg graphviz lynx openssl perl&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf config-manager --set-enabled powertools&lt;br /&gt;
sudo dnf install patch tar which gcc gcc-c++ perl-core perl-App-cpanminus graphviz expat-devel gd-devel lynx openssl openssl-devel&lt;br /&gt;
sudo setenforce 0&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
(Turning off SELinux enforcement is required on Red Hat-based distributions because, as of October 2021, nobody has written a policy for RT.)&lt;br /&gt;
&lt;br /&gt;
== Install a database ==&lt;br /&gt;
&lt;br /&gt;
You need access to a database server. It can be remote, or you can install a database server alongside RT. RT supports a few different databases, but the best supported options are PostgreSQL and MariaDB.&lt;br /&gt;
&lt;br /&gt;
=== Installing and configuring the PostgreSQL server ===&lt;br /&gt;
&lt;br /&gt;
If you want to install a fresh PostgreSQL database server alongside RT:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install postgresql&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install postgresql-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In order to set up RT’s database, you will need a PostgreSQL superuser account that can be authenticated with a password. If you don’t have that, you can create it by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo createuser -sP rt_admin&amp;lt;/pre&amp;gt;&lt;br /&gt;
Set the password when prompted. Record this; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
=== Enable password authentication in PostgreSQL ===&lt;br /&gt;
&lt;br /&gt;
You need to consider this step whether you install the database locally, or use an existing one already running. RT supports connecting to PostgreSQL a few different ways, but authenticating with a username and password is simplest, and this guide is written based on that. Not all PostgreSQL installations allow this authentication method by default. You need to review your &amp;lt;code&amp;gt;pg_hba.conf&amp;lt;/code&amp;gt; file located at:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;/etc/postgresql/VERSION/main/pg_hba.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;/var/lib/pgsql/VERSION/data/pg_hba.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Replace &amp;lt;code&amp;gt;VERSION&amp;lt;/code&amp;gt; with the version of your PostgreSQL database. Add these two lines &#039;&#039;&#039;above&#039;&#039;&#039; any other lines that start with &amp;lt;code&amp;gt;host&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;host  rt5  rt_user   all  md5&lt;br /&gt;
host  rt5  rt_admin  all  md5&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This configuration will let &amp;lt;code&amp;gt;rt_user&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;rt_admin&amp;lt;/code&amp;gt; authorize themselves for the &amp;lt;code&amp;gt;rt5&amp;lt;/code&amp;gt; database using an &amp;lt;code&amp;gt;md5&amp;lt;/code&amp;gt; crypted password over a network connection (possibly using the localhost loopback network). You might be able to further restrict some of these fields for improved security, but doing so is outside the scope of this install guide. Refer to [https://www.postgresql.org/docs/current/auth-pg-hba-conf.html the pg_hba.conf documentation] for more details.&lt;br /&gt;
&lt;br /&gt;
Save your changes and reload the database:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo systemctl reload postgresql&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Installing the PostgreSQL client libraries ===&lt;br /&gt;
&lt;br /&gt;
These are required for RT to be able to talk to any PostgreSQL server.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install libpq-dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install postgresql-devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Once this is done you can skip ahead to installing a web server.&lt;br /&gt;
&lt;br /&gt;
=== Installing and configuring the MariaDB server ===&lt;br /&gt;
&lt;br /&gt;
If you want to install a fresh MariaDB database server alongside RT:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install mariadb-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install mariadb-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In order to set up RT’s database, you will need a MySQL superuser account. To stay consistent with PostgreSQL, I suggest setting a password for it. You can do that by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo mysql&lt;br /&gt;
mysql# GRANT ALL PRIVELEGES WITH GRANT OPTION ON rt5 TO rt_admin@localhost IDENTIFIED BY &#039;YourPassphraseHere&#039;;&amp;lt;/pre&amp;gt;&lt;br /&gt;
Record your passphrase; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
=== Adjust MariaDB’s max_allowed_packet setting ===&lt;br /&gt;
&lt;br /&gt;
You need to consider this step whether you install the database locally, or use an existing one already running. [https://mariadb.com/kb/en/server-system-variables/#max_allowed_packet MariaDB’s &amp;lt;code&amp;gt;max_allowed_packet&amp;lt;/code&amp;gt; setting] functionally limits the size of attachments in RT. The default is 16MiB, which is too small for most installations. You can ultimately choose any setting you’re comfortable with; 64MiB here should allow most requests without being too open.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;echo -e &#039;[client-server]\nmax_allowed_packet=64M\n&#039; | sudo tee /etc/mysql/conf.d/max_allowed_packet.cnf&lt;br /&gt;
sudo systemctl reload mariadb&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;echo -e &#039;[client-server]\nmax_allowed_packet=64M\n&#039; | sudo tee /etc/my.cnf.d/max_allowed_packet.cnf&lt;br /&gt;
sudo systemctl reload mariadb&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Installing the MariaDB client libraries ===&lt;br /&gt;
&lt;br /&gt;
These are required for RT to be able to talk to any MariaDB server.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install libmariadb-dev libmariadb-dev-compat&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install mariadb-devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Install a web server with FastCGI ==&lt;br /&gt;
&lt;br /&gt;
FastCGI is the best way to host RT’s web interface today. Installing the web server before RT makes the installation process simpler, because RT will be able to automatically some details about your web server like what user it runs as.&lt;br /&gt;
&lt;br /&gt;
=== Installing Apache ===&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install apache2 libapache2-mod-fcgid&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install httpd mod_fcgid mod_ssl&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ### Installing nginx --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Install RT ==&lt;br /&gt;
&lt;br /&gt;
=== Get and unpack the RT source code ===&lt;br /&gt;
&lt;br /&gt;
Download the latest source code using the link on the [https://bestpractical.com/download-page RT download page], extract it using &amp;lt;code&amp;gt;tar -xf&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt; into the source code directory to run the rest of the commands in this section. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;curl -O https://download.bestpractical.com/pub/rt/release/rt-5.0.2.tar.gz&lt;br /&gt;
tar -xf rt-5.0.2.tar.gz&lt;br /&gt;
cd rt-5.0.2&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Pre-configure RT ===&lt;br /&gt;
&lt;br /&gt;
This command will detect some information about your system in order to install RT properly, and decide which set of dependencies to install. Here’s what the different parts of our command are doing:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;--with-db-type=TYPE&amp;lt;/code&amp;gt; - Replace &amp;lt;code&amp;gt;TYPE&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;Pg&amp;lt;/code&amp;gt; for PostgreSQL, or &amp;lt;code&amp;gt;mysql&amp;lt;/code&amp;gt; for MariaDB.&lt;br /&gt;
* &amp;lt;code&amp;gt;--prefix=/opt/rt5&amp;lt;/code&amp;gt; sets the directory where RT will install all of its libraries, tools, and supporting files. You can choose another path if you like.&lt;br /&gt;
* The rest of the options tell RT to install additional dependencies for optional features.&lt;br /&gt;
&lt;br /&gt;
Make sure you have &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt;ed into the RT source directory, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;./configure --with-db-type=TYPE --prefix=/opt/rt5 --with-attachment-store=disk --enable-externalauth --enable-gd --enable-graphviz --enable-gpg --enable-smime&amp;lt;/pre&amp;gt;&lt;br /&gt;
For more background, [https://docs.bestpractical.com/rt/latest/configure.html refer to the RT configure options documentation].&lt;br /&gt;
&lt;br /&gt;
=== Install RT and its Perl dependencies ===&lt;br /&gt;
&lt;br /&gt;
This command will download, build, and install all of the Perl modules necessary to run RT with the configuration you set above. Here’s what the different parts of the command are doing:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;make dirs&amp;lt;/code&amp;gt; sets up RT&#039;s directory structure. We do this first to install dependencies under it.&lt;br /&gt;
* &amp;lt;code&amp;gt;make fixdeps&amp;lt;/code&amp;gt; actually installs those dependencies.&lt;br /&gt;
* &amp;lt;code&amp;gt;RT_FIX_DEPS_CMD=&#039;cpanm …&#039;&amp;lt;/code&amp;gt; tells RT to use cpanminus to install dependencies (instead of the older, default &amp;lt;code&amp;gt;cpan&amp;lt;/code&amp;gt; command), and to install them where RT will automatically load them.&lt;br /&gt;
* &amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt; installs all of RT’s files under &amp;lt;code&amp;gt;/opt/rt5&amp;lt;/code&amp;gt; (or the prefix directory you set in the previous step). It will only run if &amp;lt;code&amp;gt;fixdeps&amp;lt;/code&amp;gt; succeeds.&lt;br /&gt;
&lt;br /&gt;
Make sure you have &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt;ed into the RT source directory, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo make dirs&lt;br /&gt;
sudo ln -s . /opt/rt5/local/lib/perl5&lt;br /&gt;
make fixdeps RT_FIX_DEPS_CMD=&#039;cpanm --sudo --quiet --local-lib=/opt/rt5/local&#039;&lt;br /&gt;
sudo make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
If it works, the command will eventually output a message that says “Congratulations. RT is now installed.” followed by instructions about configuring and setting up the database. We’ll do that next.&lt;br /&gt;
&lt;br /&gt;
=== Configure RT ===&lt;br /&gt;
&lt;br /&gt;
[https://docs.bestpractical.com/rt/latest/RT_Config.html RT has many configuration options.] You can put configuration options in the file &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/code&amp;gt;, or in individual files under &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.d/&amp;lt;/code&amp;gt;. Use an editor to save all the text below to &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/code&amp;gt; (you can just overwrite the existing file, or add this to the bottom of what’s there) and then fill in settings for your site everywhere the text &amp;lt;code&amp;gt;EDIT WITH&amp;lt;/code&amp;gt; appears.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Single-quote all values EXCEPT the special value `undef`&lt;br /&gt;
# that turns off a setting.&lt;br /&gt;
&lt;br /&gt;
# rtname appears in ticket email subjects. It needs to be globally unique,&lt;br /&gt;
# so use your organization&#039;s domain name.&lt;br /&gt;
Set($rtname, &#039;EDIT WITH yourdomain.example.com&#039;);&lt;br /&gt;
# Organization is used in the database for ticket links, etc. It also needs to&lt;br /&gt;
# be globally unique, so use your organization&#039;s domain name.&lt;br /&gt;
Set($Organization, &#039;EDIT WITH yourdomain.example.com&#039;);&lt;br /&gt;
# WebDomain is domain name of the RT web server. RT uses it to construct links&lt;br /&gt;
# and defend against CSRFs.&lt;br /&gt;
Set($WebDomain, &#039;EDIT WITH rt.yourdomain.example.com&#039;);&lt;br /&gt;
# WebPort is the port where the RT web server runs. Edit the number below if&lt;br /&gt;
# you&#039;re not using the standard HTTPS port.&lt;br /&gt;
Set($WebPort, &#039;443&#039;);&lt;br /&gt;
&lt;br /&gt;
# DatabaseUser is the name of the database account RT uses to read and store&lt;br /&gt;
# data. &#039;rt_user&#039; is the default but you can change it if you like.&lt;br /&gt;
# DO NOT use the &#039;rt_admin&#039; superuser created in the instructions above.&lt;br /&gt;
Set($DatabaseUser, &#039;rt_user&#039;);&lt;br /&gt;
# DatabasePassword is the password for DatabaseUser.&lt;br /&gt;
Set($DatabasePassword, &#039;EDIT WITH SomePassphraseHere&#039;);&lt;br /&gt;
# DatabaseHost is the hostname of the database server RT should use.&lt;br /&gt;
# Change &#039;localhost&#039; if it lives on a different server.&lt;br /&gt;
Set($DatabaseHost, &#039;localhost&#039;);&lt;br /&gt;
# DatabasePort is the port number of the database server RT should use.&lt;br /&gt;
# `undef` means the default for that database. Change it if you&#039;re not&lt;br /&gt;
# using the standard port.&lt;br /&gt;
Set($DatabasePort, undef);&lt;br /&gt;
# DatabaseName is the name of RT&#039;s database hosted on DatabaseHost.&lt;br /&gt;
# &#039;rt5&#039; is the default but you can change it if you like.&lt;br /&gt;
Set($DatabaseName, &#039;rt5&#039;);&lt;br /&gt;
# DatabaseAdmin is the name of the user in the database used to perform&lt;br /&gt;
# major administrative tasks. Change &#039;rt_admin&#039; if you&#039;re using a user&lt;br /&gt;
# besides the one created in this guide.&lt;br /&gt;
Set($DatabaseAdmin, &#039;rt_admin&#039;);&lt;br /&gt;
&lt;br /&gt;
# RT can log to syslog, stderr, and/or a dedicated file.&lt;br /&gt;
# Log settings are used both by the primary server and by command line&lt;br /&gt;
# tools like rt-crontool, rt-ldapimport, etc.&lt;br /&gt;
# You set all of RT&#039;s $LogTo* paramaters to a standard log level: &#039;debug&#039;,&lt;br /&gt;
# &#039;info&#039;, &#039;notice&#039;, &#039;warning&#039;, &#039;error&#039;, &#039;critical&#039;, &#039;alert&#039;, or &#039;emergency&#039;.&lt;br /&gt;
# For a modern install, I recommend logging primarily to syslog, so it goes&lt;br /&gt;
# to journald where it&#039;s easy to query and automatically gets rotated.&lt;br /&gt;
Set($LogToSyslog, &#039;info&#039;);&lt;br /&gt;
&lt;br /&gt;
# When the RT server logs to stderr, that usually goes to your web server&#039;s&lt;br /&gt;
# error log. Command line tools log to their own stderr. Setting this to&lt;br /&gt;
# &#039;warning&#039; or &#039;error&#039; helps ensure you get notified if RT&#039;s cron jobs&lt;br /&gt;
# encounter problems.&lt;br /&gt;
Set($LogToSTDERR, &#039;warning&#039;);&lt;br /&gt;
&lt;br /&gt;
# Turn off optional features that require additional configuration.&lt;br /&gt;
# If you want to use these, refer to the RT_Config documentation for&lt;br /&gt;
# instructions on how to set them up.&lt;br /&gt;
Set(%GnuPG, &#039;Enable&#039; =&amp;gt; &#039;0&#039;);&lt;br /&gt;
Set(%SMIME, &#039;Enable&#039; =&amp;gt; &#039;0&#039;);&lt;br /&gt;
&lt;br /&gt;
# Perl expects to find this 1 at the end of the file.&lt;br /&gt;
1;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;RT_SiteConfig.pm&amp;lt;/code&amp;gt; is actually Perl code. RT runs the code directly to load the configuration. Any time you finish editing it, you can check that you didn’t make any syntax errors by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;perl -c /opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Set up RT’s database ===&lt;br /&gt;
&lt;br /&gt;
RT includes a tool to help you set up its database. By default, it connects to the database as an administrator to create the database and user that you configured in the previous step.&lt;br /&gt;
&lt;br /&gt;
(The instructions from &amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt; and RT’s README file tell you to run &amp;lt;code&amp;gt;make initialize-database&amp;lt;/code&amp;gt;. That just runs &amp;lt;code&amp;gt;rt-setup-database&amp;lt;/code&amp;gt; for you. Running the tool directly makes it easier to pass the options you need.)&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;--action=init&amp;lt;/code&amp;gt; tells the tool to create the user, the database, the tables inside it, and insert core data RT needs to function.&lt;br /&gt;
* &#039;&#039;&#039;If&#039;&#039;&#039; you are using an existing database server and the database adminstrator has already created the user account and database for RT, then you can add the &amp;lt;code&amp;gt;--skip-create&amp;lt;/code&amp;gt; option.&lt;br /&gt;
* &#039;&#039;&#039;If&#039;&#039;&#039; you have a less common database setup, this tool has additional options to give you finer-grained control over what steps are run and how. Refer to [https://docs.bestpractical.com/rt/latest/rt-setup-database.html the full rt-setup-database documentation] to learn more about those.&lt;br /&gt;
* The command reads files from RT’s &amp;lt;code&amp;gt;etc/&amp;lt;/code&amp;gt; directory by default, so the easiest way to run it is to &amp;lt;code&amp;gt;cd /opt/rt5&amp;lt;/code&amp;gt; first, and then it will find the necessary files automatically.&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /opt/rt5&lt;br /&gt;
sudo sbin/rt-setup-database --action=init&amp;lt;/pre&amp;gt;&lt;br /&gt;
Enter the password for your database administrator account when prompted.&lt;br /&gt;
&lt;br /&gt;
=== Set up fulltext indexing ===&lt;br /&gt;
&lt;br /&gt;
Fulltext indexing speeds up searches for ticket content, which makes RT a lot nicer to use.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;--noask&amp;lt;/code&amp;gt; uses the default names for the index, which will be fine for a new install and simplifies the setup.&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo /opt/rt5/sbin/rt-setup-fulltext-index --noask&amp;lt;/pre&amp;gt;&lt;br /&gt;
Enter the password for your database administrator account when prompted. The end of the process will output some RT configuration that looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;### EXAMPLE OUTPUT ONLY - Don&#039;t use this directly!&lt;br /&gt;
Set( %FullTextSearch,&lt;br /&gt;
    Enable     =&amp;gt; 1,&lt;br /&gt;
    Indexed    =&amp;gt; 1,&lt;br /&gt;
    # Additional output from rt-setup-fulltext-index should be here.&lt;br /&gt;
    # The configuration varies by database type.&lt;br /&gt;
);&amp;lt;/pre&amp;gt;&lt;br /&gt;
Copy the output generated when you run &amp;lt;code&amp;gt;rt-setup-fulltext-index&amp;lt;/code&amp;gt; and save it to the file &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.d/FulltextIndex.pm&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Set permissions ===&lt;br /&gt;
&lt;br /&gt;
All of RT’s configuration files should be readable by the user that runs the web server, and no other users, in order to protect sensitive information like the database password. RT provides a command to set permissions appropriately according to your distribution and configuration. &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt; to the directory where you extracted the RT source code, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd rt-5.0.2&lt;br /&gt;
sudo make fixperms&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Verify the installation ===&lt;br /&gt;
&lt;br /&gt;
If everything has gone well, then you should be able to set a password for RT’s &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; user. You’ll use this later to log in to the web interface and continue setting up your system. Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo /opt/rt5/sbin/rt-passwd root&amp;lt;/pre&amp;gt;&lt;br /&gt;
Set the password when prompted. Record this; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s web server ==&lt;br /&gt;
&lt;br /&gt;
=== Configure Apache modules ===&lt;br /&gt;
&lt;br /&gt;
You will need to have the following modules enabled in Apache to run RT. You should already have these installed if you followed the instructions above.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;alias&amp;lt;/code&amp;gt; (required to map URLs to RT)&lt;br /&gt;
* &amp;lt;code&amp;gt;fcgid&amp;lt;/code&amp;gt; (required for Apache to talk to RT)&lt;br /&gt;
* &amp;lt;code&amp;gt;mpm_prefork&amp;lt;/code&amp;gt; (Apache requires you to select an MPM. RT is designed to work with the prefork module.)&lt;br /&gt;
* &amp;lt;code&amp;gt;ssl&amp;lt;/code&amp;gt; (required to serve HTTPS; optional otherwise)&lt;br /&gt;
&lt;br /&gt;
Enable them following these instructions:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo a2dismod mpm_event&lt;br /&gt;
sudo a2enmod fcgid&lt;br /&gt;
sudo a2enmod mpm_prefork&lt;br /&gt;
sudo a2enmod ssl&amp;lt;/pre&amp;gt;&lt;br /&gt;
| &amp;lt;pre&amp;gt;echo LoadModule mpm_prefork_module modules/mod_mpm_prefork.so | sudo tee /etc/httpd/conf.modules.d/00-mpm.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Configure an Apache VirtualHost ===&lt;br /&gt;
&lt;br /&gt;
Create a file at the following location. You can change the &amp;lt;code&amp;gt;RT&amp;lt;/code&amp;gt; part of the filename if you like, but the file must exist in this directory and have a &amp;lt;code&amp;gt;.conf&amp;lt;/code&amp;gt; suffix.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;/etc/apache2/sites-available/RT.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
Then after you create the file, run: &amp;lt;code&amp;gt;sudo a2ensite RT&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;/etc/httpd/conf.d/RT.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Use an editor to save all the text below to the new &amp;lt;code&amp;gt;RT.conf&amp;lt;/code&amp;gt; and then fill in settings for your site everywhere the text &amp;lt;code&amp;gt;EDIT WITH&amp;lt;/code&amp;gt; appears.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### Server-level settings&lt;br /&gt;
# These settings affect all of Apache. It is okay to put them here if Apache&lt;br /&gt;
# only hosts RT. If you are hosting other sites in the same Apache instance,&lt;br /&gt;
# you may need to put these settings in another file like&lt;br /&gt;
# (Debian/Ubuntu) /etc/apache2/conf-available/RT.conf&lt;br /&gt;
# (Red Hat/Fedora/CentOS) /etc/httpd/conf.d/RTserver.conf&lt;br /&gt;
# ... and ensure they do not conflict with settings required by other sites.&lt;br /&gt;
&lt;br /&gt;
# mod_fcgid only allows 128KiB requests by default. This is too small for users&lt;br /&gt;
# to upload files to RT. You can ultimately choose any setting you&#039;re&lt;br /&gt;
# comfortable with; 70MiB here should allow most requests without being too&lt;br /&gt;
# open.&lt;br /&gt;
FcgidMaxRequestLen 73400320&lt;br /&gt;
&lt;br /&gt;
&amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
  # Listen on the standard HTTPS port.&lt;br /&gt;
  # You can change this to a nonstandard port if you must.&lt;br /&gt;
  Listen 443&lt;br /&gt;
&amp;lt;/IfModule&amp;gt;&lt;br /&gt;
### End server-level settings&lt;br /&gt;
&lt;br /&gt;
### Primary RT VirtualHost&lt;br /&gt;
# You can change both the bind address and/or the port here as required.&lt;br /&gt;
# This default will listen for HTTPS connections on all interfaces.&lt;br /&gt;
&amp;lt;VirtualHost *:443&amp;gt;&lt;br /&gt;
  # EDIT HERE with the domain name of the web server.&lt;br /&gt;
  ServerName rt.yourdomain.example.com&lt;br /&gt;
  &amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
    SSLEngine on&lt;br /&gt;
    # These specify the paths to the SSL certificate and private key Apache&lt;br /&gt;
    # should use. These example paths are common for Let&#039;s Encrypt. If you&lt;br /&gt;
    # don&#039;t use Let&#039;s Encrypt, the standard location for these files is under&lt;br /&gt;
    # (Debian/Ubuntu) /etc/ssl&lt;br /&gt;
    # (Red Hat/Fedora/CentOS) /etc/pki/tls&lt;br /&gt;
    # EDIT HERE with the appropriate paths for your server&lt;br /&gt;
    SSLCertificateFile /etc/letsencrypt/live/example.com/fullchain.pem&lt;br /&gt;
    SSLCertificateKeyFile /etc/letsencrypt/live/example.com/privkey.pem&lt;br /&gt;
  &amp;lt;/IfModule&amp;gt;&lt;br /&gt;
  &amp;lt;Location /&amp;gt;&lt;br /&gt;
    Require all granted&lt;br /&gt;
    Options +ExecCGI&lt;br /&gt;
    AddHandler fcgid-script fcgi&lt;br /&gt;
  &amp;lt;/Location&amp;gt;&lt;br /&gt;
  AddDefaultCharset UTF-8&lt;br /&gt;
  DocumentRoot /opt/rt5/share/html&lt;br /&gt;
  ScriptAlias / /opt/rt5/sbin/rt-server.fcgi/&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
### End primary RT VirtualHost&lt;br /&gt;
&lt;br /&gt;
### Optional HTTPS Redirect VirtualHost&lt;br /&gt;
# Most modern servers support HTTPS and want all web traffic to go through it.&lt;br /&gt;
# This VirtualHost redirects normal HTTP traffic to HTTPS.&lt;br /&gt;
# You can delete this whole section if you don&#039;t want or need this.&lt;br /&gt;
&amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
  # You can change both the bind address and/or the port here as required.&lt;br /&gt;
  # This default will listen for HTTP connections on all interfaces.&lt;br /&gt;
  &amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
    SSLEngine off&lt;br /&gt;
    # EDIT HERE both lines below with the domain name of your web server.&lt;br /&gt;
    ServerName rt.yourdomain.example.com&lt;br /&gt;
    Redirect permanent / https://rt.yourdomain.example.com/&lt;br /&gt;
  &amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/IfModule&amp;gt;&lt;br /&gt;
### End optional HTTPS Redirect VirtualHost&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
After you’ve edited the file, load the configuration with:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo systemctl reload apache2&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo systemctl reload httpd&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If this command reports an error, double-check the configuration file for typos, especially in option names, file paths, and the&lt;br /&gt;
&amp;lt;Section&amp;gt;&lt;br /&gt;
pairs. Edit again and reload the configuration until it succeeds without output.&lt;br /&gt;
&lt;br /&gt;
=== Verify the web interface ===&lt;br /&gt;
&lt;br /&gt;
You should be able to visit your web server in your browser, and be presented with RT’s login screen. You should be able to log in with username &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; and the password you set previously.&lt;br /&gt;
&lt;br /&gt;
If you run into trouble, the first place to look for more information is by reading Apache’s error log:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo less /var/log/apache2/error.log&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo less /var/log/httpd/error.log&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s mail server ==&lt;br /&gt;
&lt;br /&gt;
RT both can both send and receive ticket updates via email. Unfortunately, there are too many variables to document a useful setup process here: getting this working usually requires creating DNS records, and coordinating with existing mail servers, which will be the main constraint on your setup. Instead this guide provides a brief overview of how the integration works, and where the connection points are that you likely need to work on.&lt;br /&gt;
&lt;br /&gt;
=== Sending Mail ===&lt;br /&gt;
&lt;br /&gt;
RT only knows how to send mail by passing it off to another program on the system. It cannot connect or authenticate directly to external mail servers. In the default configuration, RT runs the standard &amp;lt;code&amp;gt;sendmail&amp;lt;/code&amp;gt; command. There are [https://docs.bestpractical.com/rt/latest/RT_Config.html#Outgoing-mail configuration options to send mail through different commands] if you need.&lt;br /&gt;
&lt;br /&gt;
The most common setup is to install and configure a proper Mail Transfer Agent (MTA) like Postfix or Exim, and then configure it to send mail to the wider Internet as you need. This works well because the MTAs are robust and well-tested; they have flexible configuration to let you send mail out by relaying to other mail servers you specify with optional authentication; and most distributions install one by default anyway. The only hard part is configuring the MTA to send mail following your site’s policies.&lt;br /&gt;
&lt;br /&gt;
Other software is available that provides a slimmer version of the &amp;lt;code&amp;gt;sendmail&amp;lt;/code&amp;gt; command that connects to an external mail server for you, like ssmtp. These programs are usually easier to configure than an MTA, but they often lose email permanently if they can’t connect to the external server at the time it’s sent. (MTAs keep email queued locally until they successfully deliver it to another server.)&lt;br /&gt;
&lt;br /&gt;
=== Receiving email ===&lt;br /&gt;
&lt;br /&gt;
RT installs a command called &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; that receives an email on standard input and posts it to RT’s REST web interface, where it gets saved in the database and added to a ticket. You need to arrange for a way to send incoming email to this command.&lt;br /&gt;
&lt;br /&gt;
The most common setup is to have an MTA on the same box as RT receive email directly, and then set up mail aliases that call this command when mail comes in. Example &amp;lt;code&amp;gt;/etc/aliases&amp;lt;/code&amp;gt; entries look like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rt: &amp;quot;|/opt/rt5/bin/rt-mailgate --queue general --action correspond --url https://rt.yourdomain.example.com/&amp;quot;&lt;br /&gt;
rt-comment: &amp;quot;|/opt/rt5/bin/rt-mailgate --queue general --action comment --url https://rt.yourdomain.example.com/&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
This works well because, again, you’re probably running an MTA anyway; and the MTA can hold and queue mail if it comes in while RT is down for any reason, giving you a buffer against downtime.&lt;br /&gt;
&lt;br /&gt;
Another common option is to periodically run a tool that fetches mail using a protocol like IMAP, like fetchmail or getmail, and passes it on to &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt;. This is less common because it requires setting up another tool to run, and securely storing another set of mail server credentials. But it is useful when local policy prevents the RT server from receiving email directly.&lt;br /&gt;
&lt;br /&gt;
This is much less common, but it might help to know that &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; doesn’t have to run on the same system as RT itself. It just needs to be able to connect to RT’s web interface. If you don’t have any other options, you can install the RT software on a different system that receives email, and configure &#039;&#039;that&#039;&#039; system to run &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; and pass it on to the RT server. To do that, just repeat the installation instructions above, skipping the steps about installing the database and web server.&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s background jobs ==&lt;br /&gt;
&lt;br /&gt;
Create a file &amp;lt;code&amp;gt;/etc/cron.d/rt&amp;lt;/code&amp;gt; with the following content. You may edit all of the time fields as you see fit. Refer to the crontab(5) man page for details about their definitions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Update the fulltext index with new ticket data&lt;br /&gt;
*/3 *   *   *   *   root    /opt/rt5/sbin/rt-fulltext-indexer&lt;br /&gt;
# Email out dashboards that users have subscribed to&lt;br /&gt;
0   *   *   *   *   root    /opt/rt5/sbin/rt-email-dashboards&lt;br /&gt;
# Clean old sessions from the database&lt;br /&gt;
10  3   *   *   *   root    /opt/rt5/sbin/rt-clean-sessions --older 8d&lt;br /&gt;
# Email out weekly digests for users who have requested it&lt;br /&gt;
50  4   *   *   Mon root    /opt/rt5/sbin/rt-email-digest -m weekly&lt;br /&gt;
# Email out daily digests for users who have requested it&lt;br /&gt;
50  5   *   *   *   root    /opt/rt5/sbin/rt-email-digest -m daily&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
You can run all these jobs as the same user that runs your web server, rather than root. Run:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo sed -i &#039;s/\broot\b/www-data/&#039; /etc/cron.d/rt&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo sed -i &#039;s/\broot\b/apache/&#039; /etc/cron.d/rt&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Set up RT ==&lt;br /&gt;
&lt;br /&gt;
If you’ve gotten this far, congratulations, your RT install is really done now. You can start setting up RT with users, groups, queues, and business logic. [[Main Page|Head back to the main page]] to start exploring those topics.&lt;/div&gt;</summary>
		<author><name>Brett</name></author>
	</entry>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=CustomizingWithCallbacks&amp;diff=27046</id>
		<title>CustomizingWithCallbacks</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=CustomizingWithCallbacks&amp;diff=27046"/>
		<updated>2022-01-06T21:34:37Z</updated>

		<summary type="html">&lt;p&gt;Brett: formatting cleanups&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Callbacks =&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
RT uses Callbacks for adding extensions into the Web GUI without modifying html code. Wikipedia defines a callback as “executable code that is passed as an argument to other code. It allows a lower-level software layer to call a subroutine (or function) defined in a higher-level layer.&amp;quot; So callback in RT is a code that you can put into right place and it will be called when a user opens a page.&lt;br /&gt;
&lt;br /&gt;
Callbacks are called on different places and have to be placed into directories&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;amp;lt;rt root&amp;amp;gt;/local/html/Callbacks/&amp;amp;lt;any directory&amp;amp;gt;/&amp;amp;lt;normal path to html-page&amp;amp;gt;/&amp;amp;lt;CallbackName&amp;amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;amp;lt;rt root&amp;amp;gt; - we suppose you know where your RT is installed&lt;br /&gt;
* local - local directory for your customizations, [[CustomizingWithLocalDir]].&lt;br /&gt;
* html - directory with Mason components.&lt;br /&gt;
* Callbacks - directory for your Callbacks, create if it doesn&#039;t exist. It&#039;s Callbacks (lowercase &amp;quot;b&amp;quot;) not CallBacks (uppercase &amp;quot;B&amp;quot;), not callbacks.&lt;br /&gt;
* &amp;amp;lt;any directory&amp;amp;gt; - one directory with any name you like. Call it MyCallbacks, his_callbacks or boo. The assumption is that you will group your callbacks, based on logic of your choosing. You can have many different callback groups, and the callback will be run for each of them.&lt;br /&gt;
* &amp;amp;lt;normal path to html-page&amp;amp;gt; - if a call you want to hook on is in &amp;lt;code&amp;gt;html/X/Y.html&amp;lt;/code&amp;gt; file then you should create &amp;lt;code&amp;gt;X/Y.html&amp;lt;/code&amp;gt; directory.&lt;br /&gt;
* &amp;amp;lt;CallbackName&amp;amp;gt; - name of the callback, each page may have multiple callbacks. By default is &#039;Default&#039;, but might be different. Read more about names below.&lt;br /&gt;
&lt;br /&gt;
Places where callbacks are called look in the following way (RT 3.8):&lt;br /&gt;
&lt;br /&gt;
    $m-&amp;gt;callback(&lt;br /&gt;
        TicketObj =&amp;gt; $TicketObj,&lt;br /&gt;
        ARGSRef =&amp;gt; \%ARGS,&lt;br /&gt;
        CallbackName =&amp;gt; &#039;Initial&#039;,&lt;br /&gt;
    );&lt;br /&gt;
&lt;br /&gt;
This is example from Ticket/Display.html in RT 3.8.7, full path to your code may look like this:&lt;br /&gt;
&lt;br /&gt;
    /opt/rt3/local/html/Callbacks/MyCallbacks/Ticket/Display.html/Initial&lt;br /&gt;
&lt;br /&gt;
Arguments passed to callback function are passed into your code and you can use them to explore situation and modify behaviour.&lt;br /&gt;
&lt;br /&gt;
== Finding callbacks ==&lt;br /&gt;
&lt;br /&gt;
You can find all callbacks using grep command:&lt;br /&gt;
&lt;br /&gt;
    cd /opt/rt3/&lt;br /&gt;
    find share/html | xargs grep &#039;\-&amp;amp;gt;callback&#039;&lt;br /&gt;
&lt;br /&gt;
In RT 3.6 and older syntax is slightly different, old syntax is still valid and supported:&lt;br /&gt;
&lt;br /&gt;
    cd /opt/rt3/&lt;br /&gt;
    find share/html | xargs grep &#039;Elements/Callback&#039;&lt;br /&gt;
&lt;br /&gt;
In RT 4.2.x these are most of them: [[RT_4.2_Callbacks]]&lt;br /&gt;
&lt;br /&gt;
In RT-Assets 1.01 these are most of them: [[RT-Assets_1.01_Callbacks]]&lt;br /&gt;
&lt;br /&gt;
== CallbackName ==&lt;br /&gt;
&lt;br /&gt;
Each Mason component may call multiple callbacks, so each callback has a name. The name of the callback you figure out from arguments used to call $m-&amp;amp;gt;callback. Understandably, the argument to define a callback name is &#039;CallbackName&#039; and if it&#039;s absent then &#039;Default&#039; is used.&lt;br /&gt;
&lt;br /&gt;
For example, the following callback call in Modify.html lacks a name, so its name (by default) is Default&lt;br /&gt;
&amp;lt;source lang=&amp;quot;perl&amp;quot;&amp;gt;&lt;br /&gt;
 $m-&amp;gt;callback( TicketObj =&amp;gt; $TicketObj, CustomFields =&amp;gt; $CustomFields, ARGSRef =&amp;gt; \%ARGS );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Sample callbacks ==&lt;br /&gt;
&lt;br /&gt;
* [http://page.mi.fu-berlin.de/~pape/rt3/Callbacks/ Samples] from [[DirkPape]].&lt;br /&gt;
* [[AddCustomStyleSheet]]&lt;br /&gt;
* [[HideTransactions]]: Hide all transactions created by the system user.&lt;br /&gt;
* [[ShowPerQueueInstructions]]&lt;br /&gt;
* [[RequireCFResolve]]: Require CF value before resolve&lt;br /&gt;
* [[ToggleCFs]]: Hide certain Custom Fields unless a &amp;quot;control&amp;quot; CF is set to a specific value. Allows decluttering the user interface in the common case and exposes additional detail (CFs) when needed.&lt;br /&gt;
&lt;br /&gt;
== Comments ==&lt;br /&gt;
&lt;br /&gt;
There are some drawbacks, when customizing RT with the &amp;quot;Local&amp;quot; principle: If you have many customizations it is difficult to propagate customizations across version changes. This is mainly because&lt;br /&gt;
&lt;br /&gt;
* when using the &#039;local&#039; directory, you overlay &#039;&#039;&#039;files&#039;&#039;&#039;. If the original file is changed in a new release, e. g. a bug is fixed or a feature is added, you will not profit from this changes immediately, because your overlay is used.&lt;br /&gt;
* when using a XXX_Local.pm, you overlay &#039;&#039;&#039;methods&#039;&#039;&#039; and the same drawback as above will hit you if the method has been changed across releases.&lt;br /&gt;
&lt;br /&gt;
For both customisation methods hold: They are not local enough! If you overlay, it might be possible that you overlay code (that you did not change) from earlier versions, that have been corrected or adopted to other changes in new versions and that is not compatible with the new version. Hence version upgrades may be complicated. I added two Sections above with customization methods I prefer, because we do many customizations, these are Patches and Callbacks. --[[DirkPape]]&lt;br /&gt;
&lt;br /&gt;
==== GaryOberbrunner ====&lt;br /&gt;
&lt;br /&gt;
Here&#039;s a sample [[ShowMessageStanza]] callback. Put this in /opt/rt3/share/html/Callbacks/*/Ticket/Elements/ShowMessageStanza/Default :&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;%init&amp;gt;&lt;br /&gt;
    my $val = $$content;&lt;br /&gt;
    use bytes;&lt;br /&gt;
    # Auto link 12-digit hex strings to a search page&lt;br /&gt;
    $val =~ s{[0-9a-f]{12}}{&amp;lt;a href=&amp;quot;http://my.example.com/search?$&amp;amp;&amp;quot;&amp;gt;$&amp;amp;&amp;lt;\/a&amp;gt;}gi;&lt;br /&gt;
    $$content = $val;&lt;br /&gt;
    &amp;lt;/%init&amp;gt;&lt;br /&gt;
    &amp;lt;%args&amp;gt;&lt;br /&gt;
    $content =&amp;gt; undef&lt;br /&gt;
    &amp;lt;/%args&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note that the stanza will appear in $$content, you just modify it in place. Thanks to Toby Darling for the code!&lt;br /&gt;
&lt;br /&gt;
==Troubleshooting==&lt;br /&gt;
Did you clear your Mason cache? (See [[ClearMasonCache|CleanMasonCache]])&lt;br /&gt;
&lt;br /&gt;
Did you restart your webserver process?&lt;br /&gt;
&lt;br /&gt;
Are your Mason component settings accurate (in the web UI, visit Tools -&amp;gt; System Configuration and scroll down)?&lt;br /&gt;
&lt;br /&gt;
Are your file and directory permissions for your new callback set properly?&lt;br /&gt;
&lt;br /&gt;
Are you sure you have your callback arguments correct? Beware &#039;TicketObj&#039; vs. &#039;Ticket&#039; being passed!&lt;/div&gt;</summary>
		<author><name>Brett</name></author>
	</entry>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=ManualInstallation&amp;diff=27045</id>
		<title>ManualInstallation</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=ManualInstallation&amp;diff=27045"/>
		<updated>2021-12-26T23:15:01Z</updated>

		<summary type="html">&lt;p&gt;Brett: tweak logging configuration to account for command line tools&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Prev: [[ManualRequirements]] — Up: [[UserManual]] — Next: [[ManualApacheConfig]]&lt;br /&gt;
&lt;br /&gt;
This guide walks you through installing RT from source on a modern, popular Linux distro. Specifically, that means a distribution based on Debian or Red Hat that’s been released since around 2020.&lt;br /&gt;
&lt;br /&gt;
This guide assumes:&lt;br /&gt;
&lt;br /&gt;
* You can install packages generally available in Debian/Ubuntu or Red Hat/Fedora/CentOS.&lt;br /&gt;
* You want to install RT, and all of its Perl dependencies, from source to get the latest versions. (This is a trade-off. It means the boundaries of your install will be very clear, but you won’t get security updates for RT or Perl modules from your distribution.)&lt;br /&gt;
* You are willing to install a couple of extra tools to manage the RT installation similarly to how you would in other packaging systems (like PyPI, npm, etc.).&lt;br /&gt;
* You are willing to do a relatively maximal install of RT, enabling all the options during installation and then setting what you need in the configuration. (You could save a little space and time by being pickier about your options, but then that complicates the guide and makes it harder to turn those options on later if you want.)&lt;br /&gt;
* You are using a regular user account on the Linux system that can get superuser privileges with sudo.&lt;br /&gt;
&lt;br /&gt;
== Install the base dependencies ==&lt;br /&gt;
&lt;br /&gt;
These are required by RT, either to run or to install the dependencies.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install autoconf build-essential cpanminus curl libexpat-dev libgd-dev libssl-dev libz-dev gnupg graphviz lynx openssl perl&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install patch tar which gcc gcc-c++ perl-core perl-App-cpanminus graphviz expat-devel gd-devel lynx openssl openssl-devel&lt;br /&gt;
sudo setenforce 0&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
(Turning off SELinux enforcement is required on Red Hat-based distributions because, as of October 2021, nobody has written a policy for RT.)&lt;br /&gt;
&lt;br /&gt;
== Install a database ==&lt;br /&gt;
&lt;br /&gt;
You need access to a database server. It can be remote, or you can install a database server alongside RT. RT supports a few different databases, but the best supported options are PostgreSQL and MariaDB.&lt;br /&gt;
&lt;br /&gt;
=== Installing and configuring the PostgreSQL server ===&lt;br /&gt;
&lt;br /&gt;
If you want to install a fresh PostgreSQL database server alongside RT:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install postgresql&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install postgresql-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In order to set up RT’s database, you will need a PostgreSQL superuser account that can be authenticated with a password. If you don’t have that, you can create it by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo createuser -sP rt_admin&amp;lt;/pre&amp;gt;&lt;br /&gt;
Set the password when prompted. Record this; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
=== Enable password authentication in PostgreSQL ===&lt;br /&gt;
&lt;br /&gt;
You need to consider this step whether you install the database locally, or use an existing one already running. RT supports connecting to PostgreSQL a few different ways, but authenticating with a username and password is simplest, and this guide is written based on that. Not all PostgreSQL installations allow this authentication method by default. You need to review your &amp;lt;code&amp;gt;pg_hba.conf&amp;lt;/code&amp;gt; file located at:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;/etc/postgresql/VERSION/main/pg_hba.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;/var/lib/pgsql/VERSION/data/pg_hba.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Replace &amp;lt;code&amp;gt;VERSION&amp;lt;/code&amp;gt; with the version of your PostgreSQL database. Add these two lines &#039;&#039;&#039;above&#039;&#039;&#039; any other lines that start with &amp;lt;code&amp;gt;host&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;host  rt5  rt_user   all  md5&lt;br /&gt;
host  rt5  rt_admin  all  md5&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This configuration will let &amp;lt;code&amp;gt;rt_user&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;rt_admin&amp;lt;/code&amp;gt; authorize themselves for the &amp;lt;code&amp;gt;rt5&amp;lt;/code&amp;gt; database using an &amp;lt;code&amp;gt;md5&amp;lt;/code&amp;gt; crypted password over a network connection (possibly using the localhost loopback network). You might be able to further restrict some of these fields for improved security, but doing so is outside the scope of this install guide. Refer to [https://www.postgresql.org/docs/current/auth-pg-hba-conf.html the pg_hba.conf documentation] for more details.&lt;br /&gt;
&lt;br /&gt;
Save your changes and reload the database:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo systemctl reload postgresql&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Installing the PostgreSQL client libraries ===&lt;br /&gt;
&lt;br /&gt;
These are required for RT to be able to talk to any PostgreSQL server.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install libpq-dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install postgresql-devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Once this is done you can skip ahead to installing a web server.&lt;br /&gt;
&lt;br /&gt;
=== Installing and configuring the MariaDB server ===&lt;br /&gt;
&lt;br /&gt;
If you want to install a fresh MariaDB database server alongside RT:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install mariadb-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install mariadb-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In order to set up RT’s database, you will need a MySQL superuser account. To stay consistent with PostgreSQL, I suggest setting a password for it. You can do that by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo mysql&lt;br /&gt;
mysql# GRANT ALL PRIVELEGES WITH GRANT OPTION ON rt5 TO rt_admin@localhost IDENTIFIED BY &#039;YourPassphraseHere&#039;;&amp;lt;/pre&amp;gt;&lt;br /&gt;
Record your passphrase; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
=== Adjust MariaDB’s max_allowed_packet setting ===&lt;br /&gt;
&lt;br /&gt;
You need to consider this step whether you install the database locally, or use an existing one already running. [https://mariadb.com/kb/en/server-system-variables/#max_allowed_packet MariaDB’s &amp;lt;code&amp;gt;max_allowed_packet&amp;lt;/code&amp;gt; setting] functionally limits the size of attachments in RT. The default is 16MiB, which is too small for most installations. You can ultimately choose any setting you’re comfortable with; 64MiB here should allow most requests without being too open.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;echo -e &#039;[client-server]\nmax_allowed_packet=64M\n&#039; | sudo tee /etc/mysql/conf.d/max_allowed_packet.cnf&lt;br /&gt;
sudo systemctl reload mariadb&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;echo -e &#039;[client-server]\nmax_allowed_packet=64M\n&#039; | sudo tee /etc/my.cnf.d/max_allowed_packet.cnf&lt;br /&gt;
sudo systemctl reload mariadb&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Installing the MariaDB client libraries ===&lt;br /&gt;
&lt;br /&gt;
These are required for RT to be able to talk to any MariaDB server.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install libmariadb-dev libmariadb-dev-compat&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install mariadb-devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Install a web server with FastCGI ==&lt;br /&gt;
&lt;br /&gt;
FastCGI is the best way to host RT’s web interface today. Installing the web server before RT makes the installation process simpler, because RT will be able to automatically some details about your web server like what user it runs as.&lt;br /&gt;
&lt;br /&gt;
=== Installing Apache ===&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install apache2 libapache2-mod-fcgid&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install httpd mod_fcgid mod_ssl&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ### Installing nginx --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Install RT ==&lt;br /&gt;
&lt;br /&gt;
=== Get and unpack the RT source code ===&lt;br /&gt;
&lt;br /&gt;
Download the latest source code using the link on the [https://bestpractical.com/download-page RT download page], extract it using &amp;lt;code&amp;gt;tar -xf&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt; into the source code directory to run the rest of the commands in this section. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;curl -O https://download.bestpractical.com/pub/rt/release/rt-5.0.2.tar.gz&lt;br /&gt;
tar -xf rt-5.0.2.tar.gz&lt;br /&gt;
cd rt-5.0.2&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Pre-configure RT ===&lt;br /&gt;
&lt;br /&gt;
This command will detect some information about your system in order to install RT properly, and decide which set of dependencies to install. Here’s what the different parts of our command are doing:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;--with-db-type=TYPE&amp;lt;/code&amp;gt; - Replace &amp;lt;code&amp;gt;TYPE&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;Pg&amp;lt;/code&amp;gt; for PostgreSQL, or &amp;lt;code&amp;gt;mysql&amp;lt;/code&amp;gt; for MariaDB.&lt;br /&gt;
* &amp;lt;code&amp;gt;--prefix=/opt/rt5&amp;lt;/code&amp;gt; sets the directory where RT will install all of its libraries, tools, and supporting files. You can choose another path if you like.&lt;br /&gt;
* The rest of the options tell RT to install additional dependencies for optional features.&lt;br /&gt;
&lt;br /&gt;
Make sure you have &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt;ed into the RT source directory, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;./configure --with-db-type=TYPE --prefix=/opt/rt5 --with-attachment-store=disk --enable-externalauth --enable-gd --enable-graphviz --enable-gpg --enable-smime&amp;lt;/pre&amp;gt;&lt;br /&gt;
For more background, [https://docs.bestpractical.com/rt/latest/configure.html refer to the RT configure options documentation].&lt;br /&gt;
&lt;br /&gt;
=== Install RT and its Perl dependencies ===&lt;br /&gt;
&lt;br /&gt;
This command will download, build, and install all of the Perl modules necessary to run RT with the configuration you set above. Here’s what the different parts of the command are doing:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;make dirs&amp;lt;/code&amp;gt; sets up RT&#039;s directory structure. We do this first to install dependencies under it.&lt;br /&gt;
* &amp;lt;code&amp;gt;make fixdeps&amp;lt;/code&amp;gt; actually installs those dependencies.&lt;br /&gt;
* &amp;lt;code&amp;gt;RT_FIX_DEPS_CMD=&#039;cpanm …&#039;&amp;lt;/code&amp;gt; tells RT to use cpanminus to install dependencies (instead of the older, default &amp;lt;code&amp;gt;cpan&amp;lt;/code&amp;gt; command), and to install them where RT will automatically load them.&lt;br /&gt;
* &amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt; installs all of RT’s files under &amp;lt;code&amp;gt;/opt/rt5&amp;lt;/code&amp;gt; (or the prefix directory you set in the previous step). It will only run if &amp;lt;code&amp;gt;fixdeps&amp;lt;/code&amp;gt; succeeds.&lt;br /&gt;
&lt;br /&gt;
Make sure you have &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt;ed into the RT source directory, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo make dirs&lt;br /&gt;
sudo ln -s . /opt/rt5/local/lib/perl5&lt;br /&gt;
make fixdeps RT_FIX_DEPS_CMD=&#039;cpanm --sudo --quiet --local-lib=/opt/rt5/local&#039;&lt;br /&gt;
sudo make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
If it works, the command will eventually output a message that says “Congratulations. RT is now installed.” followed by instructions about configuring and setting up the database. We’ll do that next.&lt;br /&gt;
&lt;br /&gt;
=== Configure RT ===&lt;br /&gt;
&lt;br /&gt;
[https://docs.bestpractical.com/rt/latest/RT_Config.html RT has many configuration options.] You can put configuration options in the file &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/code&amp;gt;, or in individual files under &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.d/&amp;lt;/code&amp;gt;. Use an editor to save all the text below to &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/code&amp;gt; (you can just overwrite the existing file, or add this to the bottom of what’s there) and then fill in settings for your site everywhere the text &amp;lt;code&amp;gt;EDIT WITH&amp;lt;/code&amp;gt; appears.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Single-quote all values EXCEPT the special value `undef`&lt;br /&gt;
# that turns off a setting.&lt;br /&gt;
&lt;br /&gt;
# rtname appears in ticket email subjects. It needs to be globally unique,&lt;br /&gt;
# so use your organization&#039;s domain name.&lt;br /&gt;
Set($rtname, &#039;EDIT WITH yourdomain.example.com&#039;);&lt;br /&gt;
# Organization is used in the database for ticket links, etc. It also needs to&lt;br /&gt;
# be globally unique, so use your organization&#039;s domain name.&lt;br /&gt;
Set($Organization, &#039;EDIT WITH yourdomain.example.com&#039;);&lt;br /&gt;
# WebDomain is domain name of the RT web server. RT uses it to construct links&lt;br /&gt;
# and defend against CSRFs.&lt;br /&gt;
Set($WebDomain, &#039;EDIT WITH rt.yourdomain.example.com&#039;);&lt;br /&gt;
# WebPort is the port where the RT web server runs. Edit the number below if&lt;br /&gt;
# you&#039;re not using the standard HTTPS port.&lt;br /&gt;
Set($WebPort, &#039;443&#039;);&lt;br /&gt;
&lt;br /&gt;
# DatabaseUser is the name of the database account RT uses to read and store&lt;br /&gt;
# data. &#039;rt_user&#039; is the default but you can change it if you like.&lt;br /&gt;
# DO NOT use the &#039;rt_admin&#039; superuser created in the instructions above.&lt;br /&gt;
Set($DatabaseUser, &#039;rt_user&#039;);&lt;br /&gt;
# DatabasePassword is the password for DatabaseUser.&lt;br /&gt;
Set($DatabasePassword, &#039;EDIT WITH SomePassphraseHere&#039;);&lt;br /&gt;
# DatabaseHost is the hostname of the database server RT should use.&lt;br /&gt;
# Change &#039;localhost&#039; if it lives on a different server.&lt;br /&gt;
Set($DatabaseHost, &#039;localhost&#039;);&lt;br /&gt;
# DatabasePort is the port number of the database server RT should use.&lt;br /&gt;
# `undef` means the default for that database. Change it if you&#039;re not&lt;br /&gt;
# using the standard port.&lt;br /&gt;
Set($DatabasePort, undef);&lt;br /&gt;
# DatabaseName is the name of RT&#039;s database hosted on DatabaseHost.&lt;br /&gt;
# &#039;rt5&#039; is the default but you can change it if you like.&lt;br /&gt;
Set($DatabaseName, &#039;rt5&#039;);&lt;br /&gt;
# DatabaseAdmin is the name of the user in the database used to perform&lt;br /&gt;
# major administrative tasks. Change &#039;rt_admin&#039; if you&#039;re using a user&lt;br /&gt;
# besides the one created in this guide.&lt;br /&gt;
Set($DatabaseAdmin, &#039;rt_admin&#039;);&lt;br /&gt;
&lt;br /&gt;
# RT can log to syslog, stderr, and/or a dedicated file.&lt;br /&gt;
# Log settings are used both by the primary server and by command line&lt;br /&gt;
# tools like rt-crontool, rt-ldapimport, etc.&lt;br /&gt;
# You set all of RT&#039;s $LogTo* paramaters to a standard log level: &#039;debug&#039;,&lt;br /&gt;
# &#039;info&#039;, &#039;notice&#039;, &#039;warning&#039;, &#039;error&#039;, &#039;critical&#039;, &#039;alert&#039;, or &#039;emergency&#039;.&lt;br /&gt;
# For a modern install, I recommend logging primarily to syslog, so it goes&lt;br /&gt;
# to journald where it&#039;s easy to query and automatically gets rotated.&lt;br /&gt;
Set($LogToSyslog, &#039;info&#039;);&lt;br /&gt;
&lt;br /&gt;
# When the RT server logs to stderr, that usually goes to your web server&#039;s&lt;br /&gt;
# error log. Command line tools log to their own stderr. Setting this to&lt;br /&gt;
# &#039;warning&#039; or &#039;error&#039; helps ensure you get notified if RT&#039;s cron jobs&lt;br /&gt;
# encounter problems.&lt;br /&gt;
Set($LogToSTDERR, &#039;warning&#039;);&lt;br /&gt;
&lt;br /&gt;
# Turn off optional features that require additional configuration.&lt;br /&gt;
# If you want to use these, refer to the RT_Config documentation for&lt;br /&gt;
# instructions on how to set them up.&lt;br /&gt;
Set(%GnuPG, &#039;Enable&#039; =&amp;gt; &#039;0&#039;);&lt;br /&gt;
Set(%SMIME, &#039;Enable&#039; =&amp;gt; &#039;0&#039;);&lt;br /&gt;
&lt;br /&gt;
# Perl expects to find this 1 at the end of the file.&lt;br /&gt;
1;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;RT_SiteConfig.pm&amp;lt;/code&amp;gt; is actually Perl code. RT runs the code directly to load the configuration. Any time you finish editing it, you can check that you didn’t make any syntax errors by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;perl -c /opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Set up RT’s database ===&lt;br /&gt;
&lt;br /&gt;
RT includes a tool to help you set up its database. By default, it connects to the database as an administrator to create the database and user that you configured in the previous step.&lt;br /&gt;
&lt;br /&gt;
(The instructions from &amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt; and RT’s README file tell you to run &amp;lt;code&amp;gt;make initialize-database&amp;lt;/code&amp;gt;. That just runs &amp;lt;code&amp;gt;rt-setup-database&amp;lt;/code&amp;gt; for you. Running the tool directly makes it easier to pass the options you need.)&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;--action=init&amp;lt;/code&amp;gt; tells the tool to create the user, the database, the tables inside it, and insert core data RT needs to function.&lt;br /&gt;
* &#039;&#039;&#039;If&#039;&#039;&#039; you are using an existing database server and the database adminstrator has already created the user account and database for RT, then you can add the &amp;lt;code&amp;gt;--skip-create&amp;lt;/code&amp;gt; option.&lt;br /&gt;
* &#039;&#039;&#039;If&#039;&#039;&#039; you have a less common database setup, this tool has additional options to give you finer-grained control over what steps are run and how. Refer to [https://docs.bestpractical.com/rt/latest/rt-setup-database.html the full rt-setup-database documentation] to learn more about those.&lt;br /&gt;
* The command reads files from RT’s &amp;lt;code&amp;gt;etc/&amp;lt;/code&amp;gt; directory by default, so the easiest way to run it is to &amp;lt;code&amp;gt;cd /opt/rt5&amp;lt;/code&amp;gt; first, and then it will find the necessary files automatically.&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /opt/rt5&lt;br /&gt;
sudo sbin/rt-setup-database --action=init&amp;lt;/pre&amp;gt;&lt;br /&gt;
Enter the password for your database administrator account when prompted.&lt;br /&gt;
&lt;br /&gt;
=== Set up fulltext indexing ===&lt;br /&gt;
&lt;br /&gt;
Fulltext indexing speeds up searches for ticket content, which makes RT a lot nicer to use.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;--noask&amp;lt;/code&amp;gt; uses the default names for the index, which will be fine for a new install and simplifies the setup.&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo /opt/rt5/sbin/rt-setup-fulltext-index --noask&amp;lt;/pre&amp;gt;&lt;br /&gt;
Enter the password for your database administrator account when prompted. The end of the process will output some RT configuration that looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;### EXAMPLE OUTPUT ONLY - Don&#039;t use this directly!&lt;br /&gt;
Set( %FullTextSearch,&lt;br /&gt;
    Enable     =&amp;gt; 1,&lt;br /&gt;
    Indexed    =&amp;gt; 1,&lt;br /&gt;
    # Additional output from rt-setup-fulltext-index should be here.&lt;br /&gt;
    # The configuration varies by database type.&lt;br /&gt;
);&amp;lt;/pre&amp;gt;&lt;br /&gt;
Copy the output generated when you run &amp;lt;code&amp;gt;rt-setup-fulltext-index&amp;lt;/code&amp;gt; and save it to the file &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.d/FulltextIndex.pm&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Set permissions ===&lt;br /&gt;
&lt;br /&gt;
All of RT’s configuration files should be readable by the user that runs the web server, and no other users, in order to protect sensitive information like the database password. RT provides a command to set permissions appropriately according to your distribution and configuration. &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt; to the directory where you extracted the RT source code, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd rt-5.0.2&lt;br /&gt;
sudo make fixperms&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Verify the installation ===&lt;br /&gt;
&lt;br /&gt;
If everything has gone well, then you should be able to set a password for RT’s &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; user. You’ll use this later to log in to the web interface and continue setting up your system. Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo /opt/rt5/sbin/rt-passwd root&amp;lt;/pre&amp;gt;&lt;br /&gt;
Set the password when prompted. Record this; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s web server ==&lt;br /&gt;
&lt;br /&gt;
=== Configure Apache modules ===&lt;br /&gt;
&lt;br /&gt;
You will need to have the following modules enabled in Apache to run RT. You should already have these installed if you followed the instructions above.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;alias&amp;lt;/code&amp;gt; (required to map URLs to RT)&lt;br /&gt;
* &amp;lt;code&amp;gt;fcgid&amp;lt;/code&amp;gt; (required for Apache to talk to RT)&lt;br /&gt;
* &amp;lt;code&amp;gt;mpm_prefork&amp;lt;/code&amp;gt; (Apache requires you to select an MPM. RT is designed to work with the prefork module.)&lt;br /&gt;
* &amp;lt;code&amp;gt;ssl&amp;lt;/code&amp;gt; (required to serve HTTPS; optional otherwise)&lt;br /&gt;
&lt;br /&gt;
Enable them following these instructions:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo a2dismod mpm_event&lt;br /&gt;
sudo a2enmod fcgid&lt;br /&gt;
sudo a2enmod mpm_prefork&lt;br /&gt;
sudo a2enmod ssl&amp;lt;/pre&amp;gt;&lt;br /&gt;
| &amp;lt;pre&amp;gt;echo LoadModule mpm_prefork_module modules/mod_mpm_prefork.so | sudo tee /etc/httpd/conf.modules.d/00-mpm.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Configure an Apache VirtualHost ===&lt;br /&gt;
&lt;br /&gt;
Create a file at the following location. You can change the &amp;lt;code&amp;gt;RT&amp;lt;/code&amp;gt; part of the filename if you like, but the file must exist in this directory and have a &amp;lt;code&amp;gt;.conf&amp;lt;/code&amp;gt; suffix.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;/etc/apache2/sites-available/RT.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
Then after you create the file, run: &amp;lt;code&amp;gt;sudo a2ensite RT&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;/etc/httpd/conf.d/RT.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Use an editor to save all the text below to the new &amp;lt;code&amp;gt;RT.conf&amp;lt;/code&amp;gt; and then fill in settings for your site everywhere the text &amp;lt;code&amp;gt;EDIT WITH&amp;lt;/code&amp;gt; appears.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### Server-level settings&lt;br /&gt;
# These settings affect all of Apache. It is okay to put them here if Apache&lt;br /&gt;
# only hosts RT. If you are hosting other sites in the same Apache instance,&lt;br /&gt;
# you may need to put these settings in another file like&lt;br /&gt;
# (Debian/Ubuntu) /etc/apache2/conf-available/RT.conf&lt;br /&gt;
# (Red Hat/Fedora/CentOS) /etc/httpd/conf.d/RTserver.conf&lt;br /&gt;
# ... and ensure they do not conflict with settings required by other sites.&lt;br /&gt;
&lt;br /&gt;
# mod_fcgid only allows 128KiB requests by default. This is too small for users&lt;br /&gt;
# to upload files to RT. You can ultimately choose any setting you&#039;re&lt;br /&gt;
# comfortable with; 70MiB here should allow most requests without being too&lt;br /&gt;
# open.&lt;br /&gt;
FcgidMaxRequestLen 73400320&lt;br /&gt;
&lt;br /&gt;
&amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
  # Listen on the standard HTTPS port.&lt;br /&gt;
  # You can change this to a nonstandard port if you must.&lt;br /&gt;
  Listen 443&lt;br /&gt;
&amp;lt;/IfModule&amp;gt;&lt;br /&gt;
### End server-level settings&lt;br /&gt;
&lt;br /&gt;
### Primary RT VirtualHost&lt;br /&gt;
# You can change both the bind address and/or the port here as required.&lt;br /&gt;
# This default will listen for HTTPS connections on all interfaces.&lt;br /&gt;
&amp;lt;VirtualHost *:443&amp;gt;&lt;br /&gt;
  # EDIT HERE with the domain name of the web server.&lt;br /&gt;
  ServerName rt.yourdomain.example.com&lt;br /&gt;
  &amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
    SSLEngine on&lt;br /&gt;
    # These specify the paths to the SSL certificate and private key Apache&lt;br /&gt;
    # should use. These example paths are common for Let&#039;s Encrypt. If you&lt;br /&gt;
    # don&#039;t use Let&#039;s Encrypt, the standard location for these files is under&lt;br /&gt;
    # (Debian/Ubuntu) /etc/ssl&lt;br /&gt;
    # (Red Hat/Fedora/CentOS) /etc/pki/tls&lt;br /&gt;
    # EDIT HERE with the appropriate paths for your server&lt;br /&gt;
    SSLCertificateFile /etc/letsencrypt/live/example.com/fullchain.pem&lt;br /&gt;
    SSLCertificateKeyFile /etc/letsencrypt/live/example.com/privkey.pem&lt;br /&gt;
  &amp;lt;/IfModule&amp;gt;&lt;br /&gt;
  &amp;lt;Location /&amp;gt;&lt;br /&gt;
    Require all granted&lt;br /&gt;
    Options +ExecCGI&lt;br /&gt;
    AddHandler fcgid-script fcgi&lt;br /&gt;
  &amp;lt;/Location&amp;gt;&lt;br /&gt;
  AddDefaultCharset UTF-8&lt;br /&gt;
  DocumentRoot /opt/rt5/share/html&lt;br /&gt;
  ScriptAlias / /opt/rt5/sbin/rt-server.fcgi/&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
### End primary RT VirtualHost&lt;br /&gt;
&lt;br /&gt;
### Optional HTTPS Redirect VirtualHost&lt;br /&gt;
# Most modern servers support HTTPS and want all web traffic to go through it.&lt;br /&gt;
# This VirtualHost redirects normal HTTP traffic to HTTPS.&lt;br /&gt;
# You can delete this whole section if you don&#039;t want or need this.&lt;br /&gt;
&amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
  # You can change both the bind address and/or the port here as required.&lt;br /&gt;
  # This default will listen for HTTP connections on all interfaces.&lt;br /&gt;
  &amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
    SSLEngine off&lt;br /&gt;
    # EDIT HERE both lines below with the domain name of your web server.&lt;br /&gt;
    ServerName rt.yourdomain.example.com&lt;br /&gt;
    Redirect permanent / https://rt.yourdomain.example.com/&lt;br /&gt;
  &amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/IfModule&amp;gt;&lt;br /&gt;
### End optional HTTPS Redirect VirtualHost&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
After you’ve edited the file, load the configuration with:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo systemctl reload apache2&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo systemctl reload httpd&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If this command reports an error, double-check the configuration file for typos, especially in option names, file paths, and the&lt;br /&gt;
&amp;lt;Section&amp;gt;&lt;br /&gt;
pairs. Edit again and reload the configuration until it succeeds without output.&lt;br /&gt;
&lt;br /&gt;
=== Verify the web interface ===&lt;br /&gt;
&lt;br /&gt;
You should be able to visit your web server in your browser, and be presented with RT’s login screen. You should be able to log in with username &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; and the password you set previously.&lt;br /&gt;
&lt;br /&gt;
If you run into trouble, the first place to look for more information is by reading Apache’s error log:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo less /var/log/apache2/error.log&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo less /var/log/httpd/error.log&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s mail server ==&lt;br /&gt;
&lt;br /&gt;
RT both can both send and receive ticket updates via email. Unfortunately, there are too many variables to document a useful setup process here: getting this working usually requires creating DNS records, and coordinating with existing mail servers, which will be the main constraint on your setup. Instead this guide provides a brief overview of how the integration works, and where the connection points are that you likely need to work on.&lt;br /&gt;
&lt;br /&gt;
=== Sending Mail ===&lt;br /&gt;
&lt;br /&gt;
RT only knows how to send mail by passing it off to another program on the system. It cannot connect or authenticate directly to external mail servers. In the default configuration, RT runs the standard &amp;lt;code&amp;gt;sendmail&amp;lt;/code&amp;gt; command. There are [https://docs.bestpractical.com/rt/latest/RT_Config.html#Outgoing-mail configuration options to send mail through different commands] if you need.&lt;br /&gt;
&lt;br /&gt;
The most common setup is to install and configure a proper Mail Transfer Agent (MTA) like Postfix or Exim, and then configure it to send mail to the wider Internet as you need. This works well because the MTAs are robust and well-tested; they have flexible configuration to let you send mail out by relaying to other mail servers you specify with optional authentication; and most distributions install one by default anyway. The only hard part is configuring the MTA to send mail following your site’s policies.&lt;br /&gt;
&lt;br /&gt;
Other software is available that provides a slimmer version of the &amp;lt;code&amp;gt;sendmail&amp;lt;/code&amp;gt; command that connects to an external mail server for you, like ssmtp. These programs are usually easier to configure than an MTA, but they often lose email permanently if they can’t connect to the external server at the time it’s sent. (MTAs keep email queued locally until they successfully deliver it to another server.)&lt;br /&gt;
&lt;br /&gt;
=== Receiving email ===&lt;br /&gt;
&lt;br /&gt;
RT installs a command called &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; that receives an email on standard input and posts it to RT’s REST web interface, where it gets saved in the database and added to a ticket. You need to arrange for a way to send incoming email to this command.&lt;br /&gt;
&lt;br /&gt;
The most common setup is to have an MTA on the same box as RT receive email directly, and then set up mail aliases that call this command when mail comes in. Example &amp;lt;code&amp;gt;/etc/aliases&amp;lt;/code&amp;gt; entries look like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rt: &amp;quot;|/opt/rt5/bin/rt-mailgate --queue general --action correspond --url https://rt.yourdomain.example.com/&amp;quot;&lt;br /&gt;
rt-comment: &amp;quot;|/opt/rt5/bin/rt-mailgate --queue general --action comment --url https://rt.yourdomain.example.com/&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
This works well because, again, you’re probably running an MTA anyway; and the MTA can hold and queue mail if it comes in while RT is down for any reason, giving you a buffer against downtime.&lt;br /&gt;
&lt;br /&gt;
Another common option is to periodically run a tool that fetches mail using a protocol like IMAP, like fetchmail or getmail, and passes it on to &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt;. This is less common because it requires setting up another tool to run, and securely storing another set of mail server credentials. But it is useful when local policy prevents the RT server from receiving email directly.&lt;br /&gt;
&lt;br /&gt;
This is much less common, but it might help to know that &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; doesn’t have to run on the same system as RT itself. It just needs to be able to connect to RT’s web interface. If you don’t have any other options, you can install the RT software on a different system that receives email, and configure &#039;&#039;that&#039;&#039; system to run &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; and pass it on to the RT server. To do that, just repeat the installation instructions above, skipping the steps about installing the database and web server.&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s background jobs ==&lt;br /&gt;
&lt;br /&gt;
Create a file &amp;lt;code&amp;gt;/etc/cron.d/rt&amp;lt;/code&amp;gt; with the following content. You may edit all of the time fields as you see fit. Refer to the crontab(5) man page for details about their definitions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Update the fulltext index with new ticket data&lt;br /&gt;
*/3 *   *   *   *   root    /opt/rt5/sbin/rt-fulltext-indexer&lt;br /&gt;
# Email out dashboards that users have subscribed to&lt;br /&gt;
0   *   *   *   *   root    /opt/rt5/sbin/rt-email-dashboards&lt;br /&gt;
# Clean old sessions from the database&lt;br /&gt;
10  3   *   *   *   root    /opt/rt5/sbin/rt-clean-sessions --older 8d&lt;br /&gt;
# Email out weekly digests for users who have requested it&lt;br /&gt;
50  4   *   *   Mon root    /opt/rt5/sbin/rt-email-digest -m weekly&lt;br /&gt;
# Email out daily digests for users who have requested it&lt;br /&gt;
50  5   *   *   *   root    /opt/rt5/sbin/rt-email-digest -m daily&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
You can run all these jobs as the same user that runs your web server, rather than root. Run:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo sed -i &#039;s/\broot\b/www-data/&#039; /etc/cron.d/rt&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo sed -i &#039;s/\broot\b/apache/&#039; /etc/cron.d/rt&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Set up RT ==&lt;br /&gt;
&lt;br /&gt;
If you’ve gotten this far, congratulations, your RT install is really done now. You can start setting up RT with users, groups, queues, and business logic. [[Main Page|Head back to the main page]] to start exploring those topics.&lt;/div&gt;</summary>
		<author><name>Brett</name></author>
	</entry>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=ManualInstallation&amp;diff=27044</id>
		<title>ManualInstallation</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=ManualInstallation&amp;diff=27044"/>
		<updated>2021-12-23T19:32:10Z</updated>

		<summary type="html">&lt;p&gt;Brett: remove the need for App::virtualenv by installing modules under /opt/rt5/local&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Prev: [[ManualRequirements]] — Up: [[UserManual]] — Next: [[ManualApacheConfig]]&lt;br /&gt;
&lt;br /&gt;
This guide walks you through installing RT from source on a modern, popular Linux distro. Specifically, that means a distribution based on Debian or Red Hat that’s been released since around 2020.&lt;br /&gt;
&lt;br /&gt;
This guide assumes:&lt;br /&gt;
&lt;br /&gt;
* You can install packages generally available in Debian/Ubuntu or Red Hat/Fedora/CentOS.&lt;br /&gt;
* You want to install RT, and all of its Perl dependencies, from source to get the latest versions. (This is a trade-off. It means the boundaries of your install will be very clear, but you won’t get security updates for RT or Perl modules from your distribution.)&lt;br /&gt;
* You are willing to install a couple of extra tools to manage the RT installation similarly to how you would in other packaging systems (like PyPI, npm, etc.).&lt;br /&gt;
* You are willing to do a relatively maximal install of RT, enabling all the options during installation and then setting what you need in the configuration. (You could save a little space and time by being pickier about your options, but then that complicates the guide and makes it harder to turn those options on later if you want.)&lt;br /&gt;
* You are using a regular user account on the Linux system that can get superuser privileges with sudo.&lt;br /&gt;
&lt;br /&gt;
== Install the base dependencies ==&lt;br /&gt;
&lt;br /&gt;
These are required by RT, either to run or to install the dependencies.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install autoconf build-essential cpanminus curl libexpat-dev libgd-dev libssl-dev libz-dev gnupg graphviz lynx openssl perl&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install patch tar which gcc gcc-c++ perl-core perl-App-cpanminus graphviz expat-devel gd-devel lynx openssl openssl-devel&lt;br /&gt;
sudo setenforce 0&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
(Turning off SELinux enforcement is required on Red Hat-based distributions because, as of October 2021, nobody has written a policy for RT.)&lt;br /&gt;
&lt;br /&gt;
== Install a database ==&lt;br /&gt;
&lt;br /&gt;
You need access to a database server. It can be remote, or you can install a database server alongside RT. RT supports a few different databases, but the best supported options are PostgreSQL and MariaDB.&lt;br /&gt;
&lt;br /&gt;
=== Installing and configuring the PostgreSQL server ===&lt;br /&gt;
&lt;br /&gt;
If you want to install a fresh PostgreSQL database server alongside RT:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install postgresql&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install postgresql-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In order to set up RT’s database, you will need a PostgreSQL superuser account that can be authenticated with a password. If you don’t have that, you can create it by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo createuser -sP rt_admin&amp;lt;/pre&amp;gt;&lt;br /&gt;
Set the password when prompted. Record this; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
=== Enable password authentication in PostgreSQL ===&lt;br /&gt;
&lt;br /&gt;
You need to consider this step whether you install the database locally, or use an existing one already running. RT supports connecting to PostgreSQL a few different ways, but authenticating with a username and password is simplest, and this guide is written based on that. Not all PostgreSQL installations allow this authentication method by default. You need to review your &amp;lt;code&amp;gt;pg_hba.conf&amp;lt;/code&amp;gt; file located at:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;/etc/postgresql/VERSION/main/pg_hba.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;/var/lib/pgsql/VERSION/data/pg_hba.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Replace &amp;lt;code&amp;gt;VERSION&amp;lt;/code&amp;gt; with the version of your PostgreSQL database. Add these two lines &#039;&#039;&#039;above&#039;&#039;&#039; any other lines that start with &amp;lt;code&amp;gt;host&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;host  rt5  rt_user   all  md5&lt;br /&gt;
host  rt5  rt_admin  all  md5&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This configuration will let &amp;lt;code&amp;gt;rt_user&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;rt_admin&amp;lt;/code&amp;gt; authorize themselves for the &amp;lt;code&amp;gt;rt5&amp;lt;/code&amp;gt; database using an &amp;lt;code&amp;gt;md5&amp;lt;/code&amp;gt; crypted password over a network connection (possibly using the localhost loopback network). You might be able to further restrict some of these fields for improved security, but doing so is outside the scope of this install guide. Refer to [https://www.postgresql.org/docs/current/auth-pg-hba-conf.html the pg_hba.conf documentation] for more details.&lt;br /&gt;
&lt;br /&gt;
Save your changes and reload the database:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo systemctl reload postgresql&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Installing the PostgreSQL client libraries ===&lt;br /&gt;
&lt;br /&gt;
These are required for RT to be able to talk to any PostgreSQL server.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install libpq-dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install postgresql-devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Once this is done you can skip ahead to installing a web server.&lt;br /&gt;
&lt;br /&gt;
=== Installing and configuring the MariaDB server ===&lt;br /&gt;
&lt;br /&gt;
If you want to install a fresh MariaDB database server alongside RT:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install mariadb-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install mariadb-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In order to set up RT’s database, you will need a MySQL superuser account. To stay consistent with PostgreSQL, I suggest setting a password for it. You can do that by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo mysql&lt;br /&gt;
mysql# GRANT ALL PRIVELEGES WITH GRANT OPTION ON rt5 TO rt_admin@localhost IDENTIFIED BY &#039;YourPassphraseHere&#039;;&amp;lt;/pre&amp;gt;&lt;br /&gt;
Record your passphrase; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
=== Adjust MariaDB’s max_allowed_packet setting ===&lt;br /&gt;
&lt;br /&gt;
You need to consider this step whether you install the database locally, or use an existing one already running. [https://mariadb.com/kb/en/server-system-variables/#max_allowed_packet MariaDB’s &amp;lt;code&amp;gt;max_allowed_packet&amp;lt;/code&amp;gt; setting] functionally limits the size of attachments in RT. The default is 16MiB, which is too small for most installations. You can ultimately choose any setting you’re comfortable with; 64MiB here should allow most requests without being too open.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;echo -e &#039;[client-server]\nmax_allowed_packet=64M\n&#039; | sudo tee /etc/mysql/conf.d/max_allowed_packet.cnf&lt;br /&gt;
sudo systemctl reload mariadb&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;echo -e &#039;[client-server]\nmax_allowed_packet=64M\n&#039; | sudo tee /etc/my.cnf.d/max_allowed_packet.cnf&lt;br /&gt;
sudo systemctl reload mariadb&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Installing the MariaDB client libraries ===&lt;br /&gt;
&lt;br /&gt;
These are required for RT to be able to talk to any MariaDB server.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install libmariadb-dev libmariadb-dev-compat&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install mariadb-devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Install a web server with FastCGI ==&lt;br /&gt;
&lt;br /&gt;
FastCGI is the best way to host RT’s web interface today. Installing the web server before RT makes the installation process simpler, because RT will be able to automatically some details about your web server like what user it runs as.&lt;br /&gt;
&lt;br /&gt;
=== Installing Apache ===&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install apache2 libapache2-mod-fcgid&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install httpd mod_fcgid mod_ssl&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ### Installing nginx --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Install RT ==&lt;br /&gt;
&lt;br /&gt;
=== Get and unpack the RT source code ===&lt;br /&gt;
&lt;br /&gt;
Download the latest source code using the link on the [https://bestpractical.com/download-page RT download page], extract it using &amp;lt;code&amp;gt;tar -xf&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt; into the source code directory to run the rest of the commands in this section. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;curl -O https://download.bestpractical.com/pub/rt/release/rt-5.0.2.tar.gz&lt;br /&gt;
tar -xf rt-5.0.2.tar.gz&lt;br /&gt;
cd rt-5.0.2&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Pre-configure RT ===&lt;br /&gt;
&lt;br /&gt;
This command will detect some information about your system in order to install RT properly, and decide which set of dependencies to install. Here’s what the different parts of our command are doing:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;--with-db-type=TYPE&amp;lt;/code&amp;gt; - Replace &amp;lt;code&amp;gt;TYPE&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;Pg&amp;lt;/code&amp;gt; for PostgreSQL, or &amp;lt;code&amp;gt;mysql&amp;lt;/code&amp;gt; for MariaDB.&lt;br /&gt;
* &amp;lt;code&amp;gt;--prefix=/opt/rt5&amp;lt;/code&amp;gt; sets the directory where RT will install all of its libraries, tools, and supporting files. You can choose another path if you like.&lt;br /&gt;
* The rest of the options tell RT to install additional dependencies for optional features.&lt;br /&gt;
&lt;br /&gt;
Make sure you have &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt;ed into the RT source directory, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;./configure --with-db-type=TYPE --prefix=/opt/rt5 --with-attachment-store=disk --enable-externalauth --enable-gd --enable-graphviz --enable-gpg --enable-smime&amp;lt;/pre&amp;gt;&lt;br /&gt;
For more background, [https://docs.bestpractical.com/rt/latest/configure.html refer to the RT configure options documentation].&lt;br /&gt;
&lt;br /&gt;
=== Install RT and its Perl dependencies ===&lt;br /&gt;
&lt;br /&gt;
This command will download, build, and install all of the Perl modules necessary to run RT with the configuration you set above. Here’s what the different parts of the command are doing:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;make dirs&amp;lt;/code&amp;gt; sets up RT&#039;s directory structure. We do this first to install dependencies under it.&lt;br /&gt;
* &amp;lt;code&amp;gt;make fixdeps&amp;lt;/code&amp;gt; actually installs those dependencies.&lt;br /&gt;
* &amp;lt;code&amp;gt;RT_FIX_DEPS_CMD=&#039;cpanm …&#039;&amp;lt;/code&amp;gt; tells RT to use cpanminus to install dependencies (instead of the older, default &amp;lt;code&amp;gt;cpan&amp;lt;/code&amp;gt; command), and to install them where RT will automatically load them.&lt;br /&gt;
* &amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt; installs all of RT’s files under &amp;lt;code&amp;gt;/opt/rt5&amp;lt;/code&amp;gt; (or the prefix directory you set in the previous step). It will only run if &amp;lt;code&amp;gt;fixdeps&amp;lt;/code&amp;gt; succeeds.&lt;br /&gt;
&lt;br /&gt;
Make sure you have &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt;ed into the RT source directory, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo make dirs&lt;br /&gt;
sudo ln -s . /opt/rt5/local/lib/perl5&lt;br /&gt;
make fixdeps RT_FIX_DEPS_CMD=&#039;cpanm --sudo --quiet --local-lib=/opt/rt5/local&#039;&lt;br /&gt;
sudo make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
If it works, the command will eventually output a message that says “Congratulations. RT is now installed.” followed by instructions about configuring and setting up the database. We’ll do that next.&lt;br /&gt;
&lt;br /&gt;
=== Configure RT ===&lt;br /&gt;
&lt;br /&gt;
[https://docs.bestpractical.com/rt/latest/RT_Config.html RT has many configuration options.] You can put configuration options in the file &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/code&amp;gt;, or in individual files under &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.d/&amp;lt;/code&amp;gt;. Use an editor to save all the text below to &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/code&amp;gt; (you can just overwrite the existing file, or add this to the bottom of what’s there) and then fill in settings for your site everywhere the text &amp;lt;code&amp;gt;EDIT WITH&amp;lt;/code&amp;gt; appears.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Single-quote all values EXCEPT the special value `undef`&lt;br /&gt;
# that turns off a setting.&lt;br /&gt;
&lt;br /&gt;
# rtname appears in ticket email subjects. It needs to be globally unique,&lt;br /&gt;
# so use your organization&#039;s domain name.&lt;br /&gt;
Set($rtname, &#039;EDIT WITH yourdomain.example.com&#039;);&lt;br /&gt;
# Organization is used in the database for ticket links, etc. It also needs to&lt;br /&gt;
# be globally unique, so use your organization&#039;s domain name.&lt;br /&gt;
Set($Organization, &#039;EDIT WITH yourdomain.example.com&#039;);&lt;br /&gt;
# WebDomain is domain name of the RT web server. RT uses it to construct links&lt;br /&gt;
# and defend against CSRFs.&lt;br /&gt;
Set($WebDomain, &#039;EDIT WITH rt.yourdomain.example.com&#039;);&lt;br /&gt;
# WebPort is the port where the RT web server runs. Edit the number below if&lt;br /&gt;
# you&#039;re not using the standard HTTPS port.&lt;br /&gt;
Set($WebPort, &#039;443&#039;);&lt;br /&gt;
&lt;br /&gt;
# DatabaseUser is the name of the database account RT uses to read and store&lt;br /&gt;
# data. &#039;rt_user&#039; is the default but you can change it if you like.&lt;br /&gt;
# DO NOT use the &#039;rt_admin&#039; superuser created in the instructions above.&lt;br /&gt;
Set($DatabaseUser, &#039;rt_user&#039;);&lt;br /&gt;
# DatabasePassword is the password for DatabaseUser.&lt;br /&gt;
Set($DatabasePassword, &#039;EDIT WITH SomePassphraseHere&#039;);&lt;br /&gt;
# DatabaseHost is the hostname of the database server RT should use.&lt;br /&gt;
# Change &#039;localhost&#039; if it lives on a different server.&lt;br /&gt;
Set($DatabaseHost, &#039;localhost&#039;);&lt;br /&gt;
# DatabasePort is the port number of the database server RT should use.&lt;br /&gt;
# `undef` means the default for that database. Change it if you&#039;re not&lt;br /&gt;
# using the standard port.&lt;br /&gt;
Set($DatabasePort, undef);&lt;br /&gt;
# DatabaseName is the name of RT&#039;s database hosted on DatabaseHost.&lt;br /&gt;
# &#039;rt5&#039; is the default but you can change it if you like.&lt;br /&gt;
Set($DatabaseName, &#039;rt5&#039;);&lt;br /&gt;
# DatabaseAdmin is the name of the user in the database used to perform&lt;br /&gt;
# major administrative tasks. Change &#039;rt_admin&#039; if you&#039;re using a user&lt;br /&gt;
# besides the one created in this guide.&lt;br /&gt;
Set($DatabaseAdmin, &#039;rt_admin&#039;);&lt;br /&gt;
&lt;br /&gt;
# RT can log to syslog, stderr, and/or a dedicated file. For a modern install,&lt;br /&gt;
# I recommend logging to syslog, so it goes to journald where it&#039;s easy to&lt;br /&gt;
# query and automatically gets rotated. You set both these paramaters to a&lt;br /&gt;
# standard log level: &#039;debug&#039;, &#039;info&#039;, &#039;notice&#039;, &#039;warning&#039;, &#039;error&#039;,&lt;br /&gt;
# &#039;critical&#039;, &#039;alert&#039;, or &#039;emergency&#039;.&lt;br /&gt;
Set($LogToSyslog, &#039;info&#039;);&lt;br /&gt;
Set($LogToSTDERR, undef);&lt;br /&gt;
&lt;br /&gt;
# Turn off optional features that require additional configuration.&lt;br /&gt;
# If you want to use these, refer to the RT_Config documentation for&lt;br /&gt;
# instructions on how to set them up.&lt;br /&gt;
Set(%GnuPG, &#039;Enable&#039; =&amp;gt; &#039;0&#039;);&lt;br /&gt;
Set(%SMIME, &#039;Enable&#039; =&amp;gt; &#039;0&#039;);&lt;br /&gt;
&lt;br /&gt;
# Perl expects to find this 1 at the end of the file.&lt;br /&gt;
1;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;RT_SiteConfig.pm&amp;lt;/code&amp;gt; is actually Perl code. RT runs the code directly to load the configuration. Any time you finish editing it, you can check that you didn’t make any syntax errors by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;perl -c /opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Set up RT’s database ===&lt;br /&gt;
&lt;br /&gt;
RT includes a tool to help you set up its database. By default, it connects to the database as an administrator to create the database and user that you configured in the previous step.&lt;br /&gt;
&lt;br /&gt;
(The instructions from &amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt; and RT’s README file tell you to run &amp;lt;code&amp;gt;make initialize-database&amp;lt;/code&amp;gt;. That just runs &amp;lt;code&amp;gt;rt-setup-database&amp;lt;/code&amp;gt; for you. Running the tool directly makes it easier to pass the options you need.)&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;--action=init&amp;lt;/code&amp;gt; tells the tool to create the user, the database, the tables inside it, and insert core data RT needs to function.&lt;br /&gt;
* &#039;&#039;&#039;If&#039;&#039;&#039; you are using an existing database server and the database adminstrator has already created the user account and database for RT, then you can add the &amp;lt;code&amp;gt;--skip-create&amp;lt;/code&amp;gt; option.&lt;br /&gt;
* &#039;&#039;&#039;If&#039;&#039;&#039; you have a less common database setup, this tool has additional options to give you finer-grained control over what steps are run and how. Refer to [https://docs.bestpractical.com/rt/latest/rt-setup-database.html the full rt-setup-database documentation] to learn more about those.&lt;br /&gt;
* The command reads files from RT’s &amp;lt;code&amp;gt;etc/&amp;lt;/code&amp;gt; directory by default, so the easiest way to run it is to &amp;lt;code&amp;gt;cd /opt/rt5&amp;lt;/code&amp;gt; first, and then it will find the necessary files automatically.&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /opt/rt5&lt;br /&gt;
sudo sbin/rt-setup-database --action=init&amp;lt;/pre&amp;gt;&lt;br /&gt;
Enter the password for your database administrator account when prompted.&lt;br /&gt;
&lt;br /&gt;
=== Set up fulltext indexing ===&lt;br /&gt;
&lt;br /&gt;
Fulltext indexing speeds up searches for ticket content, which makes RT a lot nicer to use.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;--noask&amp;lt;/code&amp;gt; uses the default names for the index, which will be fine for a new install and simplifies the setup.&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo /opt/rt5/sbin/rt-setup-fulltext-index --noask&amp;lt;/pre&amp;gt;&lt;br /&gt;
Enter the password for your database administrator account when prompted. The end of the process will output some RT configuration that looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;### EXAMPLE OUTPUT ONLY - Don&#039;t use this directly!&lt;br /&gt;
Set( %FullTextSearch,&lt;br /&gt;
    Enable     =&amp;gt; 1,&lt;br /&gt;
    Indexed    =&amp;gt; 1,&lt;br /&gt;
    # Additional output from rt-setup-fulltext-index should be here.&lt;br /&gt;
    # The configuration varies by database type.&lt;br /&gt;
);&amp;lt;/pre&amp;gt;&lt;br /&gt;
Copy the output generated when you run &amp;lt;code&amp;gt;rt-setup-fulltext-index&amp;lt;/code&amp;gt; and save it to the file &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.d/FulltextIndex.pm&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Set permissions ===&lt;br /&gt;
&lt;br /&gt;
All of RT’s configuration files should be readable by the user that runs the web server, and no other users, in order to protect sensitive information like the database password. RT provides a command to set permissions appropriately according to your distribution and configuration. &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt; to the directory where you extracted the RT source code, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd rt-5.0.2&lt;br /&gt;
sudo make fixperms&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Verify the installation ===&lt;br /&gt;
&lt;br /&gt;
If everything has gone well, then you should be able to set a password for RT’s &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; user. You’ll use this later to log in to the web interface and continue setting up your system. Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo /opt/rt5/sbin/rt-passwd root&amp;lt;/pre&amp;gt;&lt;br /&gt;
Set the password when prompted. Record this; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s web server ==&lt;br /&gt;
&lt;br /&gt;
=== Configure Apache modules ===&lt;br /&gt;
&lt;br /&gt;
You will need to have the following modules enabled in Apache to run RT. You should already have these installed if you followed the instructions above.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;alias&amp;lt;/code&amp;gt; (required to map URLs to RT)&lt;br /&gt;
* &amp;lt;code&amp;gt;fcgid&amp;lt;/code&amp;gt; (required for Apache to talk to RT)&lt;br /&gt;
* &amp;lt;code&amp;gt;mpm_prefork&amp;lt;/code&amp;gt; (Apache requires you to select an MPM. RT is designed to work with the prefork module.)&lt;br /&gt;
* &amp;lt;code&amp;gt;ssl&amp;lt;/code&amp;gt; (required to serve HTTPS; optional otherwise)&lt;br /&gt;
&lt;br /&gt;
Enable them following these instructions:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo a2dismod mpm_event&lt;br /&gt;
sudo a2enmod fcgid&lt;br /&gt;
sudo a2enmod mpm_prefork&lt;br /&gt;
sudo a2enmod ssl&amp;lt;/pre&amp;gt;&lt;br /&gt;
| &amp;lt;pre&amp;gt;echo LoadModule mpm_prefork_module modules/mod_mpm_prefork.so | sudo tee /etc/httpd/conf.modules.d/00-mpm.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Configure an Apache VirtualHost ===&lt;br /&gt;
&lt;br /&gt;
Create a file at the following location. You can change the &amp;lt;code&amp;gt;RT&amp;lt;/code&amp;gt; part of the filename if you like, but the file must exist in this directory and have a &amp;lt;code&amp;gt;.conf&amp;lt;/code&amp;gt; suffix.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;/etc/apache2/sites-available/RT.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
Then after you create the file, run: &amp;lt;code&amp;gt;sudo a2ensite RT&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;/etc/httpd/conf.d/RT.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Use an editor to save all the text below to the new &amp;lt;code&amp;gt;RT.conf&amp;lt;/code&amp;gt; and then fill in settings for your site everywhere the text &amp;lt;code&amp;gt;EDIT WITH&amp;lt;/code&amp;gt; appears.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### Server-level settings&lt;br /&gt;
# These settings affect all of Apache. It is okay to put them here if Apache&lt;br /&gt;
# only hosts RT. If you are hosting other sites in the same Apache instance,&lt;br /&gt;
# you may need to put these settings in another file like&lt;br /&gt;
# (Debian/Ubuntu) /etc/apache2/conf-available/RT.conf&lt;br /&gt;
# (Red Hat/Fedora/CentOS) /etc/httpd/conf.d/RTserver.conf&lt;br /&gt;
# ... and ensure they do not conflict with settings required by other sites.&lt;br /&gt;
&lt;br /&gt;
# mod_fcgid only allows 128KiB requests by default. This is too small for users&lt;br /&gt;
# to upload files to RT. You can ultimately choose any setting you&#039;re&lt;br /&gt;
# comfortable with; 70MiB here should allow most requests without being too&lt;br /&gt;
# open.&lt;br /&gt;
FcgidMaxRequestLen 73400320&lt;br /&gt;
&lt;br /&gt;
&amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
  # Listen on the standard HTTPS port.&lt;br /&gt;
  # You can change this to a nonstandard port if you must.&lt;br /&gt;
  Listen 443&lt;br /&gt;
&amp;lt;/IfModule&amp;gt;&lt;br /&gt;
### End server-level settings&lt;br /&gt;
&lt;br /&gt;
### Primary RT VirtualHost&lt;br /&gt;
# You can change both the bind address and/or the port here as required.&lt;br /&gt;
# This default will listen for HTTPS connections on all interfaces.&lt;br /&gt;
&amp;lt;VirtualHost *:443&amp;gt;&lt;br /&gt;
  # EDIT HERE with the domain name of the web server.&lt;br /&gt;
  ServerName rt.yourdomain.example.com&lt;br /&gt;
  &amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
    SSLEngine on&lt;br /&gt;
    # These specify the paths to the SSL certificate and private key Apache&lt;br /&gt;
    # should use. These example paths are common for Let&#039;s Encrypt. If you&lt;br /&gt;
    # don&#039;t use Let&#039;s Encrypt, the standard location for these files is under&lt;br /&gt;
    # (Debian/Ubuntu) /etc/ssl&lt;br /&gt;
    # (Red Hat/Fedora/CentOS) /etc/pki/tls&lt;br /&gt;
    # EDIT HERE with the appropriate paths for your server&lt;br /&gt;
    SSLCertificateFile /etc/letsencrypt/live/example.com/fullchain.pem&lt;br /&gt;
    SSLCertificateKeyFile /etc/letsencrypt/live/example.com/privkey.pem&lt;br /&gt;
  &amp;lt;/IfModule&amp;gt;&lt;br /&gt;
  &amp;lt;Location /&amp;gt;&lt;br /&gt;
    Require all granted&lt;br /&gt;
    Options +ExecCGI&lt;br /&gt;
    AddHandler fcgid-script fcgi&lt;br /&gt;
  &amp;lt;/Location&amp;gt;&lt;br /&gt;
  AddDefaultCharset UTF-8&lt;br /&gt;
  DocumentRoot /opt/rt5/share/html&lt;br /&gt;
  ScriptAlias / /opt/rt5/sbin/rt-server.fcgi/&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
### End primary RT VirtualHost&lt;br /&gt;
&lt;br /&gt;
### Optional HTTPS Redirect VirtualHost&lt;br /&gt;
# Most modern servers support HTTPS and want all web traffic to go through it.&lt;br /&gt;
# This VirtualHost redirects normal HTTP traffic to HTTPS.&lt;br /&gt;
# You can delete this whole section if you don&#039;t want or need this.&lt;br /&gt;
&amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
  # You can change both the bind address and/or the port here as required.&lt;br /&gt;
  # This default will listen for HTTP connections on all interfaces.&lt;br /&gt;
  &amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
    SSLEngine off&lt;br /&gt;
    # EDIT HERE both lines below with the domain name of your web server.&lt;br /&gt;
    ServerName rt.yourdomain.example.com&lt;br /&gt;
    Redirect permanent / https://rt.yourdomain.example.com/&lt;br /&gt;
  &amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/IfModule&amp;gt;&lt;br /&gt;
### End optional HTTPS Redirect VirtualHost&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
After you’ve edited the file, load the configuration with:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo systemctl reload apache2&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo systemctl reload httpd&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If this command reports an error, double-check the configuration file for typos, especially in option names, file paths, and the&lt;br /&gt;
&amp;lt;Section&amp;gt;&lt;br /&gt;
pairs. Edit again and reload the configuration until it succeeds without output.&lt;br /&gt;
&lt;br /&gt;
=== Verify the web interface ===&lt;br /&gt;
&lt;br /&gt;
You should be able to visit your web server in your browser, and be presented with RT’s login screen. You should be able to log in with username &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; and the password you set previously.&lt;br /&gt;
&lt;br /&gt;
If you run into trouble, the first place to look for more information is by reading Apache’s error log:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo less /var/log/apache2/error.log&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo less /var/log/httpd/error.log&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s mail server ==&lt;br /&gt;
&lt;br /&gt;
RT both can both send and receive ticket updates via email. Unfortunately, there are too many variables to document a useful setup process here: getting this working usually requires creating DNS records, and coordinating with existing mail servers, which will be the main constraint on your setup. Instead this guide provides a brief overview of how the integration works, and where the connection points are that you likely need to work on.&lt;br /&gt;
&lt;br /&gt;
=== Sending Mail ===&lt;br /&gt;
&lt;br /&gt;
RT only knows how to send mail by passing it off to another program on the system. It cannot connect or authenticate directly to external mail servers. In the default configuration, RT runs the standard &amp;lt;code&amp;gt;sendmail&amp;lt;/code&amp;gt; command. There are [https://docs.bestpractical.com/rt/latest/RT_Config.html#Outgoing-mail configuration options to send mail through different commands] if you need.&lt;br /&gt;
&lt;br /&gt;
The most common setup is to install and configure a proper Mail Transfer Agent (MTA) like Postfix or Exim, and then configure it to send mail to the wider Internet as you need. This works well because the MTAs are robust and well-tested; they have flexible configuration to let you send mail out by relaying to other mail servers you specify with optional authentication; and most distributions install one by default anyway. The only hard part is configuring the MTA to send mail following your site’s policies.&lt;br /&gt;
&lt;br /&gt;
Other software is available that provides a slimmer version of the &amp;lt;code&amp;gt;sendmail&amp;lt;/code&amp;gt; command that connects to an external mail server for you, like ssmtp. These programs are usually easier to configure than an MTA, but they often lose email permanently if they can’t connect to the external server at the time it’s sent. (MTAs keep email queued locally until they successfully deliver it to another server.)&lt;br /&gt;
&lt;br /&gt;
=== Receiving email ===&lt;br /&gt;
&lt;br /&gt;
RT installs a command called &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; that receives an email on standard input and posts it to RT’s REST web interface, where it gets saved in the database and added to a ticket. You need to arrange for a way to send incoming email to this command.&lt;br /&gt;
&lt;br /&gt;
The most common setup is to have an MTA on the same box as RT receive email directly, and then set up mail aliases that call this command when mail comes in. Example &amp;lt;code&amp;gt;/etc/aliases&amp;lt;/code&amp;gt; entries look like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rt: &amp;quot;|/opt/rt5/bin/rt-mailgate --queue general --action correspond --url https://rt.yourdomain.example.com/&amp;quot;&lt;br /&gt;
rt-comment: &amp;quot;|/opt/rt5/bin/rt-mailgate --queue general --action comment --url https://rt.yourdomain.example.com/&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
This works well because, again, you’re probably running an MTA anyway; and the MTA can hold and queue mail if it comes in while RT is down for any reason, giving you a buffer against downtime.&lt;br /&gt;
&lt;br /&gt;
Another common option is to periodically run a tool that fetches mail using a protocol like IMAP, like fetchmail or getmail, and passes it on to &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt;. This is less common because it requires setting up another tool to run, and securely storing another set of mail server credentials. But it is useful when local policy prevents the RT server from receiving email directly.&lt;br /&gt;
&lt;br /&gt;
This is much less common, but it might help to know that &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; doesn’t have to run on the same system as RT itself. It just needs to be able to connect to RT’s web interface. If you don’t have any other options, you can install the RT software on a different system that receives email, and configure &#039;&#039;that&#039;&#039; system to run &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; and pass it on to the RT server. To do that, just repeat the installation instructions above, skipping the steps about installing the database and web server.&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s background jobs ==&lt;br /&gt;
&lt;br /&gt;
Create a file &amp;lt;code&amp;gt;/etc/cron.d/rt&amp;lt;/code&amp;gt; with the following content. You may edit all of the time fields as you see fit. Refer to the crontab(5) man page for details about their definitions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Update the fulltext index with new ticket data&lt;br /&gt;
*/3 *   *   *   *   root    /opt/rt5/sbin/rt-fulltext-indexer&lt;br /&gt;
# Email out dashboards that users have subscribed to&lt;br /&gt;
0   *   *   *   *   root    /opt/rt5/sbin/rt-email-dashboards&lt;br /&gt;
# Clean old sessions from the database&lt;br /&gt;
10  3   *   *   *   root    /opt/rt5/sbin/rt-clean-sessions --older 8d&lt;br /&gt;
# Email out weekly digests for users who have requested it&lt;br /&gt;
50  4   *   *   Mon root    /opt/rt5/sbin/rt-email-digest -m weekly&lt;br /&gt;
# Email out daily digests for users who have requested it&lt;br /&gt;
50  5   *   *   *   root    /opt/rt5/sbin/rt-email-digest -m daily&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
You can run all these jobs as the same user that runs your web server, rather than root. Run:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo sed -i &#039;s/\broot\b/www-data/&#039; /etc/cron.d/rt&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo sed -i &#039;s/\broot\b/apache/&#039; /etc/cron.d/rt&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Set up RT ==&lt;br /&gt;
&lt;br /&gt;
If you’ve gotten this far, congratulations, your RT install is really done now. You can start setting up RT with users, groups, queues, and business logic. [[Main Page|Head back to the main page]] to start exploring those topics.&lt;/div&gt;</summary>
		<author><name>Brett</name></author>
	</entry>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=ManualInstallation&amp;diff=27043</id>
		<title>ManualInstallation</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=ManualInstallation&amp;diff=27043"/>
		<updated>2021-12-23T19:08:43Z</updated>

		<summary type="html">&lt;p&gt;Brett: recommend lynx over w3m—it&amp;#039;s better maintained and packaged&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Prev: [[ManualRequirements]] — Up: [[UserManual]] — Next: [[ManualApacheConfig]]&lt;br /&gt;
&lt;br /&gt;
This guide walks you through installing RT from source on a modern, popular Linux distro. Specifically, that means a distribution based on Debian or Red Hat that’s been released since around 2020.&lt;br /&gt;
&lt;br /&gt;
This guide assumes:&lt;br /&gt;
&lt;br /&gt;
* You can install packages generally available in Debian/Ubuntu or Red Hat/Fedora/CentOS.&lt;br /&gt;
* You want to install RT, and all of its Perl dependencies, from source to get the latest versions. (This is a trade-off. It means the boundaries of your install will be very clear, but you won’t get security updates for RT or Perl modules from your distribution.)&lt;br /&gt;
* You are willing to install a couple of extra tools to manage the RT installation similarly to how you would in other packaging systems (like PyPI, npm, etc.).&lt;br /&gt;
* You are willing to do a relatively maximal install of RT, enabling all the options during installation and then setting what you need in the configuration. (You could save a little space and time by being pickier about your options, but then that complicates the guide and makes it harder to turn those options on later if you want.)&lt;br /&gt;
* You are using a regular user account on the Linux system that can get superuser privileges with sudo.&lt;br /&gt;
&lt;br /&gt;
== Install the base dependencies ==&lt;br /&gt;
&lt;br /&gt;
These are required by RT, either to run or to install the dependencies.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install autoconf build-essential curl libexpat-dev libgd-dev libssl-dev libz-dev gnupg graphviz lynx openssl perl&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install patch tar which gcc gcc-c++ perl-core perl-ExtUtils-MakeMaker graphviz expat-devel gd-devel lynx openssl openssl-devel&lt;br /&gt;
sudo setenforce 0&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
(Turning off SELinux enforcement is required on Red Hat-based distributions because, as of October 2021, nobody has written a policy for RT.)&lt;br /&gt;
&lt;br /&gt;
== Install a database ==&lt;br /&gt;
&lt;br /&gt;
You need access to a database server. It can be remote, or you can install a database server alongside RT. RT supports a few different databases, but the best supported options are PostgreSQL and MariaDB.&lt;br /&gt;
&lt;br /&gt;
=== Installing and configuring the PostgreSQL server ===&lt;br /&gt;
&lt;br /&gt;
If you want to install a fresh PostgreSQL database server alongside RT:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install postgresql&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install postgresql-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In order to set up RT’s database, you will need a PostgreSQL superuser account that can be authenticated with a password. If you don’t have that, you can create it by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo createuser -sP rt_admin&amp;lt;/pre&amp;gt;&lt;br /&gt;
Set the password when prompted. Record this; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
=== Enable password authentication in PostgreSQL ===&lt;br /&gt;
&lt;br /&gt;
You need to consider this step whether you install the database locally, or use an existing one already running. RT supports connecting to PostgreSQL a few different ways, but authenticating with a username and password is simplest, and this guide is written based on that. Not all PostgreSQL installations allow this authentication method by default. You need to review your &amp;lt;code&amp;gt;pg_hba.conf&amp;lt;/code&amp;gt; file located at:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;/etc/postgresql/VERSION/main/pg_hba.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;/var/lib/pgsql/VERSION/data/pg_hba.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Replace &amp;lt;code&amp;gt;VERSION&amp;lt;/code&amp;gt; with the version of your PostgreSQL database. Add these two lines &#039;&#039;&#039;above&#039;&#039;&#039; any other lines that start with &amp;lt;code&amp;gt;host&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;host  rt5  rt_user   all  md5&lt;br /&gt;
host  rt5  rt_admin  all  md5&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This configuration will let &amp;lt;code&amp;gt;rt_user&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;rt_admin&amp;lt;/code&amp;gt; authorize themselves for the &amp;lt;code&amp;gt;rt5&amp;lt;/code&amp;gt; database using an &amp;lt;code&amp;gt;md5&amp;lt;/code&amp;gt; crypted password over a network connection (possibly using the localhost loopback network). You might be able to further restrict some of these fields for improved security, but doing so is outside the scope of this install guide. Refer to [https://www.postgresql.org/docs/current/auth-pg-hba-conf.html the pg_hba.conf documentation] for more details.&lt;br /&gt;
&lt;br /&gt;
Save your changes and reload the database:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo systemctl reload postgresql&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Installing the PostgreSQL client libraries ===&lt;br /&gt;
&lt;br /&gt;
These are required for RT to be able to talk to any PostgreSQL server.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install libpq-dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install postgresql-devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Once this is done you can skip ahead to installing a web server.&lt;br /&gt;
&lt;br /&gt;
=== Installing and configuring the MariaDB server ===&lt;br /&gt;
&lt;br /&gt;
If you want to install a fresh MariaDB database server alongside RT:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install mariadb-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install mariadb-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In order to set up RT’s database, you will need a MySQL superuser account. To stay consistent with PostgreSQL, I suggest setting a password for it. You can do that by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo mysql&lt;br /&gt;
mysql# GRANT ALL PRIVELEGES WITH GRANT OPTION ON rt5 TO rt_admin@localhost IDENTIFIED BY &#039;YourPassphraseHere&#039;;&amp;lt;/pre&amp;gt;&lt;br /&gt;
Record your passphrase; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
=== Adjust MariaDB’s max_allowed_packet setting ===&lt;br /&gt;
&lt;br /&gt;
You need to consider this step whether you install the database locally, or use an existing one already running. [https://mariadb.com/kb/en/server-system-variables/#max_allowed_packet MariaDB’s &amp;lt;code&amp;gt;max_allowed_packet&amp;lt;/code&amp;gt; setting] functionally limits the size of attachments in RT. The default is 16MiB, which is too small for most installations. You can ultimately choose any setting you’re comfortable with; 64MiB here should allow most requests without being too open.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;echo -e &#039;[client-server]\nmax_allowed_packet=64M\n&#039; | sudo tee /etc/mysql/conf.d/max_allowed_packet.cnf&lt;br /&gt;
sudo systemctl reload mariadb&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;echo -e &#039;[client-server]\nmax_allowed_packet=64M\n&#039; | sudo tee /etc/my.cnf.d/max_allowed_packet.cnf&lt;br /&gt;
sudo systemctl reload mariadb&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Installing the MariaDB client libraries ===&lt;br /&gt;
&lt;br /&gt;
These are required for RT to be able to talk to any MariaDB server.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install libmariadb-dev libmariadb-dev-compat&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install mariadb-devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Install a web server with FastCGI ==&lt;br /&gt;
&lt;br /&gt;
FastCGI is the best way to host RT’s web interface today. Installing the web server before RT makes the installation process simpler, because RT will be able to automatically some details about your web server like what user it runs as.&lt;br /&gt;
&lt;br /&gt;
=== Installing Apache ===&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install apache2 libapache2-mod-fcgid&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install httpd mod_fcgid mod_ssl&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ### Installing nginx --&amp;gt;&lt;br /&gt;
== Install Perl packaging tools: App::cpanminus and App::Virtualenv ==&lt;br /&gt;
&lt;br /&gt;
App::cpanminus is a tool for installing and managing Perl modules from the popular CPAN repository. It does a lot of the same tasks, and follows a lot of the same UI conventions, as &amp;lt;code&amp;gt;pip&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;gem&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;npm&amp;lt;/code&amp;gt;, and similar tools. You can install it from your distribution:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install cpanminus&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install perl-App-cpanminus&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If your system doesn’t have a cpanminus package available, you can install it from source following the [https://metacpan.org/pod/App::cpanminus#INSTALLATION project instructions].&lt;br /&gt;
&lt;br /&gt;
App::Virtualenv is a tool to create a dedicated space where you install and manage a self-contained set of Perl modules. (If you’re familiar with Python virtual environments, the concept is the same and App::Virtualenv follows a lot of the same usage patterns.) Using it helps avoid situations where changes to distribution packages might potentially break RT. This guide will illustrate creating and using a virtual environment for RT in &amp;lt;code&amp;gt;/opt/rt5venv&amp;lt;/code&amp;gt;, but you can choose another location if you like.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cpanm --sudo App::Virtualenv&lt;br /&gt;
sudo virtualenv.pl --create --empty /opt/rt5venv&amp;lt;/pre&amp;gt;&lt;br /&gt;
Now whenever you want to work on RT (by installing it, upgrading dependencies, installing new extensions, etc.), you need to activate the virtualenv in your shell. This sets various environment variables that your shell uses to work on Perl modules in the right place. You activate the virtualenv by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;. /opt/rt5venv/bin/activate&amp;lt;/pre&amp;gt;&lt;br /&gt;
== Install RT ==&lt;br /&gt;
&lt;br /&gt;
=== Get and unpack the RT source code ===&lt;br /&gt;
&lt;br /&gt;
Download the latest source code using the link on the [https://bestpractical.com/download-page RT download page], extract it using &amp;lt;code&amp;gt;tar -xf&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt; into the source code directory to run the rest of the commands in this section. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;curl -O https://download.bestpractical.com/pub/rt/release/rt-5.0.2.tar.gz&lt;br /&gt;
tar -xf rt-5.0.2.tar.gz&lt;br /&gt;
cd rt-5.0.2&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Pre-configure RT ===&lt;br /&gt;
&lt;br /&gt;
This command will detect some information about your system in order to install RT properly, and decide which set of dependencies to install. Here’s what the different parts of our command are doing:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;PERL=/opt/rt5venv/bin/perl&amp;lt;/code&amp;gt; ensures RT uses the virtualenv you set up.&lt;br /&gt;
* &amp;lt;code&amp;gt;--with-db-type=TYPE&amp;lt;/code&amp;gt; - Replace &amp;lt;code&amp;gt;TYPE&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;Pg&amp;lt;/code&amp;gt; for PostgreSQL, or &amp;lt;code&amp;gt;mysql&amp;lt;/code&amp;gt; for MariaDB.&lt;br /&gt;
* &amp;lt;code&amp;gt;--prefix=/opt/rt5&amp;lt;/code&amp;gt; sets the directory where RT will install all of its libraries, tools, and supporting files. You can choose another path if you like.&lt;br /&gt;
* The rest of the options tell RT to install additional dependencies for optional features.&lt;br /&gt;
&lt;br /&gt;
Make sure you have &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt;ed into the RT source directory, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;PERL=/opt/rt5venv/bin/perl ./configure --with-db-type=TYPE --prefix=/opt/rt5 --with-attachment-store=disk --enable-externalauth --enable-gd --enable-graphviz --enable-gpg --enable-smime&amp;lt;/pre&amp;gt;&lt;br /&gt;
For more background, [https://docs.bestpractical.com/rt/latest/configure.html refer to the RT configure options documentation].&lt;br /&gt;
&lt;br /&gt;
=== Install RT and its Perl dependencies ===&lt;br /&gt;
&lt;br /&gt;
This command will download, build, and install all of the Perl modules necessary to run RT with the configuration you set above. Here’s what the different parts of the command are doing:&lt;br /&gt;
&lt;br /&gt;
* First we make sure the virtualenv is activated in our shell, so dependencies are installed there.&lt;br /&gt;
* &amp;lt;code&amp;gt;fixdeps&amp;lt;/code&amp;gt; is RT’s command to install dependencies.&lt;br /&gt;
* &amp;lt;code&amp;gt;install&amp;lt;/code&amp;gt; installs all of RT’s files under &amp;lt;code&amp;gt;/opt/rt5&amp;lt;/code&amp;gt; (or the prefix directory you set in the previous step). It will only run if &amp;lt;code&amp;gt;fixdeps&amp;lt;/code&amp;gt; succeeds.&lt;br /&gt;
* &amp;lt;code&amp;gt;RT_FIX_DEPS_CMD=&#039;cpanm --sudo --quiet&#039;&amp;lt;/code&amp;gt; tells RT to use cpanminus to install dependencies (instead of the older, default &amp;lt;code&amp;gt;cpan&amp;lt;/code&amp;gt; command).&lt;br /&gt;
&lt;br /&gt;
Make sure you have &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt;ed into the RT source directory, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;. /opt/rt5venv/bin/activate&lt;br /&gt;
make fixdeps RT_FIX_DEPS_CMD=&#039;cpanm --sudo --quiet&#039;&lt;br /&gt;
sudo make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
If it works, the command will eventually output a message that says “Congratulations. RT is now installed.” followed by instructions about configuring and setting up the database. We’ll do that next.&lt;br /&gt;
&lt;br /&gt;
=== Configure RT ===&lt;br /&gt;
&lt;br /&gt;
[https://docs.bestpractical.com/rt/latest/RT_Config.html RT has many configuration options.] You can put configuration options in the file &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/code&amp;gt;, or in individual files under &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.d/&amp;lt;/code&amp;gt;. Use an editor to save all the text below to &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/code&amp;gt; (you can just overwrite the existing file, or add this to the bottom of what’s there) and then fill in settings for your site everywhere the text &amp;lt;code&amp;gt;EDIT WITH&amp;lt;/code&amp;gt; appears.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Single-quote all values EXCEPT the special value `undef`&lt;br /&gt;
# that turns off a setting.&lt;br /&gt;
&lt;br /&gt;
# rtname appears in ticket email subjects. It needs to be globally unique,&lt;br /&gt;
# so use your organization&#039;s domain name.&lt;br /&gt;
Set($rtname, &#039;EDIT WITH yourdomain.example.com&#039;);&lt;br /&gt;
# Organization is used in the database for ticket links, etc. It also needs to&lt;br /&gt;
# be globally unique, so use your organization&#039;s domain name.&lt;br /&gt;
Set($Organization, &#039;EDIT WITH yourdomain.example.com&#039;);&lt;br /&gt;
# WebDomain is domain name of the RT web server. RT uses it to construct links&lt;br /&gt;
# and defend against CSRFs.&lt;br /&gt;
Set($WebDomain, &#039;EDIT WITH rt.yourdomain.example.com&#039;);&lt;br /&gt;
# WebPort is the port where the RT web server runs. Edit the number below if&lt;br /&gt;
# you&#039;re not using the standard HTTPS port.&lt;br /&gt;
Set($WebPort, &#039;443&#039;);&lt;br /&gt;
&lt;br /&gt;
# DatabaseUser is the name of the database account RT uses to read and store&lt;br /&gt;
# data. &#039;rt_user&#039; is the default but you can change it if you like.&lt;br /&gt;
# DO NOT use the &#039;rt_admin&#039; superuser created in the instructions above.&lt;br /&gt;
Set($DatabaseUser, &#039;rt_user&#039;);&lt;br /&gt;
# DatabasePassword is the password for DatabaseUser.&lt;br /&gt;
Set($DatabasePassword, &#039;EDIT WITH SomePassphraseHere&#039;);&lt;br /&gt;
# DatabaseHost is the hostname of the database server RT should use.&lt;br /&gt;
# Change &#039;localhost&#039; if it lives on a different server.&lt;br /&gt;
Set($DatabaseHost, &#039;localhost&#039;);&lt;br /&gt;
# DatabasePort is the port number of the database server RT should use.&lt;br /&gt;
# `undef` means the default for that database. Change it if you&#039;re not&lt;br /&gt;
# using the standard port.&lt;br /&gt;
Set($DatabasePort, undef);&lt;br /&gt;
# DatabaseName is the name of RT&#039;s database hosted on DatabaseHost.&lt;br /&gt;
# &#039;rt5&#039; is the default but you can change it if you like.&lt;br /&gt;
Set($DatabaseName, &#039;rt5&#039;);&lt;br /&gt;
# DatabaseAdmin is the name of the user in the database used to perform&lt;br /&gt;
# major administrative tasks. Change &#039;rt_admin&#039; if you&#039;re using a user&lt;br /&gt;
# besides the one created in this guide.&lt;br /&gt;
Set($DatabaseAdmin, &#039;rt_admin&#039;);&lt;br /&gt;
&lt;br /&gt;
# RT can log to syslog, stderr, and/or a dedicated file. For a modern install,&lt;br /&gt;
# I recommend logging to syslog, so it goes to journald where it&#039;s easy to&lt;br /&gt;
# query and automatically gets rotated. You set both these paramaters to a&lt;br /&gt;
# standard log level: &#039;debug&#039;, &#039;info&#039;, &#039;notice&#039;, &#039;warning&#039;, &#039;error&#039;,&lt;br /&gt;
# &#039;critical&#039;, &#039;alert&#039;, or &#039;emergency&#039;.&lt;br /&gt;
Set($LogToSyslog, &#039;info&#039;);&lt;br /&gt;
Set($LogToSTDERR, undef);&lt;br /&gt;
&lt;br /&gt;
# Turn off optional features that require additional configuration.&lt;br /&gt;
# If you want to use these, refer to the RT_Config documentation for&lt;br /&gt;
# instructions on how to set them up.&lt;br /&gt;
Set(%GnuPG, &#039;Enable&#039; =&amp;gt; &#039;0&#039;);&lt;br /&gt;
Set(%SMIME, &#039;Enable&#039; =&amp;gt; &#039;0&#039;);&lt;br /&gt;
&lt;br /&gt;
# Perl expects to find this 1 at the end of the file.&lt;br /&gt;
1;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;RT_SiteConfig.pm&amp;lt;/code&amp;gt; is actually Perl code. RT runs the code directly to load the configuration. Any time you finish editing it, you can check that you didn’t make any syntax errors by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;perl -c /opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Set up RT’s database ===&lt;br /&gt;
&lt;br /&gt;
RT includes a tool to help you set up its database. By default, it connects to the database as an administrator to create the database and user that you configured in the previous step.&lt;br /&gt;
&lt;br /&gt;
(The instructions from &amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt; and RT’s README file tell you to run &amp;lt;code&amp;gt;make initialize-database&amp;lt;/code&amp;gt;. That just runs &amp;lt;code&amp;gt;rt-setup-database&amp;lt;/code&amp;gt; for you. Running the tool directly makes it easier to pass the options you need.)&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;--action=init&amp;lt;/code&amp;gt; tells the tool to create the user, the database, the tables inside it, and insert core data RT needs to function.&lt;br /&gt;
* &#039;&#039;&#039;If&#039;&#039;&#039; you are using an existing database server and the database adminstrator has already created the user account and database for RT, then you can add the &amp;lt;code&amp;gt;--skip-create&amp;lt;/code&amp;gt; option.&lt;br /&gt;
* &#039;&#039;&#039;If&#039;&#039;&#039; you have a less common database setup, this tool has additional options to give you finer-grained control over what steps are run and how. Refer to [https://docs.bestpractical.com/rt/latest/rt-setup-database.html the full rt-setup-database documentation] to learn more about those.&lt;br /&gt;
* The command reads files from RT’s &amp;lt;code&amp;gt;etc/&amp;lt;/code&amp;gt; directory by default, so the easiest way to run it is to &amp;lt;code&amp;gt;cd /opt/rt5&amp;lt;/code&amp;gt; first, and then it will find the necessary files automatically.&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /opt/rt5&lt;br /&gt;
sudo sbin/rt-setup-database --action=init&amp;lt;/pre&amp;gt;&lt;br /&gt;
Enter the password for your database administrator account when prompted.&lt;br /&gt;
&lt;br /&gt;
=== Set up fulltext indexing ===&lt;br /&gt;
&lt;br /&gt;
Fulltext indexing speeds up searches for ticket content, which makes RT a lot nicer to use.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;--noask&amp;lt;/code&amp;gt; uses the default names for the index, which will be fine for a new install and simplifies the setup.&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo /opt/rt5/sbin/rt-setup-fulltext-index --noask&amp;lt;/pre&amp;gt;&lt;br /&gt;
Enter the password for your database administrator account when prompted. The end of the process will output some RT configuration that looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;### EXAMPLE OUTPUT ONLY - Don&#039;t use this directly!&lt;br /&gt;
Set( %FullTextSearch,&lt;br /&gt;
    Enable     =&amp;gt; 1,&lt;br /&gt;
    Indexed    =&amp;gt; 1,&lt;br /&gt;
    # Additional output from rt-setup-fulltext-index should be here.&lt;br /&gt;
    # The configuration varies by database type.&lt;br /&gt;
);&amp;lt;/pre&amp;gt;&lt;br /&gt;
Copy the output generated when you run &amp;lt;code&amp;gt;rt-setup-fulltext-index&amp;lt;/code&amp;gt; and save it to the file &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.d/FulltextIndex.pm&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Set permissions ===&lt;br /&gt;
&lt;br /&gt;
All of RT’s configuration files should be readable by the user that runs the web server, and no other users, in order to protect sensitive information like the database password. RT provides a command to set permissions appropriately according to your distribution and configuration. &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt; to the directory where you extracted the RT source code, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd rt-5.0.2&lt;br /&gt;
sudo make fixperms&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Verify the installation ===&lt;br /&gt;
&lt;br /&gt;
If everything has gone well, then you should be able to set a password for RT’s &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; user. You’ll use this later to log in to the web interface and continue setting up your system. Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo /opt/rt5/sbin/rt-passwd root&amp;lt;/pre&amp;gt;&lt;br /&gt;
Set the password when prompted. Record this; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s web server ==&lt;br /&gt;
&lt;br /&gt;
=== Configure Apache modules ===&lt;br /&gt;
&lt;br /&gt;
You will need to have the following modules enabled in Apache to run RT. You should already have these installed if you followed the instructions above.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;alias&amp;lt;/code&amp;gt; (required to map URLs to RT)&lt;br /&gt;
* &amp;lt;code&amp;gt;fcgid&amp;lt;/code&amp;gt; (required for Apache to talk to RT)&lt;br /&gt;
* &amp;lt;code&amp;gt;mpm_prefork&amp;lt;/code&amp;gt; (Apache requires you to select an MPM. RT is designed to work with the prefork module.)&lt;br /&gt;
* &amp;lt;code&amp;gt;ssl&amp;lt;/code&amp;gt; (required to serve HTTPS; optional otherwise)&lt;br /&gt;
&lt;br /&gt;
Enable them following these instructions:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo a2dismod mpm_event&lt;br /&gt;
sudo a2enmod fcgid&lt;br /&gt;
sudo a2enmod mpm_prefork&lt;br /&gt;
sudo a2enmod ssl&amp;lt;/pre&amp;gt;&lt;br /&gt;
| &amp;lt;pre&amp;gt;echo LoadModule mpm_prefork_module modules/mod_mpm_prefork.so | sudo tee /etc/httpd/conf.modules.d/00-mpm.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Configure an Apache VirtualHost ===&lt;br /&gt;
&lt;br /&gt;
Create a file at the following location. You can change the &amp;lt;code&amp;gt;RT&amp;lt;/code&amp;gt; part of the filename if you like, but the file must exist in this directory and have a &amp;lt;code&amp;gt;.conf&amp;lt;/code&amp;gt; suffix.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;/etc/apache2/sites-available/RT.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
Then after you create the file, run: &amp;lt;code&amp;gt;sudo a2ensite RT&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;/etc/httpd/conf.d/RT.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Use an editor to save all the text below to the new &amp;lt;code&amp;gt;RT.conf&amp;lt;/code&amp;gt; and then fill in settings for your site everywhere the text &amp;lt;code&amp;gt;EDIT WITH&amp;lt;/code&amp;gt; appears.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### Server-level settings&lt;br /&gt;
# These settings affect all of Apache. It is okay to put them here if Apache&lt;br /&gt;
# only hosts RT. If you are hosting other sites in the same Apache instance,&lt;br /&gt;
# you may need to put these settings in another file like&lt;br /&gt;
# (Debian/Ubuntu) /etc/apache2/conf-available/RT.conf&lt;br /&gt;
# (Red Hat/Fedora/CentOS) /etc/httpd/conf.d/RTserver.conf&lt;br /&gt;
# ... and ensure they do not conflict with settings required by other sites.&lt;br /&gt;
&lt;br /&gt;
# mod_fcgid only allows 128KiB requests by default. This is too small for users&lt;br /&gt;
# to upload files to RT. You can ultimately choose any setting you&#039;re&lt;br /&gt;
# comfortable with; 70MiB here should allow most requests without being too&lt;br /&gt;
# open.&lt;br /&gt;
FcgidMaxRequestLen 73400320&lt;br /&gt;
&lt;br /&gt;
&amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
  # Listen on the standard HTTPS port.&lt;br /&gt;
  # You can change this to a nonstandard port if you must.&lt;br /&gt;
  Listen 443&lt;br /&gt;
&amp;lt;/IfModule&amp;gt;&lt;br /&gt;
### End server-level settings&lt;br /&gt;
&lt;br /&gt;
### Primary RT VirtualHost&lt;br /&gt;
# You can change both the bind address and/or the port here as required.&lt;br /&gt;
# This default will listen for HTTPS connections on all interfaces.&lt;br /&gt;
&amp;lt;VirtualHost *:443&amp;gt;&lt;br /&gt;
  # EDIT HERE with the domain name of the web server.&lt;br /&gt;
  ServerName rt.yourdomain.example.com&lt;br /&gt;
  &amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
    SSLEngine on&lt;br /&gt;
    # These specify the paths to the SSL certificate and private key Apache&lt;br /&gt;
    # should use. These example paths are common for Let&#039;s Encrypt. If you&lt;br /&gt;
    # don&#039;t use Let&#039;s Encrypt, the standard location for these files is under&lt;br /&gt;
    # (Debian/Ubuntu) /etc/ssl&lt;br /&gt;
    # (Red Hat/Fedora/CentOS) /etc/pki/tls&lt;br /&gt;
    # EDIT HERE with the appropriate paths for your server&lt;br /&gt;
    SSLCertificateFile /etc/letsencrypt/live/example.com/fullchain.pem&lt;br /&gt;
    SSLCertificateKeyFile /etc/letsencrypt/live/example.com/privkey.pem&lt;br /&gt;
  &amp;lt;/IfModule&amp;gt;&lt;br /&gt;
  &amp;lt;Location /&amp;gt;&lt;br /&gt;
    Require all granted&lt;br /&gt;
    Options +ExecCGI&lt;br /&gt;
    AddHandler fcgid-script fcgi&lt;br /&gt;
  &amp;lt;/Location&amp;gt;&lt;br /&gt;
  AddDefaultCharset UTF-8&lt;br /&gt;
  DocumentRoot /opt/rt5/share/html&lt;br /&gt;
  ScriptAlias / /opt/rt5/sbin/rt-server.fcgi/&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
### End primary RT VirtualHost&lt;br /&gt;
&lt;br /&gt;
### Optional HTTPS Redirect VirtualHost&lt;br /&gt;
# Most modern servers support HTTPS and want all web traffic to go through it.&lt;br /&gt;
# This VirtualHost redirects normal HTTP traffic to HTTPS.&lt;br /&gt;
# You can delete this whole section if you don&#039;t want or need this.&lt;br /&gt;
&amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
  # You can change both the bind address and/or the port here as required.&lt;br /&gt;
  # This default will listen for HTTP connections on all interfaces.&lt;br /&gt;
  &amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
    SSLEngine off&lt;br /&gt;
    # EDIT HERE both lines below with the domain name of your web server.&lt;br /&gt;
    ServerName rt.yourdomain.example.com&lt;br /&gt;
    Redirect permanent / https://rt.yourdomain.example.com/&lt;br /&gt;
  &amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/IfModule&amp;gt;&lt;br /&gt;
### End optional HTTPS Redirect VirtualHost&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
After you’ve edited the file, load the configuration with:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo systemctl reload apache2&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo systemctl reload httpd&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If this command reports an error, double-check the configuration file for typos, especially in option names, file paths, and the&lt;br /&gt;
&amp;lt;Section&amp;gt;&lt;br /&gt;
pairs. Edit again and reload the configuration until it succeeds without output.&lt;br /&gt;
&lt;br /&gt;
=== Verify the web interface ===&lt;br /&gt;
&lt;br /&gt;
You should be able to visit your web server in your browser, and be presented with RT’s login screen. You should be able to log in with username &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; and the password you set previously.&lt;br /&gt;
&lt;br /&gt;
If you run into trouble, the first place to look for more information is by reading Apache’s error log:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo less /var/log/apache2/error.log&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo less /var/log/httpd/error.log&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s mail server ==&lt;br /&gt;
&lt;br /&gt;
RT both can both send and receive ticket updates via email. Unfortunately, there are too many variables to document a useful setup process here: getting this working usually requires creating DNS records, and coordinating with existing mail servers, which will be the main constraint on your setup. Instead this guide provides a brief overview of how the integration works, and where the connection points are that you likely need to work on.&lt;br /&gt;
&lt;br /&gt;
=== Sending Mail ===&lt;br /&gt;
&lt;br /&gt;
RT only knows how to send mail by passing it off to another program on the system. It cannot connect or authenticate directly to external mail servers. In the default configuration, RT runs the standard &amp;lt;code&amp;gt;sendmail&amp;lt;/code&amp;gt; command. There are [https://docs.bestpractical.com/rt/latest/RT_Config.html#Outgoing-mail configuration options to send mail through different commands] if you need.&lt;br /&gt;
&lt;br /&gt;
The most common setup is to install and configure a proper Mail Transfer Agent (MTA) like Postfix or Exim, and then configure it to send mail to the wider Internet as you need. This works well because the MTAs are robust and well-tested; they have flexible configuration to let you send mail out by relaying to other mail servers you specify with optional authentication; and most distributions install one by default anyway. The only hard part is configuring the MTA to send mail following your site’s policies.&lt;br /&gt;
&lt;br /&gt;
Other software is available that provides a slimmer version of the &amp;lt;code&amp;gt;sendmail&amp;lt;/code&amp;gt; command that connects to an external mail server for you, like ssmtp. These programs are usually easier to configure than an MTA, but they often lose email permanently if they can’t connect to the external server at the time it’s sent. (MTAs keep email queued locally until they successfully deliver it to another server.)&lt;br /&gt;
&lt;br /&gt;
=== Receiving email ===&lt;br /&gt;
&lt;br /&gt;
RT installs a command called &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; that receives an email on standard input and posts it to RT’s REST web interface, where it gets saved in the database and added to a ticket. You need to arrange for a way to send incoming email to this command.&lt;br /&gt;
&lt;br /&gt;
The most common setup is to have an MTA on the same box as RT receive email directly, and then set up mail aliases that call this command when mail comes in. Example &amp;lt;code&amp;gt;/etc/aliases&amp;lt;/code&amp;gt; entries look like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rt: &amp;quot;|/opt/rt5/bin/rt-mailgate --queue general --action correspond --url https://rt.yourdomain.example.com/&amp;quot;&lt;br /&gt;
rt-comment: &amp;quot;|/opt/rt5/bin/rt-mailgate --queue general --action comment --url https://rt.yourdomain.example.com/&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
This works well because, again, you’re probably running an MTA anyway; and the MTA can hold and queue mail if it comes in while RT is down for any reason, giving you a buffer against downtime.&lt;br /&gt;
&lt;br /&gt;
Another common option is to periodically run a tool that fetches mail using a protocol like IMAP, like fetchmail or getmail, and passes it on to &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt;. This is less common because it requires setting up another tool to run, and securely storing another set of mail server credentials. But it is useful when local policy prevents the RT server from receiving email directly.&lt;br /&gt;
&lt;br /&gt;
This is much less common, but it might help to know that &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; doesn’t have to run on the same system as RT itself. It just needs to be able to connect to RT’s web interface. If you don’t have any other options, you can install the RT software on a different system that receives email, and configure &#039;&#039;that&#039;&#039; system to run &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; and pass it on to the RT server. To do that, just repeat the installation instructions above, skipping the steps about installing the database and web server.&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s background jobs ==&lt;br /&gt;
&lt;br /&gt;
Create a file &amp;lt;code&amp;gt;/etc/cron.d/rt&amp;lt;/code&amp;gt; with the following content. You may edit all of the time fields as you see fit. Refer to the crontab(5) man page for details about their definitions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Update the fulltext index with new ticket data&lt;br /&gt;
*/3 *   *   *   *   root    /opt/rt5/sbin/rt-fulltext-indexer&lt;br /&gt;
# Email out dashboards that users have subscribed to&lt;br /&gt;
0   *   *   *   *   root    /opt/rt5/sbin/rt-email-dashboards&lt;br /&gt;
# Clean old sessions from the database&lt;br /&gt;
10  3   *   *   *   root    /opt/rt5/sbin/rt-clean-sessions --older 8d&lt;br /&gt;
# Email out weekly digests for users who have requested it&lt;br /&gt;
50  4   *   *   Mon root    /opt/rt5/sbin/rt-email-digest -m weekly&lt;br /&gt;
# Email out daily digests for users who have requested it&lt;br /&gt;
50  5   *   *   *   root    /opt/rt5/sbin/rt-email-digest -m daily&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
You can run all these jobs as the same user that runs your web server, rather than root. Run:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo sed -i &#039;s/\broot\b/www-data/&#039; /etc/cron.d/rt&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo sed -i &#039;s/\broot\b/apache/&#039; /etc/cron.d/rt&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Set up RT ==&lt;br /&gt;
&lt;br /&gt;
If you’ve gotten this far, congratulations, your RT install is really done now. You can start setting up RT with users, groups, queues, and business logic. [[Main Page|Head back to the main page]] to start exploring those topics.&lt;/div&gt;</summary>
		<author><name>Brett</name></author>
	</entry>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=ManualInstallation&amp;diff=27042</id>
		<title>ManualInstallation</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=ManualInstallation&amp;diff=27042"/>
		<updated>2021-12-23T19:07:52Z</updated>

		<summary type="html">&lt;p&gt;Brett: openssl is required; install it&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Prev: [[ManualRequirements]] — Up: [[UserManual]] — Next: [[ManualApacheConfig]]&lt;br /&gt;
&lt;br /&gt;
This guide walks you through installing RT from source on a modern, popular Linux distro. Specifically, that means a distribution based on Debian or Red Hat that’s been released since around 2020.&lt;br /&gt;
&lt;br /&gt;
This guide assumes:&lt;br /&gt;
&lt;br /&gt;
* You can install packages generally available in Debian/Ubuntu or Red Hat/Fedora/CentOS.&lt;br /&gt;
* You want to install RT, and all of its Perl dependencies, from source to get the latest versions. (This is a trade-off. It means the boundaries of your install will be very clear, but you won’t get security updates for RT or Perl modules from your distribution.)&lt;br /&gt;
* You are willing to install a couple of extra tools to manage the RT installation similarly to how you would in other packaging systems (like PyPI, npm, etc.).&lt;br /&gt;
* You are willing to do a relatively maximal install of RT, enabling all the options during installation and then setting what you need in the configuration. (You could save a little space and time by being pickier about your options, but then that complicates the guide and makes it harder to turn those options on later if you want.)&lt;br /&gt;
* You are using a regular user account on the Linux system that can get superuser privileges with sudo.&lt;br /&gt;
&lt;br /&gt;
== Install the base dependencies ==&lt;br /&gt;
&lt;br /&gt;
These are required by RT, either to run or to install the dependencies.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install autoconf build-essential curl libexpat-dev libgd-dev libssl-dev libz-dev gnupg graphviz openssl perl w3m&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install patch tar which gcc gcc-c++ perl-core perl-ExtUtils-MakeMaker graphviz expat-devel gd-devel openssl openssl-devel w3m&lt;br /&gt;
sudo setenforce 0&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
(Turning off SELinux enforcement is required on Red Hat-based distributions because, as of October 2021, nobody has written a policy for RT.)&lt;br /&gt;
&lt;br /&gt;
== Install a database ==&lt;br /&gt;
&lt;br /&gt;
You need access to a database server. It can be remote, or you can install a database server alongside RT. RT supports a few different databases, but the best supported options are PostgreSQL and MariaDB.&lt;br /&gt;
&lt;br /&gt;
=== Installing and configuring the PostgreSQL server ===&lt;br /&gt;
&lt;br /&gt;
If you want to install a fresh PostgreSQL database server alongside RT:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install postgresql&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install postgresql-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In order to set up RT’s database, you will need a PostgreSQL superuser account that can be authenticated with a password. If you don’t have that, you can create it by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo createuser -sP rt_admin&amp;lt;/pre&amp;gt;&lt;br /&gt;
Set the password when prompted. Record this; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
=== Enable password authentication in PostgreSQL ===&lt;br /&gt;
&lt;br /&gt;
You need to consider this step whether you install the database locally, or use an existing one already running. RT supports connecting to PostgreSQL a few different ways, but authenticating with a username and password is simplest, and this guide is written based on that. Not all PostgreSQL installations allow this authentication method by default. You need to review your &amp;lt;code&amp;gt;pg_hba.conf&amp;lt;/code&amp;gt; file located at:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;/etc/postgresql/VERSION/main/pg_hba.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;/var/lib/pgsql/VERSION/data/pg_hba.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Replace &amp;lt;code&amp;gt;VERSION&amp;lt;/code&amp;gt; with the version of your PostgreSQL database. Add these two lines &#039;&#039;&#039;above&#039;&#039;&#039; any other lines that start with &amp;lt;code&amp;gt;host&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;host  rt5  rt_user   all  md5&lt;br /&gt;
host  rt5  rt_admin  all  md5&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This configuration will let &amp;lt;code&amp;gt;rt_user&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;rt_admin&amp;lt;/code&amp;gt; authorize themselves for the &amp;lt;code&amp;gt;rt5&amp;lt;/code&amp;gt; database using an &amp;lt;code&amp;gt;md5&amp;lt;/code&amp;gt; crypted password over a network connection (possibly using the localhost loopback network). You might be able to further restrict some of these fields for improved security, but doing so is outside the scope of this install guide. Refer to [https://www.postgresql.org/docs/current/auth-pg-hba-conf.html the pg_hba.conf documentation] for more details.&lt;br /&gt;
&lt;br /&gt;
Save your changes and reload the database:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo systemctl reload postgresql&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Installing the PostgreSQL client libraries ===&lt;br /&gt;
&lt;br /&gt;
These are required for RT to be able to talk to any PostgreSQL server.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install libpq-dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install postgresql-devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Once this is done you can skip ahead to installing a web server.&lt;br /&gt;
&lt;br /&gt;
=== Installing and configuring the MariaDB server ===&lt;br /&gt;
&lt;br /&gt;
If you want to install a fresh MariaDB database server alongside RT:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install mariadb-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install mariadb-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In order to set up RT’s database, you will need a MySQL superuser account. To stay consistent with PostgreSQL, I suggest setting a password for it. You can do that by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo mysql&lt;br /&gt;
mysql# GRANT ALL PRIVELEGES WITH GRANT OPTION ON rt5 TO rt_admin@localhost IDENTIFIED BY &#039;YourPassphraseHere&#039;;&amp;lt;/pre&amp;gt;&lt;br /&gt;
Record your passphrase; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
=== Adjust MariaDB’s max_allowed_packet setting ===&lt;br /&gt;
&lt;br /&gt;
You need to consider this step whether you install the database locally, or use an existing one already running. [https://mariadb.com/kb/en/server-system-variables/#max_allowed_packet MariaDB’s &amp;lt;code&amp;gt;max_allowed_packet&amp;lt;/code&amp;gt; setting] functionally limits the size of attachments in RT. The default is 16MiB, which is too small for most installations. You can ultimately choose any setting you’re comfortable with; 64MiB here should allow most requests without being too open.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;echo -e &#039;[client-server]\nmax_allowed_packet=64M\n&#039; | sudo tee /etc/mysql/conf.d/max_allowed_packet.cnf&lt;br /&gt;
sudo systemctl reload mariadb&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;echo -e &#039;[client-server]\nmax_allowed_packet=64M\n&#039; | sudo tee /etc/my.cnf.d/max_allowed_packet.cnf&lt;br /&gt;
sudo systemctl reload mariadb&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Installing the MariaDB client libraries ===&lt;br /&gt;
&lt;br /&gt;
These are required for RT to be able to talk to any MariaDB server.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install libmariadb-dev libmariadb-dev-compat&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install mariadb-devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Install a web server with FastCGI ==&lt;br /&gt;
&lt;br /&gt;
FastCGI is the best way to host RT’s web interface today. Installing the web server before RT makes the installation process simpler, because RT will be able to automatically some details about your web server like what user it runs as.&lt;br /&gt;
&lt;br /&gt;
=== Installing Apache ===&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install apache2 libapache2-mod-fcgid&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install httpd mod_fcgid mod_ssl&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ### Installing nginx --&amp;gt;&lt;br /&gt;
== Install Perl packaging tools: App::cpanminus and App::Virtualenv ==&lt;br /&gt;
&lt;br /&gt;
App::cpanminus is a tool for installing and managing Perl modules from the popular CPAN repository. It does a lot of the same tasks, and follows a lot of the same UI conventions, as &amp;lt;code&amp;gt;pip&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;gem&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;npm&amp;lt;/code&amp;gt;, and similar tools. You can install it from your distribution:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install cpanminus&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install perl-App-cpanminus&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If your system doesn’t have a cpanminus package available, you can install it from source following the [https://metacpan.org/pod/App::cpanminus#INSTALLATION project instructions].&lt;br /&gt;
&lt;br /&gt;
App::Virtualenv is a tool to create a dedicated space where you install and manage a self-contained set of Perl modules. (If you’re familiar with Python virtual environments, the concept is the same and App::Virtualenv follows a lot of the same usage patterns.) Using it helps avoid situations where changes to distribution packages might potentially break RT. This guide will illustrate creating and using a virtual environment for RT in &amp;lt;code&amp;gt;/opt/rt5venv&amp;lt;/code&amp;gt;, but you can choose another location if you like.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cpanm --sudo App::Virtualenv&lt;br /&gt;
sudo virtualenv.pl --create --empty /opt/rt5venv&amp;lt;/pre&amp;gt;&lt;br /&gt;
Now whenever you want to work on RT (by installing it, upgrading dependencies, installing new extensions, etc.), you need to activate the virtualenv in your shell. This sets various environment variables that your shell uses to work on Perl modules in the right place. You activate the virtualenv by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;. /opt/rt5venv/bin/activate&amp;lt;/pre&amp;gt;&lt;br /&gt;
== Install RT ==&lt;br /&gt;
&lt;br /&gt;
=== Get and unpack the RT source code ===&lt;br /&gt;
&lt;br /&gt;
Download the latest source code using the link on the [https://bestpractical.com/download-page RT download page], extract it using &amp;lt;code&amp;gt;tar -xf&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt; into the source code directory to run the rest of the commands in this section. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;curl -O https://download.bestpractical.com/pub/rt/release/rt-5.0.2.tar.gz&lt;br /&gt;
tar -xf rt-5.0.2.tar.gz&lt;br /&gt;
cd rt-5.0.2&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Pre-configure RT ===&lt;br /&gt;
&lt;br /&gt;
This command will detect some information about your system in order to install RT properly, and decide which set of dependencies to install. Here’s what the different parts of our command are doing:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;PERL=/opt/rt5venv/bin/perl&amp;lt;/code&amp;gt; ensures RT uses the virtualenv you set up.&lt;br /&gt;
* &amp;lt;code&amp;gt;--with-db-type=TYPE&amp;lt;/code&amp;gt; - Replace &amp;lt;code&amp;gt;TYPE&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;Pg&amp;lt;/code&amp;gt; for PostgreSQL, or &amp;lt;code&amp;gt;mysql&amp;lt;/code&amp;gt; for MariaDB.&lt;br /&gt;
* &amp;lt;code&amp;gt;--prefix=/opt/rt5&amp;lt;/code&amp;gt; sets the directory where RT will install all of its libraries, tools, and supporting files. You can choose another path if you like.&lt;br /&gt;
* The rest of the options tell RT to install additional dependencies for optional features.&lt;br /&gt;
&lt;br /&gt;
Make sure you have &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt;ed into the RT source directory, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;PERL=/opt/rt5venv/bin/perl ./configure --with-db-type=TYPE --prefix=/opt/rt5 --with-attachment-store=disk --enable-externalauth --enable-gd --enable-graphviz --enable-gpg --enable-smime&amp;lt;/pre&amp;gt;&lt;br /&gt;
For more background, [https://docs.bestpractical.com/rt/latest/configure.html refer to the RT configure options documentation].&lt;br /&gt;
&lt;br /&gt;
=== Install RT and its Perl dependencies ===&lt;br /&gt;
&lt;br /&gt;
This command will download, build, and install all of the Perl modules necessary to run RT with the configuration you set above. Here’s what the different parts of the command are doing:&lt;br /&gt;
&lt;br /&gt;
* First we make sure the virtualenv is activated in our shell, so dependencies are installed there.&lt;br /&gt;
* &amp;lt;code&amp;gt;fixdeps&amp;lt;/code&amp;gt; is RT’s command to install dependencies.&lt;br /&gt;
* &amp;lt;code&amp;gt;install&amp;lt;/code&amp;gt; installs all of RT’s files under &amp;lt;code&amp;gt;/opt/rt5&amp;lt;/code&amp;gt; (or the prefix directory you set in the previous step). It will only run if &amp;lt;code&amp;gt;fixdeps&amp;lt;/code&amp;gt; succeeds.&lt;br /&gt;
* &amp;lt;code&amp;gt;RT_FIX_DEPS_CMD=&#039;cpanm --sudo --quiet&#039;&amp;lt;/code&amp;gt; tells RT to use cpanminus to install dependencies (instead of the older, default &amp;lt;code&amp;gt;cpan&amp;lt;/code&amp;gt; command).&lt;br /&gt;
&lt;br /&gt;
Make sure you have &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt;ed into the RT source directory, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;. /opt/rt5venv/bin/activate&lt;br /&gt;
make fixdeps RT_FIX_DEPS_CMD=&#039;cpanm --sudo --quiet&#039;&lt;br /&gt;
sudo make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
If it works, the command will eventually output a message that says “Congratulations. RT is now installed.” followed by instructions about configuring and setting up the database. We’ll do that next.&lt;br /&gt;
&lt;br /&gt;
=== Configure RT ===&lt;br /&gt;
&lt;br /&gt;
[https://docs.bestpractical.com/rt/latest/RT_Config.html RT has many configuration options.] You can put configuration options in the file &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/code&amp;gt;, or in individual files under &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.d/&amp;lt;/code&amp;gt;. Use an editor to save all the text below to &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/code&amp;gt; (you can just overwrite the existing file, or add this to the bottom of what’s there) and then fill in settings for your site everywhere the text &amp;lt;code&amp;gt;EDIT WITH&amp;lt;/code&amp;gt; appears.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Single-quote all values EXCEPT the special value `undef`&lt;br /&gt;
# that turns off a setting.&lt;br /&gt;
&lt;br /&gt;
# rtname appears in ticket email subjects. It needs to be globally unique,&lt;br /&gt;
# so use your organization&#039;s domain name.&lt;br /&gt;
Set($rtname, &#039;EDIT WITH yourdomain.example.com&#039;);&lt;br /&gt;
# Organization is used in the database for ticket links, etc. It also needs to&lt;br /&gt;
# be globally unique, so use your organization&#039;s domain name.&lt;br /&gt;
Set($Organization, &#039;EDIT WITH yourdomain.example.com&#039;);&lt;br /&gt;
# WebDomain is domain name of the RT web server. RT uses it to construct links&lt;br /&gt;
# and defend against CSRFs.&lt;br /&gt;
Set($WebDomain, &#039;EDIT WITH rt.yourdomain.example.com&#039;);&lt;br /&gt;
# WebPort is the port where the RT web server runs. Edit the number below if&lt;br /&gt;
# you&#039;re not using the standard HTTPS port.&lt;br /&gt;
Set($WebPort, &#039;443&#039;);&lt;br /&gt;
&lt;br /&gt;
# DatabaseUser is the name of the database account RT uses to read and store&lt;br /&gt;
# data. &#039;rt_user&#039; is the default but you can change it if you like.&lt;br /&gt;
# DO NOT use the &#039;rt_admin&#039; superuser created in the instructions above.&lt;br /&gt;
Set($DatabaseUser, &#039;rt_user&#039;);&lt;br /&gt;
# DatabasePassword is the password for DatabaseUser.&lt;br /&gt;
Set($DatabasePassword, &#039;EDIT WITH SomePassphraseHere&#039;);&lt;br /&gt;
# DatabaseHost is the hostname of the database server RT should use.&lt;br /&gt;
# Change &#039;localhost&#039; if it lives on a different server.&lt;br /&gt;
Set($DatabaseHost, &#039;localhost&#039;);&lt;br /&gt;
# DatabasePort is the port number of the database server RT should use.&lt;br /&gt;
# `undef` means the default for that database. Change it if you&#039;re not&lt;br /&gt;
# using the standard port.&lt;br /&gt;
Set($DatabasePort, undef);&lt;br /&gt;
# DatabaseName is the name of RT&#039;s database hosted on DatabaseHost.&lt;br /&gt;
# &#039;rt5&#039; is the default but you can change it if you like.&lt;br /&gt;
Set($DatabaseName, &#039;rt5&#039;);&lt;br /&gt;
# DatabaseAdmin is the name of the user in the database used to perform&lt;br /&gt;
# major administrative tasks. Change &#039;rt_admin&#039; if you&#039;re using a user&lt;br /&gt;
# besides the one created in this guide.&lt;br /&gt;
Set($DatabaseAdmin, &#039;rt_admin&#039;);&lt;br /&gt;
&lt;br /&gt;
# RT can log to syslog, stderr, and/or a dedicated file. For a modern install,&lt;br /&gt;
# I recommend logging to syslog, so it goes to journald where it&#039;s easy to&lt;br /&gt;
# query and automatically gets rotated. You set both these paramaters to a&lt;br /&gt;
# standard log level: &#039;debug&#039;, &#039;info&#039;, &#039;notice&#039;, &#039;warning&#039;, &#039;error&#039;,&lt;br /&gt;
# &#039;critical&#039;, &#039;alert&#039;, or &#039;emergency&#039;.&lt;br /&gt;
Set($LogToSyslog, &#039;info&#039;);&lt;br /&gt;
Set($LogToSTDERR, undef);&lt;br /&gt;
&lt;br /&gt;
# Turn off optional features that require additional configuration.&lt;br /&gt;
# If you want to use these, refer to the RT_Config documentation for&lt;br /&gt;
# instructions on how to set them up.&lt;br /&gt;
Set(%GnuPG, &#039;Enable&#039; =&amp;gt; &#039;0&#039;);&lt;br /&gt;
Set(%SMIME, &#039;Enable&#039; =&amp;gt; &#039;0&#039;);&lt;br /&gt;
&lt;br /&gt;
# Perl expects to find this 1 at the end of the file.&lt;br /&gt;
1;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;RT_SiteConfig.pm&amp;lt;/code&amp;gt; is actually Perl code. RT runs the code directly to load the configuration. Any time you finish editing it, you can check that you didn’t make any syntax errors by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;perl -c /opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Set up RT’s database ===&lt;br /&gt;
&lt;br /&gt;
RT includes a tool to help you set up its database. By default, it connects to the database as an administrator to create the database and user that you configured in the previous step.&lt;br /&gt;
&lt;br /&gt;
(The instructions from &amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt; and RT’s README file tell you to run &amp;lt;code&amp;gt;make initialize-database&amp;lt;/code&amp;gt;. That just runs &amp;lt;code&amp;gt;rt-setup-database&amp;lt;/code&amp;gt; for you. Running the tool directly makes it easier to pass the options you need.)&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;--action=init&amp;lt;/code&amp;gt; tells the tool to create the user, the database, the tables inside it, and insert core data RT needs to function.&lt;br /&gt;
* &#039;&#039;&#039;If&#039;&#039;&#039; you are using an existing database server and the database adminstrator has already created the user account and database for RT, then you can add the &amp;lt;code&amp;gt;--skip-create&amp;lt;/code&amp;gt; option.&lt;br /&gt;
* &#039;&#039;&#039;If&#039;&#039;&#039; you have a less common database setup, this tool has additional options to give you finer-grained control over what steps are run and how. Refer to [https://docs.bestpractical.com/rt/latest/rt-setup-database.html the full rt-setup-database documentation] to learn more about those.&lt;br /&gt;
* The command reads files from RT’s &amp;lt;code&amp;gt;etc/&amp;lt;/code&amp;gt; directory by default, so the easiest way to run it is to &amp;lt;code&amp;gt;cd /opt/rt5&amp;lt;/code&amp;gt; first, and then it will find the necessary files automatically.&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /opt/rt5&lt;br /&gt;
sudo sbin/rt-setup-database --action=init&amp;lt;/pre&amp;gt;&lt;br /&gt;
Enter the password for your database administrator account when prompted.&lt;br /&gt;
&lt;br /&gt;
=== Set up fulltext indexing ===&lt;br /&gt;
&lt;br /&gt;
Fulltext indexing speeds up searches for ticket content, which makes RT a lot nicer to use.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;--noask&amp;lt;/code&amp;gt; uses the default names for the index, which will be fine for a new install and simplifies the setup.&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo /opt/rt5/sbin/rt-setup-fulltext-index --noask&amp;lt;/pre&amp;gt;&lt;br /&gt;
Enter the password for your database administrator account when prompted. The end of the process will output some RT configuration that looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;### EXAMPLE OUTPUT ONLY - Don&#039;t use this directly!&lt;br /&gt;
Set( %FullTextSearch,&lt;br /&gt;
    Enable     =&amp;gt; 1,&lt;br /&gt;
    Indexed    =&amp;gt; 1,&lt;br /&gt;
    # Additional output from rt-setup-fulltext-index should be here.&lt;br /&gt;
    # The configuration varies by database type.&lt;br /&gt;
);&amp;lt;/pre&amp;gt;&lt;br /&gt;
Copy the output generated when you run &amp;lt;code&amp;gt;rt-setup-fulltext-index&amp;lt;/code&amp;gt; and save it to the file &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.d/FulltextIndex.pm&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Set permissions ===&lt;br /&gt;
&lt;br /&gt;
All of RT’s configuration files should be readable by the user that runs the web server, and no other users, in order to protect sensitive information like the database password. RT provides a command to set permissions appropriately according to your distribution and configuration. &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt; to the directory where you extracted the RT source code, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd rt-5.0.2&lt;br /&gt;
sudo make fixperms&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Verify the installation ===&lt;br /&gt;
&lt;br /&gt;
If everything has gone well, then you should be able to set a password for RT’s &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; user. You’ll use this later to log in to the web interface and continue setting up your system. Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo /opt/rt5/sbin/rt-passwd root&amp;lt;/pre&amp;gt;&lt;br /&gt;
Set the password when prompted. Record this; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s web server ==&lt;br /&gt;
&lt;br /&gt;
=== Configure Apache modules ===&lt;br /&gt;
&lt;br /&gt;
You will need to have the following modules enabled in Apache to run RT. You should already have these installed if you followed the instructions above.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;alias&amp;lt;/code&amp;gt; (required to map URLs to RT)&lt;br /&gt;
* &amp;lt;code&amp;gt;fcgid&amp;lt;/code&amp;gt; (required for Apache to talk to RT)&lt;br /&gt;
* &amp;lt;code&amp;gt;mpm_prefork&amp;lt;/code&amp;gt; (Apache requires you to select an MPM. RT is designed to work with the prefork module.)&lt;br /&gt;
* &amp;lt;code&amp;gt;ssl&amp;lt;/code&amp;gt; (required to serve HTTPS; optional otherwise)&lt;br /&gt;
&lt;br /&gt;
Enable them following these instructions:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo a2dismod mpm_event&lt;br /&gt;
sudo a2enmod fcgid&lt;br /&gt;
sudo a2enmod mpm_prefork&lt;br /&gt;
sudo a2enmod ssl&amp;lt;/pre&amp;gt;&lt;br /&gt;
| &amp;lt;pre&amp;gt;echo LoadModule mpm_prefork_module modules/mod_mpm_prefork.so | sudo tee /etc/httpd/conf.modules.d/00-mpm.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Configure an Apache VirtualHost ===&lt;br /&gt;
&lt;br /&gt;
Create a file at the following location. You can change the &amp;lt;code&amp;gt;RT&amp;lt;/code&amp;gt; part of the filename if you like, but the file must exist in this directory and have a &amp;lt;code&amp;gt;.conf&amp;lt;/code&amp;gt; suffix.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;/etc/apache2/sites-available/RT.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
Then after you create the file, run: &amp;lt;code&amp;gt;sudo a2ensite RT&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;/etc/httpd/conf.d/RT.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Use an editor to save all the text below to the new &amp;lt;code&amp;gt;RT.conf&amp;lt;/code&amp;gt; and then fill in settings for your site everywhere the text &amp;lt;code&amp;gt;EDIT WITH&amp;lt;/code&amp;gt; appears.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### Server-level settings&lt;br /&gt;
# These settings affect all of Apache. It is okay to put them here if Apache&lt;br /&gt;
# only hosts RT. If you are hosting other sites in the same Apache instance,&lt;br /&gt;
# you may need to put these settings in another file like&lt;br /&gt;
# (Debian/Ubuntu) /etc/apache2/conf-available/RT.conf&lt;br /&gt;
# (Red Hat/Fedora/CentOS) /etc/httpd/conf.d/RTserver.conf&lt;br /&gt;
# ... and ensure they do not conflict with settings required by other sites.&lt;br /&gt;
&lt;br /&gt;
# mod_fcgid only allows 128KiB requests by default. This is too small for users&lt;br /&gt;
# to upload files to RT. You can ultimately choose any setting you&#039;re&lt;br /&gt;
# comfortable with; 70MiB here should allow most requests without being too&lt;br /&gt;
# open.&lt;br /&gt;
FcgidMaxRequestLen 73400320&lt;br /&gt;
&lt;br /&gt;
&amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
  # Listen on the standard HTTPS port.&lt;br /&gt;
  # You can change this to a nonstandard port if you must.&lt;br /&gt;
  Listen 443&lt;br /&gt;
&amp;lt;/IfModule&amp;gt;&lt;br /&gt;
### End server-level settings&lt;br /&gt;
&lt;br /&gt;
### Primary RT VirtualHost&lt;br /&gt;
# You can change both the bind address and/or the port here as required.&lt;br /&gt;
# This default will listen for HTTPS connections on all interfaces.&lt;br /&gt;
&amp;lt;VirtualHost *:443&amp;gt;&lt;br /&gt;
  # EDIT HERE with the domain name of the web server.&lt;br /&gt;
  ServerName rt.yourdomain.example.com&lt;br /&gt;
  &amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
    SSLEngine on&lt;br /&gt;
    # These specify the paths to the SSL certificate and private key Apache&lt;br /&gt;
    # should use. These example paths are common for Let&#039;s Encrypt. If you&lt;br /&gt;
    # don&#039;t use Let&#039;s Encrypt, the standard location for these files is under&lt;br /&gt;
    # (Debian/Ubuntu) /etc/ssl&lt;br /&gt;
    # (Red Hat/Fedora/CentOS) /etc/pki/tls&lt;br /&gt;
    # EDIT HERE with the appropriate paths for your server&lt;br /&gt;
    SSLCertificateFile /etc/letsencrypt/live/example.com/fullchain.pem&lt;br /&gt;
    SSLCertificateKeyFile /etc/letsencrypt/live/example.com/privkey.pem&lt;br /&gt;
  &amp;lt;/IfModule&amp;gt;&lt;br /&gt;
  &amp;lt;Location /&amp;gt;&lt;br /&gt;
    Require all granted&lt;br /&gt;
    Options +ExecCGI&lt;br /&gt;
    AddHandler fcgid-script fcgi&lt;br /&gt;
  &amp;lt;/Location&amp;gt;&lt;br /&gt;
  AddDefaultCharset UTF-8&lt;br /&gt;
  DocumentRoot /opt/rt5/share/html&lt;br /&gt;
  ScriptAlias / /opt/rt5/sbin/rt-server.fcgi/&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
### End primary RT VirtualHost&lt;br /&gt;
&lt;br /&gt;
### Optional HTTPS Redirect VirtualHost&lt;br /&gt;
# Most modern servers support HTTPS and want all web traffic to go through it.&lt;br /&gt;
# This VirtualHost redirects normal HTTP traffic to HTTPS.&lt;br /&gt;
# You can delete this whole section if you don&#039;t want or need this.&lt;br /&gt;
&amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
  # You can change both the bind address and/or the port here as required.&lt;br /&gt;
  # This default will listen for HTTP connections on all interfaces.&lt;br /&gt;
  &amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
    SSLEngine off&lt;br /&gt;
    # EDIT HERE both lines below with the domain name of your web server.&lt;br /&gt;
    ServerName rt.yourdomain.example.com&lt;br /&gt;
    Redirect permanent / https://rt.yourdomain.example.com/&lt;br /&gt;
  &amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/IfModule&amp;gt;&lt;br /&gt;
### End optional HTTPS Redirect VirtualHost&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
After you’ve edited the file, load the configuration with:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo systemctl reload apache2&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo systemctl reload httpd&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If this command reports an error, double-check the configuration file for typos, especially in option names, file paths, and the&lt;br /&gt;
&amp;lt;Section&amp;gt;&lt;br /&gt;
pairs. Edit again and reload the configuration until it succeeds without output.&lt;br /&gt;
&lt;br /&gt;
=== Verify the web interface ===&lt;br /&gt;
&lt;br /&gt;
You should be able to visit your web server in your browser, and be presented with RT’s login screen. You should be able to log in with username &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; and the password you set previously.&lt;br /&gt;
&lt;br /&gt;
If you run into trouble, the first place to look for more information is by reading Apache’s error log:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo less /var/log/apache2/error.log&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo less /var/log/httpd/error.log&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s mail server ==&lt;br /&gt;
&lt;br /&gt;
RT both can both send and receive ticket updates via email. Unfortunately, there are too many variables to document a useful setup process here: getting this working usually requires creating DNS records, and coordinating with existing mail servers, which will be the main constraint on your setup. Instead this guide provides a brief overview of how the integration works, and where the connection points are that you likely need to work on.&lt;br /&gt;
&lt;br /&gt;
=== Sending Mail ===&lt;br /&gt;
&lt;br /&gt;
RT only knows how to send mail by passing it off to another program on the system. It cannot connect or authenticate directly to external mail servers. In the default configuration, RT runs the standard &amp;lt;code&amp;gt;sendmail&amp;lt;/code&amp;gt; command. There are [https://docs.bestpractical.com/rt/latest/RT_Config.html#Outgoing-mail configuration options to send mail through different commands] if you need.&lt;br /&gt;
&lt;br /&gt;
The most common setup is to install and configure a proper Mail Transfer Agent (MTA) like Postfix or Exim, and then configure it to send mail to the wider Internet as you need. This works well because the MTAs are robust and well-tested; they have flexible configuration to let you send mail out by relaying to other mail servers you specify with optional authentication; and most distributions install one by default anyway. The only hard part is configuring the MTA to send mail following your site’s policies.&lt;br /&gt;
&lt;br /&gt;
Other software is available that provides a slimmer version of the &amp;lt;code&amp;gt;sendmail&amp;lt;/code&amp;gt; command that connects to an external mail server for you, like ssmtp. These programs are usually easier to configure than an MTA, but they often lose email permanently if they can’t connect to the external server at the time it’s sent. (MTAs keep email queued locally until they successfully deliver it to another server.)&lt;br /&gt;
&lt;br /&gt;
=== Receiving email ===&lt;br /&gt;
&lt;br /&gt;
RT installs a command called &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; that receives an email on standard input and posts it to RT’s REST web interface, where it gets saved in the database and added to a ticket. You need to arrange for a way to send incoming email to this command.&lt;br /&gt;
&lt;br /&gt;
The most common setup is to have an MTA on the same box as RT receive email directly, and then set up mail aliases that call this command when mail comes in. Example &amp;lt;code&amp;gt;/etc/aliases&amp;lt;/code&amp;gt; entries look like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rt: &amp;quot;|/opt/rt5/bin/rt-mailgate --queue general --action correspond --url https://rt.yourdomain.example.com/&amp;quot;&lt;br /&gt;
rt-comment: &amp;quot;|/opt/rt5/bin/rt-mailgate --queue general --action comment --url https://rt.yourdomain.example.com/&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
This works well because, again, you’re probably running an MTA anyway; and the MTA can hold and queue mail if it comes in while RT is down for any reason, giving you a buffer against downtime.&lt;br /&gt;
&lt;br /&gt;
Another common option is to periodically run a tool that fetches mail using a protocol like IMAP, like fetchmail or getmail, and passes it on to &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt;. This is less common because it requires setting up another tool to run, and securely storing another set of mail server credentials. But it is useful when local policy prevents the RT server from receiving email directly.&lt;br /&gt;
&lt;br /&gt;
This is much less common, but it might help to know that &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; doesn’t have to run on the same system as RT itself. It just needs to be able to connect to RT’s web interface. If you don’t have any other options, you can install the RT software on a different system that receives email, and configure &#039;&#039;that&#039;&#039; system to run &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; and pass it on to the RT server. To do that, just repeat the installation instructions above, skipping the steps about installing the database and web server.&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s background jobs ==&lt;br /&gt;
&lt;br /&gt;
Create a file &amp;lt;code&amp;gt;/etc/cron.d/rt&amp;lt;/code&amp;gt; with the following content. You may edit all of the time fields as you see fit. Refer to the crontab(5) man page for details about their definitions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Update the fulltext index with new ticket data&lt;br /&gt;
*/3 *   *   *   *   root    /opt/rt5/sbin/rt-fulltext-indexer&lt;br /&gt;
# Email out dashboards that users have subscribed to&lt;br /&gt;
0   *   *   *   *   root    /opt/rt5/sbin/rt-email-dashboards&lt;br /&gt;
# Clean old sessions from the database&lt;br /&gt;
10  3   *   *   *   root    /opt/rt5/sbin/rt-clean-sessions --older 8d&lt;br /&gt;
# Email out weekly digests for users who have requested it&lt;br /&gt;
50  4   *   *   Mon root    /opt/rt5/sbin/rt-email-digest -m weekly&lt;br /&gt;
# Email out daily digests for users who have requested it&lt;br /&gt;
50  5   *   *   *   root    /opt/rt5/sbin/rt-email-digest -m daily&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
You can run all these jobs as the same user that runs your web server, rather than root. Run:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo sed -i &#039;s/\broot\b/www-data/&#039; /etc/cron.d/rt&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo sed -i &#039;s/\broot\b/apache/&#039; /etc/cron.d/rt&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Set up RT ==&lt;br /&gt;
&lt;br /&gt;
If you’ve gotten this far, congratulations, your RT install is really done now. You can start setting up RT with users, groups, queues, and business logic. [[Main Page|Head back to the main page]] to start exploring those topics.&lt;/div&gt;</summary>
		<author><name>Brett</name></author>
	</entry>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=AutomatedTests&amp;diff=27041</id>
		<title>AutomatedTests</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=AutomatedTests&amp;diff=27041"/>
		<updated>2021-12-17T22:05:51Z</updated>

		<summary type="html">&lt;p&gt;Brett: add docs&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Test Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
The best way to set up RT for running tests (both its own and extensions&#039;) is by running the following from a source checkout:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;./configure.ac --with-db-type=TYPE --enable-layout=inplace [other options ...]&lt;br /&gt;
mkdir -p var&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then make sure all your dependencies are in place by running &amp;lt;code&amp;gt;make testdeps&amp;lt;/code&amp;gt;. (If you need help with that part, check out [[ManualInstallation]].) If you&#039;re at that point and just want to get running as fast as possible, skip down to &amp;quot;Environment Variables to Control Tests.&amp;quot; The next couple of sections give more background about what&#039;s going on.&lt;br /&gt;
&lt;br /&gt;
=== Why a real database? ===&lt;br /&gt;
&lt;br /&gt;
RT does include database-specific tests to check that various integrations work as expected. There&#039;s no good way to abstract these, so the test suite selects and runs the tests appropriate for your database.&lt;br /&gt;
&lt;br /&gt;
=== Why an inplace layout? ===&lt;br /&gt;
&lt;br /&gt;
The RT tests read the configuration file &amp;lt;code&amp;gt;RT_Config.pm&amp;lt;/code&amp;gt; located in the directory named at &amp;lt;code&amp;gt;$RT::Generated::EtcPath&amp;lt;/code&amp;gt;. If you use the default relative layout, or another layout intended for production like FHS, the tests will try to read your production configuration. That&#039;s probably not what you want.&lt;br /&gt;
&lt;br /&gt;
Note that the tests &#039;&#039;&#039;only&#039;&#039;&#039; read &amp;lt;code&amp;gt;RT_Config.pm&amp;lt;/code&amp;gt;. They do &#039;&#039;&#039;not&#039;&#039;&#039; read &amp;lt;code&amp;gt;RT_SiteConfig.pm&amp;lt;/code&amp;gt; or files under &amp;lt;code&amp;gt;RT_SiteConfig.d&amp;lt;/code&amp;gt;. You cannot change the behavior of tests by editing configuration there.&lt;br /&gt;
&lt;br /&gt;
(This is another reason you need to specify a database type on the configure line: so it gets put into &amp;lt;code&amp;gt;RT_Config.pm&amp;lt;/code&amp;gt;. There are environment variables to control most database parameters you need, but not the database type.)&lt;br /&gt;
&lt;br /&gt;
== Environment Variables to Control Tests ==&lt;br /&gt;
&lt;br /&gt;
=== Test RT Configuration ===&lt;br /&gt;
&lt;br /&gt;
Except on SQLite, the tests need permission to create new databases; to create new users in the database; and to grant rights to those users. To run the tests at all, you &#039;&#039;&#039;must&#039;&#039;&#039; set the environment variables &amp;lt;code&amp;gt;RT_DBA_USER&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;RT_DBA_PASSWORD&amp;lt;/code&amp;gt; with the username and password, respectively, of a database account that has all those rights.&lt;br /&gt;
&lt;br /&gt;
The tests write a small &amp;lt;code&amp;gt;RT_SiteConfig.pm&amp;lt;/code&amp;gt; it uses to configure itself. You can control some of the settings with environment variables. Refer to [https://docs.bestpractical.com/rt/latest/RT_Config.html the RT_Config documentation] for full details.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! Environment variable&lt;br /&gt;
! Corresponding RT_SiteConfig setting&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;RT_TEST_DB_SID&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;$DatabaseName&amp;lt;/code&amp;gt; (intended for Oracle only)&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;RT_TEST_DB_HOST&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;$DatabaseHost&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;RT_TEST_RT_HOST&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;$DatabaseRTHost&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;RT_TEST_DEVEL&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;$DevelMode&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;RT_TEST_PLUGINS&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;@Plugins&amp;lt;/code&amp;gt; (split on spaces)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Test Selection ===&lt;br /&gt;
&lt;br /&gt;
A few tests are skipped unless you do/n&#039;t set an environment variable.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! Environment variable&lt;br /&gt;
! Controls tests&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;RT_TEST_HEAVY&amp;lt;/code&amp;gt;&lt;br /&gt;
|Set a string here to run tests that require relatively expensive database queries.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;RT_TEST_SMIME_REVOCATION&amp;lt;/code&amp;gt;&lt;br /&gt;
|Set a string here to run SMIME revocation tests. Doing so downloads a certificate revocation list (CRL) from the public Internet.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;SKIP_GPG_TESTS&amp;lt;/code&amp;gt;&lt;br /&gt;
|Set a string here to skip tests that run GnuPG&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Test Run Environment ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! Environment variable&lt;br /&gt;
! Controls tests&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;RTHOME&amp;lt;/code&amp;gt;&lt;br /&gt;
|Path to the RT source code checkout you use for testing. The core RT tests don&#039;t use this, but extensions usually do.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;RT_TEST_PARALLEL&amp;lt;/code&amp;gt;&lt;br /&gt;
|Set a string here to notify the test suite that you&#039;re running tests in parallel. This changes some of the logic around database creation and elsewhere to avoid contention. You can set this even if you only have a single test runner.&lt;br /&gt;
You may also find some references to &amp;lt;code&amp;gt;RT_TEST_PARALLEL_NUM&amp;lt;/code&amp;gt;. This is used by RT&#039;s Makefile to control how many test runners run in parallel. If you don&#039;t go through RT&#039;s Makefile, then nothing else uses that variable.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;RT_TEST_APACHE&amp;lt;/code&amp;gt;&lt;br /&gt;
|Path to the &amp;lt;code&amp;gt;httpd&amp;lt;/code&amp;gt; executable on your system&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;RT_TEST_APXS&amp;lt;/code&amp;gt;&lt;br /&gt;
|Path to the &amp;lt;code&amp;gt;apxs&amp;lt;/code&amp;gt; executable on your system&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;RT_TEST_APACHE_MODULES&amp;lt;/code&amp;gt;&lt;br /&gt;
|Path to the directory where your httpd module &amp;lt;code&amp;gt;.so&amp;lt;/code&amp;gt; files live&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Running the Tests ==&lt;br /&gt;
&lt;br /&gt;
Once you&#039;ve set and exported all the environment variables you need, run the tests with &amp;lt;code&amp;gt;prove&amp;lt;/code&amp;gt; from your source directory:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;RT_TEST_PARALLEL=1 prove -w --lib --recurse --jobs=NUMBER t&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! Option&lt;br /&gt;
! Purpose&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;-w&amp;lt;/code&amp;gt;&lt;br /&gt;
|Enable warnings&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;--lib&amp;lt;/code&amp;gt;&lt;br /&gt;
|Load libraries from the &amp;lt;code&amp;gt;lib&amp;lt;/code&amp;gt; directory (i.e., your source checkout)&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;--recurse&amp;lt;/code&amp;gt;&lt;br /&gt;
|Recurse through the path argument(s) to find and run all test &amp;lt;code&amp;gt;.t&amp;lt;/code&amp;gt; files&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;--jobs=NUMBER&amp;lt;/code&amp;gt;&lt;br /&gt;
|Run &amp;lt;code&amp;gt;NUMBER&amp;lt;/code&amp;gt; test runners in parallel&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;t&amp;lt;/code&amp;gt;&lt;br /&gt;
|Run tests under this path. You can specify other directories (some extensions have tests in &amp;lt;code&amp;gt;xt&amp;lt;/code&amp;gt;), specific subdirectories, or even individual files.&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Brett</name></author>
	</entry>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=ManualInstallation&amp;diff=27040</id>
		<title>ManualInstallation</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=ManualInstallation&amp;diff=27040"/>
		<updated>2021-12-08T17:06:37Z</updated>

		<summary type="html">&lt;p&gt;Brett: emphasize that example rt-setup-fulltext-index output is just for illustration&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Prev: [[ManualRequirements]] — Up: [[UserManual]] — Next: [[ManualApacheConfig]]&lt;br /&gt;
&lt;br /&gt;
This guide walks you through installing RT from source on a modern, popular Linux distro. Specifically, that means a distribution based on Debian or Red Hat that’s been released since around 2020.&lt;br /&gt;
&lt;br /&gt;
This guide assumes:&lt;br /&gt;
&lt;br /&gt;
* You can install packages generally available in Debian/Ubuntu or Red Hat/Fedora/CentOS.&lt;br /&gt;
* You want to install RT, and all of its Perl dependencies, from source to get the latest versions. (This is a trade-off. It means the boundaries of your install will be very clear, but you won’t get security updates for RT or Perl modules from your distribution.)&lt;br /&gt;
* You are willing to install a couple of extra tools to manage the RT installation similarly to how you would in other packaging systems (like PyPI, npm, etc.).&lt;br /&gt;
* You are willing to do a relatively maximal install of RT, enabling all the options during installation and then setting what you need in the configuration. (You could save a little space and time by being pickier about your options, but then that complicates the guide and makes it harder to turn those options on later if you want.)&lt;br /&gt;
* You are using a regular user account on the Linux system that can get superuser privileges with sudo.&lt;br /&gt;
&lt;br /&gt;
== Install the base dependencies ==&lt;br /&gt;
&lt;br /&gt;
These are required by RT, either to run or to install the dependencies.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install autoconf build-essential curl libexpat-dev libgd-dev libssl-dev libz-dev gnupg graphviz perl w3m&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install patch tar which gcc gcc-c++ perl-core perl-ExtUtils-MakeMaker graphviz expat-devel gd-devel openssl-devel w3m&lt;br /&gt;
sudo setenforce 0&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
(Turning off SELinux enforcement is required on Red Hat-based distributions because, as of October 2021, nobody has written a policy for RT.)&lt;br /&gt;
&lt;br /&gt;
== Install a database ==&lt;br /&gt;
&lt;br /&gt;
You need access to a database server. It can be remote, or you can install a database server alongside RT. RT supports a few different databases, but the best supported options are PostgreSQL and MariaDB.&lt;br /&gt;
&lt;br /&gt;
=== Installing and configuring the PostgreSQL server ===&lt;br /&gt;
&lt;br /&gt;
If you want to install a fresh PostgreSQL database server alongside RT:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install postgresql&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install postgresql-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In order to set up RT’s database, you will need a PostgreSQL superuser account that can be authenticated with a password. If you don’t have that, you can create it by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo createuser -sP rt_admin&amp;lt;/pre&amp;gt;&lt;br /&gt;
Set the password when prompted. Record this; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
=== Enable password authentication in PostgreSQL ===&lt;br /&gt;
&lt;br /&gt;
You need to consider this step whether you install the database locally, or use an existing one already running. RT supports connecting to PostgreSQL a few different ways, but authenticating with a username and password is simplest, and this guide is written based on that. Not all PostgreSQL installations allow this authentication method by default. You need to review your &amp;lt;code&amp;gt;pg_hba.conf&amp;lt;/code&amp;gt; file located at:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;/etc/postgresql/VERSION/main/pg_hba.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;/var/lib/pgsql/VERSION/data/pg_hba.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Replace &amp;lt;code&amp;gt;VERSION&amp;lt;/code&amp;gt; with the version of your PostgreSQL database. Add these two lines &#039;&#039;&#039;above&#039;&#039;&#039; any other lines that start with &amp;lt;code&amp;gt;host&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;host  rt5  rt_user   all  md5&lt;br /&gt;
host  rt5  rt_admin  all  md5&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This configuration will let &amp;lt;code&amp;gt;rt_user&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;rt_admin&amp;lt;/code&amp;gt; authorize themselves for the &amp;lt;code&amp;gt;rt5&amp;lt;/code&amp;gt; database using an &amp;lt;code&amp;gt;md5&amp;lt;/code&amp;gt; crypted password over a network connection (possibly using the localhost loopback network). You might be able to further restrict some of these fields for improved security, but doing so is outside the scope of this install guide. Refer to [https://www.postgresql.org/docs/current/auth-pg-hba-conf.html the pg_hba.conf documentation] for more details.&lt;br /&gt;
&lt;br /&gt;
Save your changes and reload the database:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo systemctl reload postgresql&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Installing the PostgreSQL client libraries ===&lt;br /&gt;
&lt;br /&gt;
These are required for RT to be able to talk to any PostgreSQL server.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install libpq-dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install postgresql-devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Once this is done you can skip ahead to installing a web server.&lt;br /&gt;
&lt;br /&gt;
=== Installing and configuring the MariaDB server ===&lt;br /&gt;
&lt;br /&gt;
If you want to install a fresh MariaDB database server alongside RT:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install mariadb-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install mariadb-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In order to set up RT’s database, you will need a MySQL superuser account. To stay consistent with PostgreSQL, I suggest setting a password for it. You can do that by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo mysql&lt;br /&gt;
mysql# GRANT ALL PRIVELEGES WITH GRANT OPTION ON rt5 TO rt_admin@localhost IDENTIFIED BY &#039;YourPassphraseHere&#039;;&amp;lt;/pre&amp;gt;&lt;br /&gt;
Record your passphrase; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
=== Adjust MariaDB’s max_allowed_packet setting ===&lt;br /&gt;
&lt;br /&gt;
You need to consider this step whether you install the database locally, or use an existing one already running. [https://mariadb.com/kb/en/server-system-variables/#max_allowed_packet MariaDB’s &amp;lt;code&amp;gt;max_allowed_packet&amp;lt;/code&amp;gt; setting] functionally limits the size of attachments in RT. The default is 16MiB, which is too small for most installations. You can ultimately choose any setting you’re comfortable with; 64MiB here should allow most requests without being too open.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;echo -e &#039;[client-server]\nmax_allowed_packet=64M\n&#039; | sudo tee /etc/mysql/conf.d/max_allowed_packet.cnf&lt;br /&gt;
sudo systemctl reload mariadb&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;echo -e &#039;[client-server]\nmax_allowed_packet=64M\n&#039; | sudo tee /etc/my.cnf.d/max_allowed_packet.cnf&lt;br /&gt;
sudo systemctl reload mariadb&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Installing the MariaDB client libraries ===&lt;br /&gt;
&lt;br /&gt;
These are required for RT to be able to talk to any MariaDB server.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install libmariadb-dev libmariadb-dev-compat&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install mariadb-devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Install a web server with FastCGI ==&lt;br /&gt;
&lt;br /&gt;
FastCGI is the best way to host RT’s web interface today. Installing the web server before RT makes the installation process simpler, because RT will be able to automatically some details about your web server like what user it runs as.&lt;br /&gt;
&lt;br /&gt;
=== Installing Apache ===&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install apache2 libapache2-mod-fcgid&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install httpd mod_fcgid mod_ssl&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ### Installing nginx --&amp;gt;&lt;br /&gt;
== Install Perl packaging tools: App::cpanminus and App::Virtualenv ==&lt;br /&gt;
&lt;br /&gt;
App::cpanminus is a tool for installing and managing Perl modules from the popular CPAN repository. It does a lot of the same tasks, and follows a lot of the same UI conventions, as &amp;lt;code&amp;gt;pip&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;gem&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;npm&amp;lt;/code&amp;gt;, and similar tools. You can install it from your distribution:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install cpanminus&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install perl-App-cpanminus&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If your system doesn’t have a cpanminus package available, you can install it from source following the [https://metacpan.org/pod/App::cpanminus#INSTALLATION project instructions].&lt;br /&gt;
&lt;br /&gt;
App::Virtualenv is a tool to create a dedicated space where you install and manage a self-contained set of Perl modules. (If you’re familiar with Python virtual environments, the concept is the same and App::Virtualenv follows a lot of the same usage patterns.) Using it helps avoid situations where changes to distribution packages might potentially break RT. This guide will illustrate creating and using a virtual environment for RT in &amp;lt;code&amp;gt;/opt/rt5venv&amp;lt;/code&amp;gt;, but you can choose another location if you like.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cpanm --sudo App::Virtualenv&lt;br /&gt;
sudo virtualenv.pl --create --empty /opt/rt5venv&amp;lt;/pre&amp;gt;&lt;br /&gt;
Now whenever you want to work on RT (by installing it, upgrading dependencies, installing new extensions, etc.), you need to activate the virtualenv in your shell. This sets various environment variables that your shell uses to work on Perl modules in the right place. You activate the virtualenv by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;. /opt/rt5venv/bin/activate&amp;lt;/pre&amp;gt;&lt;br /&gt;
== Install RT ==&lt;br /&gt;
&lt;br /&gt;
=== Get and unpack the RT source code ===&lt;br /&gt;
&lt;br /&gt;
Download the latest source code using the link on the [https://bestpractical.com/download-page RT download page], extract it using &amp;lt;code&amp;gt;tar -xf&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt; into the source code directory to run the rest of the commands in this section. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;curl -O https://download.bestpractical.com/pub/rt/release/rt-5.0.2.tar.gz&lt;br /&gt;
tar -xf rt-5.0.2.tar.gz&lt;br /&gt;
cd rt-5.0.2&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Pre-configure RT ===&lt;br /&gt;
&lt;br /&gt;
This command will detect some information about your system in order to install RT properly, and decide which set of dependencies to install. Here’s what the different parts of our command are doing:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;PERL=/opt/rt5venv/bin/perl&amp;lt;/code&amp;gt; ensures RT uses the virtualenv you set up.&lt;br /&gt;
* &amp;lt;code&amp;gt;--with-db-type=TYPE&amp;lt;/code&amp;gt; - Replace &amp;lt;code&amp;gt;TYPE&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;Pg&amp;lt;/code&amp;gt; for PostgreSQL, or &amp;lt;code&amp;gt;mysql&amp;lt;/code&amp;gt; for MariaDB.&lt;br /&gt;
* &amp;lt;code&amp;gt;--prefix=/opt/rt5&amp;lt;/code&amp;gt; sets the directory where RT will install all of its libraries, tools, and supporting files. You can choose another path if you like.&lt;br /&gt;
* The rest of the options tell RT to install additional dependencies for optional features.&lt;br /&gt;
&lt;br /&gt;
Make sure you have &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt;ed into the RT source directory, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;PERL=/opt/rt5venv/bin/perl ./configure --with-db-type=TYPE --prefix=/opt/rt5 --with-attachment-store=disk --enable-externalauth --enable-gd --enable-graphviz --enable-gpg --enable-smime&amp;lt;/pre&amp;gt;&lt;br /&gt;
For more background, [https://docs.bestpractical.com/rt/latest/configure.html refer to the RT configure options documentation].&lt;br /&gt;
&lt;br /&gt;
=== Install RT and its Perl dependencies ===&lt;br /&gt;
&lt;br /&gt;
This command will download, build, and install all of the Perl modules necessary to run RT with the configuration you set above. Here’s what the different parts of the command are doing:&lt;br /&gt;
&lt;br /&gt;
* First we make sure the virtualenv is activated in our shell, so dependencies are installed there.&lt;br /&gt;
* &amp;lt;code&amp;gt;fixdeps&amp;lt;/code&amp;gt; is RT’s command to install dependencies.&lt;br /&gt;
* &amp;lt;code&amp;gt;install&amp;lt;/code&amp;gt; installs all of RT’s files under &amp;lt;code&amp;gt;/opt/rt5&amp;lt;/code&amp;gt; (or the prefix directory you set in the previous step). It will only run if &amp;lt;code&amp;gt;fixdeps&amp;lt;/code&amp;gt; succeeds.&lt;br /&gt;
* &amp;lt;code&amp;gt;RT_FIX_DEPS_CMD=&#039;cpanm --sudo --quiet&#039;&amp;lt;/code&amp;gt; tells RT to use cpanminus to install dependencies (instead of the older, default &amp;lt;code&amp;gt;cpan&amp;lt;/code&amp;gt; command).&lt;br /&gt;
&lt;br /&gt;
Make sure you have &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt;ed into the RT source directory, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;. /opt/rt5venv/bin/activate&lt;br /&gt;
make fixdeps RT_FIX_DEPS_CMD=&#039;cpanm --sudo --quiet&#039;&lt;br /&gt;
sudo make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
If it works, the command will eventually output a message that says “Congratulations. RT is now installed.” followed by instructions about configuring and setting up the database. We’ll do that next.&lt;br /&gt;
&lt;br /&gt;
=== Configure RT ===&lt;br /&gt;
&lt;br /&gt;
[https://docs.bestpractical.com/rt/latest/RT_Config.html RT has many configuration options.] You can put configuration options in the file &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/code&amp;gt;, or in individual files under &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.d/&amp;lt;/code&amp;gt;. Use an editor to save all the text below to &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/code&amp;gt; (you can just overwrite the existing file, or add this to the bottom of what’s there) and then fill in settings for your site everywhere the text &amp;lt;code&amp;gt;EDIT WITH&amp;lt;/code&amp;gt; appears.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Single-quote all values EXCEPT the special value `undef`&lt;br /&gt;
# that turns off a setting.&lt;br /&gt;
&lt;br /&gt;
# rtname appears in ticket email subjects. It needs to be globally unique,&lt;br /&gt;
# so use your organization&#039;s domain name.&lt;br /&gt;
Set($rtname, &#039;EDIT WITH yourdomain.example.com&#039;);&lt;br /&gt;
# Organization is used in the database for ticket links, etc. It also needs to&lt;br /&gt;
# be globally unique, so use your organization&#039;s domain name.&lt;br /&gt;
Set($Organization, &#039;EDIT WITH yourdomain.example.com&#039;);&lt;br /&gt;
# WebDomain is domain name of the RT web server. RT uses it to construct links&lt;br /&gt;
# and defend against CSRFs.&lt;br /&gt;
Set($WebDomain, &#039;EDIT WITH rt.yourdomain.example.com&#039;);&lt;br /&gt;
# WebPort is the port where the RT web server runs. Edit the number below if&lt;br /&gt;
# you&#039;re not using the standard HTTPS port.&lt;br /&gt;
Set($WebPort, &#039;443&#039;);&lt;br /&gt;
&lt;br /&gt;
# DatabaseUser is the name of the database account RT uses to read and store&lt;br /&gt;
# data. &#039;rt_user&#039; is the default but you can change it if you like.&lt;br /&gt;
# DO NOT use the &#039;rt_admin&#039; superuser created in the instructions above.&lt;br /&gt;
Set($DatabaseUser, &#039;rt_user&#039;);&lt;br /&gt;
# DatabasePassword is the password for DatabaseUser.&lt;br /&gt;
Set($DatabasePassword, &#039;EDIT WITH SomePassphraseHere&#039;);&lt;br /&gt;
# DatabaseHost is the hostname of the database server RT should use.&lt;br /&gt;
# Change &#039;localhost&#039; if it lives on a different server.&lt;br /&gt;
Set($DatabaseHost, &#039;localhost&#039;);&lt;br /&gt;
# DatabasePort is the port number of the database server RT should use.&lt;br /&gt;
# `undef` means the default for that database. Change it if you&#039;re not&lt;br /&gt;
# using the standard port.&lt;br /&gt;
Set($DatabasePort, undef);&lt;br /&gt;
# DatabaseName is the name of RT&#039;s database hosted on DatabaseHost.&lt;br /&gt;
# &#039;rt5&#039; is the default but you can change it if you like.&lt;br /&gt;
Set($DatabaseName, &#039;rt5&#039;);&lt;br /&gt;
# DatabaseAdmin is the name of the user in the database used to perform&lt;br /&gt;
# major administrative tasks. Change &#039;rt_admin&#039; if you&#039;re using a user&lt;br /&gt;
# besides the one created in this guide.&lt;br /&gt;
Set($DatabaseAdmin, &#039;rt_admin&#039;);&lt;br /&gt;
&lt;br /&gt;
# RT can log to syslog, stderr, and/or a dedicated file. For a modern install,&lt;br /&gt;
# I recommend logging to syslog, so it goes to journald where it&#039;s easy to&lt;br /&gt;
# query and automatically gets rotated. You set both these paramaters to a&lt;br /&gt;
# standard log level: &#039;debug&#039;, &#039;info&#039;, &#039;notice&#039;, &#039;warning&#039;, &#039;error&#039;,&lt;br /&gt;
# &#039;critical&#039;, &#039;alert&#039;, or &#039;emergency&#039;.&lt;br /&gt;
Set($LogToSyslog, &#039;info&#039;);&lt;br /&gt;
Set($LogToSTDERR, undef);&lt;br /&gt;
&lt;br /&gt;
# Turn off optional features that require additional configuration.&lt;br /&gt;
# If you want to use these, refer to the RT_Config documentation for&lt;br /&gt;
# instructions on how to set them up.&lt;br /&gt;
Set(%GnuPG, &#039;Enable&#039; =&amp;gt; &#039;0&#039;);&lt;br /&gt;
Set(%SMIME, &#039;Enable&#039; =&amp;gt; &#039;0&#039;);&lt;br /&gt;
&lt;br /&gt;
# Perl expects to find this 1 at the end of the file.&lt;br /&gt;
1;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;RT_SiteConfig.pm&amp;lt;/code&amp;gt; is actually Perl code. RT runs the code directly to load the configuration. Any time you finish editing it, you can check that you didn’t make any syntax errors by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;perl -c /opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Set up RT’s database ===&lt;br /&gt;
&lt;br /&gt;
RT includes a tool to help you set up its database. By default, it connects to the database as an administrator to create the database and user that you configured in the previous step.&lt;br /&gt;
&lt;br /&gt;
(The instructions from &amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt; and RT’s README file tell you to run &amp;lt;code&amp;gt;make initialize-database&amp;lt;/code&amp;gt;. That just runs &amp;lt;code&amp;gt;rt-setup-database&amp;lt;/code&amp;gt; for you. Running the tool directly makes it easier to pass the options you need.)&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;--action=init&amp;lt;/code&amp;gt; tells the tool to create the user, the database, the tables inside it, and insert core data RT needs to function.&lt;br /&gt;
* &#039;&#039;&#039;If&#039;&#039;&#039; you are using an existing database server and the database adminstrator has already created the user account and database for RT, then you can add the &amp;lt;code&amp;gt;--skip-create&amp;lt;/code&amp;gt; option.&lt;br /&gt;
* &#039;&#039;&#039;If&#039;&#039;&#039; you have a less common database setup, this tool has additional options to give you finer-grained control over what steps are run and how. Refer to [https://docs.bestpractical.com/rt/latest/rt-setup-database.html the full rt-setup-database documentation] to learn more about those.&lt;br /&gt;
* The command reads files from RT’s &amp;lt;code&amp;gt;etc/&amp;lt;/code&amp;gt; directory by default, so the easiest way to run it is to &amp;lt;code&amp;gt;cd /opt/rt5&amp;lt;/code&amp;gt; first, and then it will find the necessary files automatically.&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /opt/rt5&lt;br /&gt;
sudo sbin/rt-setup-database --action=init&amp;lt;/pre&amp;gt;&lt;br /&gt;
Enter the password for your database administrator account when prompted.&lt;br /&gt;
&lt;br /&gt;
=== Set up fulltext indexing ===&lt;br /&gt;
&lt;br /&gt;
Fulltext indexing speeds up searches for ticket content, which makes RT a lot nicer to use.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;--noask&amp;lt;/code&amp;gt; uses the default names for the index, which will be fine for a new install and simplifies the setup.&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo /opt/rt5/sbin/rt-setup-fulltext-index --noask&amp;lt;/pre&amp;gt;&lt;br /&gt;
Enter the password for your database administrator account when prompted. The end of the process will output some RT configuration that looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;### EXAMPLE OUTPUT ONLY - Don&#039;t use this directly!&lt;br /&gt;
Set( %FullTextSearch,&lt;br /&gt;
    Enable     =&amp;gt; 1,&lt;br /&gt;
    Indexed    =&amp;gt; 1,&lt;br /&gt;
    # Additional output from rt-setup-fulltext-index should be here.&lt;br /&gt;
    # The configuration varies by database type.&lt;br /&gt;
);&amp;lt;/pre&amp;gt;&lt;br /&gt;
Copy the output generated when you run &amp;lt;code&amp;gt;rt-setup-fulltext-index&amp;lt;/code&amp;gt; and save it to the file &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.d/FulltextIndex.pm&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Set permissions ===&lt;br /&gt;
&lt;br /&gt;
All of RT’s configuration files should be readable by the user that runs the web server, and no other users, in order to protect sensitive information like the database password. RT provides a command to set permissions appropriately according to your distribution and configuration. &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt; to the directory where you extracted the RT source code, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd rt-5.0.2&lt;br /&gt;
sudo make fixperms&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Verify the installation ===&lt;br /&gt;
&lt;br /&gt;
If everything has gone well, then you should be able to set a password for RT’s &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; user. You’ll use this later to log in to the web interface and continue setting up your system. Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo /opt/rt5/sbin/rt-passwd root&amp;lt;/pre&amp;gt;&lt;br /&gt;
Set the password when prompted. Record this; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s web server ==&lt;br /&gt;
&lt;br /&gt;
=== Configure Apache modules ===&lt;br /&gt;
&lt;br /&gt;
You will need to have the following modules enabled in Apache to run RT. You should already have these installed if you followed the instructions above.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;alias&amp;lt;/code&amp;gt; (required to map URLs to RT)&lt;br /&gt;
* &amp;lt;code&amp;gt;fcgid&amp;lt;/code&amp;gt; (required for Apache to talk to RT)&lt;br /&gt;
* &amp;lt;code&amp;gt;mpm_prefork&amp;lt;/code&amp;gt; (Apache requires you to select an MPM. RT is designed to work with the prefork module.)&lt;br /&gt;
* &amp;lt;code&amp;gt;ssl&amp;lt;/code&amp;gt; (required to serve HTTPS; optional otherwise)&lt;br /&gt;
&lt;br /&gt;
Enable them following these instructions:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo a2dismod mpm_event&lt;br /&gt;
sudo a2enmod fcgid&lt;br /&gt;
sudo a2enmod mpm_prefork&lt;br /&gt;
sudo a2enmod ssl&amp;lt;/pre&amp;gt;&lt;br /&gt;
| &amp;lt;pre&amp;gt;echo LoadModule mpm_prefork_module modules/mod_mpm_prefork.so | sudo tee /etc/httpd/conf.modules.d/00-mpm.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Configure an Apache VirtualHost ===&lt;br /&gt;
&lt;br /&gt;
Create a file at the following location. You can change the &amp;lt;code&amp;gt;RT&amp;lt;/code&amp;gt; part of the filename if you like, but the file must exist in this directory and have a &amp;lt;code&amp;gt;.conf&amp;lt;/code&amp;gt; suffix.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;/etc/apache2/sites-available/RT.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
Then after you create the file, run: &amp;lt;code&amp;gt;sudo a2ensite RT&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;/etc/httpd/conf.d/RT.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Use an editor to save all the text below to the new &amp;lt;code&amp;gt;RT.conf&amp;lt;/code&amp;gt; and then fill in settings for your site everywhere the text &amp;lt;code&amp;gt;EDIT WITH&amp;lt;/code&amp;gt; appears.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### Server-level settings&lt;br /&gt;
# These settings affect all of Apache. It is okay to put them here if Apache&lt;br /&gt;
# only hosts RT. If you are hosting other sites in the same Apache instance,&lt;br /&gt;
# you may need to put these settings in another file like&lt;br /&gt;
# (Debian/Ubuntu) /etc/apache2/conf-available/RT.conf&lt;br /&gt;
# (Red Hat/Fedora/CentOS) /etc/httpd/conf.d/RTserver.conf&lt;br /&gt;
# ... and ensure they do not conflict with settings required by other sites.&lt;br /&gt;
&lt;br /&gt;
# mod_fcgid only allows 128KiB requests by default. This is too small for users&lt;br /&gt;
# to upload files to RT. You can ultimately choose any setting you&#039;re&lt;br /&gt;
# comfortable with; 70MiB here should allow most requests without being too&lt;br /&gt;
# open.&lt;br /&gt;
FcgidMaxRequestLen 73400320&lt;br /&gt;
&lt;br /&gt;
&amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
  # Listen on the standard HTTPS port.&lt;br /&gt;
  # You can change this to a nonstandard port if you must.&lt;br /&gt;
  Listen 443&lt;br /&gt;
&amp;lt;/IfModule&amp;gt;&lt;br /&gt;
### End server-level settings&lt;br /&gt;
&lt;br /&gt;
### Primary RT VirtualHost&lt;br /&gt;
# You can change both the bind address and/or the port here as required.&lt;br /&gt;
# This default will listen for HTTPS connections on all interfaces.&lt;br /&gt;
&amp;lt;VirtualHost *:443&amp;gt;&lt;br /&gt;
  # EDIT HERE with the domain name of the web server.&lt;br /&gt;
  ServerName rt.yourdomain.example.com&lt;br /&gt;
  &amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
    SSLEngine on&lt;br /&gt;
    # These specify the paths to the SSL certificate and private key Apache&lt;br /&gt;
    # should use. These example paths are common for Let&#039;s Encrypt. If you&lt;br /&gt;
    # don&#039;t use Let&#039;s Encrypt, the standard location for these files is under&lt;br /&gt;
    # (Debian/Ubuntu) /etc/ssl&lt;br /&gt;
    # (Red Hat/Fedora/CentOS) /etc/pki/tls&lt;br /&gt;
    # EDIT HERE with the appropriate paths for your server&lt;br /&gt;
    SSLCertificateFile /etc/letsencrypt/live/example.com/fullchain.pem&lt;br /&gt;
    SSLCertificateKeyFile /etc/letsencrypt/live/example.com/privkey.pem&lt;br /&gt;
  &amp;lt;/IfModule&amp;gt;&lt;br /&gt;
  &amp;lt;Location /&amp;gt;&lt;br /&gt;
    Require all granted&lt;br /&gt;
    Options +ExecCGI&lt;br /&gt;
    AddHandler fcgid-script fcgi&lt;br /&gt;
  &amp;lt;/Location&amp;gt;&lt;br /&gt;
  AddDefaultCharset UTF-8&lt;br /&gt;
  DocumentRoot /opt/rt5/share/html&lt;br /&gt;
  ScriptAlias / /opt/rt5/sbin/rt-server.fcgi/&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
### End primary RT VirtualHost&lt;br /&gt;
&lt;br /&gt;
### Optional HTTPS Redirect VirtualHost&lt;br /&gt;
# Most modern servers support HTTPS and want all web traffic to go through it.&lt;br /&gt;
# This VirtualHost redirects normal HTTP traffic to HTTPS.&lt;br /&gt;
# You can delete this whole section if you don&#039;t want or need this.&lt;br /&gt;
&amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
  # You can change both the bind address and/or the port here as required.&lt;br /&gt;
  # This default will listen for HTTP connections on all interfaces.&lt;br /&gt;
  &amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
    SSLEngine off&lt;br /&gt;
    # EDIT HERE both lines below with the domain name of your web server.&lt;br /&gt;
    ServerName rt.yourdomain.example.com&lt;br /&gt;
    Redirect permanent / https://rt.yourdomain.example.com/&lt;br /&gt;
  &amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/IfModule&amp;gt;&lt;br /&gt;
### End optional HTTPS Redirect VirtualHost&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
After you’ve edited the file, load the configuration with:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo systemctl reload apache2&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo systemctl reload httpd&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If this command reports an error, double-check the configuration file for typos, especially in option names, file paths, and the&lt;br /&gt;
&amp;lt;Section&amp;gt;&lt;br /&gt;
pairs. Edit again and reload the configuration until it succeeds without output.&lt;br /&gt;
&lt;br /&gt;
=== Verify the web interface ===&lt;br /&gt;
&lt;br /&gt;
You should be able to visit your web server in your browser, and be presented with RT’s login screen. You should be able to log in with username &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; and the password you set previously.&lt;br /&gt;
&lt;br /&gt;
If you run into trouble, the first place to look for more information is by reading Apache’s error log:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo less /var/log/apache2/error.log&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo less /var/log/httpd/error.log&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s mail server ==&lt;br /&gt;
&lt;br /&gt;
RT both can both send and receive ticket updates via email. Unfortunately, there are too many variables to document a useful setup process here: getting this working usually requires creating DNS records, and coordinating with existing mail servers, which will be the main constraint on your setup. Instead this guide provides a brief overview of how the integration works, and where the connection points are that you likely need to work on.&lt;br /&gt;
&lt;br /&gt;
=== Sending Mail ===&lt;br /&gt;
&lt;br /&gt;
RT only knows how to send mail by passing it off to another program on the system. It cannot connect or authenticate directly to external mail servers. In the default configuration, RT runs the standard &amp;lt;code&amp;gt;sendmail&amp;lt;/code&amp;gt; command. There are [https://docs.bestpractical.com/rt/latest/RT_Config.html#Outgoing-mail configuration options to send mail through different commands] if you need.&lt;br /&gt;
&lt;br /&gt;
The most common setup is to install and configure a proper Mail Transfer Agent (MTA) like Postfix or Exim, and then configure it to send mail to the wider Internet as you need. This works well because the MTAs are robust and well-tested; they have flexible configuration to let you send mail out by relaying to other mail servers you specify with optional authentication; and most distributions install one by default anyway. The only hard part is configuring the MTA to send mail following your site’s policies.&lt;br /&gt;
&lt;br /&gt;
Other software is available that provides a slimmer version of the &amp;lt;code&amp;gt;sendmail&amp;lt;/code&amp;gt; command that connects to an external mail server for you, like ssmtp. These programs are usually easier to configure than an MTA, but they often lose email permanently if they can’t connect to the external server at the time it’s sent. (MTAs keep email queued locally until they successfully deliver it to another server.)&lt;br /&gt;
&lt;br /&gt;
=== Receiving email ===&lt;br /&gt;
&lt;br /&gt;
RT installs a command called &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; that receives an email on standard input and posts it to RT’s REST web interface, where it gets saved in the database and added to a ticket. You need to arrange for a way to send incoming email to this command.&lt;br /&gt;
&lt;br /&gt;
The most common setup is to have an MTA on the same box as RT receive email directly, and then set up mail aliases that call this command when mail comes in. Example &amp;lt;code&amp;gt;/etc/aliases&amp;lt;/code&amp;gt; entries look like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rt: &amp;quot;|/opt/rt5/bin/rt-mailgate --queue general --action correspond --url https://rt.yourdomain.example.com/&amp;quot;&lt;br /&gt;
rt-comment: &amp;quot;|/opt/rt5/bin/rt-mailgate --queue general --action comment --url https://rt.yourdomain.example.com/&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
This works well because, again, you’re probably running an MTA anyway; and the MTA can hold and queue mail if it comes in while RT is down for any reason, giving you a buffer against downtime.&lt;br /&gt;
&lt;br /&gt;
Another common option is to periodically run a tool that fetches mail using a protocol like IMAP, like fetchmail or getmail, and passes it on to &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt;. This is less common because it requires setting up another tool to run, and securely storing another set of mail server credentials. But it is useful when local policy prevents the RT server from receiving email directly.&lt;br /&gt;
&lt;br /&gt;
This is much less common, but it might help to know that &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; doesn’t have to run on the same system as RT itself. It just needs to be able to connect to RT’s web interface. If you don’t have any other options, you can install the RT software on a different system that receives email, and configure &#039;&#039;that&#039;&#039; system to run &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; and pass it on to the RT server. To do that, just repeat the installation instructions above, skipping the steps about installing the database and web server.&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s background jobs ==&lt;br /&gt;
&lt;br /&gt;
Create a file &amp;lt;code&amp;gt;/etc/cron.d/rt&amp;lt;/code&amp;gt; with the following content. You may edit all of the time fields as you see fit. Refer to the crontab(5) man page for details about their definitions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Update the fulltext index with new ticket data&lt;br /&gt;
*/3 *   *   *   *   root    /opt/rt5/sbin/rt-fulltext-indexer&lt;br /&gt;
# Email out dashboards that users have subscribed to&lt;br /&gt;
0   *   *   *   *   root    /opt/rt5/sbin/rt-email-dashboards&lt;br /&gt;
# Clean old sessions from the database&lt;br /&gt;
10  3   *   *   *   root    /opt/rt5/sbin/rt-clean-sessions --older 8d&lt;br /&gt;
# Email out weekly digests for users who have requested it&lt;br /&gt;
50  4   *   *   Mon root    /opt/rt5/sbin/rt-email-digest -m weekly&lt;br /&gt;
# Email out daily digests for users who have requested it&lt;br /&gt;
50  5   *   *   *   root    /opt/rt5/sbin/rt-email-digest -m daily&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
You can run all these jobs as the same user that runs your web server, rather than root. Run:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo sed -i &#039;s/\broot\b/www-data/&#039; /etc/cron.d/rt&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo sed -i &#039;s/\broot\b/apache/&#039; /etc/cron.d/rt&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Set up RT ==&lt;br /&gt;
&lt;br /&gt;
If you’ve gotten this far, congratulations, your RT install is really done now. You can start setting up RT with users, groups, queues, and business logic. [[Main Page|Head back to the main page]] to start exploring those topics.&lt;/div&gt;</summary>
		<author><name>Brett</name></author>
	</entry>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=ManualInstallation&amp;diff=27039</id>
		<title>ManualInstallation</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=ManualInstallation&amp;diff=27039"/>
		<updated>2021-12-08T17:03:47Z</updated>

		<summary type="html">&lt;p&gt;Brett: suggest using $DatabaseAdmin&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Prev: [[ManualRequirements]] — Up: [[UserManual]] — Next: [[ManualApacheConfig]]&lt;br /&gt;
&lt;br /&gt;
This guide walks you through installing RT from source on a modern, popular Linux distro. Specifically, that means a distribution based on Debian or Red Hat that’s been released since around 2020.&lt;br /&gt;
&lt;br /&gt;
This guide assumes:&lt;br /&gt;
&lt;br /&gt;
* You can install packages generally available in Debian/Ubuntu or Red Hat/Fedora/CentOS.&lt;br /&gt;
* You want to install RT, and all of its Perl dependencies, from source to get the latest versions. (This is a trade-off. It means the boundaries of your install will be very clear, but you won’t get security updates for RT or Perl modules from your distribution.)&lt;br /&gt;
* You are willing to install a couple of extra tools to manage the RT installation similarly to how you would in other packaging systems (like PyPI, npm, etc.).&lt;br /&gt;
* You are willing to do a relatively maximal install of RT, enabling all the options during installation and then setting what you need in the configuration. (You could save a little space and time by being pickier about your options, but then that complicates the guide and makes it harder to turn those options on later if you want.)&lt;br /&gt;
* You are using a regular user account on the Linux system that can get superuser privileges with sudo.&lt;br /&gt;
&lt;br /&gt;
== Install the base dependencies ==&lt;br /&gt;
&lt;br /&gt;
These are required by RT, either to run or to install the dependencies.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install autoconf build-essential curl libexpat-dev libgd-dev libssl-dev libz-dev gnupg graphviz perl w3m&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install patch tar which gcc gcc-c++ perl-core perl-ExtUtils-MakeMaker graphviz expat-devel gd-devel openssl-devel w3m&lt;br /&gt;
sudo setenforce 0&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
(Turning off SELinux enforcement is required on Red Hat-based distributions because, as of October 2021, nobody has written a policy for RT.)&lt;br /&gt;
&lt;br /&gt;
== Install a database ==&lt;br /&gt;
&lt;br /&gt;
You need access to a database server. It can be remote, or you can install a database server alongside RT. RT supports a few different databases, but the best supported options are PostgreSQL and MariaDB.&lt;br /&gt;
&lt;br /&gt;
=== Installing and configuring the PostgreSQL server ===&lt;br /&gt;
&lt;br /&gt;
If you want to install a fresh PostgreSQL database server alongside RT:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install postgresql&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install postgresql-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In order to set up RT’s database, you will need a PostgreSQL superuser account that can be authenticated with a password. If you don’t have that, you can create it by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo createuser -sP rt_admin&amp;lt;/pre&amp;gt;&lt;br /&gt;
Set the password when prompted. Record this; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
=== Enable password authentication in PostgreSQL ===&lt;br /&gt;
&lt;br /&gt;
You need to consider this step whether you install the database locally, or use an existing one already running. RT supports connecting to PostgreSQL a few different ways, but authenticating with a username and password is simplest, and this guide is written based on that. Not all PostgreSQL installations allow this authentication method by default. You need to review your &amp;lt;code&amp;gt;pg_hba.conf&amp;lt;/code&amp;gt; file located at:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;/etc/postgresql/VERSION/main/pg_hba.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;/var/lib/pgsql/VERSION/data/pg_hba.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Replace &amp;lt;code&amp;gt;VERSION&amp;lt;/code&amp;gt; with the version of your PostgreSQL database. Add these two lines &#039;&#039;&#039;above&#039;&#039;&#039; any other lines that start with &amp;lt;code&amp;gt;host&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;host  rt5  rt_user   all  md5&lt;br /&gt;
host  rt5  rt_admin  all  md5&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This configuration will let &amp;lt;code&amp;gt;rt_user&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;rt_admin&amp;lt;/code&amp;gt; authorize themselves for the &amp;lt;code&amp;gt;rt5&amp;lt;/code&amp;gt; database using an &amp;lt;code&amp;gt;md5&amp;lt;/code&amp;gt; crypted password over a network connection (possibly using the localhost loopback network). You might be able to further restrict some of these fields for improved security, but doing so is outside the scope of this install guide. Refer to [https://www.postgresql.org/docs/current/auth-pg-hba-conf.html the pg_hba.conf documentation] for more details.&lt;br /&gt;
&lt;br /&gt;
Save your changes and reload the database:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo systemctl reload postgresql&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Installing the PostgreSQL client libraries ===&lt;br /&gt;
&lt;br /&gt;
These are required for RT to be able to talk to any PostgreSQL server.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install libpq-dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install postgresql-devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Once this is done you can skip ahead to installing a web server.&lt;br /&gt;
&lt;br /&gt;
=== Installing and configuring the MariaDB server ===&lt;br /&gt;
&lt;br /&gt;
If you want to install a fresh MariaDB database server alongside RT:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install mariadb-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install mariadb-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In order to set up RT’s database, you will need a MySQL superuser account. To stay consistent with PostgreSQL, I suggest setting a password for it. You can do that by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo mysql&lt;br /&gt;
mysql# GRANT ALL PRIVELEGES WITH GRANT OPTION ON rt5 TO rt_admin@localhost IDENTIFIED BY &#039;YourPassphraseHere&#039;;&amp;lt;/pre&amp;gt;&lt;br /&gt;
Record your passphrase; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
=== Adjust MariaDB’s max_allowed_packet setting ===&lt;br /&gt;
&lt;br /&gt;
You need to consider this step whether you install the database locally, or use an existing one already running. [https://mariadb.com/kb/en/server-system-variables/#max_allowed_packet MariaDB’s &amp;lt;code&amp;gt;max_allowed_packet&amp;lt;/code&amp;gt; setting] functionally limits the size of attachments in RT. The default is 16MiB, which is too small for most installations. You can ultimately choose any setting you’re comfortable with; 64MiB here should allow most requests without being too open.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;echo -e &#039;[client-server]\nmax_allowed_packet=64M\n&#039; | sudo tee /etc/mysql/conf.d/max_allowed_packet.cnf&lt;br /&gt;
sudo systemctl reload mariadb&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;echo -e &#039;[client-server]\nmax_allowed_packet=64M\n&#039; | sudo tee /etc/my.cnf.d/max_allowed_packet.cnf&lt;br /&gt;
sudo systemctl reload mariadb&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Installing the MariaDB client libraries ===&lt;br /&gt;
&lt;br /&gt;
These are required for RT to be able to talk to any MariaDB server.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install libmariadb-dev libmariadb-dev-compat&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install mariadb-devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Install a web server with FastCGI ==&lt;br /&gt;
&lt;br /&gt;
FastCGI is the best way to host RT’s web interface today. Installing the web server before RT makes the installation process simpler, because RT will be able to automatically some details about your web server like what user it runs as.&lt;br /&gt;
&lt;br /&gt;
=== Installing Apache ===&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install apache2 libapache2-mod-fcgid&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install httpd mod_fcgid mod_ssl&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ### Installing nginx --&amp;gt;&lt;br /&gt;
== Install Perl packaging tools: App::cpanminus and App::Virtualenv ==&lt;br /&gt;
&lt;br /&gt;
App::cpanminus is a tool for installing and managing Perl modules from the popular CPAN repository. It does a lot of the same tasks, and follows a lot of the same UI conventions, as &amp;lt;code&amp;gt;pip&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;gem&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;npm&amp;lt;/code&amp;gt;, and similar tools. You can install it from your distribution:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install cpanminus&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install perl-App-cpanminus&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If your system doesn’t have a cpanminus package available, you can install it from source following the [https://metacpan.org/pod/App::cpanminus#INSTALLATION project instructions].&lt;br /&gt;
&lt;br /&gt;
App::Virtualenv is a tool to create a dedicated space where you install and manage a self-contained set of Perl modules. (If you’re familiar with Python virtual environments, the concept is the same and App::Virtualenv follows a lot of the same usage patterns.) Using it helps avoid situations where changes to distribution packages might potentially break RT. This guide will illustrate creating and using a virtual environment for RT in &amp;lt;code&amp;gt;/opt/rt5venv&amp;lt;/code&amp;gt;, but you can choose another location if you like.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cpanm --sudo App::Virtualenv&lt;br /&gt;
sudo virtualenv.pl --create --empty /opt/rt5venv&amp;lt;/pre&amp;gt;&lt;br /&gt;
Now whenever you want to work on RT (by installing it, upgrading dependencies, installing new extensions, etc.), you need to activate the virtualenv in your shell. This sets various environment variables that your shell uses to work on Perl modules in the right place. You activate the virtualenv by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;. /opt/rt5venv/bin/activate&amp;lt;/pre&amp;gt;&lt;br /&gt;
== Install RT ==&lt;br /&gt;
&lt;br /&gt;
=== Get and unpack the RT source code ===&lt;br /&gt;
&lt;br /&gt;
Download the latest source code using the link on the [https://bestpractical.com/download-page RT download page], extract it using &amp;lt;code&amp;gt;tar -xf&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt; into the source code directory to run the rest of the commands in this section. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;curl -O https://download.bestpractical.com/pub/rt/release/rt-5.0.2.tar.gz&lt;br /&gt;
tar -xf rt-5.0.2.tar.gz&lt;br /&gt;
cd rt-5.0.2&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Pre-configure RT ===&lt;br /&gt;
&lt;br /&gt;
This command will detect some information about your system in order to install RT properly, and decide which set of dependencies to install. Here’s what the different parts of our command are doing:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;PERL=/opt/rt5venv/bin/perl&amp;lt;/code&amp;gt; ensures RT uses the virtualenv you set up.&lt;br /&gt;
* &amp;lt;code&amp;gt;--with-db-type=TYPE&amp;lt;/code&amp;gt; - Replace &amp;lt;code&amp;gt;TYPE&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;Pg&amp;lt;/code&amp;gt; for PostgreSQL, or &amp;lt;code&amp;gt;mysql&amp;lt;/code&amp;gt; for MariaDB.&lt;br /&gt;
* &amp;lt;code&amp;gt;--prefix=/opt/rt5&amp;lt;/code&amp;gt; sets the directory where RT will install all of its libraries, tools, and supporting files. You can choose another path if you like.&lt;br /&gt;
* The rest of the options tell RT to install additional dependencies for optional features.&lt;br /&gt;
&lt;br /&gt;
Make sure you have &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt;ed into the RT source directory, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;PERL=/opt/rt5venv/bin/perl ./configure --with-db-type=TYPE --prefix=/opt/rt5 --with-attachment-store=disk --enable-externalauth --enable-gd --enable-graphviz --enable-gpg --enable-smime&amp;lt;/pre&amp;gt;&lt;br /&gt;
For more background, [https://docs.bestpractical.com/rt/latest/configure.html refer to the RT configure options documentation].&lt;br /&gt;
&lt;br /&gt;
=== Install RT and its Perl dependencies ===&lt;br /&gt;
&lt;br /&gt;
This command will download, build, and install all of the Perl modules necessary to run RT with the configuration you set above. Here’s what the different parts of the command are doing:&lt;br /&gt;
&lt;br /&gt;
* First we make sure the virtualenv is activated in our shell, so dependencies are installed there.&lt;br /&gt;
* &amp;lt;code&amp;gt;fixdeps&amp;lt;/code&amp;gt; is RT’s command to install dependencies.&lt;br /&gt;
* &amp;lt;code&amp;gt;install&amp;lt;/code&amp;gt; installs all of RT’s files under &amp;lt;code&amp;gt;/opt/rt5&amp;lt;/code&amp;gt; (or the prefix directory you set in the previous step). It will only run if &amp;lt;code&amp;gt;fixdeps&amp;lt;/code&amp;gt; succeeds.&lt;br /&gt;
* &amp;lt;code&amp;gt;RT_FIX_DEPS_CMD=&#039;cpanm --sudo --quiet&#039;&amp;lt;/code&amp;gt; tells RT to use cpanminus to install dependencies (instead of the older, default &amp;lt;code&amp;gt;cpan&amp;lt;/code&amp;gt; command).&lt;br /&gt;
&lt;br /&gt;
Make sure you have &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt;ed into the RT source directory, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;. /opt/rt5venv/bin/activate&lt;br /&gt;
make fixdeps RT_FIX_DEPS_CMD=&#039;cpanm --sudo --quiet&#039;&lt;br /&gt;
sudo make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
If it works, the command will eventually output a message that says “Congratulations. RT is now installed.” followed by instructions about configuring and setting up the database. We’ll do that next.&lt;br /&gt;
&lt;br /&gt;
=== Configure RT ===&lt;br /&gt;
&lt;br /&gt;
[https://docs.bestpractical.com/rt/latest/RT_Config.html RT has many configuration options.] You can put configuration options in the file &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/code&amp;gt;, or in individual files under &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.d/&amp;lt;/code&amp;gt;. Use an editor to save all the text below to &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/code&amp;gt; (you can just overwrite the existing file, or add this to the bottom of what’s there) and then fill in settings for your site everywhere the text &amp;lt;code&amp;gt;EDIT WITH&amp;lt;/code&amp;gt; appears.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Single-quote all values EXCEPT the special value `undef`&lt;br /&gt;
# that turns off a setting.&lt;br /&gt;
&lt;br /&gt;
# rtname appears in ticket email subjects. It needs to be globally unique,&lt;br /&gt;
# so use your organization&#039;s domain name.&lt;br /&gt;
Set($rtname, &#039;EDIT WITH yourdomain.example.com&#039;);&lt;br /&gt;
# Organization is used in the database for ticket links, etc. It also needs to&lt;br /&gt;
# be globally unique, so use your organization&#039;s domain name.&lt;br /&gt;
Set($Organization, &#039;EDIT WITH yourdomain.example.com&#039;);&lt;br /&gt;
# WebDomain is domain name of the RT web server. RT uses it to construct links&lt;br /&gt;
# and defend against CSRFs.&lt;br /&gt;
Set($WebDomain, &#039;EDIT WITH rt.yourdomain.example.com&#039;);&lt;br /&gt;
# WebPort is the port where the RT web server runs. Edit the number below if&lt;br /&gt;
# you&#039;re not using the standard HTTPS port.&lt;br /&gt;
Set($WebPort, &#039;443&#039;);&lt;br /&gt;
&lt;br /&gt;
# DatabaseUser is the name of the database account RT uses to read and store&lt;br /&gt;
# data. &#039;rt_user&#039; is the default but you can change it if you like.&lt;br /&gt;
# DO NOT use the &#039;rt_admin&#039; superuser created in the instructions above.&lt;br /&gt;
Set($DatabaseUser, &#039;rt_user&#039;);&lt;br /&gt;
# DatabasePassword is the password for DatabaseUser.&lt;br /&gt;
Set($DatabasePassword, &#039;EDIT WITH SomePassphraseHere&#039;);&lt;br /&gt;
# DatabaseHost is the hostname of the database server RT should use.&lt;br /&gt;
# Change &#039;localhost&#039; if it lives on a different server.&lt;br /&gt;
Set($DatabaseHost, &#039;localhost&#039;);&lt;br /&gt;
# DatabasePort is the port number of the database server RT should use.&lt;br /&gt;
# `undef` means the default for that database. Change it if you&#039;re not&lt;br /&gt;
# using the standard port.&lt;br /&gt;
Set($DatabasePort, undef);&lt;br /&gt;
# DatabaseName is the name of RT&#039;s database hosted on DatabaseHost.&lt;br /&gt;
# &#039;rt5&#039; is the default but you can change it if you like.&lt;br /&gt;
Set($DatabaseName, &#039;rt5&#039;);&lt;br /&gt;
# DatabaseAdmin is the name of the user in the database used to perform&lt;br /&gt;
# major administrative tasks. Change &#039;rt_admin&#039; if you&#039;re using a user&lt;br /&gt;
# besides the one created in this guide.&lt;br /&gt;
Set($DatabaseAdmin, &#039;rt_admin&#039;);&lt;br /&gt;
&lt;br /&gt;
# RT can log to syslog, stderr, and/or a dedicated file. For a modern install,&lt;br /&gt;
# I recommend logging to syslog, so it goes to journald where it&#039;s easy to&lt;br /&gt;
# query and automatically gets rotated. You set both these paramaters to a&lt;br /&gt;
# standard log level: &#039;debug&#039;, &#039;info&#039;, &#039;notice&#039;, &#039;warning&#039;, &#039;error&#039;,&lt;br /&gt;
# &#039;critical&#039;, &#039;alert&#039;, or &#039;emergency&#039;.&lt;br /&gt;
Set($LogToSyslog, &#039;info&#039;);&lt;br /&gt;
Set($LogToSTDERR, undef);&lt;br /&gt;
&lt;br /&gt;
# Turn off optional features that require additional configuration.&lt;br /&gt;
# If you want to use these, refer to the RT_Config documentation for&lt;br /&gt;
# instructions on how to set them up.&lt;br /&gt;
Set(%GnuPG, &#039;Enable&#039; =&amp;gt; &#039;0&#039;);&lt;br /&gt;
Set(%SMIME, &#039;Enable&#039; =&amp;gt; &#039;0&#039;);&lt;br /&gt;
&lt;br /&gt;
# Perl expects to find this 1 at the end of the file.&lt;br /&gt;
1;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;RT_SiteConfig.pm&amp;lt;/code&amp;gt; is actually Perl code. RT runs the code directly to load the configuration. Any time you finish editing it, you can check that you didn’t make any syntax errors by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;perl -c /opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Set up RT’s database ===&lt;br /&gt;
&lt;br /&gt;
RT includes a tool to help you set up its database. By default, it connects to the database as an administrator to create the database and user that you configured in the previous step.&lt;br /&gt;
&lt;br /&gt;
(The instructions from &amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt; and RT’s README file tell you to run &amp;lt;code&amp;gt;make initialize-database&amp;lt;/code&amp;gt;. That just runs &amp;lt;code&amp;gt;rt-setup-database&amp;lt;/code&amp;gt; for you. Running the tool directly makes it easier to pass the options you need.)&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;--action=init&amp;lt;/code&amp;gt; tells the tool to create the user, the database, the tables inside it, and insert core data RT needs to function.&lt;br /&gt;
* &#039;&#039;&#039;If&#039;&#039;&#039; you are using an existing database server and the database adminstrator has already created the user account and database for RT, then you can add the &amp;lt;code&amp;gt;--skip-create&amp;lt;/code&amp;gt; option.&lt;br /&gt;
* &#039;&#039;&#039;If&#039;&#039;&#039; you have a less common database setup, this tool has additional options to give you finer-grained control over what steps are run and how. Refer to [https://docs.bestpractical.com/rt/latest/rt-setup-database.html the full rt-setup-database documentation] to learn more about those.&lt;br /&gt;
* The command reads files from RT’s &amp;lt;code&amp;gt;etc/&amp;lt;/code&amp;gt; directory by default, so the easiest way to run it is to &amp;lt;code&amp;gt;cd /opt/rt5&amp;lt;/code&amp;gt; first, and then it will find the necessary files automatically.&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /opt/rt5&lt;br /&gt;
sudo sbin/rt-setup-database --action=init&amp;lt;/pre&amp;gt;&lt;br /&gt;
Enter the password for your database administrator account when prompted.&lt;br /&gt;
&lt;br /&gt;
=== Set up fulltext indexing ===&lt;br /&gt;
&lt;br /&gt;
Fulltext indexing speeds up searches for ticket content, which makes RT a lot nicer to use.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;--noask&amp;lt;/code&amp;gt; uses the default names for the index, which will be fine for a new install and simplifies the setup.&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo /opt/rt5/sbin/rt-setup-fulltext-index --noask&amp;lt;/pre&amp;gt;&lt;br /&gt;
Enter the password for your database administrator account when prompted. The end of the process will output some RT configuration that looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Set( %FullTextSearch,&lt;br /&gt;
    Enable     =&amp;gt; 1,&lt;br /&gt;
    Indexed    =&amp;gt; 1,&lt;br /&gt;
    # Additional output from rt-setup-fulltext-index should be here.&lt;br /&gt;
    # The configuration varies by database type.&lt;br /&gt;
);&amp;lt;/pre&amp;gt;&lt;br /&gt;
Copy that output and save it to the file &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.d/FulltextIndex.pm&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Set permissions ===&lt;br /&gt;
&lt;br /&gt;
All of RT’s configuration files should be readable by the user that runs the web server, and no other users, in order to protect sensitive information like the database password. RT provides a command to set permissions appropriately according to your distribution and configuration. &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt; to the directory where you extracted the RT source code, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd rt-5.0.2&lt;br /&gt;
sudo make fixperms&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Verify the installation ===&lt;br /&gt;
&lt;br /&gt;
If everything has gone well, then you should be able to set a password for RT’s &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; user. You’ll use this later to log in to the web interface and continue setting up your system. Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo /opt/rt5/sbin/rt-passwd root&amp;lt;/pre&amp;gt;&lt;br /&gt;
Set the password when prompted. Record this; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s web server ==&lt;br /&gt;
&lt;br /&gt;
=== Configure Apache modules ===&lt;br /&gt;
&lt;br /&gt;
You will need to have the following modules enabled in Apache to run RT. You should already have these installed if you followed the instructions above.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;alias&amp;lt;/code&amp;gt; (required to map URLs to RT)&lt;br /&gt;
* &amp;lt;code&amp;gt;fcgid&amp;lt;/code&amp;gt; (required for Apache to talk to RT)&lt;br /&gt;
* &amp;lt;code&amp;gt;mpm_prefork&amp;lt;/code&amp;gt; (Apache requires you to select an MPM. RT is designed to work with the prefork module.)&lt;br /&gt;
* &amp;lt;code&amp;gt;ssl&amp;lt;/code&amp;gt; (required to serve HTTPS; optional otherwise)&lt;br /&gt;
&lt;br /&gt;
Enable them following these instructions:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo a2dismod mpm_event&lt;br /&gt;
sudo a2enmod fcgid&lt;br /&gt;
sudo a2enmod mpm_prefork&lt;br /&gt;
sudo a2enmod ssl&amp;lt;/pre&amp;gt;&lt;br /&gt;
| &amp;lt;pre&amp;gt;echo LoadModule mpm_prefork_module modules/mod_mpm_prefork.so | sudo tee /etc/httpd/conf.modules.d/00-mpm.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Configure an Apache VirtualHost ===&lt;br /&gt;
&lt;br /&gt;
Create a file at the following location. You can change the &amp;lt;code&amp;gt;RT&amp;lt;/code&amp;gt; part of the filename if you like, but the file must exist in this directory and have a &amp;lt;code&amp;gt;.conf&amp;lt;/code&amp;gt; suffix.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;/etc/apache2/sites-available/RT.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
Then after you create the file, run: &amp;lt;code&amp;gt;sudo a2ensite RT&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;/etc/httpd/conf.d/RT.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Use an editor to save all the text below to the new &amp;lt;code&amp;gt;RT.conf&amp;lt;/code&amp;gt; and then fill in settings for your site everywhere the text &amp;lt;code&amp;gt;EDIT WITH&amp;lt;/code&amp;gt; appears.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### Server-level settings&lt;br /&gt;
# These settings affect all of Apache. It is okay to put them here if Apache&lt;br /&gt;
# only hosts RT. If you are hosting other sites in the same Apache instance,&lt;br /&gt;
# you may need to put these settings in another file like&lt;br /&gt;
# (Debian/Ubuntu) /etc/apache2/conf-available/RT.conf&lt;br /&gt;
# (Red Hat/Fedora/CentOS) /etc/httpd/conf.d/RTserver.conf&lt;br /&gt;
# ... and ensure they do not conflict with settings required by other sites.&lt;br /&gt;
&lt;br /&gt;
# mod_fcgid only allows 128KiB requests by default. This is too small for users&lt;br /&gt;
# to upload files to RT. You can ultimately choose any setting you&#039;re&lt;br /&gt;
# comfortable with; 70MiB here should allow most requests without being too&lt;br /&gt;
# open.&lt;br /&gt;
FcgidMaxRequestLen 73400320&lt;br /&gt;
&lt;br /&gt;
&amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
  # Listen on the standard HTTPS port.&lt;br /&gt;
  # You can change this to a nonstandard port if you must.&lt;br /&gt;
  Listen 443&lt;br /&gt;
&amp;lt;/IfModule&amp;gt;&lt;br /&gt;
### End server-level settings&lt;br /&gt;
&lt;br /&gt;
### Primary RT VirtualHost&lt;br /&gt;
# You can change both the bind address and/or the port here as required.&lt;br /&gt;
# This default will listen for HTTPS connections on all interfaces.&lt;br /&gt;
&amp;lt;VirtualHost *:443&amp;gt;&lt;br /&gt;
  # EDIT HERE with the domain name of the web server.&lt;br /&gt;
  ServerName rt.yourdomain.example.com&lt;br /&gt;
  &amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
    SSLEngine on&lt;br /&gt;
    # These specify the paths to the SSL certificate and private key Apache&lt;br /&gt;
    # should use. These example paths are common for Let&#039;s Encrypt. If you&lt;br /&gt;
    # don&#039;t use Let&#039;s Encrypt, the standard location for these files is under&lt;br /&gt;
    # (Debian/Ubuntu) /etc/ssl&lt;br /&gt;
    # (Red Hat/Fedora/CentOS) /etc/pki/tls&lt;br /&gt;
    # EDIT HERE with the appropriate paths for your server&lt;br /&gt;
    SSLCertificateFile /etc/letsencrypt/live/example.com/fullchain.pem&lt;br /&gt;
    SSLCertificateKeyFile /etc/letsencrypt/live/example.com/privkey.pem&lt;br /&gt;
  &amp;lt;/IfModule&amp;gt;&lt;br /&gt;
  &amp;lt;Location /&amp;gt;&lt;br /&gt;
    Require all granted&lt;br /&gt;
    Options +ExecCGI&lt;br /&gt;
    AddHandler fcgid-script fcgi&lt;br /&gt;
  &amp;lt;/Location&amp;gt;&lt;br /&gt;
  AddDefaultCharset UTF-8&lt;br /&gt;
  DocumentRoot /opt/rt5/share/html&lt;br /&gt;
  ScriptAlias / /opt/rt5/sbin/rt-server.fcgi/&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
### End primary RT VirtualHost&lt;br /&gt;
&lt;br /&gt;
### Optional HTTPS Redirect VirtualHost&lt;br /&gt;
# Most modern servers support HTTPS and want all web traffic to go through it.&lt;br /&gt;
# This VirtualHost redirects normal HTTP traffic to HTTPS.&lt;br /&gt;
# You can delete this whole section if you don&#039;t want or need this.&lt;br /&gt;
&amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
  # You can change both the bind address and/or the port here as required.&lt;br /&gt;
  # This default will listen for HTTP connections on all interfaces.&lt;br /&gt;
  &amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
    SSLEngine off&lt;br /&gt;
    # EDIT HERE both lines below with the domain name of your web server.&lt;br /&gt;
    ServerName rt.yourdomain.example.com&lt;br /&gt;
    Redirect permanent / https://rt.yourdomain.example.com/&lt;br /&gt;
  &amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/IfModule&amp;gt;&lt;br /&gt;
### End optional HTTPS Redirect VirtualHost&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
After you’ve edited the file, load the configuration with:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo systemctl reload apache2&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo systemctl reload httpd&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If this command reports an error, double-check the configuration file for typos, especially in option names, file paths, and the&lt;br /&gt;
&amp;lt;Section&amp;gt;&lt;br /&gt;
pairs. Edit again and reload the configuration until it succeeds without output.&lt;br /&gt;
&lt;br /&gt;
=== Verify the web interface ===&lt;br /&gt;
&lt;br /&gt;
You should be able to visit your web server in your browser, and be presented with RT’s login screen. You should be able to log in with username &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; and the password you set previously.&lt;br /&gt;
&lt;br /&gt;
If you run into trouble, the first place to look for more information is by reading Apache’s error log:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo less /var/log/apache2/error.log&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo less /var/log/httpd/error.log&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s mail server ==&lt;br /&gt;
&lt;br /&gt;
RT both can both send and receive ticket updates via email. Unfortunately, there are too many variables to document a useful setup process here: getting this working usually requires creating DNS records, and coordinating with existing mail servers, which will be the main constraint on your setup. Instead this guide provides a brief overview of how the integration works, and where the connection points are that you likely need to work on.&lt;br /&gt;
&lt;br /&gt;
=== Sending Mail ===&lt;br /&gt;
&lt;br /&gt;
RT only knows how to send mail by passing it off to another program on the system. It cannot connect or authenticate directly to external mail servers. In the default configuration, RT runs the standard &amp;lt;code&amp;gt;sendmail&amp;lt;/code&amp;gt; command. There are [https://docs.bestpractical.com/rt/latest/RT_Config.html#Outgoing-mail configuration options to send mail through different commands] if you need.&lt;br /&gt;
&lt;br /&gt;
The most common setup is to install and configure a proper Mail Transfer Agent (MTA) like Postfix or Exim, and then configure it to send mail to the wider Internet as you need. This works well because the MTAs are robust and well-tested; they have flexible configuration to let you send mail out by relaying to other mail servers you specify with optional authentication; and most distributions install one by default anyway. The only hard part is configuring the MTA to send mail following your site’s policies.&lt;br /&gt;
&lt;br /&gt;
Other software is available that provides a slimmer version of the &amp;lt;code&amp;gt;sendmail&amp;lt;/code&amp;gt; command that connects to an external mail server for you, like ssmtp. These programs are usually easier to configure than an MTA, but they often lose email permanently if they can’t connect to the external server at the time it’s sent. (MTAs keep email queued locally until they successfully deliver it to another server.)&lt;br /&gt;
&lt;br /&gt;
=== Receiving email ===&lt;br /&gt;
&lt;br /&gt;
RT installs a command called &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; that receives an email on standard input and posts it to RT’s REST web interface, where it gets saved in the database and added to a ticket. You need to arrange for a way to send incoming email to this command.&lt;br /&gt;
&lt;br /&gt;
The most common setup is to have an MTA on the same box as RT receive email directly, and then set up mail aliases that call this command when mail comes in. Example &amp;lt;code&amp;gt;/etc/aliases&amp;lt;/code&amp;gt; entries look like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rt: &amp;quot;|/opt/rt5/bin/rt-mailgate --queue general --action correspond --url https://rt.yourdomain.example.com/&amp;quot;&lt;br /&gt;
rt-comment: &amp;quot;|/opt/rt5/bin/rt-mailgate --queue general --action comment --url https://rt.yourdomain.example.com/&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
This works well because, again, you’re probably running an MTA anyway; and the MTA can hold and queue mail if it comes in while RT is down for any reason, giving you a buffer against downtime.&lt;br /&gt;
&lt;br /&gt;
Another common option is to periodically run a tool that fetches mail using a protocol like IMAP, like fetchmail or getmail, and passes it on to &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt;. This is less common because it requires setting up another tool to run, and securely storing another set of mail server credentials. But it is useful when local policy prevents the RT server from receiving email directly.&lt;br /&gt;
&lt;br /&gt;
This is much less common, but it might help to know that &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; doesn’t have to run on the same system as RT itself. It just needs to be able to connect to RT’s web interface. If you don’t have any other options, you can install the RT software on a different system that receives email, and configure &#039;&#039;that&#039;&#039; system to run &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; and pass it on to the RT server. To do that, just repeat the installation instructions above, skipping the steps about installing the database and web server.&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s background jobs ==&lt;br /&gt;
&lt;br /&gt;
Create a file &amp;lt;code&amp;gt;/etc/cron.d/rt&amp;lt;/code&amp;gt; with the following content. You may edit all of the time fields as you see fit. Refer to the crontab(5) man page for details about their definitions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Update the fulltext index with new ticket data&lt;br /&gt;
*/3 *   *   *   *   root    /opt/rt5/sbin/rt-fulltext-indexer&lt;br /&gt;
# Email out dashboards that users have subscribed to&lt;br /&gt;
0   *   *   *   *   root    /opt/rt5/sbin/rt-email-dashboards&lt;br /&gt;
# Clean old sessions from the database&lt;br /&gt;
10  3   *   *   *   root    /opt/rt5/sbin/rt-clean-sessions --older 8d&lt;br /&gt;
# Email out weekly digests for users who have requested it&lt;br /&gt;
50  4   *   *   Mon root    /opt/rt5/sbin/rt-email-digest -m weekly&lt;br /&gt;
# Email out daily digests for users who have requested it&lt;br /&gt;
50  5   *   *   *   root    /opt/rt5/sbin/rt-email-digest -m daily&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
You can run all these jobs as the same user that runs your web server, rather than root. Run:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo sed -i &#039;s/\broot\b/www-data/&#039; /etc/cron.d/rt&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo sed -i &#039;s/\broot\b/apache/&#039; /etc/cron.d/rt&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Set up RT ==&lt;br /&gt;
&lt;br /&gt;
If you’ve gotten this far, congratulations, your RT install is really done now. You can start setting up RT with users, groups, queues, and business logic. [[Main Page|Head back to the main page]] to start exploring those topics.&lt;/div&gt;</summary>
		<author><name>Brett</name></author>
	</entry>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=ManualInstallation&amp;diff=27038</id>
		<title>ManualInstallation</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=ManualInstallation&amp;diff=27038"/>
		<updated>2021-12-06T22:52:15Z</updated>

		<summary type="html">&lt;p&gt;Brett: add a section about enabling PostgreSQL password auth&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Prev: [[ManualRequirements]] — Up: [[UserManual]] — Next: [[ManualApacheConfig]]&lt;br /&gt;
&lt;br /&gt;
This guide walks you through installing RT from source on a modern, popular Linux distro. Specifically, that means a distribution based on Debian or Red Hat that’s been released since around 2020.&lt;br /&gt;
&lt;br /&gt;
This guide assumes:&lt;br /&gt;
&lt;br /&gt;
* You can install packages generally available in Debian/Ubuntu or Red Hat/Fedora/CentOS.&lt;br /&gt;
* You want to install RT, and all of its Perl dependencies, from source to get the latest versions. (This is a trade-off. It means the boundaries of your install will be very clear, but you won’t get security updates for RT or Perl modules from your distribution.)&lt;br /&gt;
* You are willing to install a couple of extra tools to manage the RT installation similarly to how you would in other packaging systems (like PyPI, npm, etc.).&lt;br /&gt;
* You are willing to do a relatively maximal install of RT, enabling all the options during installation and then setting what you need in the configuration. (You could save a little space and time by being pickier about your options, but then that complicates the guide and makes it harder to turn those options on later if you want.)&lt;br /&gt;
* You are using a regular user account on the Linux system that can get superuser privileges with sudo.&lt;br /&gt;
&lt;br /&gt;
== Install the base dependencies ==&lt;br /&gt;
&lt;br /&gt;
These are required by RT, either to run or to install the dependencies.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install autoconf build-essential curl libexpat-dev libgd-dev libssl-dev libz-dev gnupg graphviz perl w3m&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install patch tar which gcc gcc-c++ perl-core perl-ExtUtils-MakeMaker graphviz expat-devel gd-devel openssl-devel w3m&lt;br /&gt;
sudo setenforce 0&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
(Turning off SELinux enforcement is required on Red Hat-based distributions because, as of October 2021, nobody has written a policy for RT.)&lt;br /&gt;
&lt;br /&gt;
== Install a database ==&lt;br /&gt;
&lt;br /&gt;
You need access to a database server. It can be remote, or you can install a database server alongside RT. RT supports a few different databases, but the best supported options are PostgreSQL and MariaDB.&lt;br /&gt;
&lt;br /&gt;
=== Installing and configuring the PostgreSQL server ===&lt;br /&gt;
&lt;br /&gt;
If you want to install a fresh PostgreSQL database server alongside RT:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install postgresql&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install postgresql-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In order to set up RT’s database, you will need a PostgreSQL superuser account that can be authenticated with a password. If you don’t have that, you can create it by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo createuser -sP rt_admin&amp;lt;/pre&amp;gt;&lt;br /&gt;
Set the password when prompted. Record this; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
=== Enable password authentication in PostgreSQL ===&lt;br /&gt;
&lt;br /&gt;
You need to consider this step whether you install the database locally, or use an existing one already running. RT supports connecting to PostgreSQL a few different ways, but authenticating with a username and password is simplest, and this guide is written based on that. Not all PostgreSQL installations allow this authentication method by default. You need to review your &amp;lt;code&amp;gt;pg_hba.conf&amp;lt;/code&amp;gt; file located at:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;/etc/postgresql/VERSION/main/pg_hba.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;/var/lib/pgsql/VERSION/data/pg_hba.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Replace &amp;lt;code&amp;gt;VERSION&amp;lt;/code&amp;gt; with the version of your PostgreSQL database. Add these two lines &#039;&#039;&#039;above&#039;&#039;&#039; any other lines that start with &amp;lt;code&amp;gt;host&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;host  rt5  rt_user   all  md5&lt;br /&gt;
host  rt5  rt_admin  all  md5&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This configuration will let &amp;lt;code&amp;gt;rt_user&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;rt_admin&amp;lt;/code&amp;gt; authorize themselves for the &amp;lt;code&amp;gt;rt5&amp;lt;/code&amp;gt; database using an &amp;lt;code&amp;gt;md5&amp;lt;/code&amp;gt; crypted password over a network connection (possibly using the localhost loopback network). You might be able to further restrict some of these fields for improved security, but doing so is outside the scope of this install guide. Refer to [https://www.postgresql.org/docs/current/auth-pg-hba-conf.html the pg_hba.conf documentation] for more details.&lt;br /&gt;
&lt;br /&gt;
Save your changes and reload the database:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo systemctl reload postgresql&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Installing the PostgreSQL client libraries ===&lt;br /&gt;
&lt;br /&gt;
These are required for RT to be able to talk to any PostgreSQL server.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install libpq-dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install postgresql-devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Once this is done you can skip ahead to installing a web server.&lt;br /&gt;
&lt;br /&gt;
=== Installing and configuring the MariaDB server ===&lt;br /&gt;
&lt;br /&gt;
If you want to install a fresh MariaDB database server alongside RT:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install mariadb-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install mariadb-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In order to set up RT’s database, you will need a MySQL superuser account. To stay consistent with PostgreSQL, I suggest setting a password for it. You can do that by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo mysql&lt;br /&gt;
mysql# GRANT ALL PRIVELEGES WITH GRANT OPTION ON rt5 TO rt_admin@localhost IDENTIFIED BY &#039;YourPassphraseHere&#039;;&amp;lt;/pre&amp;gt;&lt;br /&gt;
Record your passphrase; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
=== Adjust MariaDB’s max_allowed_packet setting ===&lt;br /&gt;
&lt;br /&gt;
You need to consider this step whether you install the database locally, or use an existing one already running. [https://mariadb.com/kb/en/server-system-variables/#max_allowed_packet MariaDB’s &amp;lt;code&amp;gt;max_allowed_packet&amp;lt;/code&amp;gt; setting] functionally limits the size of attachments in RT. The default is 16MiB, which is too small for most installations. You can ultimately choose any setting you’re comfortable with; 64MiB here should allow most requests without being too open.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;echo -e &#039;[client-server]\nmax_allowed_packet=64M\n&#039; | sudo tee /etc/mysql/conf.d/max_allowed_packet.cnf&lt;br /&gt;
sudo systemctl reload mariadb&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;echo -e &#039;[client-server]\nmax_allowed_packet=64M\n&#039; | sudo tee /etc/my.cnf.d/max_allowed_packet.cnf&lt;br /&gt;
sudo systemctl reload mariadb&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Installing the MariaDB client libraries ===&lt;br /&gt;
&lt;br /&gt;
These are required for RT to be able to talk to any MariaDB server.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install libmariadb-dev libmariadb-dev-compat&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install mariadb-devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Install a web server with FastCGI ==&lt;br /&gt;
&lt;br /&gt;
FastCGI is the best way to host RT’s web interface today. Installing the web server before RT makes the installation process simpler, because RT will be able to automatically some details about your web server like what user it runs as.&lt;br /&gt;
&lt;br /&gt;
=== Installing Apache ===&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install apache2 libapache2-mod-fcgid&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install httpd mod_fcgid mod_ssl&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ### Installing nginx --&amp;gt;&lt;br /&gt;
== Install Perl packaging tools: App::cpanminus and App::Virtualenv ==&lt;br /&gt;
&lt;br /&gt;
App::cpanminus is a tool for installing and managing Perl modules from the popular CPAN repository. It does a lot of the same tasks, and follows a lot of the same UI conventions, as &amp;lt;code&amp;gt;pip&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;gem&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;npm&amp;lt;/code&amp;gt;, and similar tools. You can install it from your distribution:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install cpanminus&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install perl-App-cpanminus&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If your system doesn’t have a cpanminus package available, you can install it from source following the [https://metacpan.org/pod/App::cpanminus#INSTALLATION project instructions].&lt;br /&gt;
&lt;br /&gt;
App::Virtualenv is a tool to create a dedicated space where you install and manage a self-contained set of Perl modules. (If you’re familiar with Python virtual environments, the concept is the same and App::Virtualenv follows a lot of the same usage patterns.) Using it helps avoid situations where changes to distribution packages might potentially break RT. This guide will illustrate creating and using a virtual environment for RT in &amp;lt;code&amp;gt;/opt/rt5venv&amp;lt;/code&amp;gt;, but you can choose another location if you like.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cpanm --sudo App::Virtualenv&lt;br /&gt;
sudo virtualenv.pl --create --empty /opt/rt5venv&amp;lt;/pre&amp;gt;&lt;br /&gt;
Now whenever you want to work on RT (by installing it, upgrading dependencies, installing new extensions, etc.), you need to activate the virtualenv in your shell. This sets various environment variables that your shell uses to work on Perl modules in the right place. You activate the virtualenv by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;. /opt/rt5venv/bin/activate&amp;lt;/pre&amp;gt;&lt;br /&gt;
== Install RT ==&lt;br /&gt;
&lt;br /&gt;
=== Get and unpack the RT source code ===&lt;br /&gt;
&lt;br /&gt;
Download the latest source code using the link on the [https://bestpractical.com/download-page RT download page], extract it using &amp;lt;code&amp;gt;tar -xf&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt; into the source code directory to run the rest of the commands in this section. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;curl -O https://download.bestpractical.com/pub/rt/release/rt-5.0.2.tar.gz&lt;br /&gt;
tar -xf rt-5.0.2.tar.gz&lt;br /&gt;
cd rt-5.0.2&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Pre-configure RT ===&lt;br /&gt;
&lt;br /&gt;
This command will detect some information about your system in order to install RT properly, and decide which set of dependencies to install. Here’s what the different parts of our command are doing:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;PERL=/opt/rt5venv/bin/perl&amp;lt;/code&amp;gt; ensures RT uses the virtualenv you set up.&lt;br /&gt;
* &amp;lt;code&amp;gt;--with-db-type=TYPE&amp;lt;/code&amp;gt; - Replace &amp;lt;code&amp;gt;TYPE&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;Pg&amp;lt;/code&amp;gt; for PostgreSQL, or &amp;lt;code&amp;gt;mysql&amp;lt;/code&amp;gt; for MariaDB.&lt;br /&gt;
* &amp;lt;code&amp;gt;--prefix=/opt/rt5&amp;lt;/code&amp;gt; sets the directory where RT will install all of its libraries, tools, and supporting files. You can choose another path if you like.&lt;br /&gt;
* The rest of the options tell RT to install additional dependencies for optional features.&lt;br /&gt;
&lt;br /&gt;
Make sure you have &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt;ed into the RT source directory, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;PERL=/opt/rt5venv/bin/perl ./configure --with-db-type=TYPE --prefix=/opt/rt5 --with-attachment-store=disk --enable-externalauth --enable-gd --enable-graphviz --enable-gpg --enable-smime&amp;lt;/pre&amp;gt;&lt;br /&gt;
For more background, [https://docs.bestpractical.com/rt/latest/configure.html refer to the RT configure options documentation].&lt;br /&gt;
&lt;br /&gt;
=== Install RT and its Perl dependencies ===&lt;br /&gt;
&lt;br /&gt;
This command will download, build, and install all of the Perl modules necessary to run RT with the configuration you set above. Here’s what the different parts of the command are doing:&lt;br /&gt;
&lt;br /&gt;
* First we make sure the virtualenv is activated in our shell, so dependencies are installed there.&lt;br /&gt;
* &amp;lt;code&amp;gt;fixdeps&amp;lt;/code&amp;gt; is RT’s command to install dependencies.&lt;br /&gt;
* &amp;lt;code&amp;gt;install&amp;lt;/code&amp;gt; installs all of RT’s files under &amp;lt;code&amp;gt;/opt/rt5&amp;lt;/code&amp;gt; (or the prefix directory you set in the previous step). It will only run if &amp;lt;code&amp;gt;fixdeps&amp;lt;/code&amp;gt; succeeds.&lt;br /&gt;
* &amp;lt;code&amp;gt;RT_FIX_DEPS_CMD=&#039;cpanm --sudo --quiet&#039;&amp;lt;/code&amp;gt; tells RT to use cpanminus to install dependencies (instead of the older, default &amp;lt;code&amp;gt;cpan&amp;lt;/code&amp;gt; command).&lt;br /&gt;
&lt;br /&gt;
Make sure you have &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt;ed into the RT source directory, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;. /opt/rt5venv/bin/activate&lt;br /&gt;
make fixdeps RT_FIX_DEPS_CMD=&#039;cpanm --sudo --quiet&#039;&lt;br /&gt;
sudo make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
If it works, the command will eventually output a message that says “Congratulations. RT is now installed.” followed by instructions about configuring and setting up the database. We’ll do that next.&lt;br /&gt;
&lt;br /&gt;
=== Configure RT ===&lt;br /&gt;
&lt;br /&gt;
[https://docs.bestpractical.com/rt/latest/RT_Config.html RT has many configuration options.] You can put configuration options in the file &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/code&amp;gt;, or in individual files under &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.d/&amp;lt;/code&amp;gt;. Use an editor to save all the text below to &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/code&amp;gt; (you can just overwrite the existing file, or add this to the bottom of what’s there) and then fill in settings for your site everywhere the text &amp;lt;code&amp;gt;EDIT WITH&amp;lt;/code&amp;gt; appears.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Single-quote all values EXCEPT the special value `undef`&lt;br /&gt;
# that turns off a setting.&lt;br /&gt;
&lt;br /&gt;
# rtname appears in ticket email subjects. It needs to be globally unique,&lt;br /&gt;
# so use your organization&#039;s domain name.&lt;br /&gt;
Set($rtname, &#039;EDIT WITH yourdomain.example.com&#039;);&lt;br /&gt;
# Organization is used in the database for ticket links, etc. It also needs to&lt;br /&gt;
# be globally unique, so use your organization&#039;s domain name.&lt;br /&gt;
Set($Organization, &#039;EDIT WITH yourdomain.example.com&#039;);&lt;br /&gt;
# WebDomain is domain name of the RT web server. RT uses it to construct links&lt;br /&gt;
# and defend against CSRFs.&lt;br /&gt;
Set($WebDomain, &#039;EDIT WITH rt.yourdomain.example.com&#039;);&lt;br /&gt;
# WebPort is the port where the RT web server runs. Edit the number below if&lt;br /&gt;
# you&#039;re not using the standard HTTPS port.&lt;br /&gt;
Set($WebPort, &#039;443&#039;);&lt;br /&gt;
&lt;br /&gt;
# DatabaseUser is the name of the database account RT uses to read and store&lt;br /&gt;
# data. &#039;rt_user&#039; is the default but you can change it if you like.&lt;br /&gt;
# DO NOT use the &#039;rt_admin&#039; superuser created in the instructions above.&lt;br /&gt;
Set($DatabaseUser, &#039;rt_user&#039;);&lt;br /&gt;
# DatabasePassword is the password for DatabaseUser.&lt;br /&gt;
Set($DatabasePassword, &#039;EDIT WITH SomePassphraseHere&#039;);&lt;br /&gt;
# DatabaseHost is the hostname of the database server RT should use.&lt;br /&gt;
# Change &#039;localhost&#039; if it lives on a different server.&lt;br /&gt;
Set($DatabaseHost, &#039;localhost&#039;);&lt;br /&gt;
# DatabasePort is the port number of the database server RT should use.&lt;br /&gt;
# `undef` means the default for that database. Change it if you&#039;re not&lt;br /&gt;
# using the standard port.&lt;br /&gt;
Set($DatabasePort, undef);&lt;br /&gt;
# DatabaseName is the name of RT&#039;s database hosted on DatabaseHost.&lt;br /&gt;
# &#039;rt5&#039; is the default but you can change it if you like.&lt;br /&gt;
Set($DatabaseName, &#039;rt5&#039;);&lt;br /&gt;
&lt;br /&gt;
# RT can log to syslog, stderr, and/or a dedicated file. For a modern install,&lt;br /&gt;
# I recommend logging to syslog, so it goes to journald where it&#039;s easy to&lt;br /&gt;
# query and automatically gets rotated. You set both these paramaters to a&lt;br /&gt;
# standard log level: &#039;debug&#039;, &#039;info&#039;, &#039;notice&#039;, &#039;warning&#039;, &#039;error&#039;,&lt;br /&gt;
# &#039;critical&#039;, &#039;alert&#039;, or &#039;emergency&#039;.&lt;br /&gt;
Set($LogToSyslog, &#039;info&#039;);&lt;br /&gt;
Set($LogToSTDERR, undef);&lt;br /&gt;
&lt;br /&gt;
# Turn off optional features that require additional configuration.&lt;br /&gt;
# If you want to use these, refer to the RT_Config documentation for&lt;br /&gt;
# instructions on how to set them up.&lt;br /&gt;
Set(%GnuPG, &#039;Enable&#039; =&amp;gt; &#039;0&#039;);&lt;br /&gt;
Set(%SMIME, &#039;Enable&#039; =&amp;gt; &#039;0&#039;);&lt;br /&gt;
&lt;br /&gt;
# Perl expects to find this 1 at the end of the file.&lt;br /&gt;
1;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;RT_SiteConfig.pm&amp;lt;/code&amp;gt; is actually Perl code. RT runs the code directly to load the configuration. Any time you finish editing it, you can check that you didn’t make any syntax errors by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;perl -c /opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Set up RT’s database ===&lt;br /&gt;
&lt;br /&gt;
RT includes a tool to help you set up its database. By default, it connects to the database as an administrator to create the database and user that you configured in the previous step.&lt;br /&gt;
&lt;br /&gt;
(The instructions from &amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt; and RT’s README file tell you to run &amp;lt;code&amp;gt;make initialize-database&amp;lt;/code&amp;gt;. That just runs &amp;lt;code&amp;gt;rt-setup-database&amp;lt;/code&amp;gt; for you. Running the tool directly makes it easier to pass the options you need.)&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;--action=init&amp;lt;/code&amp;gt; tells the tool to create the user, the database, the tables inside it, and insert core data RT needs to function.&lt;br /&gt;
* &amp;lt;code&amp;gt;--dba=rt_admin&amp;lt;/code&amp;gt; provides the username of the administrator account to use to do the setup. &amp;lt;code&amp;gt;rt_admin&amp;lt;/code&amp;gt; is the name we used earlier to set up a new database server. You can specify a different value if your database has a different adminsitrator account.&lt;br /&gt;
* &#039;&#039;&#039;If&#039;&#039;&#039; you are using an existing database server and the database adminstrator has already created the user account and database for RT, then you can add the &amp;lt;code&amp;gt;--skip-create&amp;lt;/code&amp;gt; option.&lt;br /&gt;
* &#039;&#039;&#039;If&#039;&#039;&#039; you have a less common database setup, this tool has additional options to give you finer-grained control over what steps are run and how. Refer to [https://docs.bestpractical.com/rt/latest/rt-setup-database.html the full rt-setup-database documentation] to learn more about those.&lt;br /&gt;
* The command reads files from RT’s &amp;lt;code&amp;gt;etc/&amp;lt;/code&amp;gt; directory by default, so the easiest way to run it is to &amp;lt;code&amp;gt;cd /opt/rt5&amp;lt;/code&amp;gt; first, and then it will find the necessary files automatically.&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /opt/rt5&lt;br /&gt;
sudo sbin/rt-setup-database --action=init --dba=rt_admin&amp;lt;/pre&amp;gt;&lt;br /&gt;
Enter the password for your database administrator account when prompted.&lt;br /&gt;
&lt;br /&gt;
=== Set up fulltext indexing ===&lt;br /&gt;
&lt;br /&gt;
Fulltext indexing speeds up searches for ticket content, which makes RT a lot nicer to use.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;--noask&amp;lt;/code&amp;gt; uses the default names for the index, which will be fine for a new install and simplifies the setup.&lt;br /&gt;
* &amp;lt;code&amp;gt;--dba=rt_admin&amp;lt;/code&amp;gt; provides the username of the administrator account to use to do the setup. &amp;lt;code&amp;gt;rt_admin&amp;lt;/code&amp;gt; is the name we used earlier to set up a new database server. You can specify a different value if your database has a different adminsitrator account.&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo /opt/rt5/sbin/rt-setup-fulltext-index --noask --dba=rt_admin&amp;lt;/pre&amp;gt;&lt;br /&gt;
Enter the password for your database administrator account when prompted. The end of the process will output some RT configuration that looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Set( %FullTextSearch,&lt;br /&gt;
    Enable     =&amp;gt; 1,&lt;br /&gt;
    Indexed    =&amp;gt; 1,&lt;br /&gt;
    # Additional output from rt-setup-fulltext-index should be here.&lt;br /&gt;
    # The configuration varies by database type.&lt;br /&gt;
);&amp;lt;/pre&amp;gt;&lt;br /&gt;
Copy that output and save it to the file &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.d/FulltextIndex.pm&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Set permissions ===&lt;br /&gt;
&lt;br /&gt;
All of RT’s configuration files should be readable by the user that runs the web server, and no other users, in order to protect sensitive information like the database password. RT provides a command to set permissions appropriately according to your distribution and configuration. &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt; to the directory where you extracted the RT source code, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd rt-5.0.2&lt;br /&gt;
sudo make fixperms&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Verify the installation ===&lt;br /&gt;
&lt;br /&gt;
If everything has gone well, then you should be able to set a password for RT’s &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; user. You’ll use this later to log in to the web interface and continue setting up your system. Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo /opt/rt5/sbin/rt-passwd root&amp;lt;/pre&amp;gt;&lt;br /&gt;
Set the password when prompted. Record this; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s web server ==&lt;br /&gt;
&lt;br /&gt;
=== Configure Apache modules ===&lt;br /&gt;
&lt;br /&gt;
You will need to have the following modules enabled in Apache to run RT. You should already have these installed if you followed the instructions above.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;alias&amp;lt;/code&amp;gt; (required to map URLs to RT)&lt;br /&gt;
* &amp;lt;code&amp;gt;fcgid&amp;lt;/code&amp;gt; (required for Apache to talk to RT)&lt;br /&gt;
* &amp;lt;code&amp;gt;mpm_prefork&amp;lt;/code&amp;gt; (Apache requires you to select an MPM. RT is designed to work with the prefork module.)&lt;br /&gt;
* &amp;lt;code&amp;gt;ssl&amp;lt;/code&amp;gt; (required to serve HTTPS; optional otherwise)&lt;br /&gt;
&lt;br /&gt;
Enable them following these instructions:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo a2dismod mpm_event&lt;br /&gt;
sudo a2enmod fcgid&lt;br /&gt;
sudo a2enmod mpm_prefork&lt;br /&gt;
sudo a2enmod ssl&amp;lt;/pre&amp;gt;&lt;br /&gt;
| &amp;lt;pre&amp;gt;echo LoadModule mpm_prefork_module modules/mod_mpm_prefork.so | sudo tee /etc/httpd/conf.modules.d/00-mpm.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Configure an Apache VirtualHost ===&lt;br /&gt;
&lt;br /&gt;
Create a file at the following location. You can change the &amp;lt;code&amp;gt;RT&amp;lt;/code&amp;gt; part of the filename if you like, but the file must exist in this directory and have a &amp;lt;code&amp;gt;.conf&amp;lt;/code&amp;gt; suffix.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;/etc/apache2/sites-available/RT.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
Then after you create the file, run: &amp;lt;code&amp;gt;sudo a2ensite RT&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;/etc/httpd/conf.d/RT.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Use an editor to save all the text below to the new &amp;lt;code&amp;gt;RT.conf&amp;lt;/code&amp;gt; and then fill in settings for your site everywhere the text &amp;lt;code&amp;gt;EDIT WITH&amp;lt;/code&amp;gt; appears.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### Server-level settings&lt;br /&gt;
# These settings affect all of Apache. It is okay to put them here if Apache&lt;br /&gt;
# only hosts RT. If you are hosting other sites in the same Apache instance,&lt;br /&gt;
# you may need to put these settings in another file like&lt;br /&gt;
# (Debian/Ubuntu) /etc/apache2/conf-available/RT.conf&lt;br /&gt;
# (Red Hat/Fedora/CentOS) /etc/httpd/conf.d/RTserver.conf&lt;br /&gt;
# ... and ensure they do not conflict with settings required by other sites.&lt;br /&gt;
&lt;br /&gt;
# mod_fcgid only allows 128KiB requests by default. This is too small for users&lt;br /&gt;
# to upload files to RT. You can ultimately choose any setting you&#039;re&lt;br /&gt;
# comfortable with; 70MiB here should allow most requests without being too&lt;br /&gt;
# open.&lt;br /&gt;
FcgidMaxRequestLen 73400320&lt;br /&gt;
&lt;br /&gt;
&amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
  # Listen on the standard HTTPS port.&lt;br /&gt;
  # You can change this to a nonstandard port if you must.&lt;br /&gt;
  Listen 443&lt;br /&gt;
&amp;lt;/IfModule&amp;gt;&lt;br /&gt;
### End server-level settings&lt;br /&gt;
&lt;br /&gt;
### Primary RT VirtualHost&lt;br /&gt;
# You can change both the bind address and/or the port here as required.&lt;br /&gt;
# This default will listen for HTTPS connections on all interfaces.&lt;br /&gt;
&amp;lt;VirtualHost *:443&amp;gt;&lt;br /&gt;
  # EDIT HERE with the domain name of the web server.&lt;br /&gt;
  ServerName rt.yourdomain.example.com&lt;br /&gt;
  &amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
    SSLEngine on&lt;br /&gt;
    # These specify the paths to the SSL certificate and private key Apache&lt;br /&gt;
    # should use. These example paths are common for Let&#039;s Encrypt. If you&lt;br /&gt;
    # don&#039;t use Let&#039;s Encrypt, the standard location for these files is under&lt;br /&gt;
    # (Debian/Ubuntu) /etc/ssl&lt;br /&gt;
    # (Red Hat/Fedora/CentOS) /etc/pki/tls&lt;br /&gt;
    # EDIT HERE with the appropriate paths for your server&lt;br /&gt;
    SSLCertificateFile /etc/letsencrypt/live/example.com/fullchain.pem&lt;br /&gt;
    SSLCertificateKeyFile /etc/letsencrypt/live/example.com/privkey.pem&lt;br /&gt;
  &amp;lt;/IfModule&amp;gt;&lt;br /&gt;
  &amp;lt;Location /&amp;gt;&lt;br /&gt;
    Require all granted&lt;br /&gt;
    Options +ExecCGI&lt;br /&gt;
    AddHandler fcgid-script fcgi&lt;br /&gt;
  &amp;lt;/Location&amp;gt;&lt;br /&gt;
  AddDefaultCharset UTF-8&lt;br /&gt;
  DocumentRoot /opt/rt5/share/html&lt;br /&gt;
  ScriptAlias / /opt/rt5/sbin/rt-server.fcgi/&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
### End primary RT VirtualHost&lt;br /&gt;
&lt;br /&gt;
### Optional HTTPS Redirect VirtualHost&lt;br /&gt;
# Most modern servers support HTTPS and want all web traffic to go through it.&lt;br /&gt;
# This VirtualHost redirects normal HTTP traffic to HTTPS.&lt;br /&gt;
# You can delete this whole section if you don&#039;t want or need this.&lt;br /&gt;
&amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
  # You can change both the bind address and/or the port here as required.&lt;br /&gt;
  # This default will listen for HTTP connections on all interfaces.&lt;br /&gt;
  &amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
    SSLEngine off&lt;br /&gt;
    # EDIT HERE both lines below with the domain name of your web server.&lt;br /&gt;
    ServerName rt.yourdomain.example.com&lt;br /&gt;
    Redirect permanent / https://rt.yourdomain.example.com/&lt;br /&gt;
  &amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/IfModule&amp;gt;&lt;br /&gt;
### End optional HTTPS Redirect VirtualHost&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
After you’ve edited the file, load the configuration with:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo systemctl reload apache2&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo systemctl reload httpd&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If this command reports an error, double-check the configuration file for typos, especially in option names, file paths, and the&lt;br /&gt;
&amp;lt;Section&amp;gt;&lt;br /&gt;
pairs. Edit again and reload the configuration until it succeeds without output.&lt;br /&gt;
&lt;br /&gt;
=== Verify the web interface ===&lt;br /&gt;
&lt;br /&gt;
You should be able to visit your web server in your browser, and be presented with RT’s login screen. You should be able to log in with username &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; and the password you set previously.&lt;br /&gt;
&lt;br /&gt;
If you run into trouble, the first place to look for more information is by reading Apache’s error log:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo less /var/log/apache2/error.log&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo less /var/log/httpd/error.log&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s mail server ==&lt;br /&gt;
&lt;br /&gt;
RT both can both send and receive ticket updates via email. Unfortunately, there are too many variables to document a useful setup process here: getting this working usually requires creating DNS records, and coordinating with existing mail servers, which will be the main constraint on your setup. Instead this guide provides a brief overview of how the integration works, and where the connection points are that you likely need to work on.&lt;br /&gt;
&lt;br /&gt;
=== Sending Mail ===&lt;br /&gt;
&lt;br /&gt;
RT only knows how to send mail by passing it off to another program on the system. It cannot connect or authenticate directly to external mail servers. In the default configuration, RT runs the standard &amp;lt;code&amp;gt;sendmail&amp;lt;/code&amp;gt; command. There are [https://docs.bestpractical.com/rt/latest/RT_Config.html#Outgoing-mail configuration options to send mail through different commands] if you need.&lt;br /&gt;
&lt;br /&gt;
The most common setup is to install and configure a proper Mail Transfer Agent (MTA) like Postfix or Exim, and then configure it to send mail to the wider Internet as you need. This works well because the MTAs are robust and well-tested; they have flexible configuration to let you send mail out by relaying to other mail servers you specify with optional authentication; and most distributions install one by default anyway. The only hard part is configuring the MTA to send mail following your site’s policies.&lt;br /&gt;
&lt;br /&gt;
Other software is available that provides a slimmer version of the &amp;lt;code&amp;gt;sendmail&amp;lt;/code&amp;gt; command that connects to an external mail server for you, like ssmtp. These programs are usually easier to configure than an MTA, but they often lose email permanently if they can’t connect to the external server at the time it’s sent. (MTAs keep email queued locally until they successfully deliver it to another server.)&lt;br /&gt;
&lt;br /&gt;
=== Receiving email ===&lt;br /&gt;
&lt;br /&gt;
RT installs a command called &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; that receives an email on standard input and posts it to RT’s REST web interface, where it gets saved in the database and added to a ticket. You need to arrange for a way to send incoming email to this command.&lt;br /&gt;
&lt;br /&gt;
The most common setup is to have an MTA on the same box as RT receive email directly, and then set up mail aliases that call this command when mail comes in. Example &amp;lt;code&amp;gt;/etc/aliases&amp;lt;/code&amp;gt; entries look like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rt: &amp;quot;|/opt/rt5/bin/rt-mailgate --queue general --action correspond --url https://rt.yourdomain.example.com/&amp;quot;&lt;br /&gt;
rt-comment: &amp;quot;|/opt/rt5/bin/rt-mailgate --queue general --action comment --url https://rt.yourdomain.example.com/&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
This works well because, again, you’re probably running an MTA anyway; and the MTA can hold and queue mail if it comes in while RT is down for any reason, giving you a buffer against downtime.&lt;br /&gt;
&lt;br /&gt;
Another common option is to periodically run a tool that fetches mail using a protocol like IMAP, like fetchmail or getmail, and passes it on to &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt;. This is less common because it requires setting up another tool to run, and securely storing another set of mail server credentials. But it is useful when local policy prevents the RT server from receiving email directly.&lt;br /&gt;
&lt;br /&gt;
This is much less common, but it might help to know that &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; doesn’t have to run on the same system as RT itself. It just needs to be able to connect to RT’s web interface. If you don’t have any other options, you can install the RT software on a different system that receives email, and configure &#039;&#039;that&#039;&#039; system to run &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; and pass it on to the RT server. To do that, just repeat the installation instructions above, skipping the steps about installing the database and web server.&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s background jobs ==&lt;br /&gt;
&lt;br /&gt;
Create a file &amp;lt;code&amp;gt;/etc/cron.d/rt&amp;lt;/code&amp;gt; with the following content. You may edit all of the time fields as you see fit. Refer to the crontab(5) man page for details about their definitions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Update the fulltext index with new ticket data&lt;br /&gt;
*/3 *   *   *   *   root    /opt/rt5/sbin/rt-fulltext-indexer&lt;br /&gt;
# Email out dashboards that users have subscribed to&lt;br /&gt;
0   *   *   *   *   root    /opt/rt5/sbin/rt-email-dashboards&lt;br /&gt;
# Clean old sessions from the database&lt;br /&gt;
10  3   *   *   *   root    /opt/rt5/sbin/rt-clean-sessions --older 8d&lt;br /&gt;
# Email out weekly digests for users who have requested it&lt;br /&gt;
50  4   *   *   Mon root    /opt/rt5/sbin/rt-email-digest -m weekly&lt;br /&gt;
# Email out daily digests for users who have requested it&lt;br /&gt;
50  5   *   *   *   root    /opt/rt5/sbin/rt-email-digest -m daily&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
You can run all these jobs as the same user that runs your web server, rather than root. Run:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo sed -i &#039;s/\broot\b/www-data/&#039; /etc/cron.d/rt&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo sed -i &#039;s/\broot\b/apache/&#039; /etc/cron.d/rt&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Set up RT ==&lt;br /&gt;
&lt;br /&gt;
If you’ve gotten this far, congratulations, your RT install is really done now. You can start setting up RT with users, groups, queues, and business logic. [[Main Page|Head back to the main page]] to start exploring those topics.&lt;/div&gt;</summary>
		<author><name>Brett</name></author>
	</entry>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=ManualInstallation&amp;diff=27037</id>
		<title>ManualInstallation</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=ManualInstallation&amp;diff=27037"/>
		<updated>2021-11-30T15:42:31Z</updated>

		<summary type="html">&lt;p&gt;Brett: remove the deprecated SSLCertificateChainFile&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Prev: [[ManualRequirements]] — Up: [[UserManual]] — Next: [[ManualApacheConfig]]&lt;br /&gt;
&lt;br /&gt;
This guide walks you through installing RT from source on a modern, popular Linux distro. Specifically, that means a distribution based on Debian or Red Hat that’s been released since around 2020.&lt;br /&gt;
&lt;br /&gt;
This guide assumes:&lt;br /&gt;
&lt;br /&gt;
* You can install packages generally available in Debian/Ubuntu or Red Hat/Fedora/CentOS.&lt;br /&gt;
* You want to install RT, and all of its Perl dependencies, from source to get the latest versions. (This is a trade-off. It means the boundaries of your install will be very clear, but you won’t get security updates for RT or Perl modules from your distribution.)&lt;br /&gt;
* You are willing to install a couple of extra tools to manage the RT installation similarly to how you would in other packaging systems (like PyPI, npm, etc.).&lt;br /&gt;
* You are willing to do a relatively maximal install of RT, enabling all the options during installation and then setting what you need in the configuration. (You could save a little space and time by being pickier about your options, but then that complicates the guide and makes it harder to turn those options on later if you want.)&lt;br /&gt;
* You are using a regular user account on the Linux system that can get superuser privileges with sudo.&lt;br /&gt;
&lt;br /&gt;
== Install the base dependencies ==&lt;br /&gt;
&lt;br /&gt;
These are required by RT, either to run or to install the dependencies.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install autoconf build-essential curl libexpat-dev libgd-dev libssl-dev libz-dev gnupg graphviz perl w3m&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install patch tar which gcc gcc-c++ perl-core perl-ExtUtils-MakeMaker graphviz expat-devel gd-devel openssl-devel w3m&lt;br /&gt;
sudo setenforce 0&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
(Turning off SELinux enforcement is required on Red Hat-based distributions because, as of October 2021, nobody has written a policy for RT.)&lt;br /&gt;
&lt;br /&gt;
== Install a database ==&lt;br /&gt;
&lt;br /&gt;
You need access to a database server. It can be remote, or you can install a database server alongside RT. RT supports a few different databases, but the best supported options are PostgreSQL and MariaDB.&lt;br /&gt;
&lt;br /&gt;
=== Installing and configuring the PostgreSQL server ===&lt;br /&gt;
&lt;br /&gt;
If you want to install a fresh PostgreSQL database server alongside RT:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install postgresql&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install postgresql-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In order to set up RT’s database, you will need a PostgreSQL superuser account that can be authenticated with a password. If you don’t have that, you can create it by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo createuser -sP rt_admin&amp;lt;/pre&amp;gt;&lt;br /&gt;
Set the password when prompted. Record this; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
=== Installing the PostgreSQL client libraries ===&lt;br /&gt;
&lt;br /&gt;
These are required for RT to be able to talk to any PostgreSQL server.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install libpq-dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install postgresql-devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Once this is done you can skip ahead to installing a web server.&lt;br /&gt;
&lt;br /&gt;
=== Installing and configuring the MariaDB server ===&lt;br /&gt;
&lt;br /&gt;
If you want to install a fresh MariaDB database server alongside RT:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install mariadb-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install mariadb-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In order to set up RT’s database, you will need a MySQL superuser account. To stay consistent with PostgreSQL, I suggest setting a password for it. You can do that by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo mysql&lt;br /&gt;
mysql# GRANT ALL PRIVELEGES WITH GRANT OPTION ON rt5 TO rt_admin@localhost IDENTIFIED BY &#039;YourPassphraseHere&#039;;&amp;lt;/pre&amp;gt;&lt;br /&gt;
Record your passphrase; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
=== Adjust MariaDB’s max_allowed_packet setting ===&lt;br /&gt;
&lt;br /&gt;
You need to consider this step whether you install the database locally, or use an existing one already running. [https://mariadb.com/kb/en/server-system-variables/#max_allowed_packet MariaDB’s &amp;lt;code&amp;gt;max_allowed_packet&amp;lt;/code&amp;gt; setting] functionally limits the size of attachments in RT. The default is 16MiB, which is too small for most installations. You can ultimately choose any setting you’re comfortable with; 64MiB here should allow most requests without being too open.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;echo -e &#039;[client-server]\nmax_allowed_packet=64M\n&#039; | sudo tee /etc/mysql/conf.d/max_allowed_packet.cnf&lt;br /&gt;
sudo systemctl reload mariadb&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;echo -e &#039;[client-server]\nmax_allowed_packet=64M\n&#039; | sudo tee /etc/my.cnf.d/max_allowed_packet.cnf&lt;br /&gt;
sudo systemctl reload mariadb&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Installing the MariaDB client libraries ===&lt;br /&gt;
&lt;br /&gt;
These are required for RT to be able to talk to any MariaDB server.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install libmariadb-dev libmariadb-dev-compat&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install mariadb-devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Install a web server with FastCGI ==&lt;br /&gt;
&lt;br /&gt;
FastCGI is the best way to host RT’s web interface today. Installing the web server before RT makes the installation process simpler, because RT will be able to automatically some details about your web server like what user it runs as.&lt;br /&gt;
&lt;br /&gt;
=== Installing Apache ===&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install apache2 libapache2-mod-fcgid&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install httpd mod_fcgid mod_ssl&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ### Installing nginx --&amp;gt;&lt;br /&gt;
== Install Perl packaging tools: App::cpanminus and App::Virtualenv ==&lt;br /&gt;
&lt;br /&gt;
App::cpanminus is a tool for installing and managing Perl modules from the popular CPAN repository. It does a lot of the same tasks, and follows a lot of the same UI conventions, as &amp;lt;code&amp;gt;pip&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;gem&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;npm&amp;lt;/code&amp;gt;, and similar tools. You can install it from your distribution:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install cpanminus&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install perl-App-cpanminus&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If your system doesn’t have a cpanminus package available, you can install it from source following the [https://metacpan.org/pod/App::cpanminus#INSTALLATION project instructions].&lt;br /&gt;
&lt;br /&gt;
App::Virtualenv is a tool to create a dedicated space where you install and manage a self-contained set of Perl modules. (If you’re familiar with Python virtual environments, the concept is the same and App::Virtualenv follows a lot of the same usage patterns.) Using it helps avoid situations where changes to distribution packages might potentially break RT. This guide will illustrate creating and using a virtual environment for RT in &amp;lt;code&amp;gt;/opt/rt5venv&amp;lt;/code&amp;gt;, but you can choose another location if you like.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cpanm --sudo App::Virtualenv&lt;br /&gt;
sudo virtualenv.pl --create --empty /opt/rt5venv&amp;lt;/pre&amp;gt;&lt;br /&gt;
Now whenever you want to work on RT (by installing it, upgrading dependencies, installing new extensions, etc.), you need to activate the virtualenv in your shell. This sets various environment variables that your shell uses to work on Perl modules in the right place. You activate the virtualenv by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;. /opt/rt5venv/bin/activate&amp;lt;/pre&amp;gt;&lt;br /&gt;
== Install RT ==&lt;br /&gt;
&lt;br /&gt;
=== Get and unpack the RT source code ===&lt;br /&gt;
&lt;br /&gt;
Download the latest source code using the link on the [https://bestpractical.com/download-page RT download page], extract it using &amp;lt;code&amp;gt;tar -xf&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt; into the source code directory to run the rest of the commands in this section. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;curl -O https://download.bestpractical.com/pub/rt/release/rt-5.0.2.tar.gz&lt;br /&gt;
tar -xf rt-5.0.2.tar.gz&lt;br /&gt;
cd rt-5.0.2&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Pre-configure RT ===&lt;br /&gt;
&lt;br /&gt;
This command will detect some information about your system in order to install RT properly, and decide which set of dependencies to install. Here’s what the different parts of our command are doing:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;PERL=/opt/rt5venv/bin/perl&amp;lt;/code&amp;gt; ensures RT uses the virtualenv you set up.&lt;br /&gt;
* &amp;lt;code&amp;gt;--with-db-type=TYPE&amp;lt;/code&amp;gt; - Replace &amp;lt;code&amp;gt;TYPE&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;Pg&amp;lt;/code&amp;gt; for PostgreSQL, or &amp;lt;code&amp;gt;mysql&amp;lt;/code&amp;gt; for MariaDB.&lt;br /&gt;
* &amp;lt;code&amp;gt;--prefix=/opt/rt5&amp;lt;/code&amp;gt; sets the directory where RT will install all of its libraries, tools, and supporting files. You can choose another path if you like.&lt;br /&gt;
* The rest of the options tell RT to install additional dependencies for optional features.&lt;br /&gt;
&lt;br /&gt;
Make sure you have &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt;ed into the RT source directory, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;PERL=/opt/rt5venv/bin/perl ./configure --with-db-type=TYPE --prefix=/opt/rt5 --with-attachment-store=disk --enable-externalauth --enable-gd --enable-graphviz --enable-gpg --enable-smime&amp;lt;/pre&amp;gt;&lt;br /&gt;
For more background, [https://docs.bestpractical.com/rt/latest/configure.html refer to the RT configure options documentation].&lt;br /&gt;
&lt;br /&gt;
=== Install RT and its Perl dependencies ===&lt;br /&gt;
&lt;br /&gt;
This command will download, build, and install all of the Perl modules necessary to run RT with the configuration you set above. Here’s what the different parts of the command are doing:&lt;br /&gt;
&lt;br /&gt;
* First we make sure the virtualenv is activated in our shell, so dependencies are installed there.&lt;br /&gt;
* &amp;lt;code&amp;gt;fixdeps&amp;lt;/code&amp;gt; is RT’s command to install dependencies.&lt;br /&gt;
* &amp;lt;code&amp;gt;install&amp;lt;/code&amp;gt; installs all of RT’s files under &amp;lt;code&amp;gt;/opt/rt5&amp;lt;/code&amp;gt; (or the prefix directory you set in the previous step). It will only run if &amp;lt;code&amp;gt;fixdeps&amp;lt;/code&amp;gt; succeeds.&lt;br /&gt;
* &amp;lt;code&amp;gt;RT_FIX_DEPS_CMD=&#039;cpanm --sudo --quiet&#039;&amp;lt;/code&amp;gt; tells RT to use cpanminus to install dependencies (instead of the older, default &amp;lt;code&amp;gt;cpan&amp;lt;/code&amp;gt; command).&lt;br /&gt;
&lt;br /&gt;
Make sure you have &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt;ed into the RT source directory, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;. /opt/rt5venv/bin/activate&lt;br /&gt;
make fixdeps RT_FIX_DEPS_CMD=&#039;cpanm --sudo --quiet&#039;&lt;br /&gt;
sudo make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
If it works, the command will eventually output a message that says “Congratulations. RT is now installed.” followed by instructions about configuring and setting up the database. We’ll do that next.&lt;br /&gt;
&lt;br /&gt;
=== Configure RT ===&lt;br /&gt;
&lt;br /&gt;
[https://docs.bestpractical.com/rt/latest/RT_Config.html RT has many configuration options.] You can put configuration options in the file &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/code&amp;gt;, or in individual files under &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.d/&amp;lt;/code&amp;gt;. Use an editor to save all the text below to &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/code&amp;gt; (you can just overwrite the existing file, or add this to the bottom of what’s there) and then fill in settings for your site everywhere the text &amp;lt;code&amp;gt;EDIT WITH&amp;lt;/code&amp;gt; appears.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Single-quote all values EXCEPT the special value `undef`&lt;br /&gt;
# that turns off a setting.&lt;br /&gt;
&lt;br /&gt;
# rtname appears in ticket email subjects. It needs to be globally unique,&lt;br /&gt;
# so use your organization&#039;s domain name.&lt;br /&gt;
Set($rtname, &#039;EDIT WITH yourdomain.example.com&#039;);&lt;br /&gt;
# Organization is used in the database for ticket links, etc. It also needs to&lt;br /&gt;
# be globally unique, so use your organization&#039;s domain name.&lt;br /&gt;
Set($Organization, &#039;EDIT WITH yourdomain.example.com&#039;);&lt;br /&gt;
# WebDomain is domain name of the RT web server. RT uses it to construct links&lt;br /&gt;
# and defend against CSRFs.&lt;br /&gt;
Set($WebDomain, &#039;EDIT WITH rt.yourdomain.example.com&#039;);&lt;br /&gt;
# WebPort is the port where the RT web server runs. Edit the number below if&lt;br /&gt;
# you&#039;re not using the standard HTTPS port.&lt;br /&gt;
Set($WebPort, &#039;443&#039;);&lt;br /&gt;
&lt;br /&gt;
# DatabaseUser is the name of the database account RT uses to read and store&lt;br /&gt;
# data. &#039;rt_user&#039; is the default but you can change it if you like.&lt;br /&gt;
# DO NOT use the &#039;rt_admin&#039; superuser created in the instructions above.&lt;br /&gt;
Set($DatabaseUser, &#039;rt_user&#039;);&lt;br /&gt;
# DatabasePassword is the password for DatabaseUser.&lt;br /&gt;
Set($DatabasePassword, &#039;EDIT WITH SomePassphraseHere&#039;);&lt;br /&gt;
# DatabaseHost is the hostname of the database server RT should use.&lt;br /&gt;
# Change &#039;localhost&#039; if it lives on a different server.&lt;br /&gt;
Set($DatabaseHost, &#039;localhost&#039;);&lt;br /&gt;
# DatabasePort is the port number of the database server RT should use.&lt;br /&gt;
# `undef` means the default for that database. Change it if you&#039;re not&lt;br /&gt;
# using the standard port.&lt;br /&gt;
Set($DatabasePort, undef);&lt;br /&gt;
# DatabaseName is the name of RT&#039;s database hosted on DatabaseHost.&lt;br /&gt;
# &#039;rt5&#039; is the default but you can change it if you like.&lt;br /&gt;
Set($DatabaseName, &#039;rt5&#039;);&lt;br /&gt;
&lt;br /&gt;
# RT can log to syslog, stderr, and/or a dedicated file. For a modern install,&lt;br /&gt;
# I recommend logging to syslog, so it goes to journald where it&#039;s easy to&lt;br /&gt;
# query and automatically gets rotated. You set both these paramaters to a&lt;br /&gt;
# standard log level: &#039;debug&#039;, &#039;info&#039;, &#039;notice&#039;, &#039;warning&#039;, &#039;error&#039;,&lt;br /&gt;
# &#039;critical&#039;, &#039;alert&#039;, or &#039;emergency&#039;.&lt;br /&gt;
Set($LogToSyslog, &#039;info&#039;);&lt;br /&gt;
Set($LogToSTDERR, undef);&lt;br /&gt;
&lt;br /&gt;
# Turn off optional features that require additional configuration.&lt;br /&gt;
# If you want to use these, refer to the RT_Config documentation for&lt;br /&gt;
# instructions on how to set them up.&lt;br /&gt;
Set(%GnuPG, &#039;Enable&#039; =&amp;gt; &#039;0&#039;);&lt;br /&gt;
Set(%SMIME, &#039;Enable&#039; =&amp;gt; &#039;0&#039;);&lt;br /&gt;
&lt;br /&gt;
# Perl expects to find this 1 at the end of the file.&lt;br /&gt;
1;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;RT_SiteConfig.pm&amp;lt;/code&amp;gt; is actually Perl code. RT runs the code directly to load the configuration. Any time you finish editing it, you can check that you didn’t make any syntax errors by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;perl -c /opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Set up RT’s database ===&lt;br /&gt;
&lt;br /&gt;
RT includes a tool to help you set up its database. By default, it connects to the database as an administrator to create the database and user that you configured in the previous step.&lt;br /&gt;
&lt;br /&gt;
(The instructions from &amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt; and RT’s README file tell you to run &amp;lt;code&amp;gt;make initialize-database&amp;lt;/code&amp;gt;. That just runs &amp;lt;code&amp;gt;rt-setup-database&amp;lt;/code&amp;gt; for you. Running the tool directly makes it easier to pass the options you need.)&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;--action=init&amp;lt;/code&amp;gt; tells the tool to create the user, the database, the tables inside it, and insert core data RT needs to function.&lt;br /&gt;
* &amp;lt;code&amp;gt;--dba=rt_admin&amp;lt;/code&amp;gt; provides the username of the administrator account to use to do the setup. &amp;lt;code&amp;gt;rt_admin&amp;lt;/code&amp;gt; is the name we used earlier to set up a new database server. You can specify a different value if your database has a different adminsitrator account.&lt;br /&gt;
* &#039;&#039;&#039;If&#039;&#039;&#039; you are using an existing database server and the database adminstrator has already created the user account and database for RT, then you can add the &amp;lt;code&amp;gt;--skip-create&amp;lt;/code&amp;gt; option.&lt;br /&gt;
* &#039;&#039;&#039;If&#039;&#039;&#039; you have a less common database setup, this tool has additional options to give you finer-grained control over what steps are run and how. Refer to [https://docs.bestpractical.com/rt/latest/rt-setup-database.html the full rt-setup-database documentation] to learn more about those.&lt;br /&gt;
* The command reads files from RT’s &amp;lt;code&amp;gt;etc/&amp;lt;/code&amp;gt; directory by default, so the easiest way to run it is to &amp;lt;code&amp;gt;cd /opt/rt5&amp;lt;/code&amp;gt; first, and then it will find the necessary files automatically.&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /opt/rt5&lt;br /&gt;
sudo sbin/rt-setup-database --action=init --dba=rt_admin&amp;lt;/pre&amp;gt;&lt;br /&gt;
Enter the password for your database administrator account when prompted.&lt;br /&gt;
&lt;br /&gt;
=== Set up fulltext indexing ===&lt;br /&gt;
&lt;br /&gt;
Fulltext indexing speeds up searches for ticket content, which makes RT a lot nicer to use.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;--noask&amp;lt;/code&amp;gt; uses the default names for the index, which will be fine for a new install and simplifies the setup.&lt;br /&gt;
* &amp;lt;code&amp;gt;--dba=rt_admin&amp;lt;/code&amp;gt; provides the username of the administrator account to use to do the setup. &amp;lt;code&amp;gt;rt_admin&amp;lt;/code&amp;gt; is the name we used earlier to set up a new database server. You can specify a different value if your database has a different adminsitrator account.&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo /opt/rt5/sbin/rt-setup-fulltext-index --noask --dba=rt_admin&amp;lt;/pre&amp;gt;&lt;br /&gt;
Enter the password for your database administrator account when prompted. The end of the process will output some RT configuration that looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Set( %FullTextSearch,&lt;br /&gt;
    Enable     =&amp;gt; 1,&lt;br /&gt;
    Indexed    =&amp;gt; 1,&lt;br /&gt;
    # Additional output from rt-setup-fulltext-index should be here.&lt;br /&gt;
    # The configuration varies by database type.&lt;br /&gt;
);&amp;lt;/pre&amp;gt;&lt;br /&gt;
Copy that output and save it to the file &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.d/FulltextIndex.pm&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Set permissions ===&lt;br /&gt;
&lt;br /&gt;
All of RT’s configuration files should be readable by the user that runs the web server, and no other users, in order to protect sensitive information like the database password. RT provides a command to set permissions appropriately according to your distribution and configuration. &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt; to the directory where you extracted the RT source code, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd rt-5.0.2&lt;br /&gt;
sudo make fixperms&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Verify the installation ===&lt;br /&gt;
&lt;br /&gt;
If everything has gone well, then you should be able to set a password for RT’s &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; user. You’ll use this later to log in to the web interface and continue setting up your system. Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo /opt/rt5/sbin/rt-passwd root&amp;lt;/pre&amp;gt;&lt;br /&gt;
Set the password when prompted. Record this; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s web server ==&lt;br /&gt;
&lt;br /&gt;
=== Configure Apache modules ===&lt;br /&gt;
&lt;br /&gt;
You will need to have the following modules enabled in Apache to run RT. You should already have these installed if you followed the instructions above.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;alias&amp;lt;/code&amp;gt; (required to map URLs to RT)&lt;br /&gt;
* &amp;lt;code&amp;gt;fcgid&amp;lt;/code&amp;gt; (required for Apache to talk to RT)&lt;br /&gt;
* &amp;lt;code&amp;gt;mpm_prefork&amp;lt;/code&amp;gt; (Apache requires you to select an MPM. RT is designed to work with the prefork module.)&lt;br /&gt;
* &amp;lt;code&amp;gt;ssl&amp;lt;/code&amp;gt; (required to serve HTTPS; optional otherwise)&lt;br /&gt;
&lt;br /&gt;
Enable them following these instructions:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo a2dismod mpm_event&lt;br /&gt;
sudo a2enmod fcgid&lt;br /&gt;
sudo a2enmod mpm_prefork&lt;br /&gt;
sudo a2enmod ssl&amp;lt;/pre&amp;gt;&lt;br /&gt;
| &amp;lt;pre&amp;gt;echo LoadModule mpm_prefork_module modules/mod_mpm_prefork.so | sudo tee /etc/httpd/conf.modules.d/00-mpm.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Configure an Apache VirtualHost ===&lt;br /&gt;
&lt;br /&gt;
Create a file at the following location. You can change the &amp;lt;code&amp;gt;RT&amp;lt;/code&amp;gt; part of the filename if you like, but the file must exist in this directory and have a &amp;lt;code&amp;gt;.conf&amp;lt;/code&amp;gt; suffix.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;/etc/apache2/sites-available/RT.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
Then after you create the file, run: &amp;lt;code&amp;gt;sudo a2ensite RT&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;/etc/httpd/conf.d/RT.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Use an editor to save all the text below to the new &amp;lt;code&amp;gt;RT.conf&amp;lt;/code&amp;gt; and then fill in settings for your site everywhere the text &amp;lt;code&amp;gt;EDIT WITH&amp;lt;/code&amp;gt; appears.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### Server-level settings&lt;br /&gt;
# These settings affect all of Apache. It is okay to put them here if Apache&lt;br /&gt;
# only hosts RT. If you are hosting other sites in the same Apache instance,&lt;br /&gt;
# you may need to put these settings in another file like&lt;br /&gt;
# (Debian/Ubuntu) /etc/apache2/conf-available/RT.conf&lt;br /&gt;
# (Red Hat/Fedora/CentOS) /etc/httpd/conf.d/RTserver.conf&lt;br /&gt;
# ... and ensure they do not conflict with settings required by other sites.&lt;br /&gt;
&lt;br /&gt;
# mod_fcgid only allows 128KiB requests by default. This is too small for users&lt;br /&gt;
# to upload files to RT. You can ultimately choose any setting you&#039;re&lt;br /&gt;
# comfortable with; 70MiB here should allow most requests without being too&lt;br /&gt;
# open.&lt;br /&gt;
FcgidMaxRequestLen 73400320&lt;br /&gt;
&lt;br /&gt;
&amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
  # Listen on the standard HTTPS port.&lt;br /&gt;
  # You can change this to a nonstandard port if you must.&lt;br /&gt;
  Listen 443&lt;br /&gt;
&amp;lt;/IfModule&amp;gt;&lt;br /&gt;
### End server-level settings&lt;br /&gt;
&lt;br /&gt;
### Primary RT VirtualHost&lt;br /&gt;
# You can change both the bind address and/or the port here as required.&lt;br /&gt;
# This default will listen for HTTPS connections on all interfaces.&lt;br /&gt;
&amp;lt;VirtualHost *:443&amp;gt;&lt;br /&gt;
  # EDIT HERE with the domain name of the web server.&lt;br /&gt;
  ServerName rt.yourdomain.example.com&lt;br /&gt;
  &amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
    SSLEngine on&lt;br /&gt;
    # These specify the paths to the SSL certificate and private key Apache&lt;br /&gt;
    # should use. These example paths are common for Let&#039;s Encrypt. If you&lt;br /&gt;
    # don&#039;t use Let&#039;s Encrypt, the standard location for these files is under&lt;br /&gt;
    # (Debian/Ubuntu) /etc/ssl&lt;br /&gt;
    # (Red Hat/Fedora/CentOS) /etc/pki/tls&lt;br /&gt;
    # EDIT HERE with the appropriate paths for your server&lt;br /&gt;
    SSLCertificateFile /etc/letsencrypt/live/example.com/fullchain.pem&lt;br /&gt;
    SSLCertificateKeyFile /etc/letsencrypt/live/example.com/privkey.pem&lt;br /&gt;
  &amp;lt;/IfModule&amp;gt;&lt;br /&gt;
  &amp;lt;Location /&amp;gt;&lt;br /&gt;
    Require all granted&lt;br /&gt;
    Options +ExecCGI&lt;br /&gt;
    AddHandler fcgid-script fcgi&lt;br /&gt;
  &amp;lt;/Location&amp;gt;&lt;br /&gt;
  AddDefaultCharset UTF-8&lt;br /&gt;
  DocumentRoot /opt/rt5/share/html&lt;br /&gt;
  ScriptAlias / /opt/rt5/sbin/rt-server.fcgi/&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
### End primary RT VirtualHost&lt;br /&gt;
&lt;br /&gt;
### Optional HTTPS Redirect VirtualHost&lt;br /&gt;
# Most modern servers support HTTPS and want all web traffic to go through it.&lt;br /&gt;
# This VirtualHost redirects normal HTTP traffic to HTTPS.&lt;br /&gt;
# You can delete this whole section if you don&#039;t want or need this.&lt;br /&gt;
&amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
  # You can change both the bind address and/or the port here as required.&lt;br /&gt;
  # This default will listen for HTTP connections on all interfaces.&lt;br /&gt;
  &amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
    SSLEngine off&lt;br /&gt;
    # EDIT HERE both lines below with the domain name of your web server.&lt;br /&gt;
    ServerName rt.yourdomain.example.com&lt;br /&gt;
    Redirect permanent / https://rt.yourdomain.example.com/&lt;br /&gt;
  &amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/IfModule&amp;gt;&lt;br /&gt;
### End optional HTTPS Redirect VirtualHost&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
After you’ve edited the file, load the configuration with:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo systemctl reload apache2&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo systemctl reload httpd&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If this command reports an error, double-check the configuration file for typos, especially in option names, file paths, and the&lt;br /&gt;
&amp;lt;Section&amp;gt;&lt;br /&gt;
pairs. Edit again and reload the configuration until it succeeds without output.&lt;br /&gt;
&lt;br /&gt;
=== Verify the web interface ===&lt;br /&gt;
&lt;br /&gt;
You should be able to visit your web server in your browser, and be presented with RT’s login screen. You should be able to log in with username &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; and the password you set previously.&lt;br /&gt;
&lt;br /&gt;
If you run into trouble, the first place to look for more information is by reading Apache’s error log:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo less /var/log/apache2/error.log&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo less /var/log/httpd/error.log&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s mail server ==&lt;br /&gt;
&lt;br /&gt;
RT both can both send and receive ticket updates via email. Unfortunately, there are too many variables to document a useful setup process here: getting this working usually requires creating DNS records, and coordinating with existing mail servers, which will be the main constraint on your setup. Instead this guide provides a brief overview of how the integration works, and where the connection points are that you likely need to work on.&lt;br /&gt;
&lt;br /&gt;
=== Sending Mail ===&lt;br /&gt;
&lt;br /&gt;
RT only knows how to send mail by passing it off to another program on the system. It cannot connect or authenticate directly to external mail servers. In the default configuration, RT runs the standard &amp;lt;code&amp;gt;sendmail&amp;lt;/code&amp;gt; command. There are [https://docs.bestpractical.com/rt/latest/RT_Config.html#Outgoing-mail configuration options to send mail through different commands] if you need.&lt;br /&gt;
&lt;br /&gt;
The most common setup is to install and configure a proper Mail Transfer Agent (MTA) like Postfix or Exim, and then configure it to send mail to the wider Internet as you need. This works well because the MTAs are robust and well-tested; they have flexible configuration to let you send mail out by relaying to other mail servers you specify with optional authentication; and most distributions install one by default anyway. The only hard part is configuring the MTA to send mail following your site’s policies.&lt;br /&gt;
&lt;br /&gt;
Other software is available that provides a slimmer version of the &amp;lt;code&amp;gt;sendmail&amp;lt;/code&amp;gt; command that connects to an external mail server for you, like ssmtp. These programs are usually easier to configure than an MTA, but they often lose email permanently if they can’t connect to the external server at the time it’s sent. (MTAs keep email queued locally until they successfully deliver it to another server.)&lt;br /&gt;
&lt;br /&gt;
=== Receiving email ===&lt;br /&gt;
&lt;br /&gt;
RT installs a command called &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; that receives an email on standard input and posts it to RT’s REST web interface, where it gets saved in the database and added to a ticket. You need to arrange for a way to send incoming email to this command.&lt;br /&gt;
&lt;br /&gt;
The most common setup is to have an MTA on the same box as RT receive email directly, and then set up mail aliases that call this command when mail comes in. Example &amp;lt;code&amp;gt;/etc/aliases&amp;lt;/code&amp;gt; entries look like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rt: &amp;quot;|/opt/rt5/bin/rt-mailgate --queue general --action correspond --url https://rt.yourdomain.example.com/&amp;quot;&lt;br /&gt;
rt-comment: &amp;quot;|/opt/rt5/bin/rt-mailgate --queue general --action comment --url https://rt.yourdomain.example.com/&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
This works well because, again, you’re probably running an MTA anyway; and the MTA can hold and queue mail if it comes in while RT is down for any reason, giving you a buffer against downtime.&lt;br /&gt;
&lt;br /&gt;
Another common option is to periodically run a tool that fetches mail using a protocol like IMAP, like fetchmail or getmail, and passes it on to &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt;. This is less common because it requires setting up another tool to run, and securely storing another set of mail server credentials. But it is useful when local policy prevents the RT server from receiving email directly.&lt;br /&gt;
&lt;br /&gt;
This is much less common, but it might help to know that &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; doesn’t have to run on the same system as RT itself. It just needs to be able to connect to RT’s web interface. If you don’t have any other options, you can install the RT software on a different system that receives email, and configure &#039;&#039;that&#039;&#039; system to run &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; and pass it on to the RT server. To do that, just repeat the installation instructions above, skipping the steps about installing the database and web server.&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s background jobs ==&lt;br /&gt;
&lt;br /&gt;
Create a file &amp;lt;code&amp;gt;/etc/cron.d/rt&amp;lt;/code&amp;gt; with the following content. You may edit all of the time fields as you see fit. Refer to the crontab(5) man page for details about their definitions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Update the fulltext index with new ticket data&lt;br /&gt;
*/3 *   *   *   *   root    /opt/rt5/sbin/rt-fulltext-indexer&lt;br /&gt;
# Email out dashboards that users have subscribed to&lt;br /&gt;
0   *   *   *   *   root    /opt/rt5/sbin/rt-email-dashboards&lt;br /&gt;
# Clean old sessions from the database&lt;br /&gt;
10  3   *   *   *   root    /opt/rt5/sbin/rt-clean-sessions --older 8d&lt;br /&gt;
# Email out weekly digests for users who have requested it&lt;br /&gt;
50  4   *   *   Mon root    /opt/rt5/sbin/rt-email-digest -m weekly&lt;br /&gt;
# Email out daily digests for users who have requested it&lt;br /&gt;
50  5   *   *   *   root    /opt/rt5/sbin/rt-email-digest -m daily&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
You can run all these jobs as the same user that runs your web server, rather than root. Run:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo sed -i &#039;s/\broot\b/www-data/&#039; /etc/cron.d/rt&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo sed -i &#039;s/\broot\b/apache/&#039; /etc/cron.d/rt&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Set up RT ==&lt;br /&gt;
&lt;br /&gt;
If you’ve gotten this far, congratulations, your RT install is really done now. You can start setting up RT with users, groups, queues, and business logic. [[Main Page|Head back to the main page]] to start exploring those topics.&lt;/div&gt;</summary>
		<author><name>Brett</name></author>
	</entry>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=ManualInstallation&amp;diff=27035</id>
		<title>ManualInstallation</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=ManualInstallation&amp;diff=27035"/>
		<updated>2021-11-16T15:19:08Z</updated>

		<summary type="html">&lt;p&gt;Brett: make install requires sudo&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Prev: [[ManualRequirements]] — Up: [[UserManual]] — Next: [[ManualApacheConfig]]&lt;br /&gt;
&lt;br /&gt;
This guide walks you through installing RT from source on a modern, popular Linux distro. Specifically, that means a distribution based on Debian or Red Hat that’s been released since around 2020.&lt;br /&gt;
&lt;br /&gt;
This guide assumes:&lt;br /&gt;
&lt;br /&gt;
* You can install packages generally available in Debian/Ubuntu or Red Hat/Fedora/CentOS.&lt;br /&gt;
* You want to install RT, and all of its Perl dependencies, from source to get the latest versions. (This is a trade-off. It means the boundaries of your install will be very clear, but you won’t get security updates for RT or Perl modules from your distribution.)&lt;br /&gt;
* You are willing to install a couple of extra tools to manage the RT installation similarly to how you would in other packaging systems (like PyPI, npm, etc.).&lt;br /&gt;
* You are willing to do a relatively maximal install of RT, enabling all the options during installation and then setting what you need in the configuration. (You could save a little space and time by being pickier about your options, but then that complicates the guide and makes it harder to turn those options on later if you want.)&lt;br /&gt;
* You are using a regular user account on the Linux system that can get superuser privileges with sudo.&lt;br /&gt;
&lt;br /&gt;
== Install the base dependencies ==&lt;br /&gt;
&lt;br /&gt;
These are required by RT, either to run or to install the dependencies.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install autoconf build-essential curl libexpat-dev libgd-dev libssl-dev libz-dev gnupg graphviz perl w3m&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install patch tar which gcc gcc-c++ perl-core perl-ExtUtils-MakeMaker graphviz expat-devel gd-devel openssl-devel w3m&lt;br /&gt;
sudo setenforce 0&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
(Turning off SELinux enforcement is required on Red Hat-based distributions because, as of October 2021, nobody has written a policy for RT.)&lt;br /&gt;
&lt;br /&gt;
== Install a database ==&lt;br /&gt;
&lt;br /&gt;
You need access to a database server. It can be remote, or you can install a database server alongside RT. RT supports a few different databases, but the best supported options are PostgreSQL and MariaDB.&lt;br /&gt;
&lt;br /&gt;
=== Installing and configuring the PostgreSQL server ===&lt;br /&gt;
&lt;br /&gt;
If you want to install a fresh PostgreSQL database server alongside RT:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install postgresql&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install postgresql-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In order to set up RT’s database, you will need a PostgreSQL superuser account that can be authenticated with a password. If you don’t have that, you can create it by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo createuser -sP rt_admin&amp;lt;/pre&amp;gt;&lt;br /&gt;
Set the password when prompted. Record this; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
=== Installing the PostgreSQL client libraries ===&lt;br /&gt;
&lt;br /&gt;
These are required for RT to be able to talk to any PostgreSQL server.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install libpq-dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install postgresql-devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Once this is done you can skip ahead to installing a web server.&lt;br /&gt;
&lt;br /&gt;
=== Installing and configuring the MariaDB server ===&lt;br /&gt;
&lt;br /&gt;
If you want to install a fresh MariaDB database server alongside RT:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install mariadb-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install mariadb-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In order to set up RT’s database, you will need a MySQL superuser account. To stay consistent with PostgreSQL, I suggest setting a password for it. You can do that by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo mysql&lt;br /&gt;
mysql# GRANT ALL PRIVELEGES WITH GRANT OPTION ON rt5 TO rt_admin@localhost IDENTIFIED BY &#039;YourPassphraseHere&#039;;&amp;lt;/pre&amp;gt;&lt;br /&gt;
Record your passphrase; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
=== Adjust MariaDB’s max_allowed_packet setting ===&lt;br /&gt;
&lt;br /&gt;
You need to consider this step whether you install the database locally, or use an existing one already running. [https://mariadb.com/kb/en/server-system-variables/#max_allowed_packet MariaDB’s &amp;lt;code&amp;gt;max_allowed_packet&amp;lt;/code&amp;gt; setting] functionally limits the size of attachments in RT. The default is 16MiB, which is too small for most installations. You can ultimately choose any setting you’re comfortable with; 64MiB here should allow most requests without being too open.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;echo -e &#039;[client-server]\nmax_allowed_packet=64M\n&#039; | sudo tee /etc/mysql/conf.d/max_allowed_packet.cnf&lt;br /&gt;
sudo systemctl reload mariadb&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;echo -e &#039;[client-server]\nmax_allowed_packet=64M\n&#039; | sudo tee /etc/my.cnf.d/max_allowed_packet.cnf&lt;br /&gt;
sudo systemctl reload mariadb&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Installing the MariaDB client libraries ===&lt;br /&gt;
&lt;br /&gt;
These are required for RT to be able to talk to any MariaDB server.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install libmariadb-dev libmariadb-dev-compat&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install mariadb-devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Install a web server with FastCGI ==&lt;br /&gt;
&lt;br /&gt;
FastCGI is the best way to host RT’s web interface today. Installing the web server before RT makes the installation process simpler, because RT will be able to automatically some details about your web server like what user it runs as.&lt;br /&gt;
&lt;br /&gt;
=== Installing Apache ===&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install apache2 libapache2-mod-fcgid&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install httpd mod_fcgid mod_ssl&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ### Installing nginx --&amp;gt;&lt;br /&gt;
== Install Perl packaging tools: App::cpanminus and App::Virtualenv ==&lt;br /&gt;
&lt;br /&gt;
App::cpanminus is a tool for installing and managing Perl modules from the popular CPAN repository. It does a lot of the same tasks, and follows a lot of the same UI conventions, as &amp;lt;code&amp;gt;pip&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;gem&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;npm&amp;lt;/code&amp;gt;, and similar tools. You can install it from your distribution:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install cpanminus&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install perl-App-cpanminus&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If your system doesn’t have a cpanminus package available, you can install it from source following the [https://metacpan.org/pod/App::cpanminus#INSTALLATION project instructions].&lt;br /&gt;
&lt;br /&gt;
App::Virtualenv is a tool to create a dedicated space where you install and manage a self-contained set of Perl modules. (If you’re familiar with Python virtual environments, the concept is the same and App::Virtualenv follows a lot of the same usage patterns.) Using it helps avoid situations where changes to distribution packages might potentially break RT. This guide will illustrate creating and using a virtual environment for RT in &amp;lt;code&amp;gt;/opt/rt5venv&amp;lt;/code&amp;gt;, but you can choose another location if you like.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cpanm --sudo App::Virtualenv&lt;br /&gt;
sudo virtualenv.pl --create --empty /opt/rt5venv&amp;lt;/pre&amp;gt;&lt;br /&gt;
Now whenever you want to work on RT (by installing it, upgrading dependencies, installing new extensions, etc.), you need to activate the virtualenv in your shell. This sets various environment variables that your shell uses to work on Perl modules in the right place. You activate the virtualenv by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;. /opt/rt5venv/bin/activate&amp;lt;/pre&amp;gt;&lt;br /&gt;
== Install RT ==&lt;br /&gt;
&lt;br /&gt;
=== Get and unpack the RT source code ===&lt;br /&gt;
&lt;br /&gt;
Download the latest source code using the link on the [https://bestpractical.com/download-page RT download page], extract it using &amp;lt;code&amp;gt;tar -xf&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt; into the source code directory to run the rest of the commands in this section. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;curl -O https://download.bestpractical.com/pub/rt/release/rt-5.0.2.tar.gz&lt;br /&gt;
tar -xf rt-5.0.2.tar.gz&lt;br /&gt;
cd rt-5.0.2&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Pre-configure RT ===&lt;br /&gt;
&lt;br /&gt;
This command will detect some information about your system in order to install RT properly, and decide which set of dependencies to install. Here’s what the different parts of our command are doing:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;PERL=/opt/rt5venv/bin/perl&amp;lt;/code&amp;gt; ensures RT uses the virtualenv you set up.&lt;br /&gt;
* &amp;lt;code&amp;gt;--with-db-type=TYPE&amp;lt;/code&amp;gt; - Replace &amp;lt;code&amp;gt;TYPE&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;Pg&amp;lt;/code&amp;gt; for PostgreSQL, or &amp;lt;code&amp;gt;mysql&amp;lt;/code&amp;gt; for MariaDB.&lt;br /&gt;
* &amp;lt;code&amp;gt;--prefix=/opt/rt5&amp;lt;/code&amp;gt; sets the directory where RT will install all of its libraries, tools, and supporting files. You can choose another path if you like.&lt;br /&gt;
* The rest of the options tell RT to install additional dependencies for optional features.&lt;br /&gt;
&lt;br /&gt;
Make sure you have &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt;ed into the RT source directory, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;PERL=/opt/rt5venv/bin/perl ./configure --with-db-type=TYPE --prefix=/opt/rt5 --with-attachment-store=disk --enable-externalauth --enable-gd --enable-graphviz --enable-gpg --enable-smime&amp;lt;/pre&amp;gt;&lt;br /&gt;
For more background, [https://docs.bestpractical.com/rt/latest/configure.html refer to the RT configure options documentation].&lt;br /&gt;
&lt;br /&gt;
=== Install RT and its Perl dependencies ===&lt;br /&gt;
&lt;br /&gt;
This command will download, build, and install all of the Perl modules necessary to run RT with the configuration you set above. Here’s what the different parts of the command are doing:&lt;br /&gt;
&lt;br /&gt;
* First we make sure the virtualenv is activated in our shell, so dependencies are installed there.&lt;br /&gt;
* &amp;lt;code&amp;gt;fixdeps&amp;lt;/code&amp;gt; is RT’s command to install dependencies.&lt;br /&gt;
* &amp;lt;code&amp;gt;install&amp;lt;/code&amp;gt; installs all of RT’s files under &amp;lt;code&amp;gt;/opt/rt5&amp;lt;/code&amp;gt; (or the prefix directory you set in the previous step). It will only run if &amp;lt;code&amp;gt;fixdeps&amp;lt;/code&amp;gt; succeeds.&lt;br /&gt;
* &amp;lt;code&amp;gt;RT_FIX_DEPS_CMD=&#039;cpanm --sudo --quiet&#039;&amp;lt;/code&amp;gt; tells RT to use cpanminus to install dependencies (instead of the older, default &amp;lt;code&amp;gt;cpan&amp;lt;/code&amp;gt; command).&lt;br /&gt;
&lt;br /&gt;
Make sure you have &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt;ed into the RT source directory, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;. /opt/rt5venv/bin/activate&lt;br /&gt;
make fixdeps RT_FIX_DEPS_CMD=&#039;cpanm --sudo --quiet&#039;&lt;br /&gt;
sudo make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
If it works, the command will eventually output a message that says “Congratulations. RT is now installed.” followed by instructions about configuring and setting up the database. We’ll do that next.&lt;br /&gt;
&lt;br /&gt;
=== Configure RT ===&lt;br /&gt;
&lt;br /&gt;
[https://docs.bestpractical.com/rt/latest/RT_Config.html RT has many configuration options.] You can put configuration options in the file &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/code&amp;gt;, or in individual files under &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.d/&amp;lt;/code&amp;gt;. Use an editor to save all the text below to &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/code&amp;gt; (you can just overwrite the existing file, or add this to the bottom of what’s there) and then fill in settings for your site everywhere the text &amp;lt;code&amp;gt;EDIT WITH&amp;lt;/code&amp;gt; appears.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Single-quote all values EXCEPT the special value `undef`&lt;br /&gt;
# that turns off a setting.&lt;br /&gt;
&lt;br /&gt;
# rtname appears in ticket email subjects. It needs to be globally unique,&lt;br /&gt;
# so use your organization&#039;s domain name.&lt;br /&gt;
Set($rtname, &#039;EDIT WITH yourdomain.example.com&#039;);&lt;br /&gt;
# Organization is used in the database for ticket links, etc. It also needs to&lt;br /&gt;
# be globally unique, so use your organization&#039;s domain name.&lt;br /&gt;
Set($Organization, &#039;EDIT WITH yourdomain.example.com&#039;);&lt;br /&gt;
# WebDomain is domain name of the RT web server. RT uses it to construct links&lt;br /&gt;
# and defend against CSRFs.&lt;br /&gt;
Set($WebDomain, &#039;EDIT WITH rt.yourdomain.example.com&#039;);&lt;br /&gt;
# WebPort is the port where the RT web server runs. Edit the number below if&lt;br /&gt;
# you&#039;re not using the standard HTTPS port.&lt;br /&gt;
Set($WebPort, &#039;443&#039;);&lt;br /&gt;
&lt;br /&gt;
# DatabaseUser is the name of the database account RT uses to read and store&lt;br /&gt;
# data. &#039;rt_user&#039; is the default but you can change it if you like.&lt;br /&gt;
# DO NOT use the &#039;rt_admin&#039; superuser created in the instructions above.&lt;br /&gt;
Set($DatabaseUser, &#039;rt_user&#039;);&lt;br /&gt;
# DatabasePassword is the password for DatabaseUser.&lt;br /&gt;
Set($DatabasePassword, &#039;EDIT WITH SomePassphraseHere&#039;);&lt;br /&gt;
# DatabaseHost is the hostname of the database server RT should use.&lt;br /&gt;
# Change &#039;localhost&#039; if it lives on a different server.&lt;br /&gt;
Set($DatabaseHost, &#039;localhost&#039;);&lt;br /&gt;
# DatabasePort is the port number of the database server RT should use.&lt;br /&gt;
# `undef` means the default for that database. Change it if you&#039;re not&lt;br /&gt;
# using the standard port.&lt;br /&gt;
Set($DatabasePort, undef);&lt;br /&gt;
# DatabaseName is the name of RT&#039;s database hosted on DatabaseHost.&lt;br /&gt;
# &#039;rt5&#039; is the default but you can change it if you like.&lt;br /&gt;
Set($DatabaseName, &#039;rt5&#039;);&lt;br /&gt;
&lt;br /&gt;
# RT can log to syslog, stderr, and/or a dedicated file. For a modern install,&lt;br /&gt;
# I recommend logging to syslog, so it goes to journald where it&#039;s easy to&lt;br /&gt;
# query and automatically gets rotated. You set both these paramaters to a&lt;br /&gt;
# standard log level: &#039;debug&#039;, &#039;info&#039;, &#039;notice&#039;, &#039;warning&#039;, &#039;error&#039;,&lt;br /&gt;
# &#039;critical&#039;, &#039;alert&#039;, or &#039;emergency&#039;.&lt;br /&gt;
Set($LogToSyslog, &#039;info&#039;);&lt;br /&gt;
Set($LogToSTDERR, undef);&lt;br /&gt;
&lt;br /&gt;
# Turn off optional features that require additional configuration.&lt;br /&gt;
# If you want to use these, refer to the RT_Config documentation for&lt;br /&gt;
# instructions on how to set them up.&lt;br /&gt;
Set(%GnuPG, &#039;Enable&#039; =&amp;gt; &#039;0&#039;);&lt;br /&gt;
Set(%SMIME, &#039;Enable&#039; =&amp;gt; &#039;0&#039;);&lt;br /&gt;
&lt;br /&gt;
# Perl expects to find this 1 at the end of the file.&lt;br /&gt;
1;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;RT_SiteConfig.pm&amp;lt;/code&amp;gt; is actually Perl code. RT runs the code directly to load the configuration. Any time you finish editing it, you can check that you didn’t make any syntax errors by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;perl -c /opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Set up RT’s database ===&lt;br /&gt;
&lt;br /&gt;
RT includes a tool to help you set up its database. By default, it connects to the database as an administrator to create the database and user that you configured in the previous step.&lt;br /&gt;
&lt;br /&gt;
(The instructions from &amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt; and RT’s README file tell you to run &amp;lt;code&amp;gt;make initialize-database&amp;lt;/code&amp;gt;. That just runs &amp;lt;code&amp;gt;rt-setup-database&amp;lt;/code&amp;gt; for you. Running the tool directly makes it easier to pass the options you need.)&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;--action=init&amp;lt;/code&amp;gt; tells the tool to create the user, the database, the tables inside it, and insert core data RT needs to function.&lt;br /&gt;
* &amp;lt;code&amp;gt;--dba=rt_admin&amp;lt;/code&amp;gt; provides the username of the administrator account to use to do the setup. &amp;lt;code&amp;gt;rt_admin&amp;lt;/code&amp;gt; is the name we used earlier to set up a new database server. You can specify a different value if your database has a different adminsitrator account.&lt;br /&gt;
* &#039;&#039;&#039;If&#039;&#039;&#039; you are using an existing database server and the database adminstrator has already created the user account and database for RT, then you can add the &amp;lt;code&amp;gt;--skip-create&amp;lt;/code&amp;gt; option.&lt;br /&gt;
* &#039;&#039;&#039;If&#039;&#039;&#039; you have a less common database setup, this tool has additional options to give you finer-grained control over what steps are run and how. Refer to [https://docs.bestpractical.com/rt/latest/rt-setup-database.html the full rt-setup-database documentation] to learn more about those.&lt;br /&gt;
* The command reads files from RT’s &amp;lt;code&amp;gt;etc/&amp;lt;/code&amp;gt; directory by default, so the easiest way to run it is to &amp;lt;code&amp;gt;cd /opt/rt5&amp;lt;/code&amp;gt; first, and then it will find the necessary files automatically.&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /opt/rt5&lt;br /&gt;
sudo sbin/rt-setup-database --action=init --dba=rt_admin&amp;lt;/pre&amp;gt;&lt;br /&gt;
Enter the password for your database administrator account when prompted.&lt;br /&gt;
&lt;br /&gt;
=== Set up fulltext indexing ===&lt;br /&gt;
&lt;br /&gt;
Fulltext indexing speeds up searches for ticket content, which makes RT a lot nicer to use.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;--noask&amp;lt;/code&amp;gt; uses the default names for the index, which will be fine for a new install and simplifies the setup.&lt;br /&gt;
* &amp;lt;code&amp;gt;--dba=rt_admin&amp;lt;/code&amp;gt; provides the username of the administrator account to use to do the setup. &amp;lt;code&amp;gt;rt_admin&amp;lt;/code&amp;gt; is the name we used earlier to set up a new database server. You can specify a different value if your database has a different adminsitrator account.&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo /opt/rt5/sbin/rt-setup-fulltext-index --noask --dba=rt_admin&amp;lt;/pre&amp;gt;&lt;br /&gt;
Enter the password for your database administrator account when prompted. The end of the process will output some RT configuration that looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Set( %FullTextSearch,&lt;br /&gt;
    Enable     =&amp;gt; 1,&lt;br /&gt;
    Indexed    =&amp;gt; 1,&lt;br /&gt;
    # Additional output from rt-setup-fulltext-index should be here.&lt;br /&gt;
    # The configuration varies by database type.&lt;br /&gt;
);&amp;lt;/pre&amp;gt;&lt;br /&gt;
Copy that output and save it to the file &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.d/FulltextIndex.pm&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Set permissions ===&lt;br /&gt;
&lt;br /&gt;
All of RT’s configuration files should be readable by the user that runs the web server, and no other users, in order to protect sensitive information like the database password. RT provides a command to set permissions appropriately according to your distribution and configuration. &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt; to the directory where you extracted the RT source code, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd rt-5.0.2&lt;br /&gt;
sudo make fixperms&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Verify the installation ===&lt;br /&gt;
&lt;br /&gt;
If everything has gone well, then you should be able to set a password for RT’s &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; user. You’ll use this later to log in to the web interface and continue setting up your system. Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo /opt/rt5/sbin/rt-passwd root&amp;lt;/pre&amp;gt;&lt;br /&gt;
Set the password when prompted. Record this; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s web server ==&lt;br /&gt;
&lt;br /&gt;
=== Configure Apache modules ===&lt;br /&gt;
&lt;br /&gt;
You will need to have the following modules enabled in Apache to run RT. You should already have these installed if you followed the instructions above.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;alias&amp;lt;/code&amp;gt; (required to map URLs to RT)&lt;br /&gt;
* &amp;lt;code&amp;gt;fcgid&amp;lt;/code&amp;gt; (required for Apache to talk to RT)&lt;br /&gt;
* &amp;lt;code&amp;gt;mpm_prefork&amp;lt;/code&amp;gt; (Apache requires you to select an MPM. RT is designed to work with the prefork module.)&lt;br /&gt;
* &amp;lt;code&amp;gt;ssl&amp;lt;/code&amp;gt; (required to serve HTTPS; optional otherwise)&lt;br /&gt;
&lt;br /&gt;
Enable them following these instructions:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo a2dismod mpm_event&lt;br /&gt;
sudo a2enmod fcgid&lt;br /&gt;
sudo a2enmod mpm_prefork&lt;br /&gt;
sudo a2enmod ssl&amp;lt;/pre&amp;gt;&lt;br /&gt;
| &amp;lt;pre&amp;gt;echo LoadModule mpm_prefork_module modules/mod_mpm_prefork.so | sudo tee /etc/httpd/conf.modules.d/00-mpm.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Configure an Apache VirtualHost ===&lt;br /&gt;
&lt;br /&gt;
Create a file at the following location. You can change the &amp;lt;code&amp;gt;RT&amp;lt;/code&amp;gt; part of the filename if you like, but the file must exist in this directory and have a &amp;lt;code&amp;gt;.conf&amp;lt;/code&amp;gt; suffix.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;/etc/apache2/sites-available/RT.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
Then after you create the file, run: &amp;lt;code&amp;gt;sudo a2ensite RT&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;/etc/httpd/conf.d/RT.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Use an editor to save all the text below to the new &amp;lt;code&amp;gt;RT.conf&amp;lt;/code&amp;gt; and then fill in settings for your site everywhere the text &amp;lt;code&amp;gt;EDIT WITH&amp;lt;/code&amp;gt; appears.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### Server-level settings&lt;br /&gt;
# These settings affect all of Apache. It is okay to put them here if Apache&lt;br /&gt;
# only hosts RT. If you are hosting other sites in the same Apache instance,&lt;br /&gt;
# you may need to put these settings in another file like&lt;br /&gt;
# (Debian/Ubuntu) /etc/apache2/conf-available/RT.conf&lt;br /&gt;
# (Red Hat/Fedora/CentOS) /etc/httpd/conf.d/RTserver.conf&lt;br /&gt;
# ... and ensure they do not conflict with settings required by other sites.&lt;br /&gt;
&lt;br /&gt;
# mod_fcgid only allows 128KiB requests by default. This is too small for users&lt;br /&gt;
# to upload files to RT. You can ultimately choose any setting you&#039;re&lt;br /&gt;
# comfortable with; 70MiB here should allow most requests without being too&lt;br /&gt;
# open.&lt;br /&gt;
FcgidMaxRequestLen 73400320&lt;br /&gt;
&lt;br /&gt;
&amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
  # Listen on the standard HTTPS port.&lt;br /&gt;
  # You can change this to a nonstandard port if you must.&lt;br /&gt;
  Listen 443&lt;br /&gt;
&amp;lt;/IfModule&amp;gt;&lt;br /&gt;
### End server-level settings&lt;br /&gt;
&lt;br /&gt;
### Primary RT VirtualHost&lt;br /&gt;
# You can change both the bind address and/or the port here as required.&lt;br /&gt;
# This default will listen for HTTPS connections on all interfaces.&lt;br /&gt;
&amp;lt;VirtualHost *:443&amp;gt;&lt;br /&gt;
  # EDIT HERE with the domain name of the web server.&lt;br /&gt;
  ServerName rt.yourdomain.example.com&lt;br /&gt;
  &amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
    SSLEngine on&lt;br /&gt;
    # These specify the paths to the SSL certificate and private key Apache&lt;br /&gt;
    # should use. These example paths are common for Let&#039;s Encrypt. If you&lt;br /&gt;
    # don&#039;t use Let&#039;s Encrypt, the standard location for these files is under&lt;br /&gt;
    # (Debian/Ubuntu) /etc/ssl&lt;br /&gt;
    # (Red Hat/Fedora/CentOS) /etc/pki/tls&lt;br /&gt;
    # EDIT HERE with the appropriate paths for your server&lt;br /&gt;
    SSLCertificateFile /etc/letsencrypt/live/example.com/cert.pem&lt;br /&gt;
    SSLCertificateChainFile /etc/letsencrypt/live/example.com/chain.pem&lt;br /&gt;
    SSLCertificateKeyFile /etc/letsencrypt/live/example.com/privkey.pem&lt;br /&gt;
  &amp;lt;/IfModule&amp;gt;&lt;br /&gt;
  &amp;lt;Location /&amp;gt;&lt;br /&gt;
    Require all granted&lt;br /&gt;
    Options +ExecCGI&lt;br /&gt;
    AddHandler fcgid-script fcgi&lt;br /&gt;
  &amp;lt;/Location&amp;gt;&lt;br /&gt;
  AddDefaultCharset UTF-8&lt;br /&gt;
  DocumentRoot /opt/rt5/share/html&lt;br /&gt;
  ScriptAlias / /opt/rt5/sbin/rt-server.fcgi/&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
### End primary RT VirtualHost&lt;br /&gt;
&lt;br /&gt;
### Optional HTTPS Redirect VirtualHost&lt;br /&gt;
# Most modern servers support HTTPS and want all web traffic to go through it.&lt;br /&gt;
# This VirtualHost redirects normal HTTP traffic to HTTPS.&lt;br /&gt;
# You can delete this whole section if you don&#039;t want or need this.&lt;br /&gt;
&amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
  # You can change both the bind address and/or the port here as required.&lt;br /&gt;
  # This default will listen for HTTP connections on all interfaces.&lt;br /&gt;
  &amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
    SSLEngine off&lt;br /&gt;
    # EDIT HERE both lines below with the domain name of your web server.&lt;br /&gt;
    ServerName rt.yourdomain.example.com&lt;br /&gt;
    Redirect permanent / https://rt.yourdomain.example.com/&lt;br /&gt;
  &amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/IfModule&amp;gt;&lt;br /&gt;
### End optional HTTPS Redirect VirtualHost&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
After you’ve edited the file, load the configuration with:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo systemctl reload apache2&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo systemctl reload httpd&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If this command reports an error, double-check the configuration file for typos, especially in option names, file paths, and the&lt;br /&gt;
&amp;lt;Section&amp;gt;&lt;br /&gt;
pairs. Edit again and reload the configuration until it succeeds without output.&lt;br /&gt;
&lt;br /&gt;
=== Verify the web interface ===&lt;br /&gt;
&lt;br /&gt;
You should be able to visit your web server in your browser, and be presented with RT’s login screen. You should be able to log in with username &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; and the password you set previously.&lt;br /&gt;
&lt;br /&gt;
If you run into trouble, the first place to look for more information is by reading Apache’s error log:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo less /var/log/apache2/error.log&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo less /var/log/httpd/error.log&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s mail server ==&lt;br /&gt;
&lt;br /&gt;
RT both can both send and receive ticket updates via email. Unfortunately, there are too many variables to document a useful setup process here: getting this working usually requires creating DNS records, and coordinating with existing mail servers, which will be the main constraint on your setup. Instead this guide provides a brief overview of how the integration works, and where the connection points are that you likely need to work on.&lt;br /&gt;
&lt;br /&gt;
=== Sending Mail ===&lt;br /&gt;
&lt;br /&gt;
RT only knows how to send mail by passing it off to another program on the system. It cannot connect or authenticate directly to external mail servers. In the default configuration, RT runs the standard &amp;lt;code&amp;gt;sendmail&amp;lt;/code&amp;gt; command. There are [https://docs.bestpractical.com/rt/latest/RT_Config.html#Outgoing-mail configuration options to send mail through different commands] if you need.&lt;br /&gt;
&lt;br /&gt;
The most common setup is to install and configure a proper Mail Transfer Agent (MTA) like Postfix or Exim, and then configure it to send mail to the wider Internet as you need. This works well because the MTAs are robust and well-tested; they have flexible configuration to let you send mail out by relaying to other mail servers you specify with optional authentication; and most distributions install one by default anyway. The only hard part is configuring the MTA to send mail following your site’s policies.&lt;br /&gt;
&lt;br /&gt;
Other software is available that provides a slimmer version of the &amp;lt;code&amp;gt;sendmail&amp;lt;/code&amp;gt; command that connects to an external mail server for you, like ssmtp. These programs are usually easier to configure than an MTA, but they often lose email permanently if they can’t connect to the external server at the time it’s sent. (MTAs keep email queued locally until they successfully deliver it to another server.)&lt;br /&gt;
&lt;br /&gt;
=== Receiving email ===&lt;br /&gt;
&lt;br /&gt;
RT installs a command called &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; that receives an email on standard input and posts it to RT’s REST web interface, where it gets saved in the database and added to a ticket. You need to arrange for a way to send incoming email to this command.&lt;br /&gt;
&lt;br /&gt;
The most common setup is to have an MTA on the same box as RT receive email directly, and then set up mail aliases that call this command when mail comes in. Example &amp;lt;code&amp;gt;/etc/aliases&amp;lt;/code&amp;gt; entries look like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rt: &amp;quot;|/opt/rt5/bin/rt-mailgate --queue general --action correspond --url https://rt.yourdomain.example.com/&amp;quot;&lt;br /&gt;
rt-comment: &amp;quot;|/opt/rt5/bin/rt-mailgate --queue general --action comment --url https://rt.yourdomain.example.com/&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
This works well because, again, you’re probably running an MTA anyway; and the MTA can hold and queue mail if it comes in while RT is down for any reason, giving you a buffer against downtime.&lt;br /&gt;
&lt;br /&gt;
Another common option is to periodically run a tool that fetches mail using a protocol like IMAP, like fetchmail or getmail, and passes it on to &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt;. This is less common because it requires setting up another tool to run, and securely storing another set of mail server credentials. But it is useful when local policy prevents the RT server from receiving email directly.&lt;br /&gt;
&lt;br /&gt;
This is much less common, but it might help to know that &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; doesn’t have to run on the same system as RT itself. It just needs to be able to connect to RT’s web interface. If you don’t have any other options, you can install the RT software on a different system that receives email, and configure &#039;&#039;that&#039;&#039; system to run &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; and pass it on to the RT server. To do that, just repeat the installation instructions above, skipping the steps about installing the database and web server.&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s background jobs ==&lt;br /&gt;
&lt;br /&gt;
Create a file &amp;lt;code&amp;gt;/etc/cron.d/rt&amp;lt;/code&amp;gt; with the following content. You may edit all of the time fields as you see fit. Refer to the crontab(5) man page for details about their definitions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Update the fulltext index with new ticket data&lt;br /&gt;
*/3 *   *   *   *   root    /opt/rt5/sbin/rt-fulltext-indexer&lt;br /&gt;
# Email out dashboards that users have subscribed to&lt;br /&gt;
0   *   *   *   *   root    /opt/rt5/sbin/rt-email-dashboards&lt;br /&gt;
# Clean old sessions from the database&lt;br /&gt;
10  3   *   *   *   root    /opt/rt5/sbin/rt-clean-sessions --older 8d&lt;br /&gt;
# Email out weekly digests for users who have requested it&lt;br /&gt;
50  4   *   *   Mon root    /opt/rt5/sbin/rt-email-digest -m weekly&lt;br /&gt;
# Email out daily digests for users who have requested it&lt;br /&gt;
50  5   *   *   *   root    /opt/rt5/sbin/rt-email-digest -m daily&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
You can run all these jobs as the same user that runs your web server, rather than root. Run:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo sed -i &#039;s/\broot\b/www-data/&#039; /etc/cron.d/rt&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo sed -i &#039;s/\broot\b/apache/&#039; /etc/cron.d/rt&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Set up RT ==&lt;br /&gt;
&lt;br /&gt;
If you’ve gotten this far, congratulations, your RT install is really done now. You can start setting up RT with users, groups, queues, and business logic. [[Main Page|Head back to the main page]] to start exploring those topics.&lt;/div&gt;</summary>
		<author><name>Brett</name></author>
	</entry>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=ManualInstallation&amp;diff=27033</id>
		<title>ManualInstallation</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=ManualInstallation&amp;diff=27033"/>
		<updated>2021-11-01T20:36:34Z</updated>

		<summary type="html">&lt;p&gt;Brett: Fix Debian DB library package names&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Prev: [[ManualRequirements]] — Up: [[UserManual]] — Next: [[ManualApacheConfig]]&lt;br /&gt;
&lt;br /&gt;
This guide walks you through installing RT from source on a modern, popular Linux distro. Specifically, that means a distribution based on Debian or Red Hat that’s been released since around 2020.&lt;br /&gt;
&lt;br /&gt;
This guide assumes:&lt;br /&gt;
&lt;br /&gt;
* You can install packages generally available in Debian/Ubuntu or Red Hat/Fedora/CentOS.&lt;br /&gt;
* You want to install RT, and all of its Perl dependencies, from source to get the latest versions. (This is a trade-off. It means the boundaries of your install will be very clear, but you won’t get security updates for RT or Perl modules from your distribution.)&lt;br /&gt;
* You are willing to install a couple of extra tools to manage the RT installation similarly to how you would in other packaging systems (like PyPI, npm, etc.).&lt;br /&gt;
* You are willing to do a relatively maximal install of RT, enabling all the options during installation and then setting what you need in the configuration. (You could save a little space and time by being pickier about your options, but then that complicates the guide and makes it harder to turn those options on later if you want.)&lt;br /&gt;
* You are using a regular user account on the Linux system that can get superuser privileges with sudo.&lt;br /&gt;
&lt;br /&gt;
== Install the base dependencies ==&lt;br /&gt;
&lt;br /&gt;
These are required by RT, either to run or to install the dependencies.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install autoconf build-essential curl libexpat-dev libgd-dev libssl-dev libz-dev gnupg graphviz perl w3m&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install patch tar which gcc gcc-c++ perl-core perl-ExtUtils-MakeMaker graphviz expat-devel gd-devel openssl-devel w3m&lt;br /&gt;
sudo setenforce 0&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
(Turning off SELinux enforcement is required on Red Hat-based distributions because, as of October 2021, nobody has written a policy for RT.)&lt;br /&gt;
&lt;br /&gt;
== Install a database ==&lt;br /&gt;
&lt;br /&gt;
You need access to a database server. It can be remote, or you can install a database server alongside RT. RT supports a few different databases, but the best supported options are PostgreSQL and MariaDB.&lt;br /&gt;
&lt;br /&gt;
=== Installing and configuring the PostgreSQL server ===&lt;br /&gt;
&lt;br /&gt;
If you want to install a fresh PostgreSQL database server alongside RT:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install postgresql&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install postgresql-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In order to set up RT’s database, you will need a PostgreSQL superuser account that can be authenticated with a password. If you don’t have that, you can create it by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo createuser -sP rt_admin&amp;lt;/pre&amp;gt;&lt;br /&gt;
Set the password when prompted. Record this; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
=== Installing the PostgreSQL client libraries ===&lt;br /&gt;
&lt;br /&gt;
These are required for RT to be able to talk to any PostgreSQL server.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install libpq-dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install postgresql-devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Once this is done you can skip ahead to installing a web server.&lt;br /&gt;
&lt;br /&gt;
=== Installing and configuring the MariaDB server ===&lt;br /&gt;
&lt;br /&gt;
If you want to install a fresh MariaDB database server alongside RT:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install mariadb-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install mariadb-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In order to set up RT’s database, you will need a MySQL superuser account. To stay consistent with PostgreSQL, I suggest setting a password for it. You can do that by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo mysql&lt;br /&gt;
mysql# GRANT ALL PRIVELEGES WITH GRANT OPTION ON rt5 TO rt_admin@localhost IDENTIFIED BY &#039;YourPassphraseHere&#039;;&amp;lt;/pre&amp;gt;&lt;br /&gt;
Record your passphrase; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
=== Adjust MariaDB’s max_allowed_packet setting ===&lt;br /&gt;
&lt;br /&gt;
You need to consider this step whether you install the database locally, or use an existing one already running. [https://mariadb.com/kb/en/server-system-variables/#max_allowed_packet MariaDB’s &amp;lt;code&amp;gt;max_allowed_packet&amp;lt;/code&amp;gt; setting] functionally limits the size of attachments in RT. The default is 16MiB, which is too small for most installations. You can ultimately choose any setting you’re comfortable with; 64MiB here should allow most requests without being too open.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;echo -e &#039;[client-server]\nmax_allowed_packet=64M\n&#039; | sudo tee /etc/mysql/conf.d/max_allowed_packet.cnf&lt;br /&gt;
sudo systemctl reload mariadb&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;echo -e &#039;[client-server]\nmax_allowed_packet=64M\n&#039; | sudo tee /etc/my.cnf.d/max_allowed_packet.cnf&lt;br /&gt;
sudo systemctl reload mariadb&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Installing the MariaDB client libraries ===&lt;br /&gt;
&lt;br /&gt;
These are required for RT to be able to talk to any MariaDB server.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install libmariadb-dev libmariadb-dev-compat&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install mariadb-devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Install a web server with FastCGI ==&lt;br /&gt;
&lt;br /&gt;
FastCGI is the best way to host RT’s web interface today. Installing the web server before RT makes the installation process simpler, because RT will be able to automatically some details about your web server like what user it runs as.&lt;br /&gt;
&lt;br /&gt;
=== Installing Apache ===&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install apache2 libapache2-mod-fcgid&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install httpd mod_fcgid mod_ssl&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ### Installing nginx --&amp;gt;&lt;br /&gt;
== Install Perl packaging tools: App::cpanminus and App::Virtualenv ==&lt;br /&gt;
&lt;br /&gt;
App::cpanminus is a tool for installing and managing Perl modules from the popular CPAN repository. It does a lot of the same tasks, and follows a lot of the same UI conventions, as &amp;lt;code&amp;gt;pip&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;gem&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;npm&amp;lt;/code&amp;gt;, and similar tools. You can install it from your distribution:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install cpanminus&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install perl-App-cpanminus&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If your system doesn’t have a cpanminus package available, you can install it from source following the [https://metacpan.org/pod/App::cpanminus#INSTALLATION project instructions].&lt;br /&gt;
&lt;br /&gt;
App::Virtualenv is a tool to create a dedicated space where you install and manage a self-contained set of Perl modules. (If you’re familiar with Python virtual environments, the concept is the same and App::Virtualenv follows a lot of the same usage patterns.) Using it helps avoid situations where changes to distribution packages might potentially break RT. This guide will illustrate creating and using a virtual environment for RT in &amp;lt;code&amp;gt;/opt/rt5venv&amp;lt;/code&amp;gt;, but you can choose another location if you like.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cpanm --sudo App::Virtualenv&lt;br /&gt;
sudo virtualenv.pl --create --empty /opt/rt5venv&amp;lt;/pre&amp;gt;&lt;br /&gt;
Now whenever you want to work on RT (by installing it, upgrading dependencies, installing new extensions, etc.), you need to activate the virtualenv in your shell. This sets various environment variables that your shell uses to work on Perl modules in the right place. You activate the virtualenv by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;. /opt/rt5venv/bin/activate&amp;lt;/pre&amp;gt;&lt;br /&gt;
== Install RT ==&lt;br /&gt;
&lt;br /&gt;
=== Get and unpack the RT source code ===&lt;br /&gt;
&lt;br /&gt;
Download the latest source code using the link on the [https://bestpractical.com/download-page RT download page], extract it using &amp;lt;code&amp;gt;tar -xf&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt; into the source code directory to run the rest of the commands in this section. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;curl -O https://download.bestpractical.com/pub/rt/release/rt-5.0.2.tar.gz&lt;br /&gt;
tar -xf rt-5.0.2.tar.gz&lt;br /&gt;
cd rt-5.0.2&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Pre-configure RT ===&lt;br /&gt;
&lt;br /&gt;
This command will detect some information about your system in order to install RT properly, and decide which set of dependencies to install. Here’s what the different parts of our command are doing:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;PERL=/opt/rt5venv/bin/perl&amp;lt;/code&amp;gt; ensures RT uses the virtualenv you set up.&lt;br /&gt;
* &amp;lt;code&amp;gt;--with-db-type=TYPE&amp;lt;/code&amp;gt; - Replace &amp;lt;code&amp;gt;TYPE&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;Pg&amp;lt;/code&amp;gt; for PostgreSQL, or &amp;lt;code&amp;gt;mysql&amp;lt;/code&amp;gt; for MariaDB.&lt;br /&gt;
* &amp;lt;code&amp;gt;--prefix=/opt/rt5&amp;lt;/code&amp;gt; sets the directory where RT will install all of its libraries, tools, and supporting files. You can choose another path if you like.&lt;br /&gt;
* The rest of the options tell RT to install additional dependencies for optional features.&lt;br /&gt;
&lt;br /&gt;
Make sure you have &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt;ed into the RT source directory, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;PERL=/opt/rt5venv/bin/perl ./configure --with-db-type=TYPE --prefix=/opt/rt5 --with-attachment-store=disk --enable-externalauth --enable-gd --enable-graphviz --enable-gpg --enable-smime&amp;lt;/pre&amp;gt;&lt;br /&gt;
For more background, [https://docs.bestpractical.com/rt/latest/configure.html refer to the RT configure options documentation].&lt;br /&gt;
&lt;br /&gt;
=== Install RT and its Perl dependencies ===&lt;br /&gt;
&lt;br /&gt;
This command will download, build, and install all of the Perl modules necessary to run RT with the configuration you set above. Here’s what the different parts of the command are doing:&lt;br /&gt;
&lt;br /&gt;
* First we make sure the virtualenv is activated in our shell, so dependencies are installed there.&lt;br /&gt;
* &amp;lt;code&amp;gt;fixdeps&amp;lt;/code&amp;gt; is RT’s command to install dependencies.&lt;br /&gt;
* &amp;lt;code&amp;gt;install&amp;lt;/code&amp;gt; installs all of RT’s files under &amp;lt;code&amp;gt;/opt/rt5&amp;lt;/code&amp;gt; (or the prefix directory you set in the previous step). It will only run if &amp;lt;code&amp;gt;fixdeps&amp;lt;/code&amp;gt; succeeds.&lt;br /&gt;
* &amp;lt;code&amp;gt;RT_FIX_DEPS_CMD=&#039;cpanm --sudo --quiet&#039;&amp;lt;/code&amp;gt; tells RT to use cpanminus to install dependencies (instead of the older, default &amp;lt;code&amp;gt;cpan&amp;lt;/code&amp;gt; command).&lt;br /&gt;
&lt;br /&gt;
Make sure you have &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt;ed into the RT source directory, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;. /opt/rt5venv/bin/activate&lt;br /&gt;
make fixdeps install RT_FIX_DEPS_CMD=&#039;cpanm --sudo --quiet&#039;&amp;lt;/pre&amp;gt;&lt;br /&gt;
If it works, the command will eventually output a message that says “Congratulations. RT is now installed.” followed by instructions about configuring and setting up the database. We’ll do that next.&lt;br /&gt;
&lt;br /&gt;
=== Configure RT ===&lt;br /&gt;
&lt;br /&gt;
[https://docs.bestpractical.com/rt/latest/RT_Config.html RT has many configuration options.] You can put configuration options in the file &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/code&amp;gt;, or in individual files under &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.d/&amp;lt;/code&amp;gt;. Use an editor to save all the text below to &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/code&amp;gt; (you can just overwrite the existing file, or add this to the bottom of what’s there) and then fill in settings for your site everywhere the text &amp;lt;code&amp;gt;EDIT WITH&amp;lt;/code&amp;gt; appears.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Single-quote all values EXCEPT the special value `undef`&lt;br /&gt;
# that turns off a setting.&lt;br /&gt;
&lt;br /&gt;
# rtname appears in ticket email subjects. It needs to be globally unique,&lt;br /&gt;
# so use your organization&#039;s domain name.&lt;br /&gt;
Set($rtname, &#039;EDIT WITH yourdomain.example.com&#039;);&lt;br /&gt;
# Organization is used in the database for ticket links, etc. It also needs to&lt;br /&gt;
# be globally unique, so use your organization&#039;s domain name.&lt;br /&gt;
Set($Organization, &#039;EDIT WITH yourdomain.example.com&#039;);&lt;br /&gt;
# WebDomain is domain name of the RT web server. RT uses it to construct links&lt;br /&gt;
# and defend against CSRFs.&lt;br /&gt;
Set($WebDomain, &#039;EDIT WITH rt.yourdomain.example.com&#039;);&lt;br /&gt;
# WebPort is the port where the RT web server runs. Edit the number below if&lt;br /&gt;
# you&#039;re not using the standard HTTPS port.&lt;br /&gt;
Set($WebPort, &#039;443&#039;);&lt;br /&gt;
&lt;br /&gt;
# DatabaseUser is the name of the database account RT uses to read and store&lt;br /&gt;
# data. &#039;rt_user&#039; is the default but you can change it if you like.&lt;br /&gt;
# DO NOT use the &#039;rt_admin&#039; superuser created in the instructions above.&lt;br /&gt;
Set($DatabaseUser, &#039;rt_user&#039;);&lt;br /&gt;
# DatabasePassword is the password for DatabaseUser.&lt;br /&gt;
Set($DatabasePassword, &#039;EDIT WITH SomePassphraseHere&#039;);&lt;br /&gt;
# DatabaseHost is the hostname of the database server RT should use.&lt;br /&gt;
# Change &#039;localhost&#039; if it lives on a different server.&lt;br /&gt;
Set($DatabaseHost, &#039;localhost&#039;);&lt;br /&gt;
# DatabasePort is the port number of the database server RT should use.&lt;br /&gt;
# `undef` means the default for that database. Change it if you&#039;re not&lt;br /&gt;
# using the standard port.&lt;br /&gt;
Set($DatabasePort, undef);&lt;br /&gt;
# DatabaseName is the name of RT&#039;s database hosted on DatabaseHost.&lt;br /&gt;
# &#039;rt5&#039; is the default but you can change it if you like.&lt;br /&gt;
Set($DatabaseName, &#039;rt5&#039;);&lt;br /&gt;
&lt;br /&gt;
# RT can log to syslog, stderr, and/or a dedicated file. For a modern install,&lt;br /&gt;
# I recommend logging to syslog, so it goes to journald where it&#039;s easy to&lt;br /&gt;
# query and automatically gets rotated. You set both these paramaters to a&lt;br /&gt;
# standard log level: &#039;debug&#039;, &#039;info&#039;, &#039;notice&#039;, &#039;warning&#039;, &#039;error&#039;,&lt;br /&gt;
# &#039;critical&#039;, &#039;alert&#039;, or &#039;emergency&#039;.&lt;br /&gt;
Set($LogToSyslog, &#039;info&#039;);&lt;br /&gt;
Set($LogToSTDERR, undef);&lt;br /&gt;
&lt;br /&gt;
# Turn off optional features that require additional configuration.&lt;br /&gt;
# If you want to use these, refer to the RT_Config documentation for&lt;br /&gt;
# instructions on how to set them up.&lt;br /&gt;
Set(%GnuPG, &#039;Enable&#039; =&amp;gt; &#039;0&#039;);&lt;br /&gt;
Set(%SMIME, &#039;Enable&#039; =&amp;gt; &#039;0&#039;);&lt;br /&gt;
&lt;br /&gt;
# Perl expects to find this 1 at the end of the file.&lt;br /&gt;
1;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;RT_SiteConfig.pm&amp;lt;/code&amp;gt; is actually Perl code. RT runs the code directly to load the configuration. Any time you finish editing it, you can check that you didn’t make any syntax errors by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;perl -c /opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Set up RT’s database ===&lt;br /&gt;
&lt;br /&gt;
RT includes a tool to help you set up its database. By default, it connects to the database as an administrator to create the database and user that you configured in the previous step.&lt;br /&gt;
&lt;br /&gt;
(The instructions from &amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt; and RT’s README file tell you to run &amp;lt;code&amp;gt;make initialize-database&amp;lt;/code&amp;gt;. That just runs &amp;lt;code&amp;gt;rt-setup-database&amp;lt;/code&amp;gt; for you. Running the tool directly makes it easier to pass the options you need.)&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;--action=init&amp;lt;/code&amp;gt; tells the tool to create the user, the database, the tables inside it, and insert core data RT needs to function.&lt;br /&gt;
* &amp;lt;code&amp;gt;--dba=rt_admin&amp;lt;/code&amp;gt; provides the username of the administrator account to use to do the setup. &amp;lt;code&amp;gt;rt_admin&amp;lt;/code&amp;gt; is the name we used earlier to set up a new database server. You can specify a different value if your database has a different adminsitrator account.&lt;br /&gt;
* &#039;&#039;&#039;If&#039;&#039;&#039; you are using an existing database server and the database adminstrator has already created the user account and database for RT, then you can add the &amp;lt;code&amp;gt;--skip-create&amp;lt;/code&amp;gt; option.&lt;br /&gt;
* &#039;&#039;&#039;If&#039;&#039;&#039; you have a less common database setup, this tool has additional options to give you finer-grained control over what steps are run and how. Refer to [https://docs.bestpractical.com/rt/latest/rt-setup-database.html the full rt-setup-database documentation] to learn more about those.&lt;br /&gt;
* The command reads files from RT’s &amp;lt;code&amp;gt;etc/&amp;lt;/code&amp;gt; directory by default, so the easiest way to run it is to &amp;lt;code&amp;gt;cd /opt/rt5&amp;lt;/code&amp;gt; first, and then it will find the necessary files automatically.&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /opt/rt5&lt;br /&gt;
sudo sbin/rt-setup-database --action=init --dba=rt_admin&amp;lt;/pre&amp;gt;&lt;br /&gt;
Enter the password for your database administrator account when prompted.&lt;br /&gt;
&lt;br /&gt;
=== Set up fulltext indexing ===&lt;br /&gt;
&lt;br /&gt;
Fulltext indexing speeds up searches for ticket content, which makes RT a lot nicer to use.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;--noask&amp;lt;/code&amp;gt; uses the default names for the index, which will be fine for a new install and simplifies the setup.&lt;br /&gt;
* &amp;lt;code&amp;gt;--dba=rt_admin&amp;lt;/code&amp;gt; provides the username of the administrator account to use to do the setup. &amp;lt;code&amp;gt;rt_admin&amp;lt;/code&amp;gt; is the name we used earlier to set up a new database server. You can specify a different value if your database has a different adminsitrator account.&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo /opt/rt5/sbin/rt-setup-fulltext-index --noask --dba=rt_admin&amp;lt;/pre&amp;gt;&lt;br /&gt;
Enter the password for your database administrator account when prompted. The end of the process will output some RT configuration that looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Set( %FullTextSearch,&lt;br /&gt;
    Enable     =&amp;gt; 1,&lt;br /&gt;
    Indexed    =&amp;gt; 1,&lt;br /&gt;
    # Additional output from rt-setup-fulltext-index should be here.&lt;br /&gt;
    # The configuration varies by database type.&lt;br /&gt;
);&amp;lt;/pre&amp;gt;&lt;br /&gt;
Copy that output and save it to the file &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.d/FulltextIndex.pm&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Set permissions ===&lt;br /&gt;
&lt;br /&gt;
All of RT’s configuration files should be readable by the user that runs the web server, and no other users, in order to protect sensitive information like the database password. RT provides a command to set permissions appropriately according to your distribution and configuration. &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt; to the directory where you extracted the RT source code, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd rt-5.0.2&lt;br /&gt;
sudo make fixperms&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Verify the installation ===&lt;br /&gt;
&lt;br /&gt;
If everything has gone well, then you should be able to set a password for RT’s &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; user. You’ll use this later to log in to the web interface and continue setting up your system. Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo /opt/rt5/sbin/rt-passwd root&amp;lt;/pre&amp;gt;&lt;br /&gt;
Set the password when prompted. Record this; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s web server ==&lt;br /&gt;
&lt;br /&gt;
=== Configure Apache modules ===&lt;br /&gt;
&lt;br /&gt;
You will need to have the following modules enabled in Apache to run RT. You should already have these installed if you followed the instructions above.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;alias&amp;lt;/code&amp;gt; (required to map URLs to RT)&lt;br /&gt;
* &amp;lt;code&amp;gt;fcgid&amp;lt;/code&amp;gt; (required for Apache to talk to RT)&lt;br /&gt;
* &amp;lt;code&amp;gt;mpm_prefork&amp;lt;/code&amp;gt; (Apache requires you to select an MPM. RT is designed to work with the prefork module.)&lt;br /&gt;
* &amp;lt;code&amp;gt;ssl&amp;lt;/code&amp;gt; (required to serve HTTPS; optional otherwise)&lt;br /&gt;
&lt;br /&gt;
Enable them following these instructions:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo a2dismod mpm_event&lt;br /&gt;
sudo a2enmod fcgid&lt;br /&gt;
sudo a2enmod mpm_prefork&lt;br /&gt;
sudo a2enmod ssl&amp;lt;/pre&amp;gt;&lt;br /&gt;
| &amp;lt;pre&amp;gt;echo LoadModule mpm_prefork_module modules/mod_mpm_prefork.so | sudo tee /etc/httpd/conf.modules.d/00-mpm.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Configure an Apache VirtualHost ===&lt;br /&gt;
&lt;br /&gt;
Create a file at the following location. You can change the &amp;lt;code&amp;gt;RT&amp;lt;/code&amp;gt; part of the filename if you like, but the file must exist in this directory and have a &amp;lt;code&amp;gt;.conf&amp;lt;/code&amp;gt; suffix.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;/etc/apache2/sites-available/RT.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
Then after you create the file, run: &amp;lt;code&amp;gt;sudo a2ensite RT&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;/etc/httpd/conf.d/RT.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Use an editor to save all the text below to the new &amp;lt;code&amp;gt;RT.conf&amp;lt;/code&amp;gt; and then fill in settings for your site everywhere the text &amp;lt;code&amp;gt;EDIT WITH&amp;lt;/code&amp;gt; appears.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### Server-level settings&lt;br /&gt;
# These settings affect all of Apache. It is okay to put them here if Apache&lt;br /&gt;
# only hosts RT. If you are hosting other sites in the same Apache instance,&lt;br /&gt;
# you may need to put these settings in another file like&lt;br /&gt;
# (Debian/Ubuntu) /etc/apache2/conf-available/RT.conf&lt;br /&gt;
# (Red Hat/Fedora/CentOS) /etc/httpd/conf.d/RTserver.conf&lt;br /&gt;
# ... and ensure they do not conflict with settings required by other sites.&lt;br /&gt;
&lt;br /&gt;
# mod_fcgid only allows 128KiB requests by default. This is too small for users&lt;br /&gt;
# to upload files to RT. You can ultimately choose any setting you&#039;re&lt;br /&gt;
# comfortable with; 70MiB here should allow most requests without being too&lt;br /&gt;
# open.&lt;br /&gt;
FcgidMaxRequestLen 73400320&lt;br /&gt;
&lt;br /&gt;
&amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
  # Listen on the standard HTTPS port.&lt;br /&gt;
  # You can change this to a nonstandard port if you must.&lt;br /&gt;
  Listen 443&lt;br /&gt;
&amp;lt;/IfModule&amp;gt;&lt;br /&gt;
### End server-level settings&lt;br /&gt;
&lt;br /&gt;
### Primary RT VirtualHost&lt;br /&gt;
# You can change both the bind address and/or the port here as required.&lt;br /&gt;
# This default will listen for HTTPS connections on all interfaces.&lt;br /&gt;
&amp;lt;VirtualHost *:443&amp;gt;&lt;br /&gt;
  # EDIT HERE with the domain name of the web server.&lt;br /&gt;
  ServerName rt.yourdomain.example.com&lt;br /&gt;
  &amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
    SSLEngine on&lt;br /&gt;
    # These specify the paths to the SSL certificate and private key Apache&lt;br /&gt;
    # should use. These example paths are common for Let&#039;s Encrypt. If you&lt;br /&gt;
    # don&#039;t use Let&#039;s Encrypt, the standard location for these files is under&lt;br /&gt;
    # (Debian/Ubuntu) /etc/ssl&lt;br /&gt;
    # (Red Hat/Fedora/CentOS) /etc/pki/tls&lt;br /&gt;
    # EDIT HERE with the appropriate paths for your server&lt;br /&gt;
    SSLCertificateFile /etc/letsencrypt/live/example.com/cert.pem&lt;br /&gt;
    SSLCertificateChainFile /etc/letsencrypt/live/example.com/chain.pem&lt;br /&gt;
    SSLCertificateKeyFile /etc/letsencrypt/live/example.com/privkey.pem&lt;br /&gt;
  &amp;lt;/IfModule&amp;gt;&lt;br /&gt;
  &amp;lt;Location /&amp;gt;&lt;br /&gt;
    Require all granted&lt;br /&gt;
    Options +ExecCGI&lt;br /&gt;
    AddHandler fcgid-script fcgi&lt;br /&gt;
  &amp;lt;/Location&amp;gt;&lt;br /&gt;
  AddDefaultCharset UTF-8&lt;br /&gt;
  DocumentRoot /opt/rt5/share/html&lt;br /&gt;
  ScriptAlias / /opt/rt5/sbin/rt-server.fcgi/&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
### End primary RT VirtualHost&lt;br /&gt;
&lt;br /&gt;
### Optional HTTPS Redirect VirtualHost&lt;br /&gt;
# Most modern servers support HTTPS and want all web traffic to go through it.&lt;br /&gt;
# This VirtualHost redirects normal HTTP traffic to HTTPS.&lt;br /&gt;
# You can delete this whole section if you don&#039;t want or need this.&lt;br /&gt;
&amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
  # You can change both the bind address and/or the port here as required.&lt;br /&gt;
  # This default will listen for HTTP connections on all interfaces.&lt;br /&gt;
  &amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
    SSLEngine off&lt;br /&gt;
    # EDIT HERE both lines below with the domain name of your web server.&lt;br /&gt;
    ServerName rt.yourdomain.example.com&lt;br /&gt;
    Redirect permanent / https://rt.yourdomain.example.com/&lt;br /&gt;
  &amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/IfModule&amp;gt;&lt;br /&gt;
### End optional HTTPS Redirect VirtualHost&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
After you’ve edited the file, load the configuration with:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo systemctl reload apache2&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo systemctl reload httpd&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If this command reports an error, double-check the configuration file for typos, especially in option names, file paths, and the&lt;br /&gt;
&amp;lt;Section&amp;gt;&lt;br /&gt;
pairs. Edit again and reload the configuration until it succeeds without output.&lt;br /&gt;
&lt;br /&gt;
=== Verify the web interface ===&lt;br /&gt;
&lt;br /&gt;
You should be able to visit your web server in your browser, and be presented with RT’s login screen. You should be able to log in with username &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; and the password you set previously.&lt;br /&gt;
&lt;br /&gt;
If you run into trouble, the first place to look for more information is by reading Apache’s error log:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo less /var/log/apache2/error.log&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo less /var/log/httpd/error.log&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s mail server ==&lt;br /&gt;
&lt;br /&gt;
RT both can both send and receive ticket updates via email. Unfortunately, there are too many variables to document a useful setup process here: getting this working usually requires creating DNS records, and coordinating with existing mail servers, which will be the main constraint on your setup. Instead this guide provides a brief overview of how the integration works, and where the connection points are that you likely need to work on.&lt;br /&gt;
&lt;br /&gt;
=== Sending Mail ===&lt;br /&gt;
&lt;br /&gt;
RT only knows how to send mail by passing it off to another program on the system. It cannot connect or authenticate directly to external mail servers. In the default configuration, RT runs the standard &amp;lt;code&amp;gt;sendmail&amp;lt;/code&amp;gt; command. There are [https://docs.bestpractical.com/rt/latest/RT_Config.html#Outgoing-mail configuration options to send mail through different commands] if you need.&lt;br /&gt;
&lt;br /&gt;
The most common setup is to install and configure a proper Mail Transfer Agent (MTA) like Postfix or Exim, and then configure it to send mail to the wider Internet as you need. This works well because the MTAs are robust and well-tested; they have flexible configuration to let you send mail out by relaying to other mail servers you specify with optional authentication; and most distributions install one by default anyway. The only hard part is configuring the MTA to send mail following your site’s policies.&lt;br /&gt;
&lt;br /&gt;
Other software is available that provides a slimmer version of the &amp;lt;code&amp;gt;sendmail&amp;lt;/code&amp;gt; command that connects to an external mail server for you, like ssmtp. These programs are usually easier to configure than an MTA, but they often lose email permanently if they can’t connect to the external server at the time it’s sent. (MTAs keep email queued locally until they successfully deliver it to another server.)&lt;br /&gt;
&lt;br /&gt;
=== Receiving email ===&lt;br /&gt;
&lt;br /&gt;
RT installs a command called &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; that receives an email on standard input and posts it to RT’s REST web interface, where it gets saved in the database and added to a ticket. You need to arrange for a way to send incoming email to this command.&lt;br /&gt;
&lt;br /&gt;
The most common setup is to have an MTA on the same box as RT receive email directly, and then set up mail aliases that call this command when mail comes in. Example &amp;lt;code&amp;gt;/etc/aliases&amp;lt;/code&amp;gt; entries look like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rt: &amp;quot;|/opt/rt5/bin/rt-mailgate --queue general --action correspond --url https://rt.yourdomain.example.com/&amp;quot;&lt;br /&gt;
rt-comment: &amp;quot;|/opt/rt5/bin/rt-mailgate --queue general --action comment --url https://rt.yourdomain.example.com/&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
This works well because, again, you’re probably running an MTA anyway; and the MTA can hold and queue mail if it comes in while RT is down for any reason, giving you a buffer against downtime.&lt;br /&gt;
&lt;br /&gt;
Another common option is to periodically run a tool that fetches mail using a protocol like IMAP, like fetchmail or getmail, and passes it on to &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt;. This is less common because it requires setting up another tool to run, and securely storing another set of mail server credentials. But it is useful when local policy prevents the RT server from receiving email directly.&lt;br /&gt;
&lt;br /&gt;
This is much less common, but it might help to know that &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; doesn’t have to run on the same system as RT itself. It just needs to be able to connect to RT’s web interface. If you don’t have any other options, you can install the RT software on a different system that receives email, and configure &#039;&#039;that&#039;&#039; system to run &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; and pass it on to the RT server. To do that, just repeat the installation instructions above, skipping the steps about installing the database and web server.&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s background jobs ==&lt;br /&gt;
&lt;br /&gt;
Create a file &amp;lt;code&amp;gt;/etc/cron.d/rt&amp;lt;/code&amp;gt; with the following content. You may edit all of the time fields as you see fit. Refer to the crontab(5) man page for details about their definitions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Update the fulltext index with new ticket data&lt;br /&gt;
*/3 *   *   *   *   root    /opt/rt5/sbin/rt-fulltext-indexer&lt;br /&gt;
# Email out dashboards that users have subscribed to&lt;br /&gt;
0   *   *   *   *   root    /opt/rt5/sbin/rt-email-dashboards&lt;br /&gt;
# Clean old sessions from the database&lt;br /&gt;
10  3   *   *   *   root    /opt/rt5/sbin/rt-clean-sessions --older 8d&lt;br /&gt;
# Email out weekly digests for users who have requested it&lt;br /&gt;
50  4   *   *   Mon root    /opt/rt5/sbin/rt-email-digest -m weekly&lt;br /&gt;
# Email out daily digests for users who have requested it&lt;br /&gt;
50  5   *   *   *   root    /opt/rt5/sbin/rt-email-digest -m daily&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
You can run all these jobs as the same user that runs your web server, rather than root. Run:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo sed -i &#039;s/\broot\b/www-data/&#039; /etc/cron.d/rt&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo sed -i &#039;s/\broot\b/apache/&#039; /etc/cron.d/rt&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Set up RT ==&lt;br /&gt;
&lt;br /&gt;
If you’ve gotten this far, congratulations, your RT install is really done now. You can start setting up RT with users, groups, queues, and business logic. [[Head back to the main page]] to start exploring those topics.&lt;/div&gt;</summary>
		<author><name>Brett</name></author>
	</entry>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=ManualInstallation&amp;diff=27032</id>
		<title>ManualInstallation</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=ManualInstallation&amp;diff=27032"/>
		<updated>2021-10-26T19:17:25Z</updated>

		<summary type="html">&lt;p&gt;Brett: convert to wiki markup&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Prev: [[ManualRequirements]] — Up: [[UserManual]] — Next: [[ManualApacheConfig]]&lt;br /&gt;
&lt;br /&gt;
This guide walks you through installing RT from source on a modern, popular Linux distro. Specifically, that means a distribution based on Debian or Red Hat that’s been released since around 2020.&lt;br /&gt;
&lt;br /&gt;
This guide assumes:&lt;br /&gt;
&lt;br /&gt;
* You can install packages generally available in Debian/Ubuntu or Red Hat/Fedora/CentOS.&lt;br /&gt;
* You want to install RT, and all of its Perl dependencies, from source to get the latest versions. (This is a trade-off. It means the boundaries of your install will be very clear, but you won’t get security updates for RT or Perl modules from your distribution.)&lt;br /&gt;
* You are willing to install a couple of extra tools to manage the RT installation similarly to how you would in other packaging systems (like PyPI, npm, etc.).&lt;br /&gt;
* You are willing to do a relatively maximal install of RT, enabling all the options during installation and then setting what you need in the configuration. (You could save a little space and time by being pickier about your options, but then that complicates the guide and makes it harder to turn those options on later if you want.)&lt;br /&gt;
* You are using a regular user account on the Linux system that can get superuser privileges with sudo.&lt;br /&gt;
&lt;br /&gt;
== Install the base dependencies ==&lt;br /&gt;
&lt;br /&gt;
These are required by RT, either to run or to install the dependencies.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install autoconf build-essential curl libexpat-dev libgd-dev libssl-dev libz-dev gnupg graphviz perl w3m&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install patch tar which gcc gcc-c++ perl-core perl-ExtUtils-MakeMaker graphviz expat-devel gd-devel openssl-devel w3m&lt;br /&gt;
sudo setenforce 0&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
(Turning off SELinux enforcement is required on Red Hat-based distributions because, as of October 2021, nobody has written a policy for RT.)&lt;br /&gt;
&lt;br /&gt;
== Install a database ==&lt;br /&gt;
&lt;br /&gt;
You need access to a database server. It can be remote, or you can install a database server alongside RT. RT supports a few different databases, but the best supported options are PostgreSQL and MariaDB.&lt;br /&gt;
&lt;br /&gt;
=== Installing and configuring the PostgreSQL server ===&lt;br /&gt;
&lt;br /&gt;
If you want to install a fresh PostgreSQL database server alongside RT:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install postgresql&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install postgresql-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In order to set up RT’s database, you will need a PostgreSQL superuser account that can be authenticated with a password. If you don’t have that, you can create it by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo createuser -sP rt_admin&amp;lt;/pre&amp;gt;&lt;br /&gt;
Set the password when prompted. Record this; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
=== Installing the PostgreSQL client libraries ===&lt;br /&gt;
&lt;br /&gt;
These are required for RT to be able to talk to any PostgreSQL server.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install libpq5&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install postgresql-devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Once this is done you can skip ahead to installing a web server.&lt;br /&gt;
&lt;br /&gt;
=== Installing and configuring the MariaDB server ===&lt;br /&gt;
&lt;br /&gt;
If you want to install a fresh MariaDB database server alongside RT:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install mariadb-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install mariadb-server&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In order to set up RT’s database, you will need a MySQL superuser account. To stay consistent with PostgreSQL, I suggest setting a password for it. You can do that by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo mysql&lt;br /&gt;
mysql# GRANT ALL PRIVELEGES WITH GRANT OPTION ON rt5 TO rt_admin@localhost IDENTIFIED BY &#039;YourPassphraseHere&#039;;&amp;lt;/pre&amp;gt;&lt;br /&gt;
Record your passphrase; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
=== Adjust MariaDB’s max_allowed_packet setting ===&lt;br /&gt;
&lt;br /&gt;
You need to consider this step whether you install the database locally, or use an existing one already running. [https://mariadb.com/kb/en/server-system-variables/#max_allowed_packet MariaDB’s &amp;lt;code&amp;gt;max_allowed_packet&amp;lt;/code&amp;gt; setting] functionally limits the size of attachments in RT. The default is 16MiB, which is too small for most installations. You can ultimately choose any setting you’re comfortable with; 64MiB here should allow most requests without being too open.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;echo -e &#039;[client-server]\nmax_allowed_packet=64M\n&#039; | sudo tee /etc/mysql/conf.d/max_allowed_packet.cnf&lt;br /&gt;
sudo systemctl reload mariadb&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;echo -e &#039;[client-server]\nmax_allowed_packet=64M\n&#039; | sudo tee /etc/my.cnf.d/max_allowed_packet.cnf&lt;br /&gt;
sudo systemctl reload mariadb&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Installing the MariaDB client libraries ===&lt;br /&gt;
&lt;br /&gt;
These are required for RT to be able to talk to any MariaDB server.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install libmariadb3&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install mariadb-devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Install a web server with FastCGI ==&lt;br /&gt;
&lt;br /&gt;
FastCGI is the best way to host RT’s web interface today. Installing the web server before RT makes the installation process simpler, because RT will be able to automatically some details about your web server like what user it runs as.&lt;br /&gt;
&lt;br /&gt;
=== Installing Apache ===&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install apache2 libapache2-mod-fcgid&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install httpd mod_fcgid mod_ssl&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ### Installing nginx --&amp;gt;&lt;br /&gt;
== Install Perl packaging tools: App::cpanminus and App::Virtualenv ==&lt;br /&gt;
&lt;br /&gt;
App::cpanminus is a tool for installing and managing Perl modules from the popular CPAN repository. It does a lot of the same tasks, and follows a lot of the same UI conventions, as &amp;lt;code&amp;gt;pip&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;gem&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;npm&amp;lt;/code&amp;gt;, and similar tools. You can install it from your distribution:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo apt install cpanminus&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo dnf install perl-App-cpanminus&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If your system doesn’t have a cpanminus package available, you can install it from source following the [https://metacpan.org/pod/App::cpanminus#INSTALLATION project instructions].&lt;br /&gt;
&lt;br /&gt;
App::Virtualenv is a tool to create a dedicated space where you install and manage a self-contained set of Perl modules. (If you’re familiar with Python virtual environments, the concept is the same and App::Virtualenv follows a lot of the same usage patterns.) Using it helps avoid situations where changes to distribution packages might potentially break RT. This guide will illustrate creating and using a virtual environment for RT in &amp;lt;code&amp;gt;/opt/rt5venv&amp;lt;/code&amp;gt;, but you can choose another location if you like.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cpanm --sudo App::Virtualenv&lt;br /&gt;
sudo virtualenv.pl --create --empty /opt/rt5venv&amp;lt;/pre&amp;gt;&lt;br /&gt;
Now whenever you want to work on RT (by installing it, upgrading dependencies, installing new extensions, etc.), you need to activate the virtualenv in your shell. This sets various environment variables that your shell uses to work on Perl modules in the right place. You activate the virtualenv by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;. /opt/rt5venv/bin/activate&amp;lt;/pre&amp;gt;&lt;br /&gt;
== Install RT ==&lt;br /&gt;
&lt;br /&gt;
=== Get and unpack the RT source code ===&lt;br /&gt;
&lt;br /&gt;
Download the latest source code using the link on the [https://bestpractical.com/download-page RT download page], extract it using &amp;lt;code&amp;gt;tar -xf&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt; into the source code directory to run the rest of the commands in this section. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;curl -O https://download.bestpractical.com/pub/rt/release/rt-5.0.2.tar.gz&lt;br /&gt;
tar -xf rt-5.0.2.tar.gz&lt;br /&gt;
cd rt-5.0.2&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Pre-configure RT ===&lt;br /&gt;
&lt;br /&gt;
This command will detect some information about your system in order to install RT properly, and decide which set of dependencies to install. Here’s what the different parts of our command are doing:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;PERL=/opt/rt5venv/bin/perl&amp;lt;/code&amp;gt; ensures RT uses the virtualenv you set up.&lt;br /&gt;
* &amp;lt;code&amp;gt;--with-db-type=TYPE&amp;lt;/code&amp;gt; - Replace &amp;lt;code&amp;gt;TYPE&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;Pg&amp;lt;/code&amp;gt; for PostgreSQL, or &amp;lt;code&amp;gt;mysql&amp;lt;/code&amp;gt; for MariaDB.&lt;br /&gt;
* &amp;lt;code&amp;gt;--prefix=/opt/rt5&amp;lt;/code&amp;gt; sets the directory where RT will install all of its libraries, tools, and supporting files. You can choose another path if you like.&lt;br /&gt;
* The rest of the options tell RT to install additional dependencies for optional features.&lt;br /&gt;
&lt;br /&gt;
Make sure you have &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt;ed into the RT source directory, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;PERL=/opt/rt5venv/bin/perl ./configure --with-db-type=TYPE --prefix=/opt/rt5 --with-attachment-store=disk --enable-externalauth --enable-gd --enable-graphviz --enable-gpg --enable-smime&amp;lt;/pre&amp;gt;&lt;br /&gt;
For more background, [https://docs.bestpractical.com/rt/latest/configure.html refer to the RT configure options documentation].&lt;br /&gt;
&lt;br /&gt;
=== Install RT and its Perl dependencies ===&lt;br /&gt;
&lt;br /&gt;
This command will download, build, and install all of the Perl modules necessary to run RT with the configuration you set above. Here’s what the different parts of the command are doing:&lt;br /&gt;
&lt;br /&gt;
* First we make sure the virtualenv is activated in our shell, so dependencies are installed there.&lt;br /&gt;
* &amp;lt;code&amp;gt;fixdeps&amp;lt;/code&amp;gt; is RT’s command to install dependencies.&lt;br /&gt;
* &amp;lt;code&amp;gt;install&amp;lt;/code&amp;gt; installs all of RT’s files under &amp;lt;code&amp;gt;/opt/rt5&amp;lt;/code&amp;gt; (or the prefix directory you set in the previous step). It will only run if &amp;lt;code&amp;gt;fixdeps&amp;lt;/code&amp;gt; succeeds.&lt;br /&gt;
* &amp;lt;code&amp;gt;RT_FIX_DEPS_CMD=&#039;cpanm --sudo --quiet&#039;&amp;lt;/code&amp;gt; tells RT to use cpanminus to install dependencies (instead of the older, default &amp;lt;code&amp;gt;cpan&amp;lt;/code&amp;gt; command).&lt;br /&gt;
&lt;br /&gt;
Make sure you have &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt;ed into the RT source directory, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;. /opt/rt5venv/bin/activate&lt;br /&gt;
make fixdeps install RT_FIX_DEPS_CMD=&#039;cpanm --sudo --quiet&#039;&amp;lt;/pre&amp;gt;&lt;br /&gt;
If it works, the command will eventually output a message that says “Congratulations. RT is now installed.” followed by instructions about configuring and setting up the database. We’ll do that next.&lt;br /&gt;
&lt;br /&gt;
=== Configure RT ===&lt;br /&gt;
&lt;br /&gt;
[https://docs.bestpractical.com/rt/latest/RT_Config.html RT has many configuration options.] You can put configuration options in the file &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/code&amp;gt;, or in individual files under &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.d/&amp;lt;/code&amp;gt;. Use an editor to save all the text below to &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/code&amp;gt; (you can just overwrite the existing file, or add this to the bottom of what’s there) and then fill in settings for your site everywhere the text &amp;lt;code&amp;gt;EDIT WITH&amp;lt;/code&amp;gt; appears.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Single-quote all values EXCEPT the special value `undef`&lt;br /&gt;
# that turns off a setting.&lt;br /&gt;
&lt;br /&gt;
# rtname appears in ticket email subjects. It needs to be globally unique,&lt;br /&gt;
# so use your organization&#039;s domain name.&lt;br /&gt;
Set($rtname, &#039;EDIT WITH yourdomain.example.com&#039;);&lt;br /&gt;
# Organization is used in the database for ticket links, etc. It also needs to&lt;br /&gt;
# be globally unique, so use your organization&#039;s domain name.&lt;br /&gt;
Set($Organization, &#039;EDIT WITH yourdomain.example.com&#039;);&lt;br /&gt;
# WebDomain is domain name of the RT web server. RT uses it to construct links&lt;br /&gt;
# and defend against CSRFs.&lt;br /&gt;
Set($WebDomain, &#039;EDIT WITH rt.yourdomain.example.com&#039;);&lt;br /&gt;
# WebPort is the port where the RT web server runs. Edit the number below if&lt;br /&gt;
# you&#039;re not using the standard HTTPS port.&lt;br /&gt;
Set($WebPort, &#039;443&#039;);&lt;br /&gt;
&lt;br /&gt;
# DatabaseUser is the name of the database account RT uses to read and store&lt;br /&gt;
# data. &#039;rt_user&#039; is the default but you can change it if you like.&lt;br /&gt;
# DO NOT use the &#039;rt_admin&#039; superuser created in the instructions above.&lt;br /&gt;
Set($DatabaseUser, &#039;rt_user&#039;);&lt;br /&gt;
# DatabasePassword is the password for DatabaseUser.&lt;br /&gt;
Set($DatabasePassword, &#039;EDIT WITH SomePassphraseHere&#039;);&lt;br /&gt;
# DatabaseHost is the hostname of the database server RT should use.&lt;br /&gt;
# Change &#039;localhost&#039; if it lives on a different server.&lt;br /&gt;
Set($DatabaseHost, &#039;localhost&#039;);&lt;br /&gt;
# DatabasePort is the port number of the database server RT should use.&lt;br /&gt;
# `undef` means the default for that database. Change it if you&#039;re not&lt;br /&gt;
# using the standard port.&lt;br /&gt;
Set($DatabasePort, undef);&lt;br /&gt;
# DatabaseName is the name of RT&#039;s database hosted on DatabaseHost.&lt;br /&gt;
# &#039;rt5&#039; is the default but you can change it if you like.&lt;br /&gt;
Set($DatabaseName, &#039;rt5&#039;);&lt;br /&gt;
&lt;br /&gt;
# RT can log to syslog, stderr, and/or a dedicated file. For a modern install,&lt;br /&gt;
# I recommend logging to syslog, so it goes to journald where it&#039;s easy to&lt;br /&gt;
# query and automatically gets rotated. You set both these paramaters to a&lt;br /&gt;
# standard log level: &#039;debug&#039;, &#039;info&#039;, &#039;notice&#039;, &#039;warning&#039;, &#039;error&#039;,&lt;br /&gt;
# &#039;critical&#039;, &#039;alert&#039;, or &#039;emergency&#039;.&lt;br /&gt;
Set($LogToSyslog, &#039;info&#039;);&lt;br /&gt;
Set($LogToSTDERR, undef);&lt;br /&gt;
&lt;br /&gt;
# Turn off optional features that require additional configuration.&lt;br /&gt;
# If you want to use these, refer to the RT_Config documentation for&lt;br /&gt;
# instructions on how to set them up.&lt;br /&gt;
Set(%GnuPG, &#039;Enable&#039; =&amp;gt; &#039;0&#039;);&lt;br /&gt;
Set(%SMIME, &#039;Enable&#039; =&amp;gt; &#039;0&#039;);&lt;br /&gt;
&lt;br /&gt;
# Perl expects to find this 1 at the end of the file.&lt;br /&gt;
1;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;RT_SiteConfig.pm&amp;lt;/code&amp;gt; is actually Perl code. RT runs the code directly to load the configuration. Any time you finish editing it, you can check that you didn’t make any syntax errors by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;perl -c /opt/rt5/etc/RT_SiteConfig.pm&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Set up RT’s database ===&lt;br /&gt;
&lt;br /&gt;
RT includes a tool to help you set up its database. By default, it connects to the database as an administrator to create the database and user that you configured in the previous step.&lt;br /&gt;
&lt;br /&gt;
(The instructions from &amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt; and RT’s README file tell you to run &amp;lt;code&amp;gt;make initialize-database&amp;lt;/code&amp;gt;. That just runs &amp;lt;code&amp;gt;rt-setup-database&amp;lt;/code&amp;gt; for you. Running the tool directly makes it easier to pass the options you need.)&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;--action=init&amp;lt;/code&amp;gt; tells the tool to create the user, the database, the tables inside it, and insert core data RT needs to function.&lt;br /&gt;
* &amp;lt;code&amp;gt;--dba=rt_admin&amp;lt;/code&amp;gt; provides the username of the administrator account to use to do the setup. &amp;lt;code&amp;gt;rt_admin&amp;lt;/code&amp;gt; is the name we used earlier to set up a new database server. You can specify a different value if your database has a different adminsitrator account.&lt;br /&gt;
* &#039;&#039;&#039;If&#039;&#039;&#039; you are using an existing database server and the database adminstrator has already created the user account and database for RT, then you can add the &amp;lt;code&amp;gt;--skip-create&amp;lt;/code&amp;gt; option.&lt;br /&gt;
* &#039;&#039;&#039;If&#039;&#039;&#039; you have a less common database setup, this tool has additional options to give you finer-grained control over what steps are run and how. Refer to [https://docs.bestpractical.com/rt/latest/rt-setup-database.html the full rt-setup-database documentation] to learn more about those.&lt;br /&gt;
* The command reads files from RT’s &amp;lt;code&amp;gt;etc/&amp;lt;/code&amp;gt; directory by default, so the easiest way to run it is to &amp;lt;code&amp;gt;cd /opt/rt5&amp;lt;/code&amp;gt; first, and then it will find the necessary files automatically.&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /opt/rt5&lt;br /&gt;
sudo sbin/rt-setup-database --action=init --dba=rt_admin&amp;lt;/pre&amp;gt;&lt;br /&gt;
Enter the password for your database administrator account when prompted.&lt;br /&gt;
&lt;br /&gt;
=== Set up fulltext indexing ===&lt;br /&gt;
&lt;br /&gt;
Fulltext indexing speeds up searches for ticket content, which makes RT a lot nicer to use.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;--noask&amp;lt;/code&amp;gt; uses the default names for the index, which will be fine for a new install and simplifies the setup.&lt;br /&gt;
* &amp;lt;code&amp;gt;--dba=rt_admin&amp;lt;/code&amp;gt; provides the username of the administrator account to use to do the setup. &amp;lt;code&amp;gt;rt_admin&amp;lt;/code&amp;gt; is the name we used earlier to set up a new database server. You can specify a different value if your database has a different adminsitrator account.&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo /opt/rt5/sbin/rt-setup-fulltext-index --noask --dba=rt_admin&amp;lt;/pre&amp;gt;&lt;br /&gt;
Enter the password for your database administrator account when prompted. The end of the process will output some RT configuration that looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Set( %FullTextSearch,&lt;br /&gt;
    Enable     =&amp;gt; 1,&lt;br /&gt;
    Indexed    =&amp;gt; 1,&lt;br /&gt;
    # Additional output from rt-setup-fulltext-index should be here.&lt;br /&gt;
    # The configuration varies by database type.&lt;br /&gt;
);&amp;lt;/pre&amp;gt;&lt;br /&gt;
Copy that output and save it to the file &amp;lt;code&amp;gt;/opt/rt5/etc/RT_SiteConfig.d/FulltextIndex.pm&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Set permissions ===&lt;br /&gt;
&lt;br /&gt;
All of RT’s configuration files should be readable by the user that runs the web server, and no other users, in order to protect sensitive information like the database password. RT provides a command to set permissions appropriately according to your distribution and configuration. &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt; to the directory where you extracted the RT source code, and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd rt-5.0.2&lt;br /&gt;
sudo make fixperms&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Verify the installation ===&lt;br /&gt;
&lt;br /&gt;
If everything has gone well, then you should be able to set a password for RT’s &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; user. You’ll use this later to log in to the web interface and continue setting up your system. Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo /opt/rt5/sbin/rt-passwd root&amp;lt;/pre&amp;gt;&lt;br /&gt;
Set the password when prompted. Record this; you’ll need it later.&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s web server ==&lt;br /&gt;
&lt;br /&gt;
=== Configure Apache modules ===&lt;br /&gt;
&lt;br /&gt;
You will need to have the following modules enabled in Apache to run RT. You should already have these installed if you followed the instructions above.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;alias&amp;lt;/code&amp;gt; (required to map URLs to RT)&lt;br /&gt;
* &amp;lt;code&amp;gt;fcgid&amp;lt;/code&amp;gt; (required for Apache to talk to RT)&lt;br /&gt;
* &amp;lt;code&amp;gt;mpm_prefork&amp;lt;/code&amp;gt; (Apache requires you to select an MPM. RT is designed to work with the prefork module.)&lt;br /&gt;
* &amp;lt;code&amp;gt;ssl&amp;lt;/code&amp;gt; (required to serve HTTPS; optional otherwise)&lt;br /&gt;
&lt;br /&gt;
Enable them following these instructions:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo a2dismod mpm_event&lt;br /&gt;
sudo a2enmod fcgid&lt;br /&gt;
sudo a2enmod mpm_prefork&lt;br /&gt;
sudo a2enmod ssl&amp;lt;/pre&amp;gt;&lt;br /&gt;
| &amp;lt;pre&amp;gt;echo LoadModule mpm_prefork_module modules/mod_mpm_prefork.so | sudo tee /etc/httpd/conf.modules.d/00-mpm.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Configure an Apache VirtualHost ===&lt;br /&gt;
&lt;br /&gt;
Create a file at the following location. You can change the &amp;lt;code&amp;gt;RT&amp;lt;/code&amp;gt; part of the filename if you like, but the file must exist in this directory and have a &amp;lt;code&amp;gt;.conf&amp;lt;/code&amp;gt; suffix.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;/etc/apache2/sites-available/RT.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
Then after you create the file, run: &amp;lt;code&amp;gt;sudo a2ensite RT&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;/etc/httpd/conf.d/RT.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Use an editor to save all the text below to the new &amp;lt;code&amp;gt;RT.conf&amp;lt;/code&amp;gt; and then fill in settings for your site everywhere the text &amp;lt;code&amp;gt;EDIT WITH&amp;lt;/code&amp;gt; appears.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### Server-level settings&lt;br /&gt;
# These settings affect all of Apache. It is okay to put them here if Apache&lt;br /&gt;
# only hosts RT. If you are hosting other sites in the same Apache instance,&lt;br /&gt;
# you may need to put these settings in another file like&lt;br /&gt;
# (Debian/Ubuntu) /etc/apache2/conf-available/RT.conf&lt;br /&gt;
# (Red Hat/Fedora/CentOS) /etc/httpd/conf.d/RTserver.conf&lt;br /&gt;
# ... and ensure they do not conflict with settings required by other sites.&lt;br /&gt;
&lt;br /&gt;
# mod_fcgid only allows 128KiB requests by default. This is too small for users&lt;br /&gt;
# to upload files to RT. You can ultimately choose any setting you&#039;re&lt;br /&gt;
# comfortable with; 70MiB here should allow most requests without being too&lt;br /&gt;
# open.&lt;br /&gt;
FcgidMaxRequestLen 73400320&lt;br /&gt;
&lt;br /&gt;
&amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
  # Listen on the standard HTTPS port.&lt;br /&gt;
  # You can change this to a nonstandard port if you must.&lt;br /&gt;
  Listen 443&lt;br /&gt;
&amp;lt;/IfModule&amp;gt;&lt;br /&gt;
### End server-level settings&lt;br /&gt;
&lt;br /&gt;
### Primary RT VirtualHost&lt;br /&gt;
# You can change both the bind address and/or the port here as required.&lt;br /&gt;
# This default will listen for HTTPS connections on all interfaces.&lt;br /&gt;
&amp;lt;VirtualHost *:443&amp;gt;&lt;br /&gt;
  # EDIT HERE with the domain name of the web server.&lt;br /&gt;
  ServerName rt.yourdomain.example.com&lt;br /&gt;
  &amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
    SSLEngine on&lt;br /&gt;
    # These specify the paths to the SSL certificate and private key Apache&lt;br /&gt;
    # should use. These example paths are common for Let&#039;s Encrypt. If you&lt;br /&gt;
    # don&#039;t use Let&#039;s Encrypt, the standard location for these files is under&lt;br /&gt;
    # (Debian/Ubuntu) /etc/ssl&lt;br /&gt;
    # (Red Hat/Fedora/CentOS) /etc/pki/tls&lt;br /&gt;
    # EDIT HERE with the appropriate paths for your server&lt;br /&gt;
    SSLCertificateFile /etc/letsencrypt/live/example.com/cert.pem&lt;br /&gt;
    SSLCertificateChainFile /etc/letsencrypt/live/example.com/chain.pem&lt;br /&gt;
    SSLCertificateKeyFile /etc/letsencrypt/live/example.com/privkey.pem&lt;br /&gt;
  &amp;lt;/IfModule&amp;gt;&lt;br /&gt;
  &amp;lt;Location /&amp;gt;&lt;br /&gt;
    Require all granted&lt;br /&gt;
    Options +ExecCGI&lt;br /&gt;
    AddHandler fcgid-script fcgi&lt;br /&gt;
  &amp;lt;/Location&amp;gt;&lt;br /&gt;
  AddDefaultCharset UTF-8&lt;br /&gt;
  DocumentRoot /opt/rt5/share/html&lt;br /&gt;
  ScriptAlias / /opt/rt5/sbin/rt-server.fcgi/&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
### End primary RT VirtualHost&lt;br /&gt;
&lt;br /&gt;
### Optional HTTPS Redirect VirtualHost&lt;br /&gt;
# Most modern servers support HTTPS and want all web traffic to go through it.&lt;br /&gt;
# This VirtualHost redirects normal HTTP traffic to HTTPS.&lt;br /&gt;
# You can delete this whole section if you don&#039;t want or need this.&lt;br /&gt;
&amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
  # You can change both the bind address and/or the port here as required.&lt;br /&gt;
  # This default will listen for HTTP connections on all interfaces.&lt;br /&gt;
  &amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
    SSLEngine off&lt;br /&gt;
    # EDIT HERE both lines below with the domain name of your web server.&lt;br /&gt;
    ServerName rt.yourdomain.example.com&lt;br /&gt;
    Redirect permanent / https://rt.yourdomain.example.com/&lt;br /&gt;
  &amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/IfModule&amp;gt;&lt;br /&gt;
### End optional HTTPS Redirect VirtualHost&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
After you’ve edited the file, load the configuration with:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo systemctl reload apache2&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo systemctl reload httpd&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If this command reports an error, double-check the configuration file for typos, especially in option names, file paths, and the&lt;br /&gt;
&amp;lt;Section&amp;gt;&lt;br /&gt;
pairs. Edit again and reload the configuration until it succeeds without output.&lt;br /&gt;
&lt;br /&gt;
=== Verify the web interface ===&lt;br /&gt;
&lt;br /&gt;
You should be able to visit your web server in your browser, and be presented with RT’s login screen. You should be able to log in with username &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; and the password you set previously.&lt;br /&gt;
&lt;br /&gt;
If you run into trouble, the first place to look for more information is by reading Apache’s error log:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo less /var/log/apache2/error.log&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo less /var/log/httpd/error.log&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s mail server ==&lt;br /&gt;
&lt;br /&gt;
RT both can both send and receive ticket updates via email. Unfortunately, there are too many variables to document a useful setup process here: getting this working usually requires creating DNS records, and coordinating with existing mail servers, which will be the main constraint on your setup. Instead this guide provides a brief overview of how the integration works, and where the connection points are that you likely need to work on.&lt;br /&gt;
&lt;br /&gt;
=== Sending Mail ===&lt;br /&gt;
&lt;br /&gt;
RT only knows how to send mail by passing it off to another program on the system. It cannot connect or authenticate directly to external mail servers. In the default configuration, RT runs the standard &amp;lt;code&amp;gt;sendmail&amp;lt;/code&amp;gt; command. There are [https://docs.bestpractical.com/rt/latest/RT_Config.html#Outgoing-mail configuration options to send mail through different commands] if you need.&lt;br /&gt;
&lt;br /&gt;
The most common setup is to install and configure a proper Mail Transfer Agent (MTA) like Postfix or Exim, and then configure it to send mail to the wider Internet as you need. This works well because the MTAs are robust and well-tested; they have flexible configuration to let you send mail out by relaying to other mail servers you specify with optional authentication; and most distributions install one by default anyway. The only hard part is configuring the MTA to send mail following your site’s policies.&lt;br /&gt;
&lt;br /&gt;
Other software is available that provides a slimmer version of the &amp;lt;code&amp;gt;sendmail&amp;lt;/code&amp;gt; command that connects to an external mail server for you, like ssmtp. These programs are usually easier to configure than an MTA, but they often lose email permanently if they can’t connect to the external server at the time it’s sent. (MTAs keep email queued locally until they successfully deliver it to another server.)&lt;br /&gt;
&lt;br /&gt;
=== Receiving email ===&lt;br /&gt;
&lt;br /&gt;
RT installs a command called &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; that receives an email on standard input and posts it to RT’s REST web interface, where it gets saved in the database and added to a ticket. You need to arrange for a way to send incoming email to this command.&lt;br /&gt;
&lt;br /&gt;
The most common setup is to have an MTA on the same box as RT receive email directly, and then set up mail aliases that call this command when mail comes in. Example &amp;lt;code&amp;gt;/etc/aliases&amp;lt;/code&amp;gt; entries look like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rt: &amp;quot;|/opt/rt5/bin/rt-mailgate --queue general --action correspond --url https://rt.yourdomain.example.com/&amp;quot;&lt;br /&gt;
rt-comment: &amp;quot;|/opt/rt5/bin/rt-mailgate --queue general --action comment --url https://rt.yourdomain.example.com/&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
This works well because, again, you’re probably running an MTA anyway; and the MTA can hold and queue mail if it comes in while RT is down for any reason, giving you a buffer against downtime.&lt;br /&gt;
&lt;br /&gt;
Another common option is to periodically run a tool that fetches mail using a protocol like IMAP, like fetchmail or getmail, and passes it on to &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt;. This is less common because it requires setting up another tool to run, and securely storing another set of mail server credentials. But it is useful when local policy prevents the RT server from receiving email directly.&lt;br /&gt;
&lt;br /&gt;
This is much less common, but it might help to know that &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; doesn’t have to run on the same system as RT itself. It just needs to be able to connect to RT’s web interface. If you don’t have any other options, you can install the RT software on a different system that receives email, and configure &#039;&#039;that&#039;&#039; system to run &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; and pass it on to the RT server. To do that, just repeat the installation instructions above, skipping the steps about installing the database and web server.&lt;br /&gt;
&lt;br /&gt;
== Set up RT’s background jobs ==&lt;br /&gt;
&lt;br /&gt;
Create a file &amp;lt;code&amp;gt;/etc/cron.d/rt&amp;lt;/code&amp;gt; with the following content. You may edit all of the time fields as you see fit. Refer to the crontab(5) man page for details about their definitions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Update the fulltext index with new ticket data&lt;br /&gt;
*/3 *   *   *   *   root    /opt/rt5/sbin/rt-fulltext-indexer&lt;br /&gt;
# Email out dashboards that users have subscribed to&lt;br /&gt;
0   *   *   *   *   root    /opt/rt5/sbin/rt-email-dashboards&lt;br /&gt;
# Clean old sessions from the database&lt;br /&gt;
10  3   *   *   *   root    /opt/rt5/sbin/rt-clean-sessions --older 8d&lt;br /&gt;
# Email out weekly digests for users who have requested it&lt;br /&gt;
50  4   *   *   Mon root    /opt/rt5/sbin/rt-email-digest -m weekly&lt;br /&gt;
# Email out daily digests for users who have requested it&lt;br /&gt;
50  5   *   *   *   root    /opt/rt5/sbin/rt-email-digest -m daily&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
You can run all these jobs as the same user that runs your web server, rather than root. Run:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Debian/Ubuntu&lt;br /&gt;
! style=&amp;quot;width: 50%;&amp;quot;|Red Hat/Fedora/CentOS&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo sed -i &#039;s/\broot\b/www-data/&#039; /etc/cron.d/rt&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;sudo sed -i &#039;s/\broot\b/apache/&#039; /etc/cron.d/rt&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Set up RT ==&lt;br /&gt;
&lt;br /&gt;
If you’ve gotten this far, congratulations, your RT install is really done now. You can start setting up RT with users, groups, queues, and business logic. [[Head back to the main page]] to start exploring those topics.&lt;/div&gt;</summary>
		<author><name>Brett</name></author>
	</entry>
</feed>