Re: [問題] apache 與 mongrel 連結
※ 引述《shelary (台中喵小咩)》之銘言:
: 你也沒把你的 conf 貼上來..怎麼知道是不是你那裡設錯
: 我覺得你乾脆簡單一點..反向思考
: 把你的 php 放到 rails 的 public 目錄下
: 然後 apache 加 ProxyPass /php !
: 這樣 http://localhost/ 是 rails
: http://localhost/php 是 php
: 是不是簡單多了
: 至於第二個問題
: 在 orders 的 model 裡加
: def to_label
: price
: end
原來是因為我在 Virtual Host 有設一個
DocumentRoot C:\ruby\workspace\myapp\public
所以 localhost 都會被轉到 public 下
把他註解掉就 ok 了,完整設定如下:
<VirtualHost *:80>
AddDefaultCharset utf-8
ServerName *
# ---> 就是他 DocumentRoot C:\ruby\workspace\myapp\public
ErrorDocument 500 /500.html
ErrorDocument 404 /404.html
ProxyPass /myapp http://127.0.0.1:4000/myapp
ProxyPassReverse /myapp http://127.0.0.1:4000/myapp
ProxyPass /images !
ProxyPass /stylesheets !
ProxyPass /javascripts !
#continue with other static files that should be served by apache
Alias /images C:\ruby\workspace\myapp\public\images
Alias /stylesheets C:\ruby\workspace\myapp\public\stylesheets
Alias /javascripts C:\ruby\workspace\myapp\public\javascripts
#continue with aliases for static content
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
<Directory C:\ruby\workspace\myapp\public\>
Options Indexes FollowSymLinks
Order allow,deny
allow from all
</Directory>
</VirtualHost>
然後第二問題我加了那個 function 了,但是沒作用,好怪 @@?
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 219.86.99.66
※ 編輯: dream1129 來自: 219.86.99.66 (09/10 17:16)
推
09/11 21:12, , 1F
09/11 21:12, 1F
推
09/11 23:37, , 2F
09/11 23:37, 2F
→
09/11 23:38, , 3F
09/11 23:38, 3F
推
10/24 15:24, , 4F
10/24 15:24, 4F
討論串 (同標題文章)
本文引述了以下文章的的內容:
完整討論串 (本文為第 6 之 6 篇):
Ruby 近期熱門文章
PTT數位生活區 即時熱門文章
9
12