วันเสาร์ที่ 3 มีนาคม พ.ศ. 2555

zendoptimiz

copy คำสั่งทั้งหมด แล้ว คลิกขวาใน putty เลยครับ
สำหรับ centos 32 bit

cd /usr/local/src
wget http://downloads.zend.com/optimizer/3.2.8/ZendOptimizer-3.2.8-linux-glibc21-i386.tar.gz
tar -zxvf ZendOptimizer-3.2.8-linux-glibc21-i386.tar.gz
cd ZendOptimizer-3.2.8-linux-glibc21-i386
./install

สำหรับ centos 64 bit

cd /usr/local/src
wget http://downloads.zend.com/optimizer/3.2.8/ZendOptimizer-3.2.8-linux-glibc23-x86_64.tar.gz
tar -zxvf ZendOptimizer-*.tar.gz
cd ZendOptimizer-*
./install.sh

หลังจาก นั้นจะมีหน้าจอติดตั้งขึ้นมา กด enter ไปเรื่อย ๆ จนเสร็จครับ

วิธีเช็คว่าใช้งาน Zend optimizer ได้หรือยัง

php -v

ถ้าใช้ได้แล้ว จะขึ้นว่า

PHP 5.1.6 (cli) (built: May 9 2007 11:28:53)
Copyright (c) 1997-2006 The PHP Group
Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies
with Zend Extension Manager v1.2.0, Copyright (c) 2003-2007, by Zend Technologies
with Zend Optimizer v3.2.8, Copyright (c) 1998-2007, by Zend Technologies


download Zend @
http://mirror.trouble-free.net/sources/

เมื่อ: 26 พฤศจิกายน 2006, 14:12:06ได้แล้วครับไปแก้ที่ selinux ให้ disable ของ fedora 4 เข้าไปที่ /etc/sysconfig/selinux
จาก SELINUX = enforcing เป็น
SELINUX = disabled

วันพฤหัสบดีที่ 1 มีนาคม พ.ศ. 2555

การติดตั้ง mrtg on Centos

1. ติดตั้ง mrtg

#yum install mrtg net-snmp net-snmp-utils

2. เปิด snmpd

#chkconfig snmpd on
#service snmpd start



3. config mrtg

#cfgmaker --global "WorkDir: /var/www/mrtg" --global "Options[_]: growright,bits" --ifref=name public@localhost > /etc/mrtg/mrtg.cfg

ให้ แก้ไขไฟล์ /etc/mrtg/mrtg.cfg โดยเพิ่มข้อมูลดังนี้


### Load CPU Average ###
Target[cpu]: .1.3.6.1.4.1.2021.10.1.5.1&.1.3.6.1.4.1.2021.10.1.5.2:public@localhost
MaxBytes[cpu]: 100
Unscaled[cpu]: dwmy
Options[cpu]: gauge, absolute, growright, noinfo, nopercent
YLegend[cpu]: CPU Load(%)
ShortLegend[cpu]: (%)
LegendI[cpu]:   CPU System
LegendO[cpu]:   CPU User
Title[cpu]: CPU Analysis
PageTop[cpu]:

CPU Analysis



### Memory Free ###
Target[mem]: .1.3.6.1.4.1.2021.4.6.0&.1.3.6.1.4.1.2021.4.4.0:public@localhost
MaxBytes1[mem]: 8362754048
MaxBytes2[mem]: 8587182080
#Unscaled[mem]: dwmy
Options[mem]: gauge, absolute, growright, noinfo
YLegend[mem]: Memory Free
ShortLegend[mem]: Bytes
#kilo[mem]: 1024
#kMG[mem]: G
LegendI[mem]: Real
LegendO[mem]: Swap
Legend1[mem]: (MBytes)
Legend2[mem]: (MBytes)
Title[mem]: Memory Analysis
PageTop[mem]:

Free Memory Analysis




### Established TCP Connections ###
Target[public.newconns]: tcpPassiveOpens.0&tcpActiveOpens.0:public@localhost
Title[public.newconns]: Newly Created TCP Connections
PageTop[public.newconns]:

New TCP Connections


MaxBytes[public.newconns]: 10000000000
ShortLegend[public.newconns]: c/s
YLegend[public.newconns]: Conns / Min
LegendI[public.newconns]: In
LegendO[public.newconns]: Out
Legend1[public.newconns]: New inbound connections
Legend2[public.newconns]: New outbound connections
Options[public.newconns]: growright,nopercent,perminute

### Established TCP Connections ###
Target[public.estabcons]: tcpCurrEstab.0&tcpCurrEstab.0:public@localhost
Title[public.estabcons]: Currently Established TCP Connections
PageTop[public.estabcons]:

Established TCP Connections


MaxBytes[public.estabcons]: 10000000000
ShortLegend[public.estabcons]:
YLegend[public.estabcons]: Connections
LegendI[public.estabcons]: In
LegendO[public.estabcons]:
Legend1[public.estabcons]: Established connections
Legend2[public.estabcons]:
Options[public.estabcons]: growright,nopercent,gauge

4. Gen ไฟล์ index.html

indexmaker --columns=2 --sort=title --output=/var/www/mrtg/index.html /etc/mrtg/mrtg.cfg

5. ให้เรียก mrtg ผ่าน web ได้

#nano /etc/httpd/conf.d/mrtg.conf

เพิ่มใน Allow from all #add by attasit


Order deny,allow
Deny from all
Allow from 127.0.0.1
Allow from ::1
# Allow from .example.com
Allow from all #add by attasit


6. restart apache

#service httpd restart

7. ทดสอบเรียกหน้า web]

http://ip-address/mrtg

ตั้งเวลาเครื่องให้ตรง

#ntpdate -u clock.nectec.or.th
หรือ
#ntpdate -u time.csloxinfo.com

php GD Library

# yum install php-gd
# service httpd reload