Re: [問題] Lighttpd的設定方式

看板Ruby作者 (godfat 真常)時間14年前 (2009/10/13 20:49), 編輯推噓1(105)
留言6則, 2人參與, 最新討論串2/4 (看更多)
: → ryudo:樓上的大大可以教一下如果是nginx怎樣達成本文的目的呢?3Q 10/13 19 我就不測試了,從這邊 copy 過來的: http://github.com/godfat/source-tools/ blob/master/lib/source-tools/templates/tconfig/nginx.conf.erb 假設你的 php 目錄底下有 rails app: # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 location ~ \.php$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; include conf/fastcgi_params; } # 以下這段要放在 php 之前,因為要先 match. location ~ ^/your_rails_prefix/ { # ... } 我沒用過 rails fast-cgi, 你自己查查看 rails 怎麼設。 總之 fast-cgi 就參考 php 那樣設。其他的請參考 nginx wiki: http://wiki.nginx.org/NginxConfiguration 不過我會建議你用 passenger, 或最近新的 unicorn, 或是 thin cluster. passenger 是管理方便,thin cluster 是效能比較好。 passenger 很單純,就在 location 裡面加個: passenger_enabled on; rails_env production; root /some/where/public; unicorn 參考 github: http://github.com/blog/517-unicorn 不過我自己是還沒試過。 -- 生死去来、棚頭傀儡、一線断時、落落磊磊 《花鏡》-世阿弥 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 220.135.28.18

10/15 18:29, , 1F
thin可靠嗎?我沒啥聽說有production的站在用
10/15 18:29, 1F

10/15 18:30, , 2F
unicorn還是第一次聽到
10/15 18:30, 2F

10/15 18:30, , 3F
passenger for nginx有比apache版好嗎?
10/15 18:30, 3F

10/15 23:00, , 4F
heroku就是用Thin,如果底下每個都算production的站台
10/15 23:00, 4F

10/15 23:00, , 5F
大概就有至少兩萬多個Rails網站用Thin了 :D
10/15 23:00, 5F

10/19 16:29, , 6F
heroku用的是他們自己mod過的吧!?
10/19 16:29, 6F
文章代碼(AID): #1Ar7TVVu (Ruby)
文章代碼(AID): #1Ar7TVVu (Ruby)