{"id":281,"date":"2012-03-16T17:17:43","date_gmt":"2012-03-16T22:17:43","guid":{"rendered":"http:\/\/www.soljerome.com\/blog\/?p=281"},"modified":"2012-03-16T17:17:43","modified_gmt":"2012-03-16T22:17:43","slug":"installing-request-tracker-on-debian-wheezy-with-nginx","status":"publish","type":"post","link":"https:\/\/www.soljerome.com\/blog\/2012\/03\/16\/installing-request-tracker-on-debian-wheezy-with-nginx\/","title":{"rendered":"Installing Request Tracker on Debian (wheezy) with nginx"},"content":{"rendered":"<p>The first thing you need to do is install all the required packages. The following is my rt.xml bundle for use with <a href=\"http:\/\/bcfg2.org\">Bcfg2<\/a>. It details the Packages, Services, and Paths that need to be setup for RT to work properly (the fetchmail configuration is not detailed below).<\/p>\n<p><strong>Note:<\/strong> There are some packages explicitly listed below due to the fact that I configure apt not to install recommended packages by default. You may or may not need to install them in order for your request tracker installation to work properly (the libfcgi-perl is required in order to use the rt4-fcgi method).<\/p>\n<pre>\r\n&lt;Bundle name='rt'&gt;\r\n        &lt;Package name=\"mysql-server\"\/&gt;\r\n        &lt;Service name=\"mysql\"\/&gt;\r\n        &lt;!-- rt configuration --&gt;\r\n        &lt;Package name=\"request-tracker4\"\/&gt;\r\n                &lt;Package name=\"libmime-tools-perl\"\/&gt;\r\n                &lt;Package name=\"libmouse-perl\"\/&gt;\r\n                &lt;Package name=\"libterm-readline-perl-perl\"\/&gt;\r\n                &lt;Package name=\"libxml-libxml-perl\"\/&gt;\r\n                &lt;Package name=\"rt4-fcgi\"\/&gt;\r\n                        &lt;Path name=\"\/etc\/default\/rt4-fcgi\"\/&gt;\r\n                        &lt;Package name=\"libfcgi-perl\"\/&gt;\r\n                &lt;Package name=\"rt4-db-mysql\"\/&gt;\r\n                        &lt;Package name=\"mysql-client\"\/&gt;\r\n                &lt;Package name=\"ttf-dejavu-core\"\/&gt;\r\n        &lt;Service name=\"request-tracker4\"\/&gt;\r\n        &lt;Package name=\"nginx-full\"\/&gt;\r\n                &lt;Path name=\"\/etc\/nginx\/sites-available\/rt\"\/&gt;\r\n        &lt;Service name=\"nginx\"\/&gt;\r\n        &lt;Service name=\"rt4-fcgi\"\/&gt;\r\n        &lt;Path name=\"\/etc\/request-tracker4\/RT_SiteConfig.d\/50-debconf\"\/&gt;\r\n        &lt;Path name=\"\/etc\/request-tracker4\/RT_SiteConfig.d\/51-dbconfig-common\"\/&gt;\r\n        &lt;!-- fetchmail configuration --&gt;\r\n        &lt;Package name=\"fetchmail\"\/&gt;\r\n        &lt;Path name=\"\/etc\/default\/fetchmail\"\/&gt;\r\n        &lt;Path name=\"\/etc\/fetchmailrc\"\/&gt;\r\n        &lt;Service name=\"fetchmail\"\/&gt;\r\n&lt;\/Bundle&gt;\r\n<\/pre>\n<p>You will want to install the mysql-server package first and setup the RT database.<\/p>\n<pre>\r\nroot@rt:~# mysql -u root -p\r\nEnter password: \r\nWelcome to the MySQL monitor.  Commands end with ; or \\g.\r\nYour MySQL connection id is 43\r\nServer version: 5.1.61-2 (Debian)\r\n\r\nCopyright (c) 2000, 2011, Oracle and\/or its affiliates. All rights reserved.\r\n\r\nOracle is a registered trademark of Oracle Corporation and\/or its\r\naffiliates. Other names may be trademarks of their respective\r\nowners.\r\n\r\nType 'help;' or '\\h' for help. Type '\\c' to clear the current input statement.\r\n\r\nmysql> create database rtdb;\r\nQuery OK, 1 row affected (0.00 sec)\r\n\r\nmysql> grant all privileges on rtdb.* to 'rt'@'localhost' identified by 'SECRETPASSWORD';\r\nQuery OK, 0 rows affected (0.03 sec)\r\n\r\nmysql> flush privileges;\r\nQuery OK, 0 rows affected (0.00 sec)\r\n<\/pre>\n<p>Next, modify <code>\/etc\/request-tracker4\/RT_SiteConfig.d\/50-debconf<\/code> to suit your custom environment. You also need to reconfigure <code>\/etc\/request-tracker4\/RT_SiteConfig.d\/51-dbconfig-common<\/code> to use mysql with the appropriate values for the database that was created.<\/p>\n<pre>\r\n# THE DATABASE:\r\n# generated by dbconfig-common\r\n\r\n# map from dbconfig-common database types to their names as known by RT\r\nmy %typemap = (\r\n    mysql   => 'mysql',\r\n    pgsql   => 'Pg',\r\n    sqlite3 => 'SQLite',\r\n);\r\n    \r\nSet($DatabaseType, $typemap{mysql} || \"UNKNOWN\");\r\n\r\nSet($DatabaseHost, 'localhost');\r\nSet($DatabasePort, '3306');\r\n\r\nSet($DatabaseUser , 'rt');\r\nSet($DatabasePassword , 'SECRETPASSWORD');\r\n\r\n# SQLite needs a special case, since $DatabaseName must be a full pathname\r\n#my $dbc_dbname = ''; if ( \"\" eq \"sqlite3\" ) { Set ($DatabaseName, '' . '\/' . $dbc_dbname); } else { Set ($DatabaseName, $dbc_dbname); }\r\nSet($DatabaseName, 'rtdb');\r\n<\/pre>\n<p>By default, the RT install uses an sqlite database. The above tells it to use the mysql database that was created in the previous step. Once that is complete, you need to update the SiteConfig by running <code>update-rt-siteconfig<\/code>. Then you can move on to configuring nginx.<\/p>\n<p>The following nginx configuration works for configuring RT with fcgi (probably not optimal, suggestions for improvement are welcome):<\/p>\n<pre>\r\nserver {\r\n        listen                  80;\r\n        server_name             rt.siriad.com;\r\n\r\n        access_log              \/var\/log\/nginx\/rt.siriad.com\/access_log;\r\n        error_log               \/var\/log\/nginx\/rt.siriad.com\/error_log;\r\n        root                    \/usr\/share\/request-tracker4\/html;\r\n        client_max_body_size    20M;\r\n\r\n        location \/NoAuth\/images\/ {\r\n                try_files local\/html$uri\r\n                        share\/html$uri\r\n                        @main\r\n                        ;\r\n                expires 1M;\r\n        }\r\n        location \/ {\r\n                fastcgi_pass    unix:\/var\/run\/rt4-fcgi.sock;\r\n                include         \/etc\/nginx\/fastcgi_params;\r\n                fastcgi_param   SCRIPT_NAME     \"\";\r\n                fastcgi_param   PATH_INFO       $uri;\r\n        }\r\n        location @main {\r\n                fastcgi_pass    unix:\/var\/run\/rt4-fcgi.sock;\r\n                include         \/etc\/nginx\/fastcgi_params;\r\n                fastcgi_param   SCRIPT_NAME     \"\";\r\n                fastcgi_param   PATH_INFO       $uri;\r\n        }\r\n}\r\n<\/pre>\n<p>The above nginx configuration expects the following in <code>\/etc\/default\/rt4-fcgi<\/code> (to enable the rt4-fcgi init script).<\/p>\n<pre>\r\n# Defaults for request-tracker4 initscript\r\n# sourced by \/etc\/init.d\/rt4-fcgi\r\n\r\n#\r\n# This is a POSIX shell fragment\r\n#\r\n\r\nenabled=1\r\n\r\n# number of RT workers:\r\nworkers=2\r\n<\/pre>\n<p>You should now be able to start the rt4-fcgi init script and nginx and login with the default RT username and password.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The first thing you need to do is install all the required packages. The following is my rt.xml bundle for use with Bcfg2. It details the Packages, Services, and Paths that need to be setup for RT to work properly (the fetchmail configuration is not detailed below). Note: There are some packages explicitly listed below <a href='https:\/\/www.soljerome.com\/blog\/2012\/03\/16\/installing-request-tracker-on-debian-wheezy-with-nginx\/' class='excerpt-more'>[&#8230;]<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[18,3,14],"tags":[],"_links":{"self":[{"href":"https:\/\/www.soljerome.com\/blog\/wp-json\/wp\/v2\/posts\/281"}],"collection":[{"href":"https:\/\/www.soljerome.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.soljerome.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.soljerome.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.soljerome.com\/blog\/wp-json\/wp\/v2\/comments?post=281"}],"version-history":[{"count":15,"href":"https:\/\/www.soljerome.com\/blog\/wp-json\/wp\/v2\/posts\/281\/revisions"}],"predecessor-version":[{"id":296,"href":"https:\/\/www.soljerome.com\/blog\/wp-json\/wp\/v2\/posts\/281\/revisions\/296"}],"wp:attachment":[{"href":"https:\/\/www.soljerome.com\/blog\/wp-json\/wp\/v2\/media?parent=281"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.soljerome.com\/blog\/wp-json\/wp\/v2\/categories?post=281"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.soljerome.com\/blog\/wp-json\/wp\/v2\/tags?post=281"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}