三月 27 2007

Profile Image of evenrain
evenrain

在 DreamHost 上設定 LifeType 的簡潔網址

Posted at 00:10:50 under blog

下午 Mark 跟我說他終於找到在 DreamHost 上無法使用簡潔網址的問題了。雖然目前我沒在使用 LifeType,稍微做個紀錄,以備不時之需 :)

主要的原因是出在 DH 的 mod_php 跟 php.cgi 是不同 user,mod_php 的 user 是 dhapache,而 php.cgi 的 user 是使用者自己。

所以解決的方式就是把 LifeType 網域的 FastCGI Support打開,然後重點是要注意 wiki.dreamhost.com 上的這篇文章修改設定。

首先要建立一個叫做"php5-wrapper.fcgi"的檔案,檔案的內容如下:

CODE:
  1. #!/bin/sh
  2. export PHP_FCGI_CHILDREN=3
  3. exec /dh/cgi-system/php5.cgi

然後把這個檔案設定為可執行

CODE:
  1. chmod u+x php5-wrapper.fcgi

接著修改 .htaccess 檔,在其中加入下列幾行:

CODE:
  1. AddHandler fastcgi-script fcg fcgi fpl
  2. AddHandler php5-fastcgi .php
  3. Action php5-fastcgi /php5-wrapper.fcgi

然後要確認你的根目錄可執行 CGI,在 .htaccess 中加入

CODE:
  1. Options +ExecCGI

最後呢,為了避免 LifeType 產生的檔案又變成 dhapache,要把 .htaccess 裡所有的 ForceType 統統改成 php5-fastcgi

CODE:
  1. <files>
  2. ForceType php5-fastcgi
  3. </files>
  4.  
  5. <files>
  6. ForceType php5-fastcgi
  7. </files>
  8.  
  9. <files>
  10. ForceType php5-fastcgi
  11. </files>
  12.  
  13. <files>
  14. ForceType php5-fastcgi
  15. </files>
  16.  
  17. <files>
  18. ForceType php5-fastcgi
  19. </files>
  20.  
  21. <files>
  22. ForceType php5-fastcgi
  23. </files>
  24.  
  25. <files>
  26. ForceType php5-fastcgi
  27. </files>
  28.  
  29. <files>
  30. ForceType php5-fastcgi
  31. </files>
  32.  
  33. <files>
  34. ForceType php5-fastcgi
  35. </files>
  36.  
  37. <files>
  38. ForceType php5-fastcgi
  39. </files>
  40.  
  41. <files>
  42. ForceType php5-fastcgi
  43. </files>
  44.  
  45. <files>
  46. ForceType php5-fastcgi
  47. </files>
  48.  
  49. <files>
  50. ForceType php5-fastcgi
  51. </files>

如此應該就能在 DH 上使用簡潔網址了,感謝 Mark 的辛勞 :)

標籤:,

相關文章

No responses yet

Trackback URI | Comments RSS

Leave a Reply