วันจันทร์ที่ 12 พฤศจิกายน พ.ศ. 2555

ลบ cache ใน Authen

ตรวจสอบ Memory
root@34d30y [~]# free -m
total       used       free     shared    buffers     cached
Mem:          8881       4744       4136          0        296       3567
-/+ buffers/cache:        880       8000
Swap:         4095          0       4095
root@34d30y [~]# sync
root@34d30y [~]# echo 3 > /proc/sys/vm/drop_caches
root@34d30y [~]# free -m
total       used       free     shared    buffers     cached
Mem:          8881        533       8347          0          1         19
-/+ buffers/cache:        512       8368
Swap:         4095          0       4095

=========
ลบในเคื่อง Authen ครับ
#/etc/init.d/squid stop
#rm -Rf /var/spool/squid/*
#/etc/init.d/squid start

วันพุธที่ 24 ตุลาคม พ.ศ. 2555

ลบ cache


[root@log showsita]# /etc/init.d/squid restart
Stopping squid: ................                           [  OK  ]
Starting squid: .                                          [  OK  ]

วันเสาร์ที่ 13 ตุลาคม พ.ศ. 2555

ln -s /var/www/mrtg/

ln -s /var/www/mrtg/

ลบ link

rm -rf NAME

วันอังคารที่ 25 กันยายน พ.ศ. 2555

block download centos

#cp /etc/squid/squid.conf /etc/squid/squid.conf.backup

#nano /etc/squid/squid.conf

edit at
mark @ All line

delay_poll

#service squid restart
[OK]
[OK]

วันศุกร์ที่ 27 กรกฎาคม พ.ศ. 2555

mrtg ง่ายๆ


yum -y install net-snmp mrtg
wget -4 -O /etc/snmp/snmpd.conf www.icez.net/files/snmpd.conf
wget -4 -O /var/www/mrtg/mrtg-load.sh www.icez.net/files/mrtg-load.sh
chmod a+x /var/www/mrtg/mrtg-load.sh
/etc/init.d/snmpd restart
cfgmaker --global 'WorkDir: /var/www/mrtg' --global 'Options[_]: bits,growright' --no-down --zero-speed=1000000000 --noreversedns --output /var/www/mrtg/mrtg.cfg public@localhost
wget -4 -O /tmp/mrtg.cfg www.icez.net/files/mrtg.cfg
cat /tmp/mrtg.cfg >> /var/www/mrtg/mrtg.cfg
/bin/cp -fv /var/www/mrtg/mrtg.cfg /etc/mrtg/mrtg.cfg
echo "Alias /mrtg /var/www/mrtg" > /etc/httpd/conf.d/mrtg.conf
/sbin/chkconfig snmpd on
indexmaker /etc/mrtg/mrtg.cfg > /var/www/mrtg/index.html
if [ -d /usr/local/directadmin ]; then ln -s /var/www/mrtg /var/www/html/; fi
/etc/init.d/httpd graceful

ที่มา http://www.icez.net/blog/28/ลง-mrtg-บน-centosfedora-แบบง่ายๆ

วันพุธที่ 20 มิถุนายน พ.ศ. 2555

แสดงภาษาไทยใน centos php

#vi /etc/httpd/conf/httpd.conf

#AddDefaultCharset UTF-8
AddDefaultCharset TIS-620


nano /etc/httpd/conf/httpd.conf

แก้ AddDefaultCharset TIS-620

และในส่วนของ MySQL ก็ด้วยเหมือนกันครับ
nano /etc/my.cnf
[mysqld]
# เพิ่มเข้าไป #
default-character-set = tis620
character-set-server = tis620
collation-server = tis620_thai_ci
init_connect = 'SET collation_connection = tis620_thai_ci'
init_connect = 'SET NAMES tis620'

วันอังคารที่ 19 มิถุนายน พ.ศ. 2555

ติด ตั้ง MySQL on CentOS


9/07/2011

ติด ตั้ง MySQL on CentOS

ใช้คำสั่ง yum install mysql-server เพื่อติดตั้งโปรแกรม หลังจากติดตั้งเสร็จก็มา 

เริ่มใช้งาน MySQL
หลังจากที่ติดตั้งเสร็จแล้ว ใช้คำาสั่งให้ MySQL ทำางานตอนบูท ด้วยคำาสั่ง chkconfig และให้ service
ของ MySQL ทำางานด้วยคำาสั่ง service ชื่อ service ของ MySQL คือ mysqld 
[root@server1 ~]# chkconfig mysqld on
[root@server1 ~]# service mysqld start
Initializing MySQL database: [ OK ]
Starting MySQL: [ OK ]
จะเห็นว่าถ้าเราสั่ง ให้ MySQL ทำางานเป็นครั้งแรกก็จะมีการสร้างฐานข้อมูลตั้งต้นของ MySQL โดยดูได้จาก
ข้อความ Initializing MySQL database: จะมีข้อความนี้ครั้งแรกครั้งเดียว และ MySQL เริ่มทำางาน MySQL ทำางาน
แล้วก็สามารถใช้งาน MySQL ได้
ตั้งรหัสผ่านให้กับ user root ที่จะเข้าใช้งานฐานข้อมูล
เพื่อการรักษาความ ปลอดภัยของการเข้าถึงฐานข้อมูล มีความจำาเป็นจะต้องตั้งรหัสผ่านให้กับ user root ซึ่ง
เป็น user ที่จะติดต่อฐานข้อมูล โดยการใช้คำาสั่ง mysqladmin -u root password mypassword โดยที่ mypassword
คือ ผ่าน ต่อไปนี้การติดต่อฐานข้อมูลจะใช้ user root และรหัสผ่าน คือ mypassword
[root@server1 ~]# mysqladmin u
root password mypassword
[root@server1 ~]# mysql u
root p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.0.45 Source distribution
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql>
ออกจากการใช้งาน MySQL
mysql> \q
Bye
[root@server1 ~]#
หรือ
mysql> exit
Bye
[root@server1 ~]#
การใช้งาน user และ password ของ mysql
แบบแรก ให้ mysql ถามรหัสผ่าน
[root@server1 ~]# mysqladmin u
root password mypassword
[root@server1 ~]# mysql u
root p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.0.45 Source distribution
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> 
แบบที่ 2 ใส่รหัสผ่านต่อจากออปชัน -p
[root@server1 ~]# mysql u
root pmypassword
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 6
Server version: 5.0.45 Source distribution
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql>
ถ้าใส่รหัสผ่านผิดก็จะมีข้อความเตือน
[root@server1 ~]# mysql u
root p
Enter password:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using
password: YES)
[root@server1 ~]#
การสร้างฐานข้อมูล MySQL
สร้างฐานข้อมูลใหม่และดูชื่อฐานข้อมูล
[root@server1 ~]# mysqladmin creat newdb u
root p
Enter password:
[root@server1 ~]# mysql u
root p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 12
Server version: 5.0.45 Source distribution
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> show databases;
++
| Database |
++
| information_schema |
| mysql |
| newdb |
| test |
++
4 rows in set (0.00 sec)
mysql>
การนำาเข้าฐานข้อมูล และ backup ฐานข้อมูล
นำาเข้าฐานข้อมูลจากไฟล์ด้วย mysql newdb < /path/to/file.sql -u root -p
[root@server1 ~]# mysql newdb < /root/file.sql u
root p
Enter password: 
Backup ฐานข้อมูลด้วยคำาสั่ง dump
[root@server1 ~]# mysqldump dbname > /root/file_backup.sql u
root p
Enter password:
การเปลี่ยน password ของ user root ที่ใช้งานฐานข้อมูล MySQL
การเปลี่ยนรหัสผ่าน user root ของ MySQL แบบนี้ ท่านต้องจำารหัสผ่านเดิมได้
โดยการใช้คำาสั่งเหล่า นี้
[root@server1 ~]# mysql u
root p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 12
Server version: 5.0.45 Source distribution
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with A
Database changed
mysql> UPDATE mysql.user SET Password = PASSWORD('newpassword') WHERE
User = 'root';
Query OK, 0 rows affected (0.00 sec)
Rows matched: 3 Changed: 0 Warnings: 0
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
mysql>
หรือ
mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('newpassword‘);
โดยที่ newpassword เป็นรหัสผ่านใหม่ที่ต้องการเปลี่ยน ถ้าต้องการเปลี่ยนรหัสผ่านของผู้ใช้งานคนอื่น ก็
ให้ where ที่ user นั้นๆ
การอนุญาตให้ user ติดต่อฐานข้อมูลจากโฮสอื่น
โดยปกติ MySQL จะไม่อนุญาตให้ user root ติดต่อเข้ามาใช้ฐานข้อมูลจากเครื่องอื่น ถ้าจะทำาก็ทำาได้แต่ไม่
ควรทำา ทางที่ดีควรเพิ่ม user ใหม่เข้าไปและอนุญาตให้เฉพาะ user นั้นติดต่อฐานข้อมูลจากโฮสอื่นได้
mysql> grant all privileges on *.* to sothorn@'%';
Query OK, 0 rows affected (0.00 sec)
mysql> update user set Password=password('password') where
User='sothorn';
Query OK, 1 row affected (0.00 sec)
Rows matched: 1 Changed: 1 Warnings: 0
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec) 
จากคำาสั่งสามารถ อธิบายได้ว่า อนุญาตให้ user sothorn สามารถติดต่อฐานข้อมูลที่อยู่บนเครื่องนี้ ได้จากทุก
เครื่อง (%) โดยสามารถใช้งาน ได้ทุกฐานข้อมูลทุกตาราง (*.*) ถ้าอนุญาตบางฐานข้อมูลก็ใช้ ชื่อ db.* เช่น mydb.*
ทดสอบติดต่อฐานข้อมูล จากเครื่องอื่น
root@amdx2:~# mysql h
192.168.2.111 u
sothorn p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is
Server version: 5.0.45 Source distribution
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql>
วิธีแก้ปัญหาเมื่อลืม รหัสผ่านของ root ใน MySQL
มีความเป็นไปได้มากกับ การลืมรหัสผ่านของ user root ของ MySQL ไม่ต้องตกใจครับมีวิธีการแก้ปัญหา
ดังคำาสั่งดังต่อไปนี้
[root@server1 ~]# /etc/init.d/mysqld stop
[root@server1 ~]# /usr/bin/mysqld_safe user=
root skipgranttables
&
[root@server1 ~]# mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.0.45 Source distribution
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> UPDATE mysql.user SET Password = PASSWORD('newpassword‘) WHERE
User = 'root';
mysql> FLUSH PRIVILEGES;
mysq> \q
[root@server1 ~]# mysqladmin shutdown
[root@server1 ~]# /etc/init.d/mysqld start
จะเห็นว่าเราต้องหยุด การทำางานของ MySQL ก่อน แล้วจึงสั่งให้ MySQL ทำางานอีกครั้งหนึ่งโดยใช้
ออปชัน skipgranttables
หลังจากนั้นก็สามารถ เข้าใช้งาน MySQL ได้โดยไม่ต้องใส่รหัสผ่าน เมื่อเข้า
มาได้แล้วก็ทำาการ เปลี่ยนรหัสผ่านโดยใช้คำาสั่ง update
การอัพเกรด MySQL เป็นเวอร์ชันล่าสุด
CentOS 5.2 มาพร้อมกับ MySQL เวอร์ชัน 5.0.45 ถ้าต้องการเวอร์ชันที่ใหม่กว่านี้สามารถดาวน์โหลดได้ที่
http://dev.mysql.com/downloads/mysql/5.1.html หัวข้อ
• Linux x86 generic RPM (dynamically linked) downloads หรือ
• Linux AMD64 / Intel EM64T generic RPM downloads 
ขึ้นอยู่ CPU ที่ท่านใช้อยู่ โดยดาวน์โหลดทุกไฟล์ในหัวข้อที่ตรงกับ CPU ที่ท่านใช้งานอยู่ ดาวน์โหลดมา
เรียบร้อยแล้วให้ดำาเนินการ ดังนี้
1) ถ้ามีฐานข้อมูลอยู่ให้สำารองข้อมูลด้วยคำาสั่ง mysqldump เพื่อความปลอดภัย
2) หยุดการทำางานของ MySQL ด้วยคำาสั่ง /etc/init.d/mysqld stop
3) ลบ MySQL เวอร์ชันที่ติดมากับ CentOS5.2 โดยใช้คำาสั่ง yum remove mysql-server
4) ไฟล์ที่ดาวน์โหลดมามีดังนี้
[root@server1 mysql_install]# ls
MySQL-client-5.1.32-0.glibc23.i386.rpm MySQL-server-5.1.32-0.glibc23.i386.rpm
MySQL-debuginfo-5.1.32-0.glibc23.i386.rpm MySQL-shared-5.1.32-0.glibc23.i386.rpm
MySQL-devel-5.1.32-0.glibc23.i386.rpm MySQL-shared-compat-5.1.32-0.glibc23.i386.rpm
MySQL-embedded-5.1.32-0.glibc23.i386.rpm MySQL-test-5.1.32-0.glibc23.i386.rpm
5) ติดตั้งโดยใช้คำาสั่ง rpm -Uvh --force MySQL-*.rpm
[root@server1 mysql_install]# rpm Uvh
force
MySQL*.
rpm
Preparing... ########################################### [100%]
1:MySQLsharedcompat
########################################### [ 13%]
2:MySQLdevel
########################################### [ 25%]
3:MySQLclient
########################################### [ 38%]
4:MySQLdebuginfo
########################################### [ 50%]
5:MySQLembedded
########################################### [ 63%]
6:MySQLserver
########################################### [ 75%]
7:MySQLshared
########################################### [ 88%]
8:MySQLtest
########################################### [100%]
ติดตั้งเสร็จระบบจะสตา ร์ท MySQL ให้เองทันที เราก็สามารถเข้าใช้งานฐานข้อมูลได้เลยโดยใช้ ผู้ใช้ และ
รหัสผ่านเดิม
[root@server1 mysql_install]# mysql u
root p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.1.32 MySQL Community Server (Copyright 20002008
MySQL
AB, 2008 Sun Microsystems, Inc. All rights reserved. Use is subject
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql>
ข้อควรระวัง
ไฟล์ start script ที่อยู่ใน /etc/init.d/ ใน MySQL เวอร์ชันนี้จะชื่อ mysql ไม่ใช่ mysqld เหมือนเวอร์ชันเก่า
เพราะฉะนั้นเวลาสั่ง สตาร์ท mysql เวอร์ชันนี้ ต้องใช้คำาสั่ง /etc/init.d/mysql start หรือ service mysql start
ถ้าหากไม่คุ้นเคยก็สามารถเปลี่ยนชื่อไฟล์จาก /etc/init.d/mysql เป็น /etc/init.d/mysqld ได้เช่นกัน 

วันพุธที่ 9 พฤษภาคม พ.ศ. 2555

รายงานการพัฒนาบทเรียนคอมพิวเตอร์ช่วยสอน ชุด เศรษฐศาสตร์ในชีวิตประจำวัน กลุ่มสาระการเรียนรู้สังคมศึกษา ศาสนา และวัฒนธรรม สำหรับนักเรียนชั้นประถมศึกษาปีที่ 3 โรงเรียนไขศรีปราโมชอนุสรณ์

ผู้รายงาน : นางสาวพิศมัย พาละพล
ปีที่ศึกษา : 2554
บทคัดย่อ
         การศึกษาการพัฒนาบทเรียนคอมพิวเตอร์ช่วยสอน ชุด เศรษฐศาสตร์ในชีวิตประจำวัน กลุ่มสาระการเรียนรู้สังคมศึกษา ศาสนา และวัฒนธรรม สำหรับนักเรียนชั้นประถมศึกษาปีที่ 3 โรงเรียนไขศรีปราโมชอนุสรณ์ ครั้งนี้มีวัตถุประสงค์เพื่อหาประสิทธิภาพของบทเรียนคอมพิวเตอร์ช่วยสอน ชุด เศรษฐศาสตร์ในชีวิตประจำวัน กลุ่มสาระการเรียนรู้สังคมศึกษา ศาสนา และวัฒนธรรม สำหรับนักเรียนชั้นประถมศึกษาปีที่ 3 เพื่อเปรียบเทียบผลสัมฤทธิ์ทางการเรียนของนักเรียนชั้นประถมศึกษาปีที่ 3 ก่อนและหลังเรียนจากบทเรียนคอมพิวเตอร์ช่วยสอน ชุด เศรษฐศาสตร์ในชีวิตประจำวัน กลุ่มสาระการเรียนรู้สังคมศึกษา ศาสนา และวัฒนธรรม และศึกษาความคิดเห็นของนักเรียนชั้นประถมศึกษาปีที่ 3 ที่มีต่อจัดการเรียนการสอนโดยใช้บทเรียนคอมพิวเตอร์ช่วยสอน ชุด เศรษฐศาสตร์ในชีวิตประจำวัน กลุ่มสาระการเรียนรู้สังคมศึกษา ศาสนา และวัฒนธรรม
         กลุ่มตัวอย่างที่ใช้ในการศึกษาครั้งนี้ ได้แก่ นักเรียนชั้นประถมศึกษาปีที่ 3/2 โรงเรียน ไขศรีปราโมชอนุสรณ์ ได้มาโดยการเลือกแบบเจาะจง เป็นห้องที่ผู้รายงานได้รับมอบหมายให้ดำเนินการสอนในภาคเรียนที่ 2 ปีการศึกษา 2554 จำนวน 38 คน
         เครื่องมือที่ใช้ในการศึกษา ได้แก่ บทเรียนคอมพิวเตอร์ช่วยสอน ชุด เศรษฐศาสตร์ในชีวิตประจำวัน แบบทดสอบวัดผลสัมฤทธิ์ทางการเรียน แบบฝึกหัด และแบบสอบถามความคิดเห็นของนักเรียนที่มีต่อการจัดการเรียนการสอนโดยใช้บทเรียนคอมพิวเตอร์ช่วยสอน ชุด เศรษฐศาสตร์ในชีวิตประจำวัน
         สถิติที่ใช้ในการวิเคราะห์ข้อมูลได้แก่ ค่าร้อยละ ค่าเฉลี่ย ส่วนเบี่ยงเบนมาตรฐาน การทดสอบสมมติฐานใช้ t-test

ผลการศึกษาพบว่า
1. บทเรียนคอมพิวเตอร์ช่วยสอน ชุด เศรษฐศาสตร์ในชีวิตประจำวัน กลุ่มสาระการเรียนรู้สังคมศึกษา ศาสนา และวัฒนธรรม สำหรับนักเรียนชั้นประถมศึกษาปีที่ 3 มีประสิทธิภาพเท่ากับ 83.95/82.76
2. นักเรียนมีผลสัมฤทธิ์ทางการเรียนหลังเรียนจากบทเรียนคอมพิวเตอร์ช่วยสอน ชุด เศรษฐศาสตร์ในชีวิตประจำวัน กลุ่มสาระการเรียนรู้สังคมศึกษา ศาสนา และวัฒนธรรม สำหรับนักเรียนชั้นประถมศึกษาปีที่ 3 สูงกว่าก่อนเรียน มีความแตกต่างกันอย่างมีนัยสำคัญทางสถิติ ที่ระดับ .05
3. นักเรียนมีความคิดเห็นต่อการจัดการเรียนการสอนโดยใช้บทเรียนคอมพิวเตอร์ช่วยสอน ชุด เศรษฐศาสตร์ในชีวิตประจำวัน กลุ่มสาระการเรียนรู้สังคมศึกษา ศาสนา และวัฒนธรรมสำหรับนักเรียนชั้นประถมศึกษาปีที่ 3 ในภาพรวมอยู่ในระดับมากที่สุด

ปัญหาใหม่

ปัญหาใหม่
  1. ข้อมูลในฮาร์ดดีสก์หาย กู้โดยใช้โปรแกรม Recover My Files
  2. ลืมแบ่งพาทิชั่นใช้โปรแกรม MiniTool Partition Wizard Home Edition
โอเค เลย

วันอังคารที่ 17 เมษายน พ.ศ. 2555

ดูการทำงานของ log

tail -f /var/log/squid/access.log

tail -f /var/log/messages

การอ้างอิง

การเขียนอ้างอิงจากหนังสือ
ให้เขียนข้อความก่อน (ชื่อผู้เขียน.^ปีพ.ศ:หน้า)

การเขียนอ้างอิงจากงานวิจัย
จากงานวิจัยของ ชัยฤทธิ์ ตอนปัญญา (ปีพ.ศ.) เรื่อง

วันเสาร์ที่ 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

วันอังคารที่ 21 กุมภาพันธ์ พ.ศ. 2555

centos apache php mysql

ใช้คำสั่งนี้เลย

#yum install httpd php <-----เป็นทั้งหมดที่ท่าน ลง อันนี้มันจะอัพให้ใหม่ล่าสุดไปเลยถ้าผมเข้าใจไม่ผิด แต่เครื่องต้องต่อเน็ตนะ

#service httpd restart

อีกโปรแกรมที่ ควรลงนะครับผมแนะนำให้

#yum install lynx ใช้เข้าแทน web browser ใช้ในการโหลดต่างๆ ได้ครับใช้ถูกไถแทน webbrowser ได้แต่มันอ่านภาษาไทยไม่ออกนะ

แล้วอีก อย่างครับท่าน web server ไม่มีฐานข้อมูลรึ แถมให้อีกอันครับ

#yum install mysql-server
#yum mysql-server start

เป็นฐานข้อมูลนะจ๊ะ

วันศุกร์ที่ 3 กุมภาพันธ์ พ.ศ. 2555

/etc/init.d/name start/stop/reload

ชื่อไฟล์คือชื่อ service ทั้งหมดที่เรามีในเครื่องนี้
โดยปกติแล้วสามาร start stop ได้โดยคำสั่ง
service (name) start
service (name) stop
service (name) restart
หรือ ⁄etc⁄init.d⁄(name) start ก็ได้เช่นกัน
ตัวอย่างการ start ตัว apache webserver
service httpd start
การ restart mysql
service mysqld restart

วันพุธที่ 11 มกราคม พ.ศ. 2555

แสดงภาษาไทยใน centos php

#vi /etc/httpd/conf/httpd.conf

#AddDefaultCharset UTF-8
AddDefaultCharset TIS-620

update php mysql centos

http://phnu07.org/app/thread-69-1-1.htmla