{"id":8676,"date":"2015-02-13T02:58:32","date_gmt":"2015-02-13T02:58:32","guid":{"rendered":"https:\/\/wp.okra.host\/article\/using-multiple-versions-with-passenger\/"},"modified":"2021-03-07T14:44:25","modified_gmt":"2021-03-07T13:44:25","slug":"using-multiple-versions-with-passenger","status":"publish","type":"ht_kb","link":"https:\/\/kb.okra.host\/de\/article\/using-multiple-versions-with-passenger\/","title":{"rendered":"Verwendung mehrerer Versionen mit Passenger"},"content":{"rendered":"<h2 id=\"overview\" >\u00dcbersicht<\/h2>\n<p><a href=\"https:\/\/www.phusionpassenger.com\/\">Passagier<\/a> provides an intelligent polyglot launcher interface for managing Node.js, <a title=\"Einrichten von Rails mit Passenger\" href=\"https:\/\/kb.okra.host\/de\/ruby\/setting-rails-passenger\/\">Rubin<\/a>, and Python processes. This can be teamed up with <a title=\"\u00c4ndern von Python-Versionen\" href=\"https:\/\/kb.okra.host\/de\/python\/changing-python-versions\/\">pyenv<\/a> to effortlessly launch multiple Python applications with a single shell command and <a title=\".htaccess-Leitfaden\" href=\"https:\/\/kb.okra.host\/de\/guides\/htaccess-guide\/\">.htaccess<\/a> directive.<\/p>\n<p>These steps are only necessary to use supplementary Python versions available on the server. If the default version works satisfactorily, then no further changes are necessary.<\/p>\n<h2 id=\"usage\" >Verwendung<\/h2>\n<p>Applying what has been learned from KB article: &#8220;<a title=\"\u00c4ndern von Python-Versionen\" href=\"https:\/\/kb.okra.host\/de\/python\/changing-python-versions\/\">Changing python versions<\/a>&#8220;, create a directory structure compatible with Passenger:<\/p>\n<pre data-language=\"shell\"><code>cd \/var\/www\r\nmkdir -p mypyapp\/{public,tmp}\r\ncd mypyapp<\/code><\/pre>\n<p>Now assign it a Python interpreter. We&#8217;ll use 3.3.5:<\/p>\n<pre data-language=\"shell\"><code>pyenv local 3.3.5<\/code><\/pre>\n<p>Lastly, inform Passenger to use the pyenv-compatible <code>python<\/code> shim by adding\u00a0<code>PassengerPython \/.socket\/python\/shims\/python<\/code> zu einer <code>.htaccess<\/code> file in <code>\u00f6ffentlich\/<\/code><\/p>\n<pre data-language=\"shell\"><code>echo \"PassengerPython \/.socket\/python\/shims\/python\" &gt; \/var\/www\/mypyapp\/public\/.htaccess<\/code><\/pre>\n<p><strong><span style=\"color: #000080\">Wichtig:\u00a0<\/span><\/strong><span style=\"color: #000080\"><span style=\"color: #000000\">using pyenv&#8217;s shim system is considerably slower than accessing python directly, because a series of shell subprocesses are launched to\u00a0resolve the python process necessary to satisfy a\u00a0request. If using pyenv with Passenger, consider adapting it to the FastCGI specification for background persistence.<\/span><\/span><\/p>\n<h2 id=\"see-also\" >Siehe auch<\/h2>\n<ul>\n<li>Concurrent <a href=\"http:\/\/py2.futz.net\/\">Python 2<\/a> und <a href=\"http:\/\/py3.futz.net\/\">Python 3<\/a>\u00a0implementations on Sol (a v6 platform)<\/li>\n<\/ul>","protected":false},"excerpt":{"rendered":"<p>Overview Passenger provides an intelligent polyglot launcher interface for managing Node.js, Ruby, and Python processes. This can be teamed up with pyenv to effortlessly launch multiple Python applications with a single shell command and .htaccess directive. These steps are only necessary to use supplementary Python versions available on the server&#8230;.<\/p>","protected":false},"author":1,"comment_status":"open","ping_status":"closed","template":"","format":"standard","meta":{"footnotes":""},"ht-kb-category":[65],"ht-kb-tag":[],"class_list":["post-8676","ht_kb","type-ht_kb","status-publish","format-standard","hentry","ht_kb_category-python"],"_links":{"self":[{"href":"https:\/\/kb.okra.host\/de\/wp-json\/wp\/v2\/ht-kb\/8676","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kb.okra.host\/de\/wp-json\/wp\/v2\/ht-kb"}],"about":[{"href":"https:\/\/kb.okra.host\/de\/wp-json\/wp\/v2\/types\/ht_kb"}],"author":[{"embeddable":true,"href":"https:\/\/kb.okra.host\/de\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kb.okra.host\/de\/wp-json\/wp\/v2\/comments?post=8676"}],"version-history":[{"count":1,"href":"https:\/\/kb.okra.host\/de\/wp-json\/wp\/v2\/ht-kb\/8676\/revisions"}],"predecessor-version":[{"id":8677,"href":"https:\/\/kb.okra.host\/de\/wp-json\/wp\/v2\/ht-kb\/8676\/revisions\/8677"}],"wp:attachment":[{"href":"https:\/\/kb.okra.host\/de\/wp-json\/wp\/v2\/media?parent=8676"}],"wp:term":[{"taxonomy":"ht_kb_category","embeddable":true,"href":"https:\/\/kb.okra.host\/de\/wp-json\/wp\/v2\/ht-kb-category?post=8676"},{"taxonomy":"ht_kb_tag","embeddable":true,"href":"https:\/\/kb.okra.host\/de\/wp-json\/wp\/v2\/ht-kb-tag?post=8676"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}