<?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=Craigkai</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=Craigkai"/>
	<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/wiki/Special:Contributions/Craigkai"/>
	<updated>2026-08-21T21:54:23Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.41.1</generator>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=ManualEmailConfig&amp;diff=26861</id>
		<title>ManualEmailConfig</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=ManualEmailConfig&amp;diff=26861"/>
		<updated>2019-03-22T14:31:11Z</updated>

		<summary type="html">&lt;p&gt;Craigkai: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Prev: [[ManualApacheConfig]] --- Up: [[UserManual]] --- Next: [[ManualBasicAdministration]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
= SETTING UP THE MAIL GATEWAY =&lt;br /&gt;
&lt;br /&gt;
The mail gateway is used to receive mail messages &#039;&#039;&#039;into&#039;&#039;&#039; an RT instance; outbound mail is usually just handed off to the local SMTP sending program, or a specified SMTP smarthost.&lt;br /&gt;
&lt;br /&gt;
The mail gateway requires the web UI to be set up and functional. If you intend to use SSL to secure your mail gateway, you need to make sure that lib-www-perl, a.k.a LWP, is built with SSL support.&lt;br /&gt;
&lt;br /&gt;
1) Documentation for setting up the mail gateway can be found at:&lt;br /&gt;
&lt;br /&gt;
https://docs.bestpractical.com/rt/latest/rt-mailgate.html&lt;br /&gt;
&lt;br /&gt;
2) You need to tell your Mail Transfer Agent (e.g. sendmail, postfix, or qmail) how to forward messages to RT&#039;s mail gateway. To do this, create an aliases in your system&#039;s mail aliases file. Here&#039;s an example, which routes mail to the mailbox [=[mailto:rt@example.com rt@example.com]] (and [=[mailto:rt-comment@example.com rt-comment@example.com]]) into new tickets in the RT queue named &#039;&#039;&#039;General&#039;&#039;&#039;. Note that the queue name is case-insensitive.&lt;br /&gt;
&lt;br /&gt;
Add the following lines to /etc/aliases (or your local equivalent such as /etc/mail/aliases):&lt;br /&gt;
     rt: &amp;quot;|/opt/rt4/bin/rt-mailgate --queue general --action correspond --url http://localhost/rt&amp;quot;&lt;br /&gt;
     rt-comment: &amp;quot;|/opt/rt4/bin/rt-mailgate --queue general --action comment --url http://localhost/rt&amp;quot;&lt;br /&gt;
(Replace /opt/rt4 by your RT installation path and http://localhost/rt by the URL of your RT installation on your webserver)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039; When you add the above each alias entry should be all one line; make sure you include the quotes.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039; &amp;lt;code&amp;gt;qmail&amp;lt;/code&amp;gt; users should follow the [[QMail]] link to review caveats about &amp;lt;code&amp;gt;fastforward&amp;lt;/code&amp;gt; command aliases.&lt;br /&gt;
&lt;br /&gt;
Replace &#039;&#039;&#039;general&#039;&#039;&#039; with the name of your queue and &#039;&#039;&#039;rt&#039;&#039;&#039; (before the colon in the alias) with the email address you wish people to send their messages to. You might, for example, have messages to &#039;&#039;&#039;support&#039;&#039;&#039; go into the &#039;&#039;&#039;service&#039;&#039;&#039; queue, and &#039;&#039;&#039;abuse&#039;&#039;&#039; go into the &#039;&#039;&#039;ops&#039;&#039;&#039; queue. You can have more than one set of aliases point to the same queue, if, for example, you wanted mail to both &#039;&#039;&#039;abuse&#039;&#039;&#039; and &#039;&#039;&#039;security&#039;&#039;&#039; both go to the &#039;&#039;&#039;ops&#039;&#039;&#039; queue.&lt;br /&gt;
&lt;br /&gt;
The queue name may have spaces. &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; works as well with them, but do not forget to escape these spaces by enclosing the queue name in single quote:&lt;br /&gt;
    my-queue: &amp;quot;|/opt/rt4/bin/rt-mailgate --queue &#039;My Queue&#039; --action correspond --url http://localhost/&amp;quot;&lt;br /&gt;
If you are using the default sendmail included in most redhat distro&#039;s you will most likely need to copy (cp) rt-mailgate to /etc/smrsh or create a symbolic link and change /opt/rt4/bin above to /etc/smrsh or sendmail will complain. These sendmails will only execute programs as alias targets which have been blessed by placing them in a special directory. This is not necessary for Exim or postfix.&lt;br /&gt;
&lt;br /&gt;
You&#039;ll choose from &amp;quot;--action correspond&amp;quot; and &amp;quot;--action comment&amp;quot; depending on whether the mail should be resent to the requestor. If you want the requestor to see it, choose correspond; if you want to keep it from the requestor, choose comment.&lt;br /&gt;
&lt;br /&gt;
The URL will be the URL for RT&#039;s web interface, such as http://issues.bestpractical.com/, [http://fsck.com/rt/ =]; whatever is the root of your RT install.&lt;br /&gt;
&lt;br /&gt;
3) Stop and start your mail server, so it picks up your configuration changes. With sendmail or postfix (possibly others), you usually also need to type the command &amp;quot;newaliases&amp;quot; to get the server to recognize the new aliases.  If this command is unrecognized, it&#039;s probably not in your default path; a common location is &amp;quot;/usr/sbin/newaliases&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
You &#039;&#039;&#039;can&#039;&#039;&#039; have the mail gateway on your MX or some other server and have it talk to RT via HTTP. For more details, see [[InstallMailgateOnly]].&lt;br /&gt;
&lt;br /&gt;
To configure a mail transfer agent (postfix) to post tickets to RT4 on a separate server ....&lt;br /&gt;
&lt;br /&gt;
Add the following lines to /etc/aliases (or your local equivalent such as /etc/mail/aliases):&lt;br /&gt;
    rt: &amp;quot;|/&amp;amp;lt;path-to-mailgate&amp;amp;gt;/rt-mailgate --queue general --action correspond --url http://&amp;amp;lt;the-URL-of-the-RT-server&amp;amp;gt;/&amp;quot;&lt;br /&gt;
    rt-comment: &amp;quot;|/&amp;amp;lt;path-to-mailgate&amp;amp;gt;/rt-mailgate --queue general --action comment --url http://&amp;amp;lt;the-URL-of-the-RT-server&amp;amp;gt;/&amp;quot;&lt;br /&gt;
The link to RT is now configured. However, the rt-mailgate script is a perl script which requires support. On a fresh [[SuSE]] 9.3 server install, the following was needed to provide the necessary perl libraries (someone with deeper knowledge may know of a more restrictive set of libraries, but these worked).&lt;br /&gt;
&lt;br /&gt;
 #(install gcc and glibc, if necessary)&lt;br /&gt;
 perl -MCPAN -eshell (to configure CPAN)&lt;br /&gt;
 perl -MCPAN -e &#039;install(&amp;quot;LWP&amp;quot;)&#039;&lt;br /&gt;
 perl -MCPAN -e &#039;install(&amp;quot;Bundle::LWP&amp;quot;)&#039;&lt;br /&gt;
&lt;br /&gt;
If Using SSL, add:&lt;br /&gt;
    perl -MCPAN -e &#039;install(&amp;quot;Crypt::SSLeay&amp;quot;)&#039;&lt;br /&gt;
To test the connection...&lt;br /&gt;
   echo &#039;hello&#039; | mail -s &amp;quot;Test subject&amp;quot; rt&lt;br /&gt;
If you get a &amp;quot;command died with status 1&amp;quot; error message, the rt-mailgate script possibly doesn&#039;t have the execute bit set for the user/group under which postfix is running.&lt;br /&gt;
   chmod o+x /&amp;amp;lt;path-to-mailgate&amp;amp;gt;/rt-mailgate&lt;br /&gt;
For more information on configuring your mail gateway, see [[ManualAdministration]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Using Fetchmail/Getmail For Incoming Email =&lt;br /&gt;
&lt;br /&gt;
Fetchmail or Getmail can be used to fetch email from a inbox using IMAP or POP. An example configuration for Fetchmail can be seen below:&lt;br /&gt;
    set daemon 0&lt;br /&gt;
    # PID files are more useful for forking systemd services. But fetchmail will&lt;br /&gt;
    # always write one. Since the service runs fetchmail as the apache user,&lt;br /&gt;
    # www-data, we need to give fetchmail a path that it has write permission to.&lt;br /&gt;
    #set pidfile &#039;/opt/rt4/var/run/fetchmail-rtir.pid&#039;&lt;br /&gt;
    poll &amp;quot;IP_OF_MAIL_SERVER&amp;quot; proto imap port 993&lt;br /&gt;
        user &amp;quot;rt@mycompany.com&amp;quot; password &amp;quot;password&amp;quot;&lt;br /&gt;
        ssl&lt;br /&gt;
        folder &#039;Inbox&#039;&lt;br /&gt;
    # Some IMAP servers generate an error like this:&lt;br /&gt;
    #&lt;br /&gt;
    # could not decode BASE64 challenge&lt;br /&gt;
    #&lt;br /&gt;
    # This might be because the server is configured to expect&lt;br /&gt;
    # certain authentication attempt types, first. fetchmail also&lt;br /&gt;
    # tries certain authentication methods first, but not password,&lt;br /&gt;
    # even with the &#039;password&#039; keyword.&lt;br /&gt;
    #&lt;br /&gt;
    # The &#039;auth&#039; keyword tells fetchmail to attempt the given&lt;br /&gt;
    # authentication type, first. That can eliminate initial&lt;br /&gt;
    # authentication failures, which might eliminate this error&lt;br /&gt;
    # messgae&lt;br /&gt;
    # IMAP supports flags on individual messages to indicate the&lt;br /&gt;
    # message status. The &#039;Seen&#039; flag indicates that the message has&lt;br /&gt;
    # been read by a client. This could be a webmail client like Gmail&lt;br /&gt;
    # our Outlook, or fetchmail. The RT use case for fetchmail expects&lt;br /&gt;
    # that fetchmail will get all mail that hasn&#039;t been delivered to&lt;br /&gt;
    # RT, regardless of whether other clients have seen it. Without&lt;br /&gt;
    # this option, fetchmail will only download mail from an IMAP&lt;br /&gt;
    # server without the &#039;Seen&#039; flag. This option tells fetchmail to&lt;br /&gt;
    # ignore &#039;Seen&#039; flags and download all messages.&lt;br /&gt;
    # fetchall&lt;br /&gt;
    mda &#039;/opt/rt4/bin/rt-mailgate --url https://rt.mycompany.com --queue &amp;quot;support&amp;quot; --action correspond&#039;&lt;br /&gt;
    idle&lt;br /&gt;
Lastly you will need a cronjob to pull your inbox periodically&lt;br /&gt;
    `*/1 * * * * root /usr/bin/getmail --fetchmailrc /opt/rt4/etc/fetchmailrc --quiet`&lt;br /&gt;
----&lt;br /&gt;
Prev: [[ManualApacheConfig]] --- Up: [[UserManual]] --- Next: [[ManualBasicAdministration]]&lt;br /&gt;
[[Category:RT User Manual]]&lt;/div&gt;</summary>
		<author><name>Craigkai</name></author>
	</entry>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=ManualEmailConfig&amp;diff=26860</id>
		<title>ManualEmailConfig</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=ManualEmailConfig&amp;diff=26860"/>
		<updated>2019-03-22T14:27:10Z</updated>

		<summary type="html">&lt;p&gt;Craigkai: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Prev: [[ManualApacheConfig]] --- Up: [[UserManual]] --- Next: [[ManualBasicAdministration]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
= SETTING UP THE MAIL GATEWAY =&lt;br /&gt;
&lt;br /&gt;
The mail gateway is used to receive mail messages &#039;&#039;&#039;into&#039;&#039;&#039; an RT instance; outbound mail is usually just handed off to the local SMTP sending program, or a specified SMTP smarthost.&lt;br /&gt;
&lt;br /&gt;
The mail gateway requires the web UI to be set up and functional. If you intend to use SSL to secure your mail gateway, you need to make sure that lib-www-perl, a.k.a LWP, is built with SSL support.&lt;br /&gt;
&lt;br /&gt;
1) Documentation for setting up the mail gateway can be found at:&lt;br /&gt;
&lt;br /&gt;
https://docs.bestpractical.com/rt/latest/rt-mailgate.html&lt;br /&gt;
&lt;br /&gt;
2) You need to tell your Mail Transfer Agent (e.g. sendmail, postfix, or qmail) how to forward messages to RT&#039;s mail gateway. To do this, create an aliases in your system&#039;s mail aliases file. Here&#039;s an example, which routes mail to the mailbox [=[mailto:rt@example.com rt@example.com]] (and [=[mailto:rt-comment@example.com rt-comment@example.com]]) into new tickets in the RT queue named &#039;&#039;&#039;General&#039;&#039;&#039;. Note that the queue name is case-insensitive.&lt;br /&gt;
&lt;br /&gt;
Add the following lines to /etc/aliases (or your local equivalent such as /etc/mail/aliases):&lt;br /&gt;
     rt: &amp;quot;|/opt/rt4/bin/rt-mailgate --queue general --action correspond --url http://localhost/rt&amp;quot;&lt;br /&gt;
     rt-comment: &amp;quot;|/opt/rt4/bin/rt-mailgate --queue general --action comment --url http://localhost/rt&amp;quot;&lt;br /&gt;
(Replace /opt/rt4 by your RT installation path and http://localhost/rt by the URL of your RT installation on your webserver)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039; When you add the above each alias entry should be all one line; make sure you include the quotes.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039; &amp;lt;code&amp;gt;qmail&amp;lt;/code&amp;gt; users should follow the [[QMail]] link to review caveats about &amp;lt;code&amp;gt;fastforward&amp;lt;/code&amp;gt; command aliases.&lt;br /&gt;
&lt;br /&gt;
Replace &#039;&#039;&#039;general&#039;&#039;&#039; with the name of your queue and &#039;&#039;&#039;rt&#039;&#039;&#039; (before the colon in the alias) with the email address you wish people to send their messages to. You might, for example, have messages to &#039;&#039;&#039;support&#039;&#039;&#039; go into the &#039;&#039;&#039;service&#039;&#039;&#039; queue, and &#039;&#039;&#039;abuse&#039;&#039;&#039; go into the &#039;&#039;&#039;ops&#039;&#039;&#039; queue. You can have more than one set of aliases point to the same queue, if, for example, you wanted mail to both &#039;&#039;&#039;abuse&#039;&#039;&#039; and &#039;&#039;&#039;security&#039;&#039;&#039; both go to the &#039;&#039;&#039;ops&#039;&#039;&#039; queue.&lt;br /&gt;
&lt;br /&gt;
The queue name may have spaces. &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; works as well with them, but do not forget to escape these spaces by enclosing the queue name in single quote:&lt;br /&gt;
    my-queue: &amp;quot;|/opt/rt4/bin/rt-mailgate --queue &#039;My Queue&#039; --action correspond --url http://localhost/&amp;quot;&lt;br /&gt;
If you are using the default sendmail included in most redhat distro&#039;s you will most likely need to copy (cp) rt-mailgate to /etc/smrsh or create a symbolic link and change /opt/rt4/bin above to /etc/smrsh or sendmail will complain. These sendmails will only execute programs as alias targets which have been blessed by placing them in a special directory. This is not necessary for Exim or postfix.&lt;br /&gt;
&lt;br /&gt;
You&#039;ll choose from &amp;quot;--action correspond&amp;quot; and &amp;quot;--action comment&amp;quot; depending on whether the mail should be resent to the requestor. If you want the requestor to see it, choose correspond; if you want to keep it from the requestor, choose comment.&lt;br /&gt;
&lt;br /&gt;
The URL will be the URL for RT&#039;s web interface, such as http://issues.bestpractical.com/, [http://fsck.com/rt/ =]; whatever is the root of your RT install.&lt;br /&gt;
&lt;br /&gt;
3) Stop and start your mail server, so it picks up your configuration changes. With sendmail or postfix (possibly others), you usually also need to type the command &amp;quot;newaliases&amp;quot; to get the server to recognize the new aliases.  If this command is unrecognized, it&#039;s probably not in your default path; a common location is &amp;quot;/usr/sbin/newaliases&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
You &#039;&#039;&#039;can&#039;&#039;&#039; have the mail gateway on your MX or some other server and have it talk to RT via HTTP. For more details, see [[InstallMailgateOnly]].&lt;br /&gt;
&lt;br /&gt;
To configure a mail transfer agent (postfix) to post tickets to RT4 on a separate server ....&lt;br /&gt;
&lt;br /&gt;
Add the following lines to /etc/aliases (or your local equivalent such as /etc/mail/aliases):&lt;br /&gt;
    rt: &amp;quot;|/&amp;amp;lt;path-to-mailgate&amp;amp;gt;/rt-mailgate --queue general --action correspond --url http://&amp;amp;lt;the-URL-of-the-RT-server&amp;amp;gt;/&amp;quot;&lt;br /&gt;
    rt-comment: &amp;quot;|/&amp;amp;lt;path-to-mailgate&amp;amp;gt;/rt-mailgate --queue general --action comment --url http://&amp;amp;lt;the-URL-of-the-RT-server&amp;amp;gt;/&amp;quot;&lt;br /&gt;
The link to RT is now configured. However, the rt-mailgate script is a perl script which requires support. On a fresh [[SuSE]] 9.3 server install, the following was needed to provide the necessary perl libraries (someone with deeper knowledge may know of a more restrictive set of libraries, but these worked).&lt;br /&gt;
&lt;br /&gt;
 #(install gcc and glibc, if necessary)&lt;br /&gt;
 perl -MCPAN -eshell (to configure CPAN)&lt;br /&gt;
 perl -MCPAN -e &#039;install(&amp;quot;LWP&amp;quot;)&#039;&lt;br /&gt;
 perl -MCPAN -e &#039;install(&amp;quot;Bundle::LWP&amp;quot;)&#039;&lt;br /&gt;
&lt;br /&gt;
If Using SSL, add:&lt;br /&gt;
    perl -MCPAN -e &#039;install(&amp;quot;Crypt::SSLeay&amp;quot;)&#039;&lt;br /&gt;
To test the connection...&lt;br /&gt;
   echo &#039;hello&#039; | mail -s &amp;quot;Test subject&amp;quot; rt&lt;br /&gt;
If you get a &amp;quot;command died with status 1&amp;quot; error message, the rt-mailgate script possibly doesn&#039;t have the execute bit set for the user/group under which postfix is running.&lt;br /&gt;
   chmod o+x /&amp;amp;lt;path-to-mailgate&amp;amp;gt;/rt-mailgate&lt;br /&gt;
For more information on configuring your mail gateway, see [[ManualAdministration]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Using Fetchmail/Getmail For Incoming Email =&lt;br /&gt;
&lt;br /&gt;
Fetchmail or Getmail can be used to fetch email from a inbox using IMAP or POP. An example configuration for Fetchmail can be seen below:&lt;br /&gt;
    set daemon 0&lt;br /&gt;
    &lt;br /&gt;
    # PID files are more useful for forking systemd services. But fetchmail will&lt;br /&gt;
    # always write one. Since the service runs fetchmail as the apache user,&lt;br /&gt;
    # www-data, we need to give fetchmail a path that it has write permission to.&lt;br /&gt;
    #set pidfile &#039;/opt/rt4/var/run/fetchmail-rtir.pid&#039;&lt;br /&gt;
    &lt;br /&gt;
    poll &amp;quot;IP_OF_MAIL_SERVER&amp;quot; proto imap port 993&lt;br /&gt;
        user &amp;quot;rt@mycompany.com&amp;quot; password &amp;quot;password&amp;quot;&lt;br /&gt;
        ssl&lt;br /&gt;
        folder &#039;Inbox&#039;&lt;br /&gt;
    # Some IMAP servers generate an error like this:&lt;br /&gt;
    #&lt;br /&gt;
    # could not decode BASE64 challenge&lt;br /&gt;
    #&lt;br /&gt;
    # This might be because the server is configured to expect&lt;br /&gt;
    # certain authentication attempt types, first. fetchmail also&lt;br /&gt;
    # tries certain authentication methods first, but not password,&lt;br /&gt;
    # even with the &#039;password&#039; keyword.&lt;br /&gt;
    #&lt;br /&gt;
    # The &#039;auth&#039; keyword tells fetchmail to attempt the given&lt;br /&gt;
    # authentication type, first. That can eliminate initial&lt;br /&gt;
    # authentication failures, which might eliminate this error&lt;br /&gt;
    # messgae&lt;br /&gt;
    #  auth password&lt;br /&gt;
    &lt;br /&gt;
    # IMAP supports flags on individual messages to indicate the&lt;br /&gt;
    # message status. The &#039;Seen&#039; flag indicates that the message has&lt;br /&gt;
    # been read by a client. This could be a webmail client like Gmail&lt;br /&gt;
    # our Outlook, or fetchmail. The RT use case for fetchmail expects&lt;br /&gt;
    # that fetchmail will get all mail that hasn&#039;t been delivered to&lt;br /&gt;
    # RT, regardless of whether other clients have seen it. Without&lt;br /&gt;
    # this option, fetchmail will only download mail from an IMAP&lt;br /&gt;
    # server without the &#039;Seen&#039; flag. This option tells fetchmail to&lt;br /&gt;
    # ignore &#039;Seen&#039; flags and download all messages.&lt;br /&gt;
    # fetchall&lt;br /&gt;
    &lt;br /&gt;
    mda &#039;/opt/rt4/bin/rt-mailgate --url https://rt.mycompany.com --queue &amp;quot;support&amp;quot; --action correspond&#039;&lt;br /&gt;
    idle&lt;br /&gt;
&lt;br /&gt;
Lastly you will need a cronjob to pull your inbox periodically&lt;br /&gt;
    `*/1 * * * * root /usr/bin/getmail --fetchmailrc /opt/rt4/etc/fetchmailrc --quiet`&lt;br /&gt;
----&lt;br /&gt;
Prev: [[ManualApacheConfig]] --- Up: [[UserManual]] --- Next: [[ManualBasicAdministration]]&lt;br /&gt;
[[Category:RT User Manual]]&lt;/div&gt;</summary>
		<author><name>Craigkai</name></author>
	</entry>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=ManualEmailConfig&amp;diff=26859</id>
		<title>ManualEmailConfig</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=ManualEmailConfig&amp;diff=26859"/>
		<updated>2019-03-22T14:26:43Z</updated>

		<summary type="html">&lt;p&gt;Craigkai: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Prev: [[ManualApacheConfig]] --- Up: [[UserManual]] --- Next: [[ManualBasicAdministration]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
= SETTING UP THE MAIL GATEWAY =&lt;br /&gt;
&lt;br /&gt;
The mail gateway is used to receive mail messages &#039;&#039;&#039;into&#039;&#039;&#039; an RT instance; outbound mail is usually just handed off to the local SMTP sending program, or a specified SMTP smarthost.&lt;br /&gt;
&lt;br /&gt;
The mail gateway requires the web UI to be set up and functional. If you intend to use SSL to secure your mail gateway, you need to make sure that lib-www-perl, a.k.a LWP, is built with SSL support.&lt;br /&gt;
&lt;br /&gt;
1) Documentation for setting up the mail gateway can be found at:&lt;br /&gt;
&lt;br /&gt;
https://docs.bestpractical.com/rt/latest/rt-mailgate.html&lt;br /&gt;
&lt;br /&gt;
2) You need to tell your Mail Transfer Agent (e.g. sendmail, postfix, or qmail) how to forward messages to RT&#039;s mail gateway. To do this, create an aliases in your system&#039;s mail aliases file. Here&#039;s an example, which routes mail to the mailbox [=[mailto:rt@example.com rt@example.com]] (and [=[mailto:rt-comment@example.com rt-comment@example.com]]) into new tickets in the RT queue named &#039;&#039;&#039;General&#039;&#039;&#039;. Note that the queue name is case-insensitive.&lt;br /&gt;
&lt;br /&gt;
Add the following lines to /etc/aliases (or your local equivalent such as /etc/mail/aliases):&lt;br /&gt;
     rt: &amp;quot;|/opt/rt4/bin/rt-mailgate --queue general --action correspond --url http://localhost/rt&amp;quot;&lt;br /&gt;
     rt-comment: &amp;quot;|/opt/rt4/bin/rt-mailgate --queue general --action comment --url http://localhost/rt&amp;quot;&lt;br /&gt;
(Replace /opt/rt4 by your RT installation path and http://localhost/rt by the URL of your RT installation on your webserver)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039; When you add the above each alias entry should be all one line; make sure you include the quotes.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039; &amp;lt;code&amp;gt;qmail&amp;lt;/code&amp;gt; users should follow the [[QMail]] link to review caveats about &amp;lt;code&amp;gt;fastforward&amp;lt;/code&amp;gt; command aliases.&lt;br /&gt;
&lt;br /&gt;
Replace &#039;&#039;&#039;general&#039;&#039;&#039; with the name of your queue and &#039;&#039;&#039;rt&#039;&#039;&#039; (before the colon in the alias) with the email address you wish people to send their messages to. You might, for example, have messages to &#039;&#039;&#039;support&#039;&#039;&#039; go into the &#039;&#039;&#039;service&#039;&#039;&#039; queue, and &#039;&#039;&#039;abuse&#039;&#039;&#039; go into the &#039;&#039;&#039;ops&#039;&#039;&#039; queue. You can have more than one set of aliases point to the same queue, if, for example, you wanted mail to both &#039;&#039;&#039;abuse&#039;&#039;&#039; and &#039;&#039;&#039;security&#039;&#039;&#039; both go to the &#039;&#039;&#039;ops&#039;&#039;&#039; queue.&lt;br /&gt;
&lt;br /&gt;
The queue name may have spaces. &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; works as well with them, but do not forget to escape these spaces by enclosing the queue name in single quote:&lt;br /&gt;
    my-queue: &amp;quot;|/opt/rt4/bin/rt-mailgate --queue &#039;My Queue&#039; --action correspond --url http://localhost/&amp;quot;&lt;br /&gt;
If you are using the default sendmail included in most redhat distro&#039;s you will most likely need to copy (cp) rt-mailgate to /etc/smrsh or create a symbolic link and change /opt/rt4/bin above to /etc/smrsh or sendmail will complain. These sendmails will only execute programs as alias targets which have been blessed by placing them in a special directory. This is not necessary for Exim or postfix.&lt;br /&gt;
&lt;br /&gt;
You&#039;ll choose from &amp;quot;--action correspond&amp;quot; and &amp;quot;--action comment&amp;quot; depending on whether the mail should be resent to the requestor. If you want the requestor to see it, choose correspond; if you want to keep it from the requestor, choose comment.&lt;br /&gt;
&lt;br /&gt;
The URL will be the URL for RT&#039;s web interface, such as http://issues.bestpractical.com/, [http://fsck.com/rt/ =]; whatever is the root of your RT install.&lt;br /&gt;
&lt;br /&gt;
3) Stop and start your mail server, so it picks up your configuration changes. With sendmail or postfix (possibly others), you usually also need to type the command &amp;quot;newaliases&amp;quot; to get the server to recognize the new aliases.  If this command is unrecognized, it&#039;s probably not in your default path; a common location is &amp;quot;/usr/sbin/newaliases&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
You &#039;&#039;&#039;can&#039;&#039;&#039; have the mail gateway on your MX or some other server and have it talk to RT via HTTP. For more details, see [[InstallMailgateOnly]].&lt;br /&gt;
&lt;br /&gt;
To configure a mail transfer agent (postfix) to post tickets to RT4 on a separate server ....&lt;br /&gt;
&lt;br /&gt;
Add the following lines to /etc/aliases (or your local equivalent such as /etc/mail/aliases):&lt;br /&gt;
    rt: &amp;quot;|/&amp;amp;lt;path-to-mailgate&amp;amp;gt;/rt-mailgate --queue general --action correspond --url http://&amp;amp;lt;the-URL-of-the-RT-server&amp;amp;gt;/&amp;quot;&lt;br /&gt;
    rt-comment: &amp;quot;|/&amp;amp;lt;path-to-mailgate&amp;amp;gt;/rt-mailgate --queue general --action comment --url http://&amp;amp;lt;the-URL-of-the-RT-server&amp;amp;gt;/&amp;quot;&lt;br /&gt;
The link to RT is now configured. However, the rt-mailgate script is a perl script which requires support. On a fresh [[SuSE]] 9.3 server install, the following was needed to provide the necessary perl libraries (someone with deeper knowledge may know of a more restrictive set of libraries, but these worked).&lt;br /&gt;
&lt;br /&gt;
 #(install gcc and glibc, if necessary)&lt;br /&gt;
 perl -MCPAN -eshell (to configure CPAN)&lt;br /&gt;
 perl -MCPAN -e &#039;install(&amp;quot;LWP&amp;quot;)&#039;&lt;br /&gt;
 perl -MCPAN -e &#039;install(&amp;quot;Bundle::LWP&amp;quot;)&#039;&lt;br /&gt;
&lt;br /&gt;
If Using SSL, add:&lt;br /&gt;
    perl -MCPAN -e &#039;install(&amp;quot;Crypt::SSLeay&amp;quot;)&#039;&lt;br /&gt;
To test the connection...&lt;br /&gt;
   echo &#039;hello&#039; | mail -s &amp;quot;Test subject&amp;quot; rt&lt;br /&gt;
If you get a &amp;quot;command died with status 1&amp;quot; error message, the rt-mailgate script possibly doesn&#039;t have the execute bit set for the user/group under which postfix is running.&lt;br /&gt;
   chmod o+x /&amp;amp;lt;path-to-mailgate&amp;amp;gt;/rt-mailgate&lt;br /&gt;
For more information on configuring your mail gateway, see [[ManualAdministration]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Using Fetchmail/Getmail For Incoming Email =&lt;br /&gt;
&lt;br /&gt;
Fetchmail or Getmail can be used to fetch email from a inbox using IMAP or POP. An example configuration for Fetchmail can be seen below:&lt;br /&gt;
    set daemon 0&lt;br /&gt;
    &lt;br /&gt;
    # PID files are more useful for forking systemd services. But fetchmail will&lt;br /&gt;
    # always write one. Since the service runs fetchmail as the apache user,&lt;br /&gt;
    # www-data, we need to give fetchmail a path that it has write permission to.&lt;br /&gt;
    #set pidfile &#039;/opt/rt4/var/run/fetchmail-rtir.pid&#039;&lt;br /&gt;
    &lt;br /&gt;
    poll &amp;quot;IP_OF_MAIL_SERVER&amp;quot; proto imap port 993&lt;br /&gt;
        user &amp;quot;rt@mycompany.com&amp;quot; password &amp;quot;password&amp;quot;&lt;br /&gt;
        ssl&lt;br /&gt;
        folder &#039;Inbox&#039;&lt;br /&gt;
    # Some IMAP servers generate an error like this:&lt;br /&gt;
    #&lt;br /&gt;
    # could not decode BASE64 challenge&lt;br /&gt;
    #&lt;br /&gt;
    # This might be because the server is configured to expect&lt;br /&gt;
    # certain authentication attempt types, first. fetchmail also&lt;br /&gt;
    # tries certain authentication methods first, but not password,&lt;br /&gt;
    # even with the &#039;password&#039; keyword.&lt;br /&gt;
    #&lt;br /&gt;
    # The &#039;auth&#039; keyword tells fetchmail to attempt the given&lt;br /&gt;
    # authentication type, first. That can eliminate initial&lt;br /&gt;
    # authentication failures, which might eliminate this error&lt;br /&gt;
    # messgae&lt;br /&gt;
    #  auth password&lt;br /&gt;
    &lt;br /&gt;
    # IMAP supports flags on individual messages to indicate the&lt;br /&gt;
    # message status. The &#039;Seen&#039; flag indicates that the message has&lt;br /&gt;
    # been read by a client. This could be a webmail client like Gmail&lt;br /&gt;
    # our Outlook, or fetchmail. The RT use case for fetchmail expects&lt;br /&gt;
    # that fetchmail will get all mail that hasn&#039;t been delivered to&lt;br /&gt;
    # RT, regardless of whether other clients have seen it. Without&lt;br /&gt;
    # this option, fetchmail will only download mail from an IMAP&lt;br /&gt;
    # server without the &#039;Seen&#039; flag. This option tells fetchmail to&lt;br /&gt;
    # ignore &#039;Seen&#039; flags and download all messages.&lt;br /&gt;
    # fetchall&lt;br /&gt;
    &lt;br /&gt;
    mda &#039;/opt/rt4/bin/rt-mailgate --url https://rt.mycompany.com --queue &amp;quot;support&amp;quot; --action correspond&#039;&lt;br /&gt;
    idle&lt;br /&gt;
&lt;br /&gt;
Lastly you will need a cronjob to pull your inbox periodically&lt;br /&gt;
&lt;br /&gt;
    */1 * * * * root /usr/bin/getmail --fetchmailrc /opt/rt4/etc/fetchmailrc --quiet&lt;br /&gt;
----&lt;br /&gt;
Prev: [[ManualApacheConfig]] --- Up: [[UserManual]] --- Next: [[ManualBasicAdministration]]&lt;br /&gt;
[[Category:RT User Manual]]&lt;/div&gt;</summary>
		<author><name>Craigkai</name></author>
	</entry>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=ManualEmailConfig&amp;diff=26858</id>
		<title>ManualEmailConfig</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=ManualEmailConfig&amp;diff=26858"/>
		<updated>2019-03-22T14:24:58Z</updated>

		<summary type="html">&lt;p&gt;Craigkai: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Prev: [[ManualApacheConfig]] --- Up: [[UserManual]] --- Next: [[ManualBasicAdministration]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
= SETTING UP THE MAIL GATEWAY =&lt;br /&gt;
&lt;br /&gt;
The mail gateway is used to receive mail messages &#039;&#039;&#039;into&#039;&#039;&#039; an RT instance; outbound mail is usually just handed off to the local SMTP sending program, or a specified SMTP smarthost.&lt;br /&gt;
&lt;br /&gt;
The mail gateway requires the web UI to be set up and functional. If you intend to use SSL to secure your mail gateway, you need to make sure that lib-www-perl, a.k.a LWP, is built with SSL support.&lt;br /&gt;
&lt;br /&gt;
1) Documentation for setting up the mail gateway can be found at:&lt;br /&gt;
&lt;br /&gt;
https://docs.bestpractical.com/rt/latest/rt-mailgate.html&lt;br /&gt;
&lt;br /&gt;
2) You need to tell your Mail Transfer Agent (e.g. sendmail, postfix, or qmail) how to forward messages to RT&#039;s mail gateway. To do this, create an aliases in your system&#039;s mail aliases file. Here&#039;s an example, which routes mail to the mailbox [=[mailto:rt@example.com rt@example.com]] (and [=[mailto:rt-comment@example.com rt-comment@example.com]]) into new tickets in the RT queue named &#039;&#039;&#039;General&#039;&#039;&#039;. Note that the queue name is case-insensitive.&lt;br /&gt;
&lt;br /&gt;
Add the following lines to /etc/aliases (or your local equivalent such as /etc/mail/aliases):&lt;br /&gt;
     rt: &amp;quot;|/opt/rt4/bin/rt-mailgate --queue general --action correspond --url http://localhost/rt&amp;quot;&lt;br /&gt;
     rt-comment: &amp;quot;|/opt/rt4/bin/rt-mailgate --queue general --action comment --url http://localhost/rt&amp;quot;&lt;br /&gt;
(Replace /opt/rt4 by your RT installation path and http://localhost/rt by the URL of your RT installation on your webserver)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039; When you add the above each alias entry should be all one line; make sure you include the quotes.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039; &amp;lt;code&amp;gt;qmail&amp;lt;/code&amp;gt; users should follow the [[QMail]] link to review caveats about &amp;lt;code&amp;gt;fastforward&amp;lt;/code&amp;gt; command aliases.&lt;br /&gt;
&lt;br /&gt;
Replace &#039;&#039;&#039;general&#039;&#039;&#039; with the name of your queue and &#039;&#039;&#039;rt&#039;&#039;&#039; (before the colon in the alias) with the email address you wish people to send their messages to. You might, for example, have messages to &#039;&#039;&#039;support&#039;&#039;&#039; go into the &#039;&#039;&#039;service&#039;&#039;&#039; queue, and &#039;&#039;&#039;abuse&#039;&#039;&#039; go into the &#039;&#039;&#039;ops&#039;&#039;&#039; queue. You can have more than one set of aliases point to the same queue, if, for example, you wanted mail to both &#039;&#039;&#039;abuse&#039;&#039;&#039; and &#039;&#039;&#039;security&#039;&#039;&#039; both go to the &#039;&#039;&#039;ops&#039;&#039;&#039; queue.&lt;br /&gt;
&lt;br /&gt;
The queue name may have spaces. &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; works as well with them, but do not forget to escape these spaces by enclosing the queue name in single quote:&lt;br /&gt;
    my-queue: &amp;quot;|/opt/rt4/bin/rt-mailgate --queue &#039;My Queue&#039; --action correspond --url http://localhost/&amp;quot;&lt;br /&gt;
If you are using the default sendmail included in most redhat distro&#039;s you will most likely need to copy (cp) rt-mailgate to /etc/smrsh or create a symbolic link and change /opt/rt4/bin above to /etc/smrsh or sendmail will complain. These sendmails will only execute programs as alias targets which have been blessed by placing them in a special directory. This is not necessary for Exim or postfix.&lt;br /&gt;
&lt;br /&gt;
You&#039;ll choose from &amp;quot;--action correspond&amp;quot; and &amp;quot;--action comment&amp;quot; depending on whether the mail should be resent to the requestor. If you want the requestor to see it, choose correspond; if you want to keep it from the requestor, choose comment.&lt;br /&gt;
&lt;br /&gt;
The URL will be the URL for RT&#039;s web interface, such as http://issues.bestpractical.com/, [http://fsck.com/rt/ =]; whatever is the root of your RT install.&lt;br /&gt;
&lt;br /&gt;
3) Stop and start your mail server, so it picks up your configuration changes. With sendmail or postfix (possibly others), you usually also need to type the command &amp;quot;newaliases&amp;quot; to get the server to recognize the new aliases.  If this command is unrecognized, it&#039;s probably not in your default path; a common location is &amp;quot;/usr/sbin/newaliases&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
You &#039;&#039;&#039;can&#039;&#039;&#039; have the mail gateway on your MX or some other server and have it talk to RT via HTTP. For more details, see [[InstallMailgateOnly]].&lt;br /&gt;
&lt;br /&gt;
To configure a mail transfer agent (postfix) to post tickets to RT4 on a separate server ....&lt;br /&gt;
&lt;br /&gt;
Add the following lines to /etc/aliases (or your local equivalent such as /etc/mail/aliases):&lt;br /&gt;
    rt: &amp;quot;|/&amp;amp;lt;path-to-mailgate&amp;amp;gt;/rt-mailgate --queue general --action correspond --url http://&amp;amp;lt;the-URL-of-the-RT-server&amp;amp;gt;/&amp;quot;&lt;br /&gt;
    rt-comment: &amp;quot;|/&amp;amp;lt;path-to-mailgate&amp;amp;gt;/rt-mailgate --queue general --action comment --url http://&amp;amp;lt;the-URL-of-the-RT-server&amp;amp;gt;/&amp;quot;&lt;br /&gt;
The link to RT is now configured. However, the rt-mailgate script is a perl script which requires support. On a fresh [[SuSE]] 9.3 server install, the following was needed to provide the necessary perl libraries (someone with deeper knowledge may know of a more restrictive set of libraries, but these worked).&lt;br /&gt;
&lt;br /&gt;
 #(install gcc and glibc, if necessary)&lt;br /&gt;
 perl -MCPAN -eshell (to configure CPAN)&lt;br /&gt;
 perl -MCPAN -e &#039;install(&amp;quot;LWP&amp;quot;)&#039;&lt;br /&gt;
 perl -MCPAN -e &#039;install(&amp;quot;Bundle::LWP&amp;quot;)&#039;&lt;br /&gt;
&lt;br /&gt;
If Using SSL, add:&lt;br /&gt;
    perl -MCPAN -e &#039;install(&amp;quot;Crypt::SSLeay&amp;quot;)&#039;&lt;br /&gt;
To test the connection...&lt;br /&gt;
   echo &#039;hello&#039; | mail -s &amp;quot;Test subject&amp;quot; rt&lt;br /&gt;
If you get a &amp;quot;command died with status 1&amp;quot; error message, the rt-mailgate script possibly doesn&#039;t have the execute bit set for the user/group under which postfix is running.&lt;br /&gt;
   chmod o+x /&amp;amp;lt;path-to-mailgate&amp;amp;gt;/rt-mailgate&lt;br /&gt;
For more information on configuring your mail gateway, see [[ManualAdministration]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Using Fetchmail/Getmail For Incoming Email =&lt;br /&gt;
&lt;br /&gt;
Fetchmail or Getmail can be used to fetch email from a inbox using IMAP or POP. An example configuration for Fetchmail can be seen below:&lt;br /&gt;
    set daemon 0&lt;br /&gt;
    &lt;br /&gt;
    # PID files are more useful for forking systemd services. But fetchmail will&lt;br /&gt;
    # always write one. Since the service runs fetchmail as the apache user,&lt;br /&gt;
    # www-data, we need to give fetchmail a path that it has write permission to.&lt;br /&gt;
    #set pidfile &#039;/opt/rt4/var/run/fetchmail-rtir.pid&#039;&lt;br /&gt;
    &lt;br /&gt;
    poll &amp;quot;IP_OF_MAIL_SERVER&amp;quot; proto imap port 993&lt;br /&gt;
        user &amp;quot;rt@mycompany.com&amp;quot; password &amp;quot;password&amp;quot;&lt;br /&gt;
        ssl&lt;br /&gt;
        folder &#039;Inbox&#039;&lt;br /&gt;
    # Some IMAP servers generate an error like this:&lt;br /&gt;
    #&lt;br /&gt;
    # could not decode BASE64 challenge&lt;br /&gt;
    #&lt;br /&gt;
    # This might be because the server is configured to expect&lt;br /&gt;
    # certain authentication attempt types, first. fetchmail also&lt;br /&gt;
    # tries certain authentication methods first, but not password,&lt;br /&gt;
    # even with the &#039;password&#039; keyword.&lt;br /&gt;
    #&lt;br /&gt;
    # The &#039;auth&#039; keyword tells fetchmail to attempt the given&lt;br /&gt;
    # authentication type, first. That can eliminate initial&lt;br /&gt;
    # authentication failures, which might eliminate this error&lt;br /&gt;
    # messgae&lt;br /&gt;
    #  auth password&lt;br /&gt;
    &lt;br /&gt;
    # IMAP supports flags on individual messages to indicate the&lt;br /&gt;
    # message status. The &#039;Seen&#039; flag indicates that the message has&lt;br /&gt;
    # been read by a client. This could be a webmail client like Gmail&lt;br /&gt;
    # our Outlook, or fetchmail. The RT use case for fetchmail expects&lt;br /&gt;
    # that fetchmail will get all mail that hasn&#039;t been delivered to&lt;br /&gt;
    # RT, regardless of whether other clients have seen it. Without&lt;br /&gt;
    # this option, fetchmail will only download mail from an IMAP&lt;br /&gt;
    # server without the &#039;Seen&#039; flag. This option tells fetchmail to&lt;br /&gt;
    # ignore &#039;Seen&#039; flags and download all messages.&lt;br /&gt;
    # fetchall&lt;br /&gt;
    &lt;br /&gt;
    mda &#039;/opt/rt4/bin/rt-mailgate --url https://rt.mycompany.com --queue &amp;quot;support&amp;quot; --action correspond&#039;&lt;br /&gt;
    idle&lt;br /&gt;
----&lt;br /&gt;
Prev: [[ManualApacheConfig]] --- Up: [[UserManual]] --- Next: [[ManualBasicAdministration]]&lt;br /&gt;
[[Category:RT User Manual]]&lt;/div&gt;</summary>
		<author><name>Craigkai</name></author>
	</entry>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=ManualEmailConfig&amp;diff=26857</id>
		<title>ManualEmailConfig</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=ManualEmailConfig&amp;diff=26857"/>
		<updated>2019-03-22T14:24:25Z</updated>

		<summary type="html">&lt;p&gt;Craigkai: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Prev: [[ManualApacheConfig]] --- Up: [[UserManual]] --- Next: [[ManualBasicAdministration]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
= SETTING UP THE MAIL GATEWAY =&lt;br /&gt;
&lt;br /&gt;
The mail gateway is used to receive mail messages &#039;&#039;&#039;into&#039;&#039;&#039; an RT instance; outbound mail is usually just handed off to the local SMTP sending program, or a specified SMTP smarthost.&lt;br /&gt;
&lt;br /&gt;
The mail gateway requires the web UI to be set up and functional. If you intend to use SSL to secure your mail gateway, you need to make sure that lib-www-perl, a.k.a LWP, is built with SSL support.&lt;br /&gt;
&lt;br /&gt;
1) Documentation for setting up the mail gateway can be found at:&lt;br /&gt;
&lt;br /&gt;
https://docs.bestpractical.com/rt/latest/rt-mailgate.html&lt;br /&gt;
&lt;br /&gt;
2) You need to tell your Mail Transfer Agent (e.g. sendmail, postfix, or qmail) how to forward messages to RT&#039;s mail gateway. To do this, create an aliases in your system&#039;s mail aliases file. Here&#039;s an example, which routes mail to the mailbox [=[mailto:rt@example.com rt@example.com]] (and [=[mailto:rt-comment@example.com rt-comment@example.com]]) into new tickets in the RT queue named &#039;&#039;&#039;General&#039;&#039;&#039;. Note that the queue name is case-insensitive.&lt;br /&gt;
&lt;br /&gt;
Add the following lines to /etc/aliases (or your local equivalent such as /etc/mail/aliases):&lt;br /&gt;
     rt: &amp;quot;|/opt/rt4/bin/rt-mailgate --queue general --action correspond --url http://localhost/rt&amp;quot;&lt;br /&gt;
     rt-comment: &amp;quot;|/opt/rt4/bin/rt-mailgate --queue general --action comment --url http://localhost/rt&amp;quot;&lt;br /&gt;
(Replace /opt/rt4 by your RT installation path and http://localhost/rt by the URL of your RT installation on your webserver)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039; When you add the above each alias entry should be all one line; make sure you include the quotes.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039; &amp;lt;code&amp;gt;qmail&amp;lt;/code&amp;gt; users should follow the [[QMail]] link to review caveats about &amp;lt;code&amp;gt;fastforward&amp;lt;/code&amp;gt; command aliases.&lt;br /&gt;
&lt;br /&gt;
Replace &#039;&#039;&#039;general&#039;&#039;&#039; with the name of your queue and &#039;&#039;&#039;rt&#039;&#039;&#039; (before the colon in the alias) with the email address you wish people to send their messages to. You might, for example, have messages to &#039;&#039;&#039;support&#039;&#039;&#039; go into the &#039;&#039;&#039;service&#039;&#039;&#039; queue, and &#039;&#039;&#039;abuse&#039;&#039;&#039; go into the &#039;&#039;&#039;ops&#039;&#039;&#039; queue. You can have more than one set of aliases point to the same queue, if, for example, you wanted mail to both &#039;&#039;&#039;abuse&#039;&#039;&#039; and &#039;&#039;&#039;security&#039;&#039;&#039; both go to the &#039;&#039;&#039;ops&#039;&#039;&#039; queue.&lt;br /&gt;
&lt;br /&gt;
The queue name may have spaces. &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; works as well with them, but do not forget to escape these spaces by enclosing the queue name in single quote:&lt;br /&gt;
    my-queue: &amp;quot;|/opt/rt4/bin/rt-mailgate --queue &#039;My Queue&#039; --action correspond --url http://localhost/&amp;quot;&lt;br /&gt;
If you are using the default sendmail included in most redhat distro&#039;s you will most likely need to copy (cp) rt-mailgate to /etc/smrsh or create a symbolic link and change /opt/rt4/bin above to /etc/smrsh or sendmail will complain. These sendmails will only execute programs as alias targets which have been blessed by placing them in a special directory. This is not necessary for Exim or postfix.&lt;br /&gt;
&lt;br /&gt;
You&#039;ll choose from &amp;quot;--action correspond&amp;quot; and &amp;quot;--action comment&amp;quot; depending on whether the mail should be resent to the requestor. If you want the requestor to see it, choose correspond; if you want to keep it from the requestor, choose comment.&lt;br /&gt;
&lt;br /&gt;
The URL will be the URL for RT&#039;s web interface, such as http://issues.bestpractical.com/, [http://fsck.com/rt/ =]; whatever is the root of your RT install.&lt;br /&gt;
&lt;br /&gt;
3) Stop and start your mail server, so it picks up your configuration changes. With sendmail or postfix (possibly others), you usually also need to type the command &amp;quot;newaliases&amp;quot; to get the server to recognize the new aliases.  If this command is unrecognized, it&#039;s probably not in your default path; a common location is &amp;quot;/usr/sbin/newaliases&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
You &#039;&#039;&#039;can&#039;&#039;&#039; have the mail gateway on your MX or some other server and have it talk to RT via HTTP. For more details, see [[InstallMailgateOnly]].&lt;br /&gt;
&lt;br /&gt;
To configure a mail transfer agent (postfix) to post tickets to RT4 on a separate server ....&lt;br /&gt;
&lt;br /&gt;
Add the following lines to /etc/aliases (or your local equivalent such as /etc/mail/aliases):&lt;br /&gt;
    rt: &amp;quot;|/&amp;amp;lt;path-to-mailgate&amp;amp;gt;/rt-mailgate --queue general --action correspond --url http://&amp;amp;lt;the-URL-of-the-RT-server&amp;amp;gt;/&amp;quot;&lt;br /&gt;
    rt-comment: &amp;quot;|/&amp;amp;lt;path-to-mailgate&amp;amp;gt;/rt-mailgate --queue general --action comment --url http://&amp;amp;lt;the-URL-of-the-RT-server&amp;amp;gt;/&amp;quot;&lt;br /&gt;
The link to RT is now configured. However, the rt-mailgate script is a perl script which requires support. On a fresh [[SuSE]] 9.3 server install, the following was needed to provide the necessary perl libraries (someone with deeper knowledge may know of a more restrictive set of libraries, but these worked).&lt;br /&gt;
&lt;br /&gt;
 #(install gcc and glibc, if necessary)&lt;br /&gt;
 perl -MCPAN -eshell (to configure CPAN)&lt;br /&gt;
 perl -MCPAN -e &#039;install(&amp;quot;LWP&amp;quot;)&#039;&lt;br /&gt;
 perl -MCPAN -e &#039;install(&amp;quot;Bundle::LWP&amp;quot;)&#039;&lt;br /&gt;
&lt;br /&gt;
If Using SSL, add:&lt;br /&gt;
    perl -MCPAN -e &#039;install(&amp;quot;Crypt::SSLeay&amp;quot;)&#039;&lt;br /&gt;
To test the connection...&lt;br /&gt;
   echo &#039;hello&#039; | mail -s &amp;quot;Test subject&amp;quot; rt&lt;br /&gt;
If you get a &amp;quot;command died with status 1&amp;quot; error message, the rt-mailgate script possibly doesn&#039;t have the execute bit set for the user/group under which postfix is running.&lt;br /&gt;
   chmod o+x /&amp;amp;lt;path-to-mailgate&amp;amp;gt;/rt-mailgate&lt;br /&gt;
For more information on configuring your mail gateway, see [[ManualAdministration]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Using Fetchmail/Getmail For Incoming Email =&lt;br /&gt;
&lt;br /&gt;
Fetchmail or Getmail can be used to fetch email from a inbox using IMAP or POP. An example configuration for Fetchmail can be seen below:&lt;br /&gt;
    set daemon 0&lt;br /&gt;
&lt;br /&gt;
    # PID files are more useful for forking systemd services. But fetchmail will&lt;br /&gt;
    # always write one. Since the service runs fetchmail as the apache user,&lt;br /&gt;
    # www-data, we need to give fetchmail a path that it has write permission to.&lt;br /&gt;
    #set pidfile &#039;/opt/rt4/var/run/fetchmail-rtir.pid&#039;&lt;br /&gt;
&lt;br /&gt;
    poll &amp;quot;IP_OF_MAIL_SERVER&amp;quot; proto imap port 993&lt;br /&gt;
        user &amp;quot;rt@mycompany.com&amp;quot; password &amp;quot;password&amp;quot;&lt;br /&gt;
        ssl&lt;br /&gt;
        folder &#039;Inbox&#039;&lt;br /&gt;
    # Some IMAP servers generate an error like this:&lt;br /&gt;
    #&lt;br /&gt;
    # could not decode BASE64 challenge&lt;br /&gt;
    #&lt;br /&gt;
    # This might be because the server is configured to expect&lt;br /&gt;
    # certain authentication attempt types, first. fetchmail also&lt;br /&gt;
    # tries certain authentication methods first, but not password,&lt;br /&gt;
    # even with the &#039;password&#039; keyword.&lt;br /&gt;
    #&lt;br /&gt;
    # The &#039;auth&#039; keyword tells fetchmail to attempt the given&lt;br /&gt;
    # authentication type, first. That can eliminate initial&lt;br /&gt;
    # authentication failures, which might eliminate this error&lt;br /&gt;
    # messgae&lt;br /&gt;
    #  auth password&lt;br /&gt;
&lt;br /&gt;
    # IMAP supports flags on individual messages to indicate the&lt;br /&gt;
    # message status. The &#039;Seen&#039; flag indicates that the message has&lt;br /&gt;
    # been read by a client. This could be a webmail client like Gmail&lt;br /&gt;
    # our Outlook, or fetchmail. The RT use case for fetchmail expects&lt;br /&gt;
    # that fetchmail will get all mail that hasn&#039;t been delivered to&lt;br /&gt;
    # RT, regardless of whether other clients have seen it. Without&lt;br /&gt;
    # this option, fetchmail will only download mail from an IMAP&lt;br /&gt;
    # server without the &#039;Seen&#039; flag. This option tells fetchmail to&lt;br /&gt;
    # ignore &#039;Seen&#039; flags and download all messages.&lt;br /&gt;
    # fetchall&lt;br /&gt;
&lt;br /&gt;
    mda &#039;/opt/rt4/bin/rt-mailgate --url https://rt.mycompany.com --queue &amp;quot;support&amp;quot; --action correspond&#039;&lt;br /&gt;
    idle&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Prev: [[ManualApacheConfig]] --- Up: [[UserManual]] --- Next: [[ManualBasicAdministration]]&lt;br /&gt;
[[Category:RT User Manual]]&lt;/div&gt;</summary>
		<author><name>Craigkai</name></author>
	</entry>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=ManualApacheConfig&amp;diff=26845</id>
		<title>ManualApacheConfig</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=ManualApacheConfig&amp;diff=26845"/>
		<updated>2019-03-21T17:04:34Z</updated>

		<summary type="html">&lt;p&gt;Craigkai: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Prev: [[ManualInstallation]] --- Up: [[UserManual]] --- Next: [[ManualEmailConfig]]&lt;br /&gt;
&lt;br /&gt;
See official docs: https://docs.bestpractical.com/rt/latest/web_deployment.html&lt;br /&gt;
{{OutdatedInstallGuide}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE: The information on this page is outdated.  It is superseded by the documentation in docs/web_deployment.pod in the base RT tarball.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Apache + mod_perl2 guide updated for RT4&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
= SETTING UP THE WEB INTERFACE =&lt;br /&gt;
&lt;br /&gt;
== Choosing a web handler ==&lt;br /&gt;
&lt;br /&gt;
A note of caution: Do not use symbolic links in the Apache conf directory structures.&lt;br /&gt;
&lt;br /&gt;
RT&#039;s web interface is written using HTML::Mason, which works with the mod_perl embedded perl interpreter within Apache httpd. Alternatively, support for the [[FastCGI]] interface is also provided as &#039;bin/mason_handler.fcgi&#039;. Setting up either of these can be fairly intricate; don&#039;t get discouraged if it takes you some time to get this right -- though it&#039;s not nearly as difficult as it used to be.&lt;br /&gt;
&lt;br /&gt;
=== FastCGI vs. mod_perl ===&lt;br /&gt;
&lt;br /&gt;
Both work fine. Each have some strong and weak points.&lt;br /&gt;
&lt;br /&gt;
You cannot run multiple instances of RT under one server with mod_perl, even in multiple vhosts; since mod_perl embeds a perl process in apache, but only one, whichever configuration is loaded last will clobber all other ones. If you need to run more than once instance of RT on the same server, you will need to run them with fastcgi.&lt;br /&gt;
&lt;br /&gt;
If you have something already installed then use it. Otherwise here are a few notes to help choose:&lt;br /&gt;
&lt;br /&gt;
* apache 1.x is for those who are already using it and don&#039;t want to upgrade&lt;br /&gt;
* use whatever version of apache is installed on your system&lt;br /&gt;
* have no experience with [[FastCGI]] or mod_perl then just throw a coin to choose between -- or pick whichever one is provided as a package by your distribution&lt;br /&gt;
* a few warnings about mod_perl:&lt;br /&gt;
** If your system has only mod_perl 1.9x (development version before mod_perl 2 release) and you don&#039;t know how to or don&#039;t want to build mod_perl from scratch then just ignore it and &#039;&#039;&#039;DON&#039;T TRY TO USE&#039;&#039;&#039; RT with mod_perl 1.9x, jump to [[FastCGI]] (this is unlikely to be the case on new installs, as mod_perl 2 has been out for some number of years now).&lt;br /&gt;
** If you have apache 2.x then you need mod_perl 2.x as well. mod_perl 1.x just won&#039;t work with apache 2.x&lt;br /&gt;
** If you have apache 1.x then you need mod_perl 1.xx where xx is not 9x&lt;br /&gt;
&lt;br /&gt;
The [[PerformanceTuning]] page has some info about the [[FastCGI]] vs. mod_perl. Read the Myths section.&lt;br /&gt;
&lt;br /&gt;
=== Other options ===&lt;br /&gt;
&lt;br /&gt;
Other options as well exist, like speedycgi, [[FastCGI]]+nginx, [[FastCGI]]+lighttpd... But Apache+[[FastCGI]] and Apache+mod_perl these are two major variants perl developers pay attention to as they are most common. If it&#039;s your first install then make your life easier and choose a common solution. Later you may find time to experiment with others.&lt;br /&gt;
&lt;br /&gt;
=== Checking dependencies ===&lt;br /&gt;
&lt;br /&gt;
Once you&#039;ve made your choice then test dependencies again to make sure everything is there for web environment of choice:&lt;br /&gt;
&lt;br /&gt;
: &amp;amp;#35; without arguments to get list of options&lt;br /&gt;
: make testdeps&lt;br /&gt;
&lt;br /&gt;
You can choose web handler during ./configure step using its option. Check ./configure --help&lt;br /&gt;
&lt;br /&gt;
== Choosing web layout ==&lt;br /&gt;
&lt;br /&gt;
Before you start your install, you have to decide which URL will be the base for your RT instance. Will it be [[ManualInstallation|http://rt.example.com/]] or do you prefer [[ManualInstallation|http://www.example.com/rt/]] ? RT can&#039;t get this info from apache config or preconfigure your server for any possible setup, so it&#039;s your task to decide and configure both ends.&lt;br /&gt;
&lt;br /&gt;
If you decide to use rt.example.com, and you&#039;re sharing the webserver with other domains using [[VirtualHosts]], then you&#039;ll have additional configuration to perform.&lt;br /&gt;
&lt;br /&gt;
== SiteConfig ==&lt;br /&gt;
&lt;br /&gt;
RT config has several options to define web server [[URLs]] layout [[WebBaseURL]], [[WebPath]] and [[WebURL]]. The first two are the most important things you must configure:&lt;br /&gt;
&lt;br /&gt;
* [[WebBaseURL]] - it&#039;s the base URL for the server that serves RT web interface, it should contain scheme (http or https), server name and port (if it&#039;s not standard value 80), for example [[ManualInstallation|http://rt.example.com]], [[ManualInstallation|https://rt.example.com]] and [[ManualInstallation|http://www.example.com]] are valid and sane values. Note that there is &#039;&#039;&#039;no trailing slash&#039;&#039;&#039; and &#039;&#039;&#039;it&#039;s root URL of the server&#039;&#039;&#039;.&lt;br /&gt;
* [[WebPath]] - it&#039;s URL path relative to the root of the server (WebBaseURL option) that has leading slash and no trailing slash, for example &amp;lt;code&amp;gt;/rt&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;/helpdesk&amp;lt;/code&amp;gt; or empty value.&lt;br /&gt;
&lt;br /&gt;
We discussed these in the [[ManualInstallation]] section, previously, but here are some examples to recap:&lt;br /&gt;
&lt;br /&gt;
* You want [[ManualInstallation|http://rt.example.com/]] as RT main page then WebBaseURL should be [[ManualInstallation|http://rt.example.com]] and WebPath should be empty.&lt;br /&gt;
* You want [[ManualInstallation|http://www.example.com/helpdesk/]] as RT main page then WebBaseURL should be [[ManualInstallation|http://www.example.com]] and WebPath should be &amp;lt;code&amp;gt;/helpdesk&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
That&#039;s all: once you&#039;ve chosen layout and configured RT&#039;s config you can configure apache server.&lt;br /&gt;
&lt;br /&gt;
== Configuring Apache ==&lt;br /&gt;
&lt;br /&gt;
You&#039;ve made several choices above and now you&#039;re ready to configure your server. Usually configuration files are in /etc/apache* or /etc/httpd&lt;br /&gt;
&lt;br /&gt;
You&#039;ll need to add a few lines to your httpd.conf telling it to use RT&#039;s web interface and how to handle it. Search below for a variant matching your choices. If you can not find it here then search on other pages and move here example or ask on [[MailingLists]], but don&#039;t forget mention that you came from this page and it has no example for your case, so people can update it.&lt;br /&gt;
&lt;br /&gt;
Note: RT will not load without a valid virtual host name&lt;br /&gt;
&lt;br /&gt;
=== apache2 + mod_perl2 and RT4 on [[ManualInstallation|http://rt.example.com/]] ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;pre&amp;gt;&lt;br /&gt;
            &amp;amp;lt;VirtualHost rt.example.com&amp;amp;gt;&lt;br /&gt;
                # Optional apache logs for RT&lt;br /&gt;
                # ErrorLog /opt/rt4/var/log/apache2.error&lt;br /&gt;
                # TransferLog /opt/rt4/var/log/apache2.access&lt;br /&gt;
                # LogLevel debug&lt;br /&gt;
        &lt;br /&gt;
                AddDefaultCharset UTF-8&lt;br /&gt;
                DocumentRoot &amp;quot;/opt/rt4/share/html&amp;quot;&lt;br /&gt;
        &lt;br /&gt;
                &amp;amp;lt;Location /&amp;amp;gt;&lt;br /&gt;
                    Order allow,deny&lt;br /&gt;
                    Allow from all&lt;br /&gt;
        &lt;br /&gt;
                    SetHandler modperl&lt;br /&gt;
                    PerlResponseHandler Plack::Handler::Apache2&lt;br /&gt;
                    PerlSetVar psgi_app /opt/rt4/sbin/rt-server&lt;br /&gt;
                &amp;amp;lt;/Location&amp;amp;gt;&lt;br /&gt;
                &amp;amp;lt;Perl&amp;amp;gt;&lt;br /&gt;
                    use Plack::Handler::Apache2;&lt;br /&gt;
                    Plack::Handler::Apache2-&amp;gt;preload(&amp;quot;/opt/rt4/sbin/rt-server&amp;quot;);&lt;br /&gt;
                &amp;amp;lt;/Perl&amp;amp;gt;&lt;br /&gt;
            &amp;amp;lt;/VirtualHost&amp;amp;gt;&lt;br /&gt;
        &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== apache2 + mod_perl2 and RT on [[ManualInstallation|http://rt.example.com/]] ===&lt;br /&gt;
Note: This only works for RT4&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;pre&amp;gt;# ip based virtual host&lt;br /&gt;
         Listen ip_of_the_rt.example.com:80&lt;br /&gt;
         &amp;amp;lt;VirtualHost ip_of_the_rt.example.com:80&amp;amp;gt;&lt;br /&gt;
            ServerName rt.example.com&lt;br /&gt;
            ServerAdmin Email.Address@example.com&lt;br /&gt;
         &lt;br /&gt;
         &lt;br /&gt;
            DocumentRoot /opt/rt4/share/html&lt;br /&gt;
         &lt;br /&gt;
            AddDefaultCharset UTF-8&lt;br /&gt;
            PerlRequire /opt/rt4/bin/webmux.pl&lt;br /&gt;
         &lt;br /&gt;
         &lt;br /&gt;
            &amp;amp;lt;Directory /opt/rt4/share/html&amp;amp;gt;&lt;br /&gt;
                Order allow,deny&lt;br /&gt;
                Allow from all&lt;br /&gt;
         &lt;br /&gt;
                SetHandler perl-script&lt;br /&gt;
                PerlResponseHandler RT::Mason&lt;br /&gt;
            &amp;amp;lt;/Directory&amp;amp;gt;&lt;br /&gt;
         &amp;amp;lt;/VirtualHost&amp;amp;gt;&lt;br /&gt;
         &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== apache2 + mod_perl2 and RT on [[ManualInstallation|http://www.example.com/rt/]] ===&lt;br /&gt;
&lt;br /&gt;
 Listen ip_of_the_www.example.com:80&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 &amp;amp;lt;VirtualHost ip_of_the_www.example.com:80&amp;amp;gt;&lt;br /&gt;
    ServerName www.example.com&lt;br /&gt;
    ServerAdmin Email.Address@example.com&lt;br /&gt;
 &lt;br /&gt;
    # config for your main content&lt;br /&gt;
    DocumentRoot /www/www.example.com&lt;br /&gt;
    &amp;amp;lt;Directory /www/www.example.com&amp;amp;gt;&lt;br /&gt;
        # here and in other places goes config&lt;br /&gt;
        # of your main host&lt;br /&gt;
    &amp;amp;lt;/Directory&amp;amp;gt;&lt;br /&gt;
 &lt;br /&gt;
    # as RT is out of document root then we want alias&lt;br /&gt;
    # and should define directory access&lt;br /&gt;
    Alias /rt/ /opt/rt4/share/html/&lt;br /&gt;
    &amp;amp;lt;Directory /opt/rt4/share/html/&amp;amp;gt;&lt;br /&gt;
        Order allow,deny&lt;br /&gt;
        Allow from all&lt;br /&gt;
    &amp;amp;lt;/Directory&amp;amp;gt;&lt;br /&gt;
 &lt;br /&gt;
    PerlRequire /opt/rt4/bin/webmux.pl&lt;br /&gt;
    &amp;amp;lt;Location /rt/&amp;amp;gt;&lt;br /&gt;
        AddDefaultCharset UTF-8&lt;br /&gt;
        SetHandler perl-script&lt;br /&gt;
        PerlHandler RT::Mason&lt;br /&gt;
    &amp;amp;lt;/Location&amp;amp;gt;&lt;br /&gt;
 &amp;amp;lt;/VirtualHost&amp;amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Some historical notes people left, some make sense, some are wrong, for refactoring ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039; If you are running Apache 2, the recommended configuration directive is:&lt;br /&gt;
&lt;br /&gt;
 RedirectMatch permanent (.*)/$ [[ManualInstallation|http://example.com$1/index.html]]&lt;br /&gt;
&lt;br /&gt;
in your [[VirtualHost]] section&lt;br /&gt;
&lt;br /&gt;
This line will take all requests of form &amp;quot;[http://example.com/foo/ http://example.com/foo/&amp;quot;] into &amp;quot;[http://example.com/foo/index.html http://example.com/foo/index.html&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039; If &amp;quot;your.ip.address&amp;quot; above is the same as your webserver&#039;s IP and you&#039;re not planning to assign a unique IP address or alias (CNAME) for RT, you should realize that the above [[VirtualHost]] configuration works when RT is the only content provided at the root of the webserver. If your webserver has existing content or you plan to add content later, you&#039;ll probably want to place RT in a directory other than the root of the webserver. If you choose to use &amp;quot;[http://fsck.com/rt/ http://fsck.com/rt/&amp;quot;], you&#039;ll want to modify the [[VirtualHost]] configuration as follows:&lt;br /&gt;
&lt;br /&gt;
Comment with &#039;#&#039; or remove the following line:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 DocumentRoot /opt/rt4/share/html&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
and add in its place:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 Alias /rt &amp;quot;/opt/rt4/share/html&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Lastly, change the Location path from:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 &amp;amp;lt;Location /&amp;amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
to&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 &amp;amp;lt;Location /rt&amp;amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
That gives a configuration similar to&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 Alias /rt &amp;quot;/opt/rt4/share/html&amp;quot;&lt;br /&gt;
 PerlModule Apache::DBI&lt;br /&gt;
 PerlRequire /opt/rt4/bin/webmux.pl&lt;br /&gt;
 &amp;amp;lt;Directory /opt/rt4/share/html&amp;amp;gt;&lt;br /&gt;
   AllowOverride All&lt;br /&gt;
   Options ExecCGI FollowSymLinks&lt;br /&gt;
   &amp;amp;lt;IfModule mod_access.c&amp;amp;gt;&lt;br /&gt;
         Order allow,deny&lt;br /&gt;
       Allow from all&lt;br /&gt;
   &amp;amp;lt;/IfModule&amp;amp;gt;&lt;br /&gt;
 &amp;amp;lt;/Directory&amp;amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;amp;lt;Location /rt&amp;amp;gt;&lt;br /&gt;
   RewriteEngine On&lt;br /&gt;
   RedirectMatch permanent (.*)/$ $1/index.html&lt;br /&gt;
   AddDefaultCharset UTF-8&lt;br /&gt;
   SetHandler perl-script&lt;br /&gt;
   PerlHandler RT::Mason&lt;br /&gt;
 &amp;amp;lt;/Location&amp;amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
You will also need to modify the $[[WebPath]] variable in etc/[[RT SiteConfig|RT_SiteConfig]].pm in your RT installation directory. For the above example you would use:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 $WebPath = &amp;quot;/rt&amp;quot;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Remember that $[[WebPath]] requires a leading / but no trailing /. $[[WebPath]], your Apache alias, and your Apache Location should all contain the same string.&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
Next, stop Apache. This will vary by system but might look something like this:&lt;br /&gt;
&lt;br /&gt;
 cd /etc/init.d&lt;br /&gt;
 ./httpd stop&lt;br /&gt;
&lt;br /&gt;
or, if your distro includes it:&lt;br /&gt;
&lt;br /&gt;
 apachectl stop&lt;br /&gt;
&lt;br /&gt;
Try to use a browser to go to your RT server&#039;s website. You shouldn&#039;t be able to do it. Restart Apache:&lt;br /&gt;
&lt;br /&gt;
 ./httpd start&lt;br /&gt;
&lt;br /&gt;
Now, you should be able to go to your RT URL and get the login screen.&lt;br /&gt;
&lt;br /&gt;
Once this works, you may move on to setting up your email gateway.&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Read the entry in the [[FAQ]] about [[MaxRequestsPerChild]].&lt;br /&gt;
&lt;br /&gt;
=== client denied by server configuration ===&lt;br /&gt;
&lt;br /&gt;
If you receive a &amp;quot;client denied by server configuration: /opt/rt4/share/html&amp;quot; in your Apache error.log or a &amp;quot;403 Forbidden&amp;quot; error then also add the following to your [[VirtualHost]] section:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 &amp;amp;lt;Directory &amp;quot;/opt/rt4/share/html&amp;quot;&amp;amp;gt;&lt;br /&gt;
     Order allow,deny&lt;br /&gt;
     Allow from all&lt;br /&gt;
 &amp;amp;lt;/Directory&amp;amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
(the above hint for 403/denied was found on [[ManualInstallation|http://wiki.bestpractical.com/view/FastCGIConfiguration]])&lt;br /&gt;
&lt;br /&gt;
=== Can&#039;t locate Apache/DBI.pm in ... ===&lt;br /&gt;
&lt;br /&gt;
At this point you can either delete &amp;quot;[[PerlModule]] Apache::DBI&amp;quot; from apache config, or figure out how to install it -- [[SuSE]], for example, provides it as a package to match their Apache2 package.&lt;br /&gt;
&lt;br /&gt;
 This feature is *optional*. Read ApacheConfig for more info about &amp;quot;mod_perl and caching connections to the DB&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Prev: [[ManualInstallation]] --- Up: [[UserManual]] --- Next: [[ManualEmailConfig]]&lt;br /&gt;
[[Category:RT User Manual]]&lt;/div&gt;</summary>
		<author><name>Craigkai</name></author>
	</entry>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=ManualApacheConfig&amp;diff=26844</id>
		<title>ManualApacheConfig</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=ManualApacheConfig&amp;diff=26844"/>
		<updated>2019-03-21T17:04:23Z</updated>

		<summary type="html">&lt;p&gt;Craigkai: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Prev: [[ManualInstallation]] --- Up: [[UserManual]] --- Next: [[ManualEmailConfig]]&lt;br /&gt;
&lt;br /&gt;
See official docs: https://docs.bestpractical.com/rt/latest/web_deployment.html&lt;br /&gt;
&lt;br /&gt;
{{OutdatedInstallGuide}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE: The information on this page is outdated.  It is superseded by the documentation in docs/web_deployment.pod in the base RT tarball.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Apache + mod_perl2 guide updated for RT4&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
= SETTING UP THE WEB INTERFACE =&lt;br /&gt;
&lt;br /&gt;
== Choosing a web handler ==&lt;br /&gt;
&lt;br /&gt;
A note of caution: Do not use symbolic links in the Apache conf directory structures.&lt;br /&gt;
&lt;br /&gt;
RT&#039;s web interface is written using HTML::Mason, which works with the mod_perl embedded perl interpreter within Apache httpd. Alternatively, support for the [[FastCGI]] interface is also provided as &#039;bin/mason_handler.fcgi&#039;. Setting up either of these can be fairly intricate; don&#039;t get discouraged if it takes you some time to get this right -- though it&#039;s not nearly as difficult as it used to be.&lt;br /&gt;
&lt;br /&gt;
=== FastCGI vs. mod_perl ===&lt;br /&gt;
&lt;br /&gt;
Both work fine. Each have some strong and weak points.&lt;br /&gt;
&lt;br /&gt;
You cannot run multiple instances of RT under one server with mod_perl, even in multiple vhosts; since mod_perl embeds a perl process in apache, but only one, whichever configuration is loaded last will clobber all other ones. If you need to run more than once instance of RT on the same server, you will need to run them with fastcgi.&lt;br /&gt;
&lt;br /&gt;
If you have something already installed then use it. Otherwise here are a few notes to help choose:&lt;br /&gt;
&lt;br /&gt;
* apache 1.x is for those who are already using it and don&#039;t want to upgrade&lt;br /&gt;
* use whatever version of apache is installed on your system&lt;br /&gt;
* have no experience with [[FastCGI]] or mod_perl then just throw a coin to choose between -- or pick whichever one is provided as a package by your distribution&lt;br /&gt;
* a few warnings about mod_perl:&lt;br /&gt;
** If your system has only mod_perl 1.9x (development version before mod_perl 2 release) and you don&#039;t know how to or don&#039;t want to build mod_perl from scratch then just ignore it and &#039;&#039;&#039;DON&#039;T TRY TO USE&#039;&#039;&#039; RT with mod_perl 1.9x, jump to [[FastCGI]] (this is unlikely to be the case on new installs, as mod_perl 2 has been out for some number of years now).&lt;br /&gt;
** If you have apache 2.x then you need mod_perl 2.x as well. mod_perl 1.x just won&#039;t work with apache 2.x&lt;br /&gt;
** If you have apache 1.x then you need mod_perl 1.xx where xx is not 9x&lt;br /&gt;
&lt;br /&gt;
The [[PerformanceTuning]] page has some info about the [[FastCGI]] vs. mod_perl. Read the Myths section.&lt;br /&gt;
&lt;br /&gt;
=== Other options ===&lt;br /&gt;
&lt;br /&gt;
Other options as well exist, like speedycgi, [[FastCGI]]+nginx, [[FastCGI]]+lighttpd... But Apache+[[FastCGI]] and Apache+mod_perl these are two major variants perl developers pay attention to as they are most common. If it&#039;s your first install then make your life easier and choose a common solution. Later you may find time to experiment with others.&lt;br /&gt;
&lt;br /&gt;
=== Checking dependencies ===&lt;br /&gt;
&lt;br /&gt;
Once you&#039;ve made your choice then test dependencies again to make sure everything is there for web environment of choice:&lt;br /&gt;
&lt;br /&gt;
: &amp;amp;#35; without arguments to get list of options&lt;br /&gt;
: make testdeps&lt;br /&gt;
&lt;br /&gt;
You can choose web handler during ./configure step using its option. Check ./configure --help&lt;br /&gt;
&lt;br /&gt;
== Choosing web layout ==&lt;br /&gt;
&lt;br /&gt;
Before you start your install, you have to decide which URL will be the base for your RT instance. Will it be [[ManualInstallation|http://rt.example.com/]] or do you prefer [[ManualInstallation|http://www.example.com/rt/]] ? RT can&#039;t get this info from apache config or preconfigure your server for any possible setup, so it&#039;s your task to decide and configure both ends.&lt;br /&gt;
&lt;br /&gt;
If you decide to use rt.example.com, and you&#039;re sharing the webserver with other domains using [[VirtualHosts]], then you&#039;ll have additional configuration to perform.&lt;br /&gt;
&lt;br /&gt;
== SiteConfig ==&lt;br /&gt;
&lt;br /&gt;
RT config has several options to define web server [[URLs]] layout [[WebBaseURL]], [[WebPath]] and [[WebURL]]. The first two are the most important things you must configure:&lt;br /&gt;
&lt;br /&gt;
* [[WebBaseURL]] - it&#039;s the base URL for the server that serves RT web interface, it should contain scheme (http or https), server name and port (if it&#039;s not standard value 80), for example [[ManualInstallation|http://rt.example.com]], [[ManualInstallation|https://rt.example.com]] and [[ManualInstallation|http://www.example.com]] are valid and sane values. Note that there is &#039;&#039;&#039;no trailing slash&#039;&#039;&#039; and &#039;&#039;&#039;it&#039;s root URL of the server&#039;&#039;&#039;.&lt;br /&gt;
* [[WebPath]] - it&#039;s URL path relative to the root of the server (WebBaseURL option) that has leading slash and no trailing slash, for example &amp;lt;code&amp;gt;/rt&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;/helpdesk&amp;lt;/code&amp;gt; or empty value.&lt;br /&gt;
&lt;br /&gt;
We discussed these in the [[ManualInstallation]] section, previously, but here are some examples to recap:&lt;br /&gt;
&lt;br /&gt;
* You want [[ManualInstallation|http://rt.example.com/]] as RT main page then WebBaseURL should be [[ManualInstallation|http://rt.example.com]] and WebPath should be empty.&lt;br /&gt;
* You want [[ManualInstallation|http://www.example.com/helpdesk/]] as RT main page then WebBaseURL should be [[ManualInstallation|http://www.example.com]] and WebPath should be &amp;lt;code&amp;gt;/helpdesk&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
That&#039;s all: once you&#039;ve chosen layout and configured RT&#039;s config you can configure apache server.&lt;br /&gt;
&lt;br /&gt;
== Configuring Apache ==&lt;br /&gt;
&lt;br /&gt;
You&#039;ve made several choices above and now you&#039;re ready to configure your server. Usually configuration files are in /etc/apache* or /etc/httpd&lt;br /&gt;
&lt;br /&gt;
You&#039;ll need to add a few lines to your httpd.conf telling it to use RT&#039;s web interface and how to handle it. Search below for a variant matching your choices. If you can not find it here then search on other pages and move here example or ask on [[MailingLists]], but don&#039;t forget mention that you came from this page and it has no example for your case, so people can update it.&lt;br /&gt;
&lt;br /&gt;
Note: RT will not load without a valid virtual host name&lt;br /&gt;
&lt;br /&gt;
=== apache2 + mod_perl2 and RT4 on [[ManualInstallation|http://rt.example.com/]] ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;pre&amp;gt;&lt;br /&gt;
            &amp;amp;lt;VirtualHost rt.example.com&amp;amp;gt;&lt;br /&gt;
                # Optional apache logs for RT&lt;br /&gt;
                # ErrorLog /opt/rt4/var/log/apache2.error&lt;br /&gt;
                # TransferLog /opt/rt4/var/log/apache2.access&lt;br /&gt;
                # LogLevel debug&lt;br /&gt;
        &lt;br /&gt;
                AddDefaultCharset UTF-8&lt;br /&gt;
                DocumentRoot &amp;quot;/opt/rt4/share/html&amp;quot;&lt;br /&gt;
        &lt;br /&gt;
                &amp;amp;lt;Location /&amp;amp;gt;&lt;br /&gt;
                    Order allow,deny&lt;br /&gt;
                    Allow from all&lt;br /&gt;
        &lt;br /&gt;
                    SetHandler modperl&lt;br /&gt;
                    PerlResponseHandler Plack::Handler::Apache2&lt;br /&gt;
                    PerlSetVar psgi_app /opt/rt4/sbin/rt-server&lt;br /&gt;
                &amp;amp;lt;/Location&amp;amp;gt;&lt;br /&gt;
                &amp;amp;lt;Perl&amp;amp;gt;&lt;br /&gt;
                    use Plack::Handler::Apache2;&lt;br /&gt;
                    Plack::Handler::Apache2-&amp;gt;preload(&amp;quot;/opt/rt4/sbin/rt-server&amp;quot;);&lt;br /&gt;
                &amp;amp;lt;/Perl&amp;amp;gt;&lt;br /&gt;
            &amp;amp;lt;/VirtualHost&amp;amp;gt;&lt;br /&gt;
        &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== apache2 + mod_perl2 and RT on [[ManualInstallation|http://rt.example.com/]] ===&lt;br /&gt;
Note: This only works for RT4&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;pre&amp;gt;# ip based virtual host&lt;br /&gt;
         Listen ip_of_the_rt.example.com:80&lt;br /&gt;
         &amp;amp;lt;VirtualHost ip_of_the_rt.example.com:80&amp;amp;gt;&lt;br /&gt;
            ServerName rt.example.com&lt;br /&gt;
            ServerAdmin Email.Address@example.com&lt;br /&gt;
         &lt;br /&gt;
         &lt;br /&gt;
            DocumentRoot /opt/rt4/share/html&lt;br /&gt;
         &lt;br /&gt;
            AddDefaultCharset UTF-8&lt;br /&gt;
            PerlRequire /opt/rt4/bin/webmux.pl&lt;br /&gt;
         &lt;br /&gt;
         &lt;br /&gt;
            &amp;amp;lt;Directory /opt/rt4/share/html&amp;amp;gt;&lt;br /&gt;
                Order allow,deny&lt;br /&gt;
                Allow from all&lt;br /&gt;
         &lt;br /&gt;
                SetHandler perl-script&lt;br /&gt;
                PerlResponseHandler RT::Mason&lt;br /&gt;
            &amp;amp;lt;/Directory&amp;amp;gt;&lt;br /&gt;
         &amp;amp;lt;/VirtualHost&amp;amp;gt;&lt;br /&gt;
         &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== apache2 + mod_perl2 and RT on [[ManualInstallation|http://www.example.com/rt/]] ===&lt;br /&gt;
&lt;br /&gt;
 Listen ip_of_the_www.example.com:80&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 &amp;amp;lt;VirtualHost ip_of_the_www.example.com:80&amp;amp;gt;&lt;br /&gt;
    ServerName www.example.com&lt;br /&gt;
    ServerAdmin Email.Address@example.com&lt;br /&gt;
 &lt;br /&gt;
    # config for your main content&lt;br /&gt;
    DocumentRoot /www/www.example.com&lt;br /&gt;
    &amp;amp;lt;Directory /www/www.example.com&amp;amp;gt;&lt;br /&gt;
        # here and in other places goes config&lt;br /&gt;
        # of your main host&lt;br /&gt;
    &amp;amp;lt;/Directory&amp;amp;gt;&lt;br /&gt;
 &lt;br /&gt;
    # as RT is out of document root then we want alias&lt;br /&gt;
    # and should define directory access&lt;br /&gt;
    Alias /rt/ /opt/rt4/share/html/&lt;br /&gt;
    &amp;amp;lt;Directory /opt/rt4/share/html/&amp;amp;gt;&lt;br /&gt;
        Order allow,deny&lt;br /&gt;
        Allow from all&lt;br /&gt;
    &amp;amp;lt;/Directory&amp;amp;gt;&lt;br /&gt;
 &lt;br /&gt;
    PerlRequire /opt/rt4/bin/webmux.pl&lt;br /&gt;
    &amp;amp;lt;Location /rt/&amp;amp;gt;&lt;br /&gt;
        AddDefaultCharset UTF-8&lt;br /&gt;
        SetHandler perl-script&lt;br /&gt;
        PerlHandler RT::Mason&lt;br /&gt;
    &amp;amp;lt;/Location&amp;amp;gt;&lt;br /&gt;
 &amp;amp;lt;/VirtualHost&amp;amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Some historical notes people left, some make sense, some are wrong, for refactoring ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039; If you are running Apache 2, the recommended configuration directive is:&lt;br /&gt;
&lt;br /&gt;
 RedirectMatch permanent (.*)/$ [[ManualInstallation|http://example.com$1/index.html]]&lt;br /&gt;
&lt;br /&gt;
in your [[VirtualHost]] section&lt;br /&gt;
&lt;br /&gt;
This line will take all requests of form &amp;quot;[http://example.com/foo/ http://example.com/foo/&amp;quot;] into &amp;quot;[http://example.com/foo/index.html http://example.com/foo/index.html&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039; If &amp;quot;your.ip.address&amp;quot; above is the same as your webserver&#039;s IP and you&#039;re not planning to assign a unique IP address or alias (CNAME) for RT, you should realize that the above [[VirtualHost]] configuration works when RT is the only content provided at the root of the webserver. If your webserver has existing content or you plan to add content later, you&#039;ll probably want to place RT in a directory other than the root of the webserver. If you choose to use &amp;quot;[http://fsck.com/rt/ http://fsck.com/rt/&amp;quot;], you&#039;ll want to modify the [[VirtualHost]] configuration as follows:&lt;br /&gt;
&lt;br /&gt;
Comment with &#039;#&#039; or remove the following line:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 DocumentRoot /opt/rt4/share/html&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
and add in its place:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 Alias /rt &amp;quot;/opt/rt4/share/html&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Lastly, change the Location path from:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 &amp;amp;lt;Location /&amp;amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
to&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 &amp;amp;lt;Location /rt&amp;amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
That gives a configuration similar to&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 Alias /rt &amp;quot;/opt/rt4/share/html&amp;quot;&lt;br /&gt;
 PerlModule Apache::DBI&lt;br /&gt;
 PerlRequire /opt/rt4/bin/webmux.pl&lt;br /&gt;
 &amp;amp;lt;Directory /opt/rt4/share/html&amp;amp;gt;&lt;br /&gt;
   AllowOverride All&lt;br /&gt;
   Options ExecCGI FollowSymLinks&lt;br /&gt;
   &amp;amp;lt;IfModule mod_access.c&amp;amp;gt;&lt;br /&gt;
         Order allow,deny&lt;br /&gt;
       Allow from all&lt;br /&gt;
   &amp;amp;lt;/IfModule&amp;amp;gt;&lt;br /&gt;
 &amp;amp;lt;/Directory&amp;amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;amp;lt;Location /rt&amp;amp;gt;&lt;br /&gt;
   RewriteEngine On&lt;br /&gt;
   RedirectMatch permanent (.*)/$ $1/index.html&lt;br /&gt;
   AddDefaultCharset UTF-8&lt;br /&gt;
   SetHandler perl-script&lt;br /&gt;
   PerlHandler RT::Mason&lt;br /&gt;
 &amp;amp;lt;/Location&amp;amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
You will also need to modify the $[[WebPath]] variable in etc/[[RT SiteConfig|RT_SiteConfig]].pm in your RT installation directory. For the above example you would use:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 $WebPath = &amp;quot;/rt&amp;quot;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Remember that $[[WebPath]] requires a leading / but no trailing /. $[[WebPath]], your Apache alias, and your Apache Location should all contain the same string.&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
Next, stop Apache. This will vary by system but might look something like this:&lt;br /&gt;
&lt;br /&gt;
 cd /etc/init.d&lt;br /&gt;
 ./httpd stop&lt;br /&gt;
&lt;br /&gt;
or, if your distro includes it:&lt;br /&gt;
&lt;br /&gt;
 apachectl stop&lt;br /&gt;
&lt;br /&gt;
Try to use a browser to go to your RT server&#039;s website. You shouldn&#039;t be able to do it. Restart Apache:&lt;br /&gt;
&lt;br /&gt;
 ./httpd start&lt;br /&gt;
&lt;br /&gt;
Now, you should be able to go to your RT URL and get the login screen.&lt;br /&gt;
&lt;br /&gt;
Once this works, you may move on to setting up your email gateway.&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Read the entry in the [[FAQ]] about [[MaxRequestsPerChild]].&lt;br /&gt;
&lt;br /&gt;
=== client denied by server configuration ===&lt;br /&gt;
&lt;br /&gt;
If you receive a &amp;quot;client denied by server configuration: /opt/rt4/share/html&amp;quot; in your Apache error.log or a &amp;quot;403 Forbidden&amp;quot; error then also add the following to your [[VirtualHost]] section:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 &amp;amp;lt;Directory &amp;quot;/opt/rt4/share/html&amp;quot;&amp;amp;gt;&lt;br /&gt;
     Order allow,deny&lt;br /&gt;
     Allow from all&lt;br /&gt;
 &amp;amp;lt;/Directory&amp;amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
(the above hint for 403/denied was found on [[ManualInstallation|http://wiki.bestpractical.com/view/FastCGIConfiguration]])&lt;br /&gt;
&lt;br /&gt;
=== Can&#039;t locate Apache/DBI.pm in ... ===&lt;br /&gt;
&lt;br /&gt;
At this point you can either delete &amp;quot;[[PerlModule]] Apache::DBI&amp;quot; from apache config, or figure out how to install it -- [[SuSE]], for example, provides it as a package to match their Apache2 package.&lt;br /&gt;
&lt;br /&gt;
 This feature is *optional*. Read ApacheConfig for more info about &amp;quot;mod_perl and caching connections to the DB&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Prev: [[ManualInstallation]] --- Up: [[UserManual]] --- Next: [[ManualEmailConfig]]&lt;br /&gt;
[[Category:RT User Manual]]&lt;/div&gt;</summary>
		<author><name>Craigkai</name></author>
	</entry>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=ManualApacheConfig&amp;diff=26843</id>
		<title>ManualApacheConfig</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=ManualApacheConfig&amp;diff=26843"/>
		<updated>2019-03-21T16:34:10Z</updated>

		<summary type="html">&lt;p&gt;Craigkai: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Prev: [[ManualInstallation]] --- Up: [[UserManual]] --- Next: [[ManualEmailConfig]]&lt;br /&gt;
&lt;br /&gt;
{{OutdatedInstallGuide}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE: The information on this page is outdated.  It is superseded by the documentation in docs/web_deployment.pod in the base RT tarball.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Apache + mod_perl2 guide updated for RT4&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
= SETTING UP THE WEB INTERFACE =&lt;br /&gt;
&lt;br /&gt;
== Choosing a web handler ==&lt;br /&gt;
&lt;br /&gt;
A note of caution: Do not use symbolic links in the Apache conf directory structures.&lt;br /&gt;
&lt;br /&gt;
RT&#039;s web interface is written using HTML::Mason, which works with the mod_perl embedded perl interpreter within Apache httpd. Alternatively, support for the [[FastCGI]] interface is also provided as &#039;bin/mason_handler.fcgi&#039;. Setting up either of these can be fairly intricate; don&#039;t get discouraged if it takes you some time to get this right -- though it&#039;s not nearly as difficult as it used to be.&lt;br /&gt;
&lt;br /&gt;
=== FastCGI vs. mod_perl ===&lt;br /&gt;
&lt;br /&gt;
Both work fine. Each have some strong and weak points.&lt;br /&gt;
&lt;br /&gt;
You cannot run multiple instances of RT under one server with mod_perl, even in multiple vhosts; since mod_perl embeds a perl process in apache, but only one, whichever configuration is loaded last will clobber all other ones. If you need to run more than once instance of RT on the same server, you will need to run them with fastcgi.&lt;br /&gt;
&lt;br /&gt;
If you have something already installed then use it. Otherwise here are a few notes to help choose:&lt;br /&gt;
&lt;br /&gt;
* apache 1.x is for those who are already using it and don&#039;t want to upgrade&lt;br /&gt;
* use whatever version of apache is installed on your system&lt;br /&gt;
* have no experience with [[FastCGI]] or mod_perl then just throw a coin to choose between -- or pick whichever one is provided as a package by your distribution&lt;br /&gt;
* a few warnings about mod_perl:&lt;br /&gt;
** If your system has only mod_perl 1.9x (development version before mod_perl 2 release) and you don&#039;t know how to or don&#039;t want to build mod_perl from scratch then just ignore it and &#039;&#039;&#039;DON&#039;T TRY TO USE&#039;&#039;&#039; RT with mod_perl 1.9x, jump to [[FastCGI]] (this is unlikely to be the case on new installs, as mod_perl 2 has been out for some number of years now).&lt;br /&gt;
** If you have apache 2.x then you need mod_perl 2.x as well. mod_perl 1.x just won&#039;t work with apache 2.x&lt;br /&gt;
** If you have apache 1.x then you need mod_perl 1.xx where xx is not 9x&lt;br /&gt;
&lt;br /&gt;
The [[PerformanceTuning]] page has some info about the [[FastCGI]] vs. mod_perl. Read the Myths section.&lt;br /&gt;
&lt;br /&gt;
=== Other options ===&lt;br /&gt;
&lt;br /&gt;
Other options as well exist, like speedycgi, [[FastCGI]]+nginx, [[FastCGI]]+lighttpd... But Apache+[[FastCGI]] and Apache+mod_perl these are two major variants perl developers pay attention to as they are most common. If it&#039;s your first install then make your life easier and choose a common solution. Later you may find time to experiment with others.&lt;br /&gt;
&lt;br /&gt;
=== Checking dependencies ===&lt;br /&gt;
&lt;br /&gt;
Once you&#039;ve made your choice then test dependencies again to make sure everything is there for web environment of choice:&lt;br /&gt;
&lt;br /&gt;
: &amp;amp;#35; without arguments to get list of options&lt;br /&gt;
: make testdeps&lt;br /&gt;
&lt;br /&gt;
You can choose web handler during ./configure step using its option. Check ./configure --help&lt;br /&gt;
&lt;br /&gt;
== Choosing web layout ==&lt;br /&gt;
&lt;br /&gt;
Before you start your install, you have to decide which URL will be the base for your RT instance. Will it be [[ManualInstallation|http://rt.example.com/]] or do you prefer [[ManualInstallation|http://www.example.com/rt/]] ? RT can&#039;t get this info from apache config or preconfigure your server for any possible setup, so it&#039;s your task to decide and configure both ends.&lt;br /&gt;
&lt;br /&gt;
If you decide to use rt.example.com, and you&#039;re sharing the webserver with other domains using [[VirtualHosts]], then you&#039;ll have additional configuration to perform.&lt;br /&gt;
&lt;br /&gt;
== SiteConfig ==&lt;br /&gt;
&lt;br /&gt;
RT config has several options to define web server [[URLs]] layout [[WebBaseURL]], [[WebPath]] and [[WebURL]]. The first two are the most important things you must configure:&lt;br /&gt;
&lt;br /&gt;
* [[WebBaseURL]] - it&#039;s the base URL for the server that serves RT web interface, it should contain scheme (http or https), server name and port (if it&#039;s not standard value 80), for example [[ManualInstallation|http://rt.example.com]], [[ManualInstallation|https://rt.example.com]] and [[ManualInstallation|http://www.example.com]] are valid and sane values. Note that there is &#039;&#039;&#039;no trailing slash&#039;&#039;&#039; and &#039;&#039;&#039;it&#039;s root URL of the server&#039;&#039;&#039;.&lt;br /&gt;
* [[WebPath]] - it&#039;s URL path relative to the root of the server (WebBaseURL option) that has leading slash and no trailing slash, for example &amp;lt;code&amp;gt;/rt&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;/helpdesk&amp;lt;/code&amp;gt; or empty value.&lt;br /&gt;
&lt;br /&gt;
We discussed these in the [[ManualInstallation]] section, previously, but here are some examples to recap:&lt;br /&gt;
&lt;br /&gt;
* You want [[ManualInstallation|http://rt.example.com/]] as RT main page then WebBaseURL should be [[ManualInstallation|http://rt.example.com]] and WebPath should be empty.&lt;br /&gt;
* You want [[ManualInstallation|http://www.example.com/helpdesk/]] as RT main page then WebBaseURL should be [[ManualInstallation|http://www.example.com]] and WebPath should be &amp;lt;code&amp;gt;/helpdesk&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
That&#039;s all: once you&#039;ve chosen layout and configured RT&#039;s config you can configure apache server.&lt;br /&gt;
&lt;br /&gt;
== Configuring Apache ==&lt;br /&gt;
&lt;br /&gt;
You&#039;ve made several choices above and now you&#039;re ready to configure your server. Usually configuration files are in /etc/apache* or /etc/httpd&lt;br /&gt;
&lt;br /&gt;
You&#039;ll need to add a few lines to your httpd.conf telling it to use RT&#039;s web interface and how to handle it. Search below for a variant matching your choices. If you can not find it here then search on other pages and move here example or ask on [[MailingLists]], but don&#039;t forget mention that you came from this page and it has no example for your case, so people can update it.&lt;br /&gt;
&lt;br /&gt;
Note: RT will not load without a valid virtual host name&lt;br /&gt;
&lt;br /&gt;
=== apache2 + mod_perl2 and RT4 on [[ManualInstallation|http://rt.example.com/]] ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;pre&amp;gt;&lt;br /&gt;
            &amp;amp;lt;VirtualHost rt.example.com&amp;amp;gt;&lt;br /&gt;
                # Optional apache logs for RT&lt;br /&gt;
                # ErrorLog /opt/rt4/var/log/apache2.error&lt;br /&gt;
                # TransferLog /opt/rt4/var/log/apache2.access&lt;br /&gt;
                # LogLevel debug&lt;br /&gt;
        &lt;br /&gt;
                AddDefaultCharset UTF-8&lt;br /&gt;
                DocumentRoot &amp;quot;/opt/rt4/share/html&amp;quot;&lt;br /&gt;
        &lt;br /&gt;
                &amp;amp;lt;Location /&amp;amp;gt;&lt;br /&gt;
                    Order allow,deny&lt;br /&gt;
                    Allow from all&lt;br /&gt;
        &lt;br /&gt;
                    SetHandler modperl&lt;br /&gt;
                    PerlResponseHandler Plack::Handler::Apache2&lt;br /&gt;
                    PerlSetVar psgi_app /opt/rt4/sbin/rt-server&lt;br /&gt;
                &amp;amp;lt;/Location&amp;amp;gt;&lt;br /&gt;
                &amp;amp;lt;Perl&amp;amp;gt;&lt;br /&gt;
                    use Plack::Handler::Apache2;&lt;br /&gt;
                    Plack::Handler::Apache2-&amp;gt;preload(&amp;quot;/opt/rt4/sbin/rt-server&amp;quot;);&lt;br /&gt;
                &amp;amp;lt;/Perl&amp;amp;gt;&lt;br /&gt;
            &amp;amp;lt;/VirtualHost&amp;amp;gt;&lt;br /&gt;
        &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== apache2 + mod_perl2 and RT on [[ManualInstallation|http://rt.example.com/]] ===&lt;br /&gt;
Note: This only works for RT4&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;pre&amp;gt;# ip based virtual host&lt;br /&gt;
         Listen ip_of_the_rt.example.com:80&lt;br /&gt;
         &amp;amp;lt;VirtualHost ip_of_the_rt.example.com:80&amp;amp;gt;&lt;br /&gt;
            ServerName rt.example.com&lt;br /&gt;
            ServerAdmin Email.Address@example.com&lt;br /&gt;
         &lt;br /&gt;
         &lt;br /&gt;
            DocumentRoot /opt/rt4/share/html&lt;br /&gt;
         &lt;br /&gt;
            AddDefaultCharset UTF-8&lt;br /&gt;
            PerlRequire /opt/rt4/bin/webmux.pl&lt;br /&gt;
         &lt;br /&gt;
         &lt;br /&gt;
            &amp;amp;lt;Directory /opt/rt4/share/html&amp;amp;gt;&lt;br /&gt;
                Order allow,deny&lt;br /&gt;
                Allow from all&lt;br /&gt;
         &lt;br /&gt;
                SetHandler perl-script&lt;br /&gt;
                PerlResponseHandler RT::Mason&lt;br /&gt;
            &amp;amp;lt;/Directory&amp;amp;gt;&lt;br /&gt;
         &amp;amp;lt;/VirtualHost&amp;amp;gt;&lt;br /&gt;
         &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== apache2 + mod_perl2 and RT on [[ManualInstallation|http://www.example.com/rt/]] ===&lt;br /&gt;
&lt;br /&gt;
 Listen ip_of_the_www.example.com:80&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 &amp;amp;lt;VirtualHost ip_of_the_www.example.com:80&amp;amp;gt;&lt;br /&gt;
    ServerName www.example.com&lt;br /&gt;
    ServerAdmin Email.Address@example.com&lt;br /&gt;
 &lt;br /&gt;
    # config for your main content&lt;br /&gt;
    DocumentRoot /www/www.example.com&lt;br /&gt;
    &amp;amp;lt;Directory /www/www.example.com&amp;amp;gt;&lt;br /&gt;
        # here and in other places goes config&lt;br /&gt;
        # of your main host&lt;br /&gt;
    &amp;amp;lt;/Directory&amp;amp;gt;&lt;br /&gt;
 &lt;br /&gt;
    # as RT is out of document root then we want alias&lt;br /&gt;
    # and should define directory access&lt;br /&gt;
    Alias /rt/ /opt/rt4/share/html/&lt;br /&gt;
    &amp;amp;lt;Directory /opt/rt4/share/html/&amp;amp;gt;&lt;br /&gt;
        Order allow,deny&lt;br /&gt;
        Allow from all&lt;br /&gt;
    &amp;amp;lt;/Directory&amp;amp;gt;&lt;br /&gt;
 &lt;br /&gt;
    PerlRequire /opt/rt4/bin/webmux.pl&lt;br /&gt;
    &amp;amp;lt;Location /rt/&amp;amp;gt;&lt;br /&gt;
        AddDefaultCharset UTF-8&lt;br /&gt;
        SetHandler perl-script&lt;br /&gt;
        PerlHandler RT::Mason&lt;br /&gt;
    &amp;amp;lt;/Location&amp;amp;gt;&lt;br /&gt;
 &amp;amp;lt;/VirtualHost&amp;amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Some historical notes people left, some make sense, some are wrong, for refactoring ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039; If you are running Apache 2, the recommended configuration directive is:&lt;br /&gt;
&lt;br /&gt;
 RedirectMatch permanent (.*)/$ [[ManualInstallation|http://example.com$1/index.html]]&lt;br /&gt;
&lt;br /&gt;
in your [[VirtualHost]] section&lt;br /&gt;
&lt;br /&gt;
This line will take all requests of form &amp;quot;[http://example.com/foo/ http://example.com/foo/&amp;quot;] into &amp;quot;[http://example.com/foo/index.html http://example.com/foo/index.html&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039; If &amp;quot;your.ip.address&amp;quot; above is the same as your webserver&#039;s IP and you&#039;re not planning to assign a unique IP address or alias (CNAME) for RT, you should realize that the above [[VirtualHost]] configuration works when RT is the only content provided at the root of the webserver. If your webserver has existing content or you plan to add content later, you&#039;ll probably want to place RT in a directory other than the root of the webserver. If you choose to use &amp;quot;[http://fsck.com/rt/ http://fsck.com/rt/&amp;quot;], you&#039;ll want to modify the [[VirtualHost]] configuration as follows:&lt;br /&gt;
&lt;br /&gt;
Comment with &#039;#&#039; or remove the following line:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 DocumentRoot /opt/rt4/share/html&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
and add in its place:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 Alias /rt &amp;quot;/opt/rt4/share/html&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Lastly, change the Location path from:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 &amp;amp;lt;Location /&amp;amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
to&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 &amp;amp;lt;Location /rt&amp;amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
That gives a configuration similar to&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 Alias /rt &amp;quot;/opt/rt4/share/html&amp;quot;&lt;br /&gt;
 PerlModule Apache::DBI&lt;br /&gt;
 PerlRequire /opt/rt4/bin/webmux.pl&lt;br /&gt;
 &amp;amp;lt;Directory /opt/rt4/share/html&amp;amp;gt;&lt;br /&gt;
   AllowOverride All&lt;br /&gt;
   Options ExecCGI FollowSymLinks&lt;br /&gt;
   &amp;amp;lt;IfModule mod_access.c&amp;amp;gt;&lt;br /&gt;
         Order allow,deny&lt;br /&gt;
       Allow from all&lt;br /&gt;
   &amp;amp;lt;/IfModule&amp;amp;gt;&lt;br /&gt;
 &amp;amp;lt;/Directory&amp;amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;amp;lt;Location /rt&amp;amp;gt;&lt;br /&gt;
   RewriteEngine On&lt;br /&gt;
   RedirectMatch permanent (.*)/$ $1/index.html&lt;br /&gt;
   AddDefaultCharset UTF-8&lt;br /&gt;
   SetHandler perl-script&lt;br /&gt;
   PerlHandler RT::Mason&lt;br /&gt;
 &amp;amp;lt;/Location&amp;amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
You will also need to modify the $[[WebPath]] variable in etc/[[RT SiteConfig|RT_SiteConfig]].pm in your RT installation directory. For the above example you would use:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 $WebPath = &amp;quot;/rt&amp;quot;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Remember that $[[WebPath]] requires a leading / but no trailing /. $[[WebPath]], your Apache alias, and your Apache Location should all contain the same string.&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
Next, stop Apache. This will vary by system but might look something like this:&lt;br /&gt;
&lt;br /&gt;
 cd /etc/init.d&lt;br /&gt;
 ./httpd stop&lt;br /&gt;
&lt;br /&gt;
or, if your distro includes it:&lt;br /&gt;
&lt;br /&gt;
 apachectl stop&lt;br /&gt;
&lt;br /&gt;
Try to use a browser to go to your RT server&#039;s website. You shouldn&#039;t be able to do it. Restart Apache:&lt;br /&gt;
&lt;br /&gt;
 ./httpd start&lt;br /&gt;
&lt;br /&gt;
Now, you should be able to go to your RT URL and get the login screen.&lt;br /&gt;
&lt;br /&gt;
Once this works, you may move on to setting up your email gateway.&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Read the entry in the [[FAQ]] about [[MaxRequestsPerChild]].&lt;br /&gt;
&lt;br /&gt;
=== client denied by server configuration ===&lt;br /&gt;
&lt;br /&gt;
If you receive a &amp;quot;client denied by server configuration: /opt/rt4/share/html&amp;quot; in your Apache error.log or a &amp;quot;403 Forbidden&amp;quot; error then also add the following to your [[VirtualHost]] section:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 &amp;amp;lt;Directory &amp;quot;/opt/rt4/share/html&amp;quot;&amp;amp;gt;&lt;br /&gt;
     Order allow,deny&lt;br /&gt;
     Allow from all&lt;br /&gt;
 &amp;amp;lt;/Directory&amp;amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
(the above hint for 403/denied was found on [[ManualInstallation|http://wiki.bestpractical.com/view/FastCGIConfiguration]])&lt;br /&gt;
&lt;br /&gt;
=== Can&#039;t locate Apache/DBI.pm in ... ===&lt;br /&gt;
&lt;br /&gt;
At this point you can either delete &amp;quot;[[PerlModule]] Apache::DBI&amp;quot; from apache config, or figure out how to install it -- [[SuSE]], for example, provides it as a package to match their Apache2 package.&lt;br /&gt;
&lt;br /&gt;
 This feature is *optional*. Read ApacheConfig for more info about &amp;quot;mod_perl and caching connections to the DB&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Prev: [[ManualInstallation]] --- Up: [[UserManual]] --- Next: [[ManualEmailConfig]]&lt;br /&gt;
[[Category:RT User Manual]]&lt;/div&gt;</summary>
		<author><name>Craigkai</name></author>
	</entry>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=ManualScrips&amp;diff=26832</id>
		<title>ManualScrips</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=ManualScrips&amp;diff=26832"/>
		<updated>2019-03-21T12:51:04Z</updated>

		<summary type="html">&lt;p&gt;Craigkai: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Prev: [[ManualRights]] --- Up: [[UserManual]] --- Next: [[ManualApprovals]]&lt;br /&gt;
&lt;br /&gt;
= Appendix 3 =&lt;br /&gt;
&lt;br /&gt;
== Scrips ==&lt;br /&gt;
&lt;br /&gt;
Official docs can be found here: https://docs.bestpractical.com/rt/latest/customizing/scrip_conditions_and_action.html&lt;br /&gt;
&lt;br /&gt;
A scrip performs some action when some conditions are met. Many actions use a template. You can read a scrip as a sentence like: When &amp;amp;lt;condition&amp;amp;gt;, do &amp;amp;lt;action&amp;amp;gt; with &amp;amp;lt;template&amp;amp;gt;. When creating a Scrip, it is helpful to make the &amp;quot;Description&amp;quot; field a user-friendly phrase such as &amp;quot;Send replies to Requestor and Cc users&amp;quot; because users see that description in &#039;&#039;&#039;bold&#039;&#039;&#039; on the ticket update composition page.&lt;br /&gt;
&lt;br /&gt;
=== Table 1: Conditions  ===&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| Condition Name&lt;br /&gt;
| What it means&lt;br /&gt;
| Possible Template&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| User Defined&lt;br /&gt;
| A user-defined condition (should be described below)&lt;br /&gt;
| User-defined templates&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| On Create&lt;br /&gt;
| When a new ticket is created&lt;br /&gt;
| Global template: Autoreply&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| On Transaction&lt;br /&gt;
| When a ticket is updated or changed in any way&lt;br /&gt;
| Global template: Transaction&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| On Reply&lt;br /&gt;
| When a watcher replies to a ticket&lt;br /&gt;
| Global template: Reply or Global template: Admin Reply&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| On Comment&lt;br /&gt;
| When a watcher comments on a ticket (privately)&lt;br /&gt;
| Global template: Admin Comment&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| On Correspond&lt;br /&gt;
| When a watcher corresponds to (replies to) a ticket (publicly)&lt;br /&gt;
| Global template: Blank&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| On Status&lt;br /&gt;
| When the ticket&#039;s status changes&lt;br /&gt;
| Global template: Status Changed&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| On Owner Change&lt;br /&gt;
| When the ticket gets a new owner&lt;br /&gt;
| Global template: Transaction&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| On Queue Change&lt;br /&gt;
| When the ticket is put in a different queue&lt;br /&gt;
| Global template: Transaction&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| On Resolve&lt;br /&gt;
| When the ticket is resolved (completed)&lt;br /&gt;
| Global template: Resolved&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note: don&#039;t create a global scrip using the &amp;quot;On Create&amp;quot; condition and the &amp;quot;Create Ticket&amp;quot; scrip action. This will create a loop.&lt;br /&gt;
&lt;br /&gt;
User Defined Condition:&lt;br /&gt;
        $self-&amp;gt;ScripObj               RT::Scrip,&lt;br /&gt;
        $self-&amp;gt;TicketObj              RT::Ticket,&lt;br /&gt;
        $self-&amp;gt;TransactionObj         RT::Transaction,&lt;br /&gt;
=== Table 2: Actions ===&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| Action Name&lt;br /&gt;
| What It Means&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| Auto Reply to Requestors&lt;br /&gt;
| Email an Auto Reply template to the ticket&#039;s requestor&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| Notify Requestors&lt;br /&gt;
| Email the ticket&#039;s requestor&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| Notify Owner As Comment&lt;br /&gt;
| Email the ticket&#039;s owner. &amp;quot;As Comment&amp;quot; means the return address of the email is RT&#039;s comment address and all responses will be posted as comments not visible to the requestor.&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| Notify Owner&lt;br /&gt;
| Email the ticket&#039;s owner.&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| Notify Admin Ccs As Comment&lt;br /&gt;
| Email the ticket&#039;s Admin Ccs. &amp;quot;As Comment&amp;quot; means the return address of the email is RT&#039;s comment address and all responses will be posted as comments not visible to the requestor.&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| Notify Admin Ccs&lt;br /&gt;
| Email the ticket&#039;s Admin Ccs.&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| Notify Requestors And Ccs As Comment&lt;br /&gt;
| Email the ticket&#039;s requestor and Ccs. &amp;quot;As Comment&amp;quot; means the return address of the email is RT&#039;s comment address and all responses will be posted as comments not visible to the requestor.&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| Notify Requestors And Ccs&lt;br /&gt;
| Email the ticket&#039;s requestor and Ccs.&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| Notify All Watchers As Comment&lt;br /&gt;
| Email the ticket&#039;s requestor, owner, Ccs, and Admin Ccs. &amp;quot;As Comment&amp;quot; means the return address of the email is RT&#039;s comment address and all responses will be posted as comments not visible to the requestor.&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| Notify All Watchers&lt;br /&gt;
| Email the ticket&#039;s requestor, owner, Ccs, and Admin Ccs.&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| Notify Other Recipients As Comment&lt;br /&gt;
| Email the addresses in the Cc: and Bcc: fields of a ticket&#039;s reply or comment. &amp;quot;As Comment&amp;quot; means the return address of the email is RT&#039;s comment address and all responses will be posted as comments not visible to the requestor.&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| Notify Other Recipients&lt;br /&gt;
| Email the addresses in the Cc: and Bcc: fields of a ticket&#039;s reply or comment&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| Open Tickets&lt;br /&gt;
| Automatically opens a stalled, resolved, or rejected ticket when anyone replies to it; automatically opens new tickets when anyone except the requestor replies to it. Does not apply to tickets that are already open.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Custom Action Commit/Preparation Code:&lt;br /&gt;
        $self-&amp;gt;ScripActionObj   RT::ScripAction,&lt;br /&gt;
        $self-&amp;gt;ScripObj         RT::Scrip,&lt;br /&gt;
        $self-&amp;gt;TemplateObj      RT::Template,&lt;br /&gt;
        $self-&amp;gt;TicketObj        RT::Ticket,&lt;br /&gt;
        $self-&amp;gt;TransactionObj   RT::Transaction,&lt;br /&gt;
Prev: [[ManualRights]] --- Up: [[UserManual]] --- Next: [[ManualApache]]&lt;br /&gt;
[[Category:RT User Manual]]&lt;/div&gt;</summary>
		<author><name>Craigkai</name></author>
	</entry>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=ManualScrips&amp;diff=26831</id>
		<title>ManualScrips</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=ManualScrips&amp;diff=26831"/>
		<updated>2019-03-21T12:50:14Z</updated>

		<summary type="html">&lt;p&gt;Craigkai: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Prev: [[ManualRights]] --- Up: [[UserManual]] --- Next: [[ManualApprovals]]&lt;br /&gt;
&lt;br /&gt;
= Appendix 3 =&lt;br /&gt;
&lt;br /&gt;
== Scrips ==&lt;br /&gt;
&lt;br /&gt;
Official docs can be found here: https://docs.bestpractical.com/rt/4.4.4/customizing/scrip_conditions_and_action.html&lt;br /&gt;
&lt;br /&gt;
A scrip performs some action when some conditions are met. Many actions use a template. You can read a scrip as a sentence like: When &amp;amp;lt;condition&amp;amp;gt;, do &amp;amp;lt;action&amp;amp;gt; with &amp;amp;lt;template&amp;amp;gt;. When creating a Scrip, it is helpful to make the &amp;quot;Description&amp;quot; field a user-friendly phrase such as &amp;quot;Send replies to Requestor and Cc users&amp;quot; because users see that description in &#039;&#039;&#039;bold&#039;&#039;&#039; on the ticket update composition page.&lt;br /&gt;
&lt;br /&gt;
=== Table 1: Conditions  ===&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| Condition Name&lt;br /&gt;
| What it means&lt;br /&gt;
| Possible Template&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| User Defined&lt;br /&gt;
| A user-defined condition (should be described below)&lt;br /&gt;
| User-defined templates&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| On Create&lt;br /&gt;
| When a new ticket is created&lt;br /&gt;
| Global template: Autoreply&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| On Transaction&lt;br /&gt;
| When a ticket is updated or changed in any way&lt;br /&gt;
| Global template: Transaction&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| On Reply&lt;br /&gt;
| When a watcher replies to a ticket&lt;br /&gt;
| Global template: Reply or Global template: Admin Reply&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| On Comment&lt;br /&gt;
| When a watcher comments on a ticket (privately)&lt;br /&gt;
| Global template: Admin Comment&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| On Correspond&lt;br /&gt;
| When a watcher corresponds to (replies to) a ticket (publicly)&lt;br /&gt;
| Global template: Blank&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| On Status&lt;br /&gt;
| When the ticket&#039;s status changes&lt;br /&gt;
| Global template: Status Changed&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| On Owner Change&lt;br /&gt;
| When the ticket gets a new owner&lt;br /&gt;
| Global template: Transaction&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| On Queue Change&lt;br /&gt;
| When the ticket is put in a different queue&lt;br /&gt;
| Global template: Transaction&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| On Resolve&lt;br /&gt;
| When the ticket is resolved (completed)&lt;br /&gt;
| Global template: Resolved&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note: don&#039;t create a global scrip using the &amp;quot;On Create&amp;quot; condition and the &amp;quot;Create Ticket&amp;quot; scrip action. This will create a loop.&lt;br /&gt;
&lt;br /&gt;
User Defined Condition:&lt;br /&gt;
        $self-&amp;gt;ScripObj               RT::Scrip,&lt;br /&gt;
        $self-&amp;gt;TicketObj              RT::Ticket,&lt;br /&gt;
        $self-&amp;gt;TransactionObj         RT::Transaction,&lt;br /&gt;
=== Table 2: Actions ===&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| Action Name&lt;br /&gt;
| What It Means&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| Auto Reply to Requestors&lt;br /&gt;
| Email an Auto Reply template to the ticket&#039;s requestor&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| Notify Requestors&lt;br /&gt;
| Email the ticket&#039;s requestor&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| Notify Owner As Comment&lt;br /&gt;
| Email the ticket&#039;s owner. &amp;quot;As Comment&amp;quot; means the return address of the email is RT&#039;s comment address and all responses will be posted as comments not visible to the requestor.&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| Notify Owner&lt;br /&gt;
| Email the ticket&#039;s owner.&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| Notify Admin Ccs As Comment&lt;br /&gt;
| Email the ticket&#039;s Admin Ccs. &amp;quot;As Comment&amp;quot; means the return address of the email is RT&#039;s comment address and all responses will be posted as comments not visible to the requestor.&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| Notify Admin Ccs&lt;br /&gt;
| Email the ticket&#039;s Admin Ccs.&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| Notify Requestors And Ccs As Comment&lt;br /&gt;
| Email the ticket&#039;s requestor and Ccs. &amp;quot;As Comment&amp;quot; means the return address of the email is RT&#039;s comment address and all responses will be posted as comments not visible to the requestor.&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| Notify Requestors And Ccs&lt;br /&gt;
| Email the ticket&#039;s requestor and Ccs.&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| Notify All Watchers As Comment&lt;br /&gt;
| Email the ticket&#039;s requestor, owner, Ccs, and Admin Ccs. &amp;quot;As Comment&amp;quot; means the return address of the email is RT&#039;s comment address and all responses will be posted as comments not visible to the requestor.&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| Notify All Watchers&lt;br /&gt;
| Email the ticket&#039;s requestor, owner, Ccs, and Admin Ccs.&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| Notify Other Recipients As Comment&lt;br /&gt;
| Email the addresses in the Cc: and Bcc: fields of a ticket&#039;s reply or comment. &amp;quot;As Comment&amp;quot; means the return address of the email is RT&#039;s comment address and all responses will be posted as comments not visible to the requestor.&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| Notify Other Recipients&lt;br /&gt;
| Email the addresses in the Cc: and Bcc: fields of a ticket&#039;s reply or comment&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| Open Tickets&lt;br /&gt;
| Automatically opens a stalled, resolved, or rejected ticket when anyone replies to it; automatically opens new tickets when anyone except the requestor replies to it. Does not apply to tickets that are already open.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Custom Action Commit/Preparation Code:&lt;br /&gt;
        $self-&amp;gt;ScripActionObj   RT::ScripAction,&lt;br /&gt;
        $self-&amp;gt;ScripObj         RT::Scrip,&lt;br /&gt;
        $self-&amp;gt;TemplateObj      RT::Template,&lt;br /&gt;
        $self-&amp;gt;TicketObj        RT::Ticket,&lt;br /&gt;
        $self-&amp;gt;TransactionObj   RT::Transaction,&lt;br /&gt;
Prev: [[ManualRights]] --- Up: [[UserManual]] --- Next: [[ManualApache]]&lt;br /&gt;
[[Category:RT User Manual]]&lt;/div&gt;</summary>
		<author><name>Craigkai</name></author>
	</entry>
</feed>