{"id":1037,"date":"2014-11-04T11:06:57","date_gmt":"2014-11-04T03:06:57","guid":{"rendered":"http:\/\/www.shsh.ylc.edu.tw\/~taichis\/wp\/?p=1037"},"modified":"2014-11-04T11:06:57","modified_gmt":"2014-11-04T03:06:57","slug":"%e5%9c%a8ubuntu-14-04-1-lts-%e4%b8%8b%e5%ae%89%e8%a3%9dapache-passenger","status":"publish","type":"post","link":"https:\/\/www.shsh.ylc.edu.tw\/~taichis\/wp\/?p=1037","title":{"rendered":"\u5728Ubuntu 14.04.1 LTS \u4e0b\u5b89\u88ddapache passenger"},"content":{"rendered":"<p>\u7406\u8ad6\u4e0a\u8981\u5b89\u88dd\u6771\u897f\uff0c\u6700\u597d\u7528\u540c\u4e00\u5957\u7248\u672c\u7ba1\u7406\u7cfb\u7d71\u8655\u7406\uff0c\u9019\u6a23\u5728\u672a\u4f86\u53ef\u4ee5\u907f\u514d\u5347\u7d1a\u4e4b\u5f8c\uff0c\u7522\u751f\u5957\u4ef6\u76f8\u4f9d\u6027\u7684\u5e72\u64fe\u3002<br \/>\n\u5957\u4ef6\u76f8\u4f9d\u6027\u721b\u6389\u4e4b\u5f8c\uff0c\u6709\u6642\u5019\u8981\u82b1\u6bd4\u91cd\u704c\u66f4\u591a\u7684\u6642\u9593\u624d\u80fd\u8655\u7406\u597d\uff0c\u76f8\u7576\u9ebb\u7169\u3002<br \/>\n\u4e0d\u904e\u5982\u679c\u5728 Ubuntu \u4e0b\u9762\uff0c\u4f7f\u7528 apt-get \u5b89\u88dd\u7684\u6771\u897f\u53ef\u80fd\u4e0d\u4e00\u5b9a\u662f\u65b0\u7248\u7684\uff0c\u6709\u7684\u7db2\u7ad9\u6703\u6559\u7528 gem \u5b89\u88dd\uff0c\u9019\u6a23\u53c8\u9055\u80cc\u4e86\u4e0a\u9762\u7684\u8aaa\u660e\u3002<\/p>\n<p>\u73fe\u5728\u6211\u5c31\u9047\u5230\u9019\u554f\u984c\u4e86\uff0c\u5df2\u7d93\u88dd\u597d Apache 2.4.x\u3001php5\u3001Mysql\u3001Ruby 2.x\u3001Rails 4.x\u3002<br \/>\n\u63a5\u4e0b\u4f86\u8981\u5b89\u88dd passenger\uff0c\u767c\u73fe apt-get \u8981\u6309\u7167\u76f8\u4f9d\u6027\u5b89\u88dd Ruby 1.9.x\uff0c\u9019\u5c31\u8ddf\u5df2\u7d93\u88dd\u597d\u7684 Ruby 2.x \u885d\u7a81\u4e86\u3002\u53ea\u597d\u90fd\u6539\u7528 gem \u5b89\u88dd\u3002<\/p>\n<p>\u5047\u8a2d\u4f60\u7684\u72c0\u6cc1\u8ddf\u6211\u4e00\u6a23\uff0c\u63d0\u4f9b\u6211\u63a5\u4e0b\u4f86\u7684\u4f5c\u6cd5\uff08\u6307\u4ee4\uff09\u7d66\u5404\u4f4d\u53c3\u8003\uff1a<\/p>\n<ul>\n<li>gem install passenger<br \/>\n\u61c9\u8a72\u6703\u53eb\u4f60\u9806\u4fbf\u505a\u4ee5\u4e0b\u9019\u5e7e\u500b\uff1a<br \/>\napt-get install apache2-threaded-dev<br \/>\napt-get install libapr1-dev<br \/>\napt-get install libaprutil1-dev\n<\/li>\n<li>passenger-install-apache2-module<\/li>\n<\/ul>\n<p>\u4e4b\u5f8c\u518d\u6309\u7167\u6307\u793a\u65b0\u589e\u4e00\u500b\u6a94\u6848\u5728 \/etc\/apache2\/conf-available\/passenger.conf<br \/>\n\u5167\u5bb9\u985e\u4f3c\u9019\u6a23\uff08\u8acb\u52ff\u8cbc\u9019\u88e1\u7684\uff0c\u800c\u662f\u6309\u7167\u756b\u9762\u6307\u793a\uff09<br \/>\n<code><br \/>\nLoadModule passenger_module \/home\/taichis\/.rbenv\/versions\/2.1.3\/lib\/ruby\/gems\/2.1.0\/gems\/passenger-4.0.53\/buildout\/apache2\/mod_passenger.so<br \/>\n   <ifmodule mod_passenger.c><br \/>\n     PassengerRoot \/home\/taichis\/.rbenv\/versions\/2.1.3\/lib\/ruby\/gems\/2.1.0\/gems\/passenger-4.0.53<br \/>\n     PassengerDefaultRuby \/home\/taichis\/.rbenv\/versions\/2.1.3\/bin\/ruby<br \/>\n   <\/ifmodule><br \/>\n<\/code><br \/>\n\u4e0b\u6307\u4ee4 a2enconf passenger<br \/>\n\u518d\u4f86\u65b0\u589e\u4e00\u500b\u6a94\u6848\u5728 \/etc\/apache2\/sites-available\/myrails.conf  \uff08\u6a94\u540d\u81ea\u5df1\u53d6\uff0c\u5f8c\u9762\u7559 .conf\uff09<br \/>\n<code><br \/>\n   <virtualhost *:80><br \/>\n      ServerName www.yourhost.com<br \/>\n      # !!! Be sure to point DocumentRoot to 'public'!<br \/>\n      DocumentRoot \/somewhere\/public<br \/>\n      <directory \/somewhere\/public><br \/>\n         # This relaxes Apache security settings.<br \/>\n         AllowOverride all<br \/>\n         # MultiViews must be turned off.<br \/>\n         Options -MultiViews<br \/>\n         <strong># Uncomment this if you're on Apache >= 2.4:<\/strong><br \/>\n         #Require all granted<br \/>\n      <\/directory><br \/>\n   <\/virtualhost><br \/>\n<\/code><br \/>\n\u4e0b\u6307\u4ee4 a2ensite myrails<br \/>\n\u7136\u5f8c\u91cd\u65b0\u555f\u52d5\u9019\u4e9b\u65b0\u8a2d\u5b9a\u5c31\u597d\uff1a<br \/>\nservice apache2 reload<\/p>\n<div class=\"fcbkbttn_buttons_block\" id=\"fcbkbttn_left\"><div class=\"fcbkbttn_like \"><fb:like href=\"https:\/\/www.shsh.ylc.edu.tw\/~taichis\/wp\/?p=1037\" action=\"like\" colorscheme=\"light\" layout=\"standard\" show-faces='false' width=\"450px\" size=\"small\"><\/fb:like><\/div><\/div>","protected":false},"excerpt":{"rendered":"<p>\u7406\u8ad6\u4e0a\u8981\u5b89\u88dd\u6771\u897f\uff0c\u6700\u597d\u7528\u540c\u4e00\u5957\u7248\u672c\u7ba1\u7406\u7cfb\u7d71\u8655\u7406\uff0c\u9019\u6a23\u5728\u672a\u4f86\u53ef\u4ee5\u907f\u514d\u5347\u7d1a\u4e4b\u5f8c\uff0c\u7522\u751f &hellip;<\/p>\n<p class=\"read-more\"> <a class=\"more-link\" href=\"https:\/\/www.shsh.ylc.edu.tw\/~taichis\/wp\/?p=1037\"> <span class=\"screen-reader-text\">\u5728Ubuntu 14.04.1 LTS \u4e0b\u5b89\u88ddapache passenger<\/span> \u95b1\u8b80\u66f4\u591a &raquo;<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[3],"tags":[],"_links":{"self":[{"href":"https:\/\/www.shsh.ylc.edu.tw\/~taichis\/wp\/index.php?rest_route=\/wp\/v2\/posts\/1037"}],"collection":[{"href":"https:\/\/www.shsh.ylc.edu.tw\/~taichis\/wp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.shsh.ylc.edu.tw\/~taichis\/wp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.shsh.ylc.edu.tw\/~taichis\/wp\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.shsh.ylc.edu.tw\/~taichis\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1037"}],"version-history":[{"count":1,"href":"https:\/\/www.shsh.ylc.edu.tw\/~taichis\/wp\/index.php?rest_route=\/wp\/v2\/posts\/1037\/revisions"}],"predecessor-version":[{"id":1038,"href":"https:\/\/www.shsh.ylc.edu.tw\/~taichis\/wp\/index.php?rest_route=\/wp\/v2\/posts\/1037\/revisions\/1038"}],"wp:attachment":[{"href":"https:\/\/www.shsh.ylc.edu.tw\/~taichis\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1037"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.shsh.ylc.edu.tw\/~taichis\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1037"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.shsh.ylc.edu.tw\/~taichis\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1037"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}