<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://rt-wiki.bestpractical.com/index.php?action=history&amp;feed=atom&amp;title=Debug</id>
	<title>Debug - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://rt-wiki.bestpractical.com/index.php?action=history&amp;feed=atom&amp;title=Debug"/>
	<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=Debug&amp;action=history"/>
	<updated>2026-08-24T01:55:17Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.41.1</generator>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=Debug&amp;diff=896&amp;oldid=prev</id>
		<title>Admin: 2 revisions imported</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=Debug&amp;diff=896&amp;oldid=prev"/>
		<updated>2016-04-06T20:08:48Z</updated>

		<summary type="html">&lt;p&gt;2 revisions imported&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== Logs ==&lt;br /&gt;
&lt;br /&gt;
See [[LogsConfig]].&lt;br /&gt;
&lt;br /&gt;
== Apache ==&lt;br /&gt;
&lt;br /&gt;
See also [[ApacheConfig]]&lt;br /&gt;
&lt;br /&gt;
=== one process mode ===&lt;br /&gt;
&lt;br /&gt;
This is useful only for debug, this start only one apache process and prevent concurent requests.&lt;br /&gt;
&lt;br /&gt;
 /usr/local/apache/bin/httpd -X&lt;br /&gt;
&lt;br /&gt;
=== Perl debugger with Apache/Mod_perl ===&lt;br /&gt;
&lt;br /&gt;
Install the module Apache::DB.&lt;br /&gt;
&lt;br /&gt;
Put this in your apache config file:&lt;br /&gt;
&lt;br /&gt;
 &amp;amp;lt;IfDefine PERLDB&amp;amp;gt;&lt;br /&gt;
   &amp;amp;lt;Perl&amp;amp;gt;&lt;br /&gt;
     use Apache::DB ();&lt;br /&gt;
     Apache::DB-&amp;amp;gt;init();&lt;br /&gt;
   &amp;amp;lt;/Perl&amp;amp;gt;&lt;br /&gt;
   &amp;amp;lt;Location /rt&amp;amp;gt;&lt;br /&gt;
     PerlFixupHandler Apache::DB&lt;br /&gt;
   &amp;amp;lt;/Location&amp;amp;gt;&lt;br /&gt;
 &amp;amp;lt;/IfDefine&amp;amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
You may need to change the location to your own installation. Then stop the main apache server and start apache like this:&lt;br /&gt;
&lt;br /&gt;
 /usr/local/apache/bin/httpd -X -DPERLDB&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
Now, any http request you make to RT will drop you in the debugger first.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;nowiki&amp;gt;[http://search.cpan.org/dist/DBI DBI::ProfileDumper::Apache]&amp;lt;/nowiki&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
Maybe not everyone knows this but if you use mod_perl and RT(2/3) then you can use this in httpd.conf:&lt;br /&gt;
&lt;br /&gt;
 PerlSetEnv DBI_PROFILE DBI::ProfileDumper::Apache&lt;br /&gt;
&lt;br /&gt;
At each stop/start of Apache you&amp;#039;ll get profiling data in your logs directory which you can analyse with &amp;lt;code&amp;gt;dbiprof&amp;lt;/code&amp;gt;. If a mod_perl/apache process terminaties due to max accesses reached it will also dump its profile data.&lt;br /&gt;
&lt;br /&gt;
For more information see dbiprof -h.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;NOTE:&amp;#039;&amp;#039;&amp;#039; Apache doesn&amp;#039;t need to be in one process mode.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;nowiki&amp;gt;[http://search.cpan.org/dist/Apache-DB Apache::DProf, Apache::SmallProf]&amp;lt;/nowiki&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
This is useful when you&amp;#039;re going to profile perl code.&lt;br /&gt;
&lt;br /&gt;
* DProf dump profile per sub&lt;br /&gt;
* SmallProf dump profile per line&lt;br /&gt;
&lt;br /&gt;
In httpd.conf&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;amp;lt;Perl&amp;amp;gt;&lt;br /&gt;
        use Apache::DB ();&lt;br /&gt;
        Apache::DB-&amp;amp;gt;init;&lt;br /&gt;
 &amp;amp;lt;/Perl&amp;amp;gt;&lt;br /&gt;
 # comment this line if you want SmallProf&lt;br /&gt;
 PerlModule Apache::DProf&lt;br /&gt;
 ...&lt;br /&gt;
 # previous block should be before other perl modules&lt;br /&gt;
 PerlRequire ...webmux.pl&lt;br /&gt;
 ...&lt;br /&gt;
 &amp;amp;lt;Location ...&amp;amp;gt;&lt;br /&gt;
        ...&lt;br /&gt;
        PerlHandler RT::Mason&lt;br /&gt;
        # In the same location or diretory block where&lt;br /&gt;
        # RT::Mason configured add fixup handler&lt;br /&gt;
        # if you want profile each line of perl code&lt;br /&gt;
        # uncomment next line&lt;br /&gt;
        # PerlFixupHandler Apache::SmallProf&lt;br /&gt;
 &amp;amp;lt;/Location&amp;amp;gt;&lt;br /&gt;
 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;NOTE:&amp;#039;&amp;#039;&amp;#039; The server must be started with the -X to use Apache::DB&lt;br /&gt;
&lt;br /&gt;
=== Other profilers ===&lt;br /&gt;
&lt;br /&gt;
* [http://search.cpan.org/dist/MasonX-Profiler MasonX-Profiler]&lt;br /&gt;
&lt;br /&gt;
== Email ==&lt;br /&gt;
&lt;br /&gt;
=== get email content ===&lt;br /&gt;
&lt;br /&gt;
You send email to RT and it fails and you think that exactly content in mail break RT. In this case you should get full MIME content of email.&lt;br /&gt;
&lt;br /&gt;
* Mozilla Mail variant&lt;br /&gt;
** Send email that fails&lt;br /&gt;
** Find it in Sent folder&lt;br /&gt;
** Click on it&lt;br /&gt;
** &amp;lt;code&amp;gt;Ctrl-U&amp;lt;/code&amp;gt;&lt;br /&gt;
** Now you should see &amp;quot;Source of:...&amp;quot; page&lt;br /&gt;
** Copy content. It&amp;#039;s exactly what you need.&lt;br /&gt;
&lt;br /&gt;
This content can be used to check if your mailgate works fine:&lt;br /&gt;
&lt;br /&gt;
* open your alias files and copy RT alias&lt;br /&gt;
* run alias as shell command, don&amp;#039;t forget to add &amp;#039;&amp;#039;&amp;#039;debug&amp;#039;&amp;#039;&amp;#039; option.&lt;br /&gt;
&lt;br /&gt;
 cat |/opt/rt3/bin/rt-mailgate --queue ... --url ... --debug&lt;br /&gt;
&lt;br /&gt;
* now mailgate wait for email content on STDIN, paste content.&lt;br /&gt;
* press &amp;lt;code&amp;gt;Ctrl-D&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
</feed>