2008年10月11日 星期六

一點都不累

本文有密碼保護, 需要輸入密碼:
密碼提示:
 

2008年10月7日 星期二

Debian cacti安裝

  • 安裝cacti

    debina:~# apt-get install cacti

    安裝過程中會要求輸入mysql的root密碼,cacti並會建立一個名為cacti的資料使用者,並設定其密碼

  • 打開瀏覽器http://www.myurl.org/cacti,按Next繼續安裝,cacti第一次安裝完成預設帳密為admin/admin,登入後系統會要求更改admin密碼,更改後即可登入cacti

2008年10月6日 星期一

期待

本文有密碼保護, 需要輸入密碼:
密碼提示:
 

Debian Awstats

  • 安裝awstats

    debian:~# apt-get install awstats

  • 設定aswtats

    debian:~# vi /etc/awstats/awstats.conf
    LogFile="/var/log/apache2/access.log"
    SiteDomain="hft.tweetylny.org"
    LogFormat=1

    save&exit

    debian:~# vi /etc/cron.d/awstats

    fix

    0,10,20,30,40,50 * * * * www-data [ -x /usr/lib/cgi-bin/awstats.pl -a -f /etc/awstats/awstats.conf -a -r /var/log/apache/access.log ] && /usr/lib/cgi-bin/awstats.pl -config=awstats -update >/dev/null

    to

    0,10,20,30,40,50 * * * * www-data [ -x /usr/lib/cgi-bin/awstats.pl -a -f /etc/awstats/awstats.conf -a -r /var/log/apache2/access.log ] && /usr/lib/cgi-bin/awstats.pl -config=awstats -update >/dev/null

    save & exit

    debian:~# ln -s /usr/share/awstats/icon /var/www/awstats-icon
  • 第一次手動執行

    debian:~# /usr/lib/cgi-bin/awstats.pl -config=awstats -update >/dev/null

  • 瀏覽器輸入網址

    http://www.myurl.org/cgi-bin/awstats.pl
  • Debian預設

    cron檔放在 /etc/cron.d/awstats 每10分鍾更新一次

Debian MRTG安裝

  • 安裝MRTG

    debian:~# apt-get install snmp snmpd mrtg
    debian:~# cp /etc/snmp/snmpd.conf /etc/snmp/snmpd.conf.bak
    debian:~# rm /etc/snmp/snmpd.conf
    debian:~# touch /etc/snmp/snmpd.conf
    debian:~# vi /etc/snmp/snmpd.conf

    add

    rocommunity public

    save&exit

    debian:~# /etc/init.d/snmpd restart

  • 測試snmp是否正常啟動

    debian:~# snmpwalk -c public -v 1 localhost

  • 設定/etc/mrtg.cfg

    add&fix

    WorkDir: /var/www/mrtg
    EnableIPv6: no
    WorkDir: /var/www/mrtg
    Target[eth0]: \eth0:public@localhost:
    Refresh: 600
    Interval: 5
    MaxBytes[eth0]: 1310720
    Language: ansi
    options[_]: bits, growright, transparent, printrouter, pngdate
    PNGTitle[eth0]: tweetylny-tw.org
    XScale[eth0]: 1.8
    YScale[eth0]: 1.8
    LegendO[eth0]: eth0 out flow
    LegendI[eth0]: eth0 in flow
    Colours[eth0]: 1#FFCC00,2#336699,3#FF0000,4#00FF00;
    SetEnv[eth0]: MRTG_INT_IP="123.204.90.138" MRTG_INT_DESCR="eth0" EMAIL="root@tweetylny.org" HOST="tweetylny.org"
    Title[eth0]: tweetylny.org
    PageTop[eth0]: <h1>tweetylny.org</h1>

    save&exit

  • 執行mrtg,建立index.html

    debian:~# mrtg /etc/mrtg.cfg 執行三次
    debian:~# indexmaker -output=/var/www/mrtg/index.html -title='tweetylny.org Traffic Info' /etc/mrtg.cfg

  • Debain預設的值

    主要網站是掛在/var/www/mrtg
    cron檔放在/etc/cron.d/mrtg 5分鍾更新一次

專題相關

http://blog.roga.tw/2007/09/07/494/
http://bbs.mychat.to/read.php?fid=164&tid=476780

cacti
awstats
mrtg

http://wiki.debian.org/Manual-Howto#head-af0cf2b4461252ac231800c12fa5d28f3a04e166

壓力測試參考資料1

Mail Server 壓力測試參考資料 1

Mail Server 壓力測試(郵件病毒)參考文件 2

壓力測試實錄分享參考文件


http://cha.homeip.net/blog/archives/2005/01/sendmail_mailsc.html
http://mydebian.freeblog.hu/archives/2006/12/11/postfix__amavisd-new__spamassassin__spamc__clamav_--_on_debian_etch/

打掃

本文有密碼保護, 需要輸入密碼:
密碼提示:
 

2008年10月5日 星期日

Thank you

本文有密碼保護, 需要輸入密碼:
密碼提示:
 

2008年10月1日 星期三

osTube安裝設定

  1. 首先將apt的來源加入multimedia支援

    debian:# vi /etc/apt/sources.list

    add

    deb http://www.debian-multimedia.org stable main

    save&exit

  2. 增加multimedia的gpgkey,並更新apt列表,安裝gpgkey前請先檢查bzip2安裝了沒

    debian:~# wget http://debian-multimedia.org/gpgkey.pub -O - | apt-key add - && apt-get install debian-multimedia-keyring
    debian:~# apt-get update

  3. 安裝套件mplayer、mencoder、ruby、flvtools2、php5-cli、php5-gd

    debian:~# apt-get install mplayer mencoder ruby php5-cli php5-gd
    debian:~# wget http://rubyforge.org/frs/download.php/17497/flvtool2-1.0.6.tgz
    debian:~# tar zxvf flvtool2-1.0.6.tgz
    debian:~# cd flvtool2-1.0.6
    debian:~/flvtool2-1.0.6# ruby setup.rb config;ruby setup.rb setup;ruby setup.rb install
    debian:~# /etc/init.d/apache2 restart

  4. osTube網站註冊,並下載osTube_2.2_Community_Edition_osTube_community_edt_2.2.tar.gz

    debian:~# mkdir /var/www/ostube
    debian:~# tar zxvf osTube_2.2_Community_Edition_osTube_community_edt_2.2.tar.gz -C /var/www/ostube

  5. 建立ostube的mysql資料庫,並將指定資料庫使用者權限

  6. 打開瀏覽器,輸入ostube的網址http://www.myurl.org/ostube開始進行安裝

    安裝到 "Error! (one last setting needed..)"時

    debian:/var/www/ostube# touch includes/config.php
    debian:/var/www/ostube# chmod 777 includes/config.php

    按下F5重整繼續安裝,出現Congratulations就代表安裝完成

  7. 設定檔案上傳的位置及上傳的大小限制,單位為byte,1GB =1024 MB = 1048576 KB = 1073741824 Byte,並將ostube/cgi-bin下的所有檔案複製到/usr/lib/cgi-bin

    debian:~# cd /var/www/ostube/cgi-bin/
    debian:~# vi uu_default_config.pm (照上面的修改)

    fix

    upload_dir => $ENV{'DOCUMENT_ROOT'} . '/ostube/media/tmp/',
    redirect_url => 'http://' . $ENV{'SERVER_NAME'} . '/ostube/upload.php',
    path_to_upload => 'http://'. $ENV{'SERVER_NAME'} . '/ostube/uploads/',

    max_upload => 509715200,

    save&exit

    debian:/var/www/ostube# cp cgi-bin/* /usr/lib/cgi-bin/

  8. 修正convert.php,將下列程式碼加上註解#

    debian:/var/www/ostube# vi convert.php

    fix

    if (!$mplayer_rc1) {
    #$conversionString = str_replace("-lavfopts i_certify_that_my_video_stream_does_not_use_b_frames ", "", $conversionString);
    }

  9. 中文化

    懶人法

    debian:/var/www/ostube# rm -rf languages/english/english.ini
    debian:/var/www/ostube# wget http://203.68.253.130/~yungzai/ostube2.2/english_2.2.ini;mv english_2.2.ini languages/english/english.ini
    debian:/var/www/ostube# wget http://203.68.253.130/~yungzai/ostube2.2/admin.ini;mv admin.ini languages/english/admin.ini
    debian:/var/www/ostube#iconv -f BIG5 -t UTF-8 languages/english/admin.ini.1 > admin.ini
    debian:/var/www/ostube# rm -rf languages/english/admin.ini.1

    自建語系法(怕麻煩者勿用)

    debian:/var/www/ostube# cd languages/
    debian:/var/www/ostube/languages# cp -r english zh-TW
    debian:/var/www/ostube/languages# cd zh-TW
    debian:/var/www/ostube/languages/zh-TW# vi settings.php

    fix

    $settings['iso_code'] = "zh-TW";
    $settings['title'] = "繁體中文";
    $settings['locale'] = array('zh-TW','tw','Taiwan');

    save&exit

    debian:/var/www/ostube/languages/zh-TW# rm english.ini
    debian:/var/www/ostube/languages/zh-TW# wget http://203.68.253.130/~yungzai/ostube2.2/english_2.2.ini;mv english_2.2.ini zh-TW.ini
    debian:/var/www/ostube/languages/zh-TW# wget http://203.68.253.130/~yungzai/ostube2.2/admin.ini
    debian:/var/www/ostube/languages/zh-TW#iconv -f BIG5 -t UTF-8 languages/english/admin.ini.1 > admin.ini
    debian:/var/www/ostube/languages/zh-TW# rm -rf languages/english/admin.ini.1


    debian:/var/www/ostube/languages/zh-TW# cd /var/www/ostube/templates/default/images
    debian:/var/www/ostube/templates/default/images# cp -r english zh-TW
    debian:/var/www/ostube/templates/default/images# cd zh-TW
    debian:/var/www/ostube/templates/default/images/zh-TW# wget http://video.hlps.tcc.edu.tw/templates/default/images/zh-TW/zh-TW.gif

    debian:~# cd /var/www/ostube/templates/default/mail
    debian:/var/www/ostube/templates/default/mail# cp english -r zh-TW

    由於新建一個語系,在分類上要先在English模式下,將中文的分類名稱加好再做轉換

    或是將以下sql指令匯入資料庫

    INSERT INTO `ost_channels2language` (`id`, `channel_id`, `channel_name`, `channel_desc`, `channel_language`) VALUES
    (25, 11, '趣味', NULL, 'zh-TW'),
    (26, 9, '運動', NULL, 'zh-TW'),
    (27, 3, '競賽', NULL, 'zh-TW'),
    (28, 5, '教育', NULL, 'zh-TW'),
    (29, 4, '電影', NULL, 'zh-TW'),
    (30, 1, '卡通', NULL, 'zh-TW'),
    (31, 7, '新聞', NULL, 'zh-TW'),
    (32, 8, '旅遊', NULL, 'zh-TW'),
    (33, 6, '流行', NULL, 'zh-TW'),
    (34, 12, '科技', NULL, 'zh-TW'),
    (35, 10, '動物', NULL, 'zh-TW'),
    (36, 2, '奇異', NULL, 'zh-TW');

    在Configuration->General Settings->Default Language選擇為繁體中文,至於管理者的語系要到資料庫下ost_users資料表的users_language,將管理者的users_language改成zh-TW即可

  10. mysql中文utf8設定,增加@mysql_query("SET NAMES utf8", $this->connection);

    debian:/var/www/ostube# vi includes/class.database.php

    if(!$this -> connection = @mysql_connect($DBhost,$DBuser,$DBpass)) {
    if($this->debug) die("Error: Can not connect to database - " . $DBhost);
    unset($this);
    return false;
    } else {
    @mysql_query("SET NAMES utf8", $this->connection);
    $this->connected = true;
    }

  11. 因為中文化檔是澎湖的老師修改的,所以要對中文化檔的參數做修正

    debian:~# vi /var/www/ostube/languages/zh-TW/zh-TW.ini

    send2friend_subject

    debian~# vi /var/www/ostube/languages/zh-TW/admin.ini

    tosite

  12. convert error debug

    debian:~# cat /var/www/ostube/conversion.log

    觀察錯誤訊息,再去對convert.php...等檔案做設定