2008年2月20日 星期三

設定 Cakephp console on Windows

1. setup 環境變數:
PATH= C:\wamp\bin\php\php5.2.5\;E:\cake\cake\console

2. 可以到處下 cake 檢查 app 目錄和 core 目錄

3. cake bake (煮蛋糕了!)

*** 注意 WAMP 有兩個 php.ini 檔案 (一個是apache 在用的,一個是php),花了一個下午才發現這個問題
- cake console 會使用 php 那個 (wamp\bin\php\php5.2.5\)

2008年2月15日 星期五

Apache Log

通常Apache Log 都很肥...
這時候要利用它(access_log)來做SEO就很累了... 常常跑一半會當掉...
所以 這時候就要用 Rotate log

怎麼做呢?

使用Piped Logs
- Apache 本身有個rotatelogs 的軟體
把原先的 CustomLog logs/access_log combined 改成
CustomLog "/usr/local/apache/bin/rotatelogs /var/log/access_log 86400" combined
- 上述指令會每24小時rotate 一次
或是
CustomLog "bin/rotatelogs /var/logs/logfile 5M" common
- 限制5 Mb的大小

另外 error_log 和其他的log 也可以如法泡製.
ErrorLog "bin/rotatelogs /var/logs/errorlog.%Y-%m-%d-%H_%M_%S 5M"


參考:http://httpd.apache.org/docs/2.0/logs.html
http://httpd.apache.org/docs/2.0/programs/rotatelogs.html