[問題] 關於Apache同時跑PHP跟ROR的問題
平時寫ROR都是直接在Webrick上跑,這次要上線運行發現了問題。
我要上線的主機不是只有我一個人使用的,上面平時是執行PHP,但是有安裝Ruby跟Rails
原本想經由FastCGI來跑,但是我設好以 RailsProjectPath/public 的方式測試執行時
會直接出現下面這樣
#!/usr/bin/ruby1.8
#!/usr/local/bin/ruby
#
# You may specify the path to the FastCGI crash log (a log of unhandled
# exceptions which forced the FastCGI instance to exit, great for debugging)
# and the number of requests to process before running garbage collection.
#
# By default, the FastCGI crash log is RAILS_ROOT/log/fastcgi.crash.log
# and the GC period is nil (turned off). A reasonable number of requests
# could range from 10-100 depending on the memory footprint of your app.
#
# Example:
# # Default log path, normal GC behavior.
# RailsFCGIHandler.process!
#
# # Default log path, 50 requests between GC.
# RailsFCGIHandler.process! nil, 50
#
# # Custom log path, normal GC behavior.
# RailsFCGIHandler.process! '/var/log/myapp_fcgi_crash.log'
#
require File.dirname(__FILE__) + "/../config/environment"
require 'fcgi_handler'
RailsFCGIHandler.process!
看起來是直接把 public/dispatch.fcgi 給直接列出來了,這是代表我有什麼地方出錯嗎
?
我後來嘗試用Mogrel+Apache來跑,但是設定完成後是跑出來了,可是卻直接指向Mogrel
其他PHP網頁全都跑不出來了,所以也只好直接放棄。
這主機不是只有我一個人在跑,所以我不能把整個IP都指向Mongrel,可以單純指定某個
Domain到Mongrel而已嗎?一般外面的虛擬主機支援ROR都是怎麼做的呢?
因為只是個小公司行號網站,並不會有太大的流量,所以我想Apache+FCGI的方式應該是
可以,只是不知道我漏掉了什麼步驟呢?
我的作法是
1. 讓Apache支援FCGI
2. 修改專案中的.htaccess 支援FCGI
3. http://domainname/railsproject/public/ 的方式來試跑就跑出上面的那一大串了,
我在Dreamhost的主機下這樣跑是OK的
煩請各位幫忙解答,我已經弄這個弄到頭痛了... 謝謝
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 122.116.172.228
推
03/02 02:05, , 1F
03/02 02:05, 1F
→
03/02 02:05, , 2F
03/02 02:05, 2F
→
03/02 02:10, , 3F
03/02 02:10, 3F
→
03/02 02:10, , 4F
03/02 02:10, 4F
→
03/02 02:52, , 5F
03/02 02:52, 5F
推
03/02 07:20, , 6F
03/02 07:20, 6F
推
03/02 12:59, , 7F
03/02 12:59, 7F
Ruby 近期熱門文章
PTT數位生活區 即時熱門文章