{"id":2270,"date":"2011-11-07T14:11:00","date_gmt":"2011-11-07T14:11:00","guid":{"rendered":"https:\/\/supportex.net\/?p=2270"},"modified":"2019-05-10T17:34:11","modified_gmt":"2019-05-10T15:34:11","slug":"migrating-otrs-apache-nginx","status":"publish","type":"post","link":"https:\/\/supportex.net\/blog\/2011\/11\/migrating-otrs-apache-nginx\/","title":{"rendered":"Migrating OTRS from Apache to Nginx"},"content":{"rendered":"<p>Installing <a href=\"http:\/\/otrs.org\/\">OTRS<\/a> on Fedora is quite easy considering it has pre-built RPM packages and clean documentation.<br \/>\nUsually OTRS is used with Apache. It&#8217;s stable well-tested solution. But what to do if you have nginx and you don&#8217;t want to have Apache? An issue becomes more complicated considering that nginx doesn&#8217;t support CGI from a box, and OTRS can&#8217;t be deployed as FastCGI application. If you try to use OTRS in FastCGi mode you will get such error messages:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">Wide character in FCGI::Stream::PRINT at \/opt\/otrs\/bin\/fcgi-bin\/..\/..\/Kernel\/Output\/HTML\/Layout.pm line 1663.\nWide character in FCGI::Stream::PRINT at \/opt\/otrs\/bin\/fcgi-bin\/..\/..\/Kernel\/Output\/HTML\/Layout.pm line 1663\"<\/pre>\n<p>And it caused by CGI::Fast Perl library newer than 0.67. Anyway, it&#8217;s not a good idea to downgrade it. Fortunately, we can use FastCGI wrapper, so OTRS will be FastCGI application for nginx, but will be launched as CGI.<\/p>\n<p>There are two FastCGI wrappers for using CGI application with nginx. First one can be found on <a href=\"http:\/\/wiki.nginx.org\/SimpleCGI\">nginx wiki page<\/a>. \u00a0Also you can use modified by Denis S. Filimonov version of this wrapper. It&#8217;s written in Pelr and can be found <a href=\"http:\/\/www.ruby-forum.com\/topic\/145858\">here<\/a>. The second wrapper is <a href=\"http:\/\/nginx.localdomain.pl\/wiki\/FcgiWrap\">fcgiwrap<\/a>. It&#8217;s writen in C. I have choosen Perl wrapper since\u00a0 there is no need to compile sources.<\/p>\n<p>Put wrapper to \/usr\/local\/bin\/fastcgi-wrapper.pl and change it to open Unix socket at \/var\/run\/otrs\/perl_cgi-dispatch.sock:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">$socket = FCGI::OpenSocket( \"\/var\/run\/otrs\/perl_cgi-dispatch.sock\", 10 );<\/pre>\n<p>Here is systemd configuration file for fast-cgi wrapper:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">[Unit]\nDescription=otrs-index.pl\n\n[Service]\nExecStart=\/usr\/local\/bin\/fastcgi-wrapper.pl\nType=forking\nUser=otrs\nGroup=nginx\nRestart=always\n\n[Install]\nWantedBy=multi-user.target<\/pre>\n<p>Put it to\u00a0\/lib\/systemd\/system\/perl-fcgi.service. Now we need to enable it:<\/p>\n<p><code class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">systemctl enable perl-fcgi.service<\/code><\/p>\n<p>nginx configuration file:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">server {\nlisten 1.2.3.4:80;\nserver_name otrs.example.com otrs;\nroot \/opt\/otrs\/var\/httpd\/htdocs;\nindex index.html;\n\nlocation \/otrs-web {\ngzip on;\nalias \/opt\/otrs\/var\/httpd\/htdocs;\n}\n\nlocation ~ ^\/otrs\/(.*.pl)(\/.*)?$ {\nfastcgi_pass unix:\/var\/run\/otrs\/perl_cgi-dispatch.sock;\nfastcgi_index index.pl;\nfastcgi_param SCRIPT_FILENAME   \/opt\/otrs\/bin\/fcgi-bin\/$1;\nfastcgi_param QUERY_STRING      $query_string;\nfastcgi_param REQUEST_METHOD    $request_method;\nfastcgi_param CONTENT_TYPE      $content_type;\nfastcgi_param CONTENT_LENGTH    $content_length;\nfastcgi_param GATEWAY_INTERFACE CGI\/1.1;\nfastcgi_param SERVER_SOFTWARE   nginx;\nfastcgi_param SCRIPT_NAME       $fastcgi_script_name;\nfastcgi_param REQUEST_URI       $request_uri;\nfastcgi_param DOCUMENT_URI      $document_uri;\nfastcgi_param DOCUMENT_ROOT     $document_root;\nfastcgi_param SERVER_PROTOCOL   $server_protocol;\nfastcgi_param REMOTE_ADDR       $remote_addr;\nfastcgi_param REMOTE_PORT       $remote_port;\nfastcgi_param SERVER_ADDR       $server_addr;\nfastcgi_param SERVER_PORT       $server_port;\nfastcgi_param SERVER_NAME       $server_name;\n}\n}<\/pre>\n<p>Restating nginx, startting FastCGI wrapper:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">service nginx restart\nservice perl-fcgi start<\/pre>\n<p>Now you can start using your OTRS with nginx.<\/p>\n<h3>Future readings<\/h3>\n<p><a href=\"http:\/\/wiki.otrs.org\/index.php?title=OTRS_in_Nginx_using_FCGI_(multiple_users_possible)\">OTRS in Nginx using FCGI (multiple users possible) <\/a><\/p>\n<p><a href=\"http:\/\/lists.otrs.org\/pipermail\/otrs\/2010-July\/032936.html\">OTRS + Nginx + Fcgi howto<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Installing OTRS on Fedora is quite easy considering it has pre-built RPM packages and clean documentation. Usually OTRS is used with Apache. It&#8217;s stable well-tested solution. But what to do if you have nginx and you don&#8217;t want to have Apache? An issue becomes more complicated considering that nginx doesn&#8217;t support CGI from a box,&hellip; <\/p>\n<div class=\"readmore-wrapper\"><a href=\"https:\/\/supportex.net\/blog\/2011\/11\/migrating-otrs-apache-nginx\/\" class=\"more-link\">Read <\/a><\/div>\n","protected":false},"author":4,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[152],"tags":[249,275,246,248],"class_list":["post-2270","post","type-post","status-publish","format-standard","hentry","category-linux","tag-apache-en","tag-linux","tag-nginx-en","tag-otrs"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Migrating OTRS from Apache to Nginx &#8211; Supportex.NET blog<\/title>\n<meta name=\"description\" content=\"How to move OTRS from Apache to Nginx. Migrate OTRS from Apache to Nginx\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/supportex.net\/blog\/2011\/11\/migrating-otrs-apache-nginx\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Migrating OTRS from Apache to Nginx &#8211; Supportex.NET blog\" \/>\n<meta property=\"og:description\" content=\"How to move OTRS from Apache to Nginx. Migrate OTRS from Apache to Nginx\" \/>\n<meta property=\"og:url\" content=\"https:\/\/supportex.net\/blog\/2011\/11\/migrating-otrs-apache-nginx\/\" \/>\n<meta property=\"og:site_name\" content=\"Supportex.NET blog\" \/>\n<meta property=\"article:published_time\" content=\"2011-11-07T14:11:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-05-10T15:34:11+00:00\" \/>\n<meta name=\"author\" content=\"Oleksii Tykhonov\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Oleksii Tykhonov\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/supportex.net\/blog\/2011\/11\/migrating-otrs-apache-nginx\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/supportex.net\/blog\/2011\/11\/migrating-otrs-apache-nginx\/\"},\"author\":{\"name\":\"Oleksii Tykhonov\",\"@id\":\"https:\/\/supportex.net\/blog\/en\/#\/schema\/person\/0690c26a0266603129fc15eae6243251\"},\"headline\":\"Migrating OTRS from Apache to Nginx\",\"datePublished\":\"2011-11-07T14:11:00+00:00\",\"dateModified\":\"2019-05-10T15:34:11+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/supportex.net\/blog\/2011\/11\/migrating-otrs-apache-nginx\/\"},\"wordCount\":269,\"keywords\":[\"Apache\",\"linux\",\"nginx\",\"otrs\"],\"articleSection\":[\"linux\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/supportex.net\/blog\/2011\/11\/migrating-otrs-apache-nginx\/\",\"url\":\"https:\/\/supportex.net\/blog\/2011\/11\/migrating-otrs-apache-nginx\/\",\"name\":\"Migrating OTRS from Apache to Nginx &#8211; Supportex.NET blog\",\"isPartOf\":{\"@id\":\"https:\/\/supportex.net\/blog\/en\/#website\"},\"datePublished\":\"2011-11-07T14:11:00+00:00\",\"dateModified\":\"2019-05-10T15:34:11+00:00\",\"author\":{\"@id\":\"https:\/\/supportex.net\/blog\/en\/#\/schema\/person\/0690c26a0266603129fc15eae6243251\"},\"description\":\"How to move OTRS from Apache to Nginx. Migrate OTRS from Apache to Nginx\",\"breadcrumb\":{\"@id\":\"https:\/\/supportex.net\/blog\/2011\/11\/migrating-otrs-apache-nginx\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/supportex.net\/blog\/2011\/11\/migrating-otrs-apache-nginx\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/supportex.net\/blog\/2011\/11\/migrating-otrs-apache-nginx\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/supportex.net\/blog\/en\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Migrating OTRS from Apache to Nginx\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/supportex.net\/blog\/en\/#website\",\"url\":\"https:\/\/supportex.net\/blog\/en\/\",\"name\":\"Supportex.NET blog\",\"description\":\"Server and network management company\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/supportex.net\/blog\/en\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/supportex.net\/blog\/en\/#\/schema\/person\/0690c26a0266603129fc15eae6243251\",\"name\":\"Oleksii Tykhonov\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/supportex.net\/blog\/en\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/4fd5f58002717075c88963469b9babef?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/4fd5f58002717075c88963469b9babef?s=96&d=mm&r=g\",\"caption\":\"Oleksii Tykhonov\"},\"url\":\"https:\/\/supportex.net\/blog\/author\/oleksiitykhonov\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Migrating OTRS from Apache to Nginx &#8211; Supportex.NET blog","description":"How to move OTRS from Apache to Nginx. Migrate OTRS from Apache to Nginx","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/supportex.net\/blog\/2011\/11\/migrating-otrs-apache-nginx\/","og_locale":"en_US","og_type":"article","og_title":"Migrating OTRS from Apache to Nginx &#8211; Supportex.NET blog","og_description":"How to move OTRS from Apache to Nginx. Migrate OTRS from Apache to Nginx","og_url":"https:\/\/supportex.net\/blog\/2011\/11\/migrating-otrs-apache-nginx\/","og_site_name":"Supportex.NET blog","article_published_time":"2011-11-07T14:11:00+00:00","article_modified_time":"2019-05-10T15:34:11+00:00","author":"Oleksii Tykhonov","twitter_misc":{"Written by":"Oleksii Tykhonov","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/supportex.net\/blog\/2011\/11\/migrating-otrs-apache-nginx\/#article","isPartOf":{"@id":"https:\/\/supportex.net\/blog\/2011\/11\/migrating-otrs-apache-nginx\/"},"author":{"name":"Oleksii Tykhonov","@id":"https:\/\/supportex.net\/blog\/en\/#\/schema\/person\/0690c26a0266603129fc15eae6243251"},"headline":"Migrating OTRS from Apache to Nginx","datePublished":"2011-11-07T14:11:00+00:00","dateModified":"2019-05-10T15:34:11+00:00","mainEntityOfPage":{"@id":"https:\/\/supportex.net\/blog\/2011\/11\/migrating-otrs-apache-nginx\/"},"wordCount":269,"keywords":["Apache","linux","nginx","otrs"],"articleSection":["linux"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/supportex.net\/blog\/2011\/11\/migrating-otrs-apache-nginx\/","url":"https:\/\/supportex.net\/blog\/2011\/11\/migrating-otrs-apache-nginx\/","name":"Migrating OTRS from Apache to Nginx &#8211; Supportex.NET blog","isPartOf":{"@id":"https:\/\/supportex.net\/blog\/en\/#website"},"datePublished":"2011-11-07T14:11:00+00:00","dateModified":"2019-05-10T15:34:11+00:00","author":{"@id":"https:\/\/supportex.net\/blog\/en\/#\/schema\/person\/0690c26a0266603129fc15eae6243251"},"description":"How to move OTRS from Apache to Nginx. Migrate OTRS from Apache to Nginx","breadcrumb":{"@id":"https:\/\/supportex.net\/blog\/2011\/11\/migrating-otrs-apache-nginx\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/supportex.net\/blog\/2011\/11\/migrating-otrs-apache-nginx\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/supportex.net\/blog\/2011\/11\/migrating-otrs-apache-nginx\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/supportex.net\/blog\/en\/"},{"@type":"ListItem","position":2,"name":"Migrating OTRS from Apache to Nginx"}]},{"@type":"WebSite","@id":"https:\/\/supportex.net\/blog\/en\/#website","url":"https:\/\/supportex.net\/blog\/en\/","name":"Supportex.NET blog","description":"Server and network management company","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/supportex.net\/blog\/en\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/supportex.net\/blog\/en\/#\/schema\/person\/0690c26a0266603129fc15eae6243251","name":"Oleksii Tykhonov","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/supportex.net\/blog\/en\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/4fd5f58002717075c88963469b9babef?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/4fd5f58002717075c88963469b9babef?s=96&d=mm&r=g","caption":"Oleksii Tykhonov"},"url":"https:\/\/supportex.net\/blog\/author\/oleksiitykhonov\/"}]}},"_links":{"self":[{"href":"https:\/\/supportex.net\/blog\/wp-json\/wp\/v2\/posts\/2270","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/supportex.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/supportex.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/supportex.net\/blog\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/supportex.net\/blog\/wp-json\/wp\/v2\/comments?post=2270"}],"version-history":[{"count":4,"href":"https:\/\/supportex.net\/blog\/wp-json\/wp\/v2\/posts\/2270\/revisions"}],"predecessor-version":[{"id":3170,"href":"https:\/\/supportex.net\/blog\/wp-json\/wp\/v2\/posts\/2270\/revisions\/3170"}],"wp:attachment":[{"href":"https:\/\/supportex.net\/blog\/wp-json\/wp\/v2\/media?parent=2270"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/supportex.net\/blog\/wp-json\/wp\/v2\/categories?post=2270"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/supportex.net\/blog\/wp-json\/wp\/v2\/tags?post=2270"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}