26 tháng 6, 2008

Apache Log Rotation

On even a moderately busy server, the quantity of information stored in the log files is very large. The access log file typically grows 1 MB or more per 10,000 requests. It will consequently be necessary to periodically rotate the log files by moving or deleting the existing logs. This cannot be done while the server is running, because Apache will continue writing to the old log file as long as it holds the file open. Instead, the server must be restarted after the log files are moved or deleted so that it will open new log files.
in httpd.conf, add:

CustomLog "|/usr/local/apache/bin/rotatelogs /usr/local/apache/logs/access_log.%Y%m%d 86400 -360" common

(changing the path as needed...)
where the number 86400 is seconds to rotation (86400 is 24 hours)
and -360 is minutes offset from UTC 0 (-360 is for US Central)

and comment out any other line beginning with 'CustomLog'

this will give you logs, rotated daily, named something like:


...so you don't have to stop the server to deal with gigantic log files...
-->đọc tiếp...

23 tháng 6, 2008

Play next movie after FLV movie is complete

if stream is your NetStream class, at some point you need to hook up an onStatus event handler.
stream.notify = this;
stream.onStatus = function( s ) { notify.onStatus( s ); };
this being our video "component", the class that contained the NetStream object.
Then our onStatus handler was:
function onStatus( status )
switch( status.code ) {
case "NetStream.Buffer.Empty": onEmpty(); break;
case "NetStream.Buffer.Full": onFull(); break;
case "NetStream.Buffer.Flush": onFlush(); break;
case "NetStream.Play.Start": onStart(); break;
case "NetStream.Play.Stop": onStop(); break;
case "NetStream.Play.StreamNotFound": onStreamNotFound(); break;
case "NetStream.Seek.InvalidTime": onInvalidSeek(); break;
case "NetStream.Seek.Notify": onSeekReady(); break;
And finally you want onStop to do your gotoAndWhatever.
If I recollect you do need to interpret the state depending on what else may be going on ... are you already playing etc etc... So our onStop handler looked like:
function onStop()
cancelTask( "monitor" );

if( statePlaying ) {


statePlaying = false;
notify( "stop", this );
deferCall( styleDeferRewindOnStop, onStop2 );
BTW... functions like deferCall, notify, cancelTask, are all our own... not Flash or V2 related.
In our case, when the movie stopped, and if styleDeferRewindOnStop was greater than 0, the movie went back to it's beginning and stopped:
function onStop2()
stream.seek( 0 );
-->đọc tiếp...
BlogWeb: tạo từ Blog của Google
Nội dung: lấy từ nhiều Nguồn khác nhau.
Mục đích: note lại bài Hướng dẫn hay và Đáng đọc.
Kết quả: nghiện Internet Nặng.
Tương lại: xuống lỗ Vẫn Nghiện nếu không có ai giúp.
Blog Web của: Trí Dũng đến từ Việt Nam - Liên kết đến trang Blog Cá Nhân
Tôi biết (^_^)
Thông tin về Tác giả. Chi Tiết
Sử dụng (FireFox | Google Chrome on Ubuntu) để xem tốt nhất. Học Nhiều Hơn Tại Đây
©2009 Google Blogger - HuuNguyen's Home