วันจันทร์ที่ 18 กุมภาพันธ์ พ.ศ. 2556

Install Webmin in FreeBSD

ติดตั้ง perl ก่อน
#cd /usr/ports/lang/perl5.10
#make install clean

ติดตั้ง webmin
#cd /usr/ports/sysutils/webmin
#make install clean

หลังจากติดตั้งเสร็จแล้ว ให้ใช้คำสั่ง เพื่อตั้งค่าการเข้า webmin
# /usr/local/lib/webmin/setup.sh
กำหนดค่าต่างๆให้เรียบร้อย

เริ่มการทำงานของ webmin
# /usr/local/etc/webmin/start

เปิด Browser แล้วเพิ่มไอพี server สำหรับเข้า webmin
https://ipserver:10000


ตั้ง Auto Start ทุกครั้งตอนบูตเครื่องใหม่
เข้าไปที่ rc.conf
#pico /etc/rc.conf

เพิ่มไปว่า
webmin_enable="YES"


ขั้นตอนการติดตั้ง Apache + Mysql + PHP FreeBSD9


ขั้นตอนการติดตั้ง  Apache + Mysql + PHP

1 ) ทำการติดตั้ง Freebsd ให้เรียบร้อย
2 ) หลังจากติดตั้ง Freebsd เสร็จให้ทำการ ติดตั้ง Mysql ก่อน ซึ่งมีวิธีการดังนี้

cd /usr/ports/databases/mysql55-server
make WITH_CHARSET=tis620 WITH_XCHARSET=all WITH_COLLATION=tis620_thai_ci install clean

* ทำการติดตั้ง Mysql 5.5.x โดยติดตั้ง ให้สนับสนุน tis-620 บน Mysql
echo 'mysql_enable="YES"' >> /etc/rc.conf
/usr/local/etc/rc.d/mysql-server start
rehash
ทำการ rehash เพื่อ อัพเดทคำสั่ง mysql ต่าง ๆ โดยไม่ต้อง reboot เครื่อง

เมื่อทำการเปิดใช้งาน mysql แล้ว ให้ท่านทำการเปลี่ยน รหัสผ่านของ root mysql ก่อน ด้วยคำสั่ง
mysqladmin -u root password '123456'
โดย '123456' นั้น คือ รหัสผ่าน ที่จะตั้งให้ root ซึ่ง ควรตั้งรหัสผ่านให้ยาก ๆ นะครับ

3 ) ทำการติดตั้ง Apache 2.2.x ผ่าน Freebsd port

cd /usr/ports/www/apache22
make install clean
echo 'apache22_enable="YES"' >> /etc/rc.conf
/usr/local/etc/rc.d/apache22 start

4) ทำการติดตั้ง PHP 5.3.x ผ่าน Freebsd Port
cd /usr/ports/lang/php5
make install clean
เมื่อทำการติดตั้ง PHP เสร็จ ระบบจะไป config ให้ apache built-in php module อัตโนมัติ ให้เราทำการ restart apache ด้วยวิธีการ
/usr/local/etc/rc.d/apache22 restart
ก็จะเสร็จสิ้น กระบวนการติดตั้ง  Apache + Mysql + PHP แบบง่าย ๆ แต่มีประสิทธิภาพ

อ้างอิง http://info.onlineoops.com/64

วันอาทิตย์ที่ 17 กุมภาพันธ์ พ.ศ. 2556

FreeBSD แก้ปัญหา Database Server เต็ม

db server
"Public IP"
cd /var/log
du -h *
ให้สังเกตไฟล์ที่มีขนาดใหญ่
5.7G httpd-access.log
3.2G httpd-error.log
สองไฟล์นี้ลบได้เลย
หรือยังไปไว้ที่อื่น
/data
ย้ายสองไฟล์นี้ไปไว้ที่ /data ก่อนก็ได้
#rm httpd-access.log httpd-error.log
#touch httpd-access.log
#touch httpd-error.log
สั่งให้ apache ทำงานใหม่
#/usr/local/sbin/apachectl restart

FreeBSD - DHCP ไม่จ่ายไอพี

dhcp server

dhcp3# tail -f /var/log/messanges

ถ้ามี DHCPDISCOVER ---- no free leasese = dhcp ไม่แจกไอพี

ให้ทำดังนี้ คือ stop dhcp server
dhcp# /usr/local/etc/rc.d/isc-dhcpd stop

เข้าเว็บ
http://172.16.11.6:10000
user: ใส่ User
pass: ใส่ Password

เมนู server -- dhcp server -- กดปุ่ม start server

เข้า dhcp3# tail -f /var/log/messanges
หากไม่ขึ้น DHCPDISCOVER แล้ว แสดงว่าปกติ

DHCP ไม่ทำงาน On FreeBSD

ใน web  start server แล้ว ขึ้น Filed Start DHPC
วิธีแก้ไขดังนี้

dhcp3# ps ax | grep dhcp
1053  ??  Ss     2:24.68 /usr/local/sbin/dhcpd -q -cf /usr/local/etc/dhcpd.con
43150   0  S+     0:00.00 grep dhcp
dhcp3# kill -9 1053
dhcp3# ps ax | grep dhcp

หลังจากนั้นให้เข้าที่ 172.16.11.6:10000
Server -- DHCP Server
แล้วกดปุ่ม Start Server

FreeBSD วิธีการลบไฟล์ขยะในกรณีเนื้อที่เต็ม

วิธีการลบไฟล์ขยะในกรณีเนื้อที่เต็ม
เว็บ web.abc.ac.th

secure shell
IP นี้  หรือ  IP นี้
user : ใส่ USERNAME
pass : ใส่ PASSWORD

su
pass: ใส่ password

user: root   
pass : ใส่ password

ดูขนาดไฟล์ทั้งหมด
/var
du -h
ls -la
ดูผ่านเว็บ http://web.abc.ac.th:10000/
เข้าหัวข้อ Server
sendmail Mail Server
เลือกดู User Mailbox
ดูไฟล์ไหนใหญ่ ลบทิ้งได้เลย

ลบไฟล์ใน  cd /var/mail
rm www
touch www
chown www:www www

rm root
touch root
chown root:wheel root

ลบใน
rm -rf /var/spool/clientmqueue/*


เข้า cd /var/log
cp httpd_access.log /usr/httpd-access.log หรือ

rm httpd-access.log
touch httpd-access.log
chown root:wheel httpd-access.log

rm httpd-error.log
touch httpd-error.log
chown root:wheel httpd-error.log

สั่งให้ apache ทำงานใหม่
#/usr/local/sbin/apachectl restart

ดูไดเรคทอรีใน /var
แล้วดูว่าไฟล์ไหนใหญ่ ขนาดเป็นกิ๊ก ลบออก
du -h (filename)cd

# cd /var/spool
# find clientmqueue -exec rm {} \;
or
# find clientmqueue -exec rm {} +

rm clientmqueue
touch clientmqueue
chown root:wheel clientmqueue

ติดตั้ง WebMin บน Ubuntu

sudo apt-get install perl libnet-ssleay-perl openssl libauthen-pam-perl libpam-runtime libio-pty-perl apt-show-versions python

wget http://prdownloads.sourceforge.net/sourceforge/webadmin/webmin_1.690_all.deb

wget http://10.10.2.108/software/webmin_1.730_all.deb

sudo dpkg --install webmin_1.690_all.deb

This will install webmin now you need to access

https://ubuntu-serverip:10000

Config Network Ubuntu หลังจากติดตั้งเสร็จใหม่ๆ

หากต้องการใช้เลข IP แบบ fix ก็ต้องตั้งค่าเองในแฟ้ม /etc/network/interfaces เป็นตัวอย่างประมาณว่า

auto eth0
iface eth0 inet static
address 172.16.11.222
netmask 255.255.255.0
gateway 172.16.11.1
dns-nameservers 202.29.32.1 202.129.27.133 8.8.8.8


และต้องแก้ไขแฟ้ม /etc/resolv.conf เป็นตัวอย่างประมาณว่า
nameserver 202.29.32.1

แล้วสั่งให้ network ทำงานใหม่ด้วยคำสั่ง sudo /etc/init.d/networking restart

ทดสอบว่า network ใช้งานได้แล้ว โดยลองปรับตั้งเวลากับสากลด้วยคำสั่ง

sudo ntpdate pool.ntp.org

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install ubuntu-desktop

วันพุธที่ 13 กุมภาพันธ์ พ.ศ. 2556

วิธีการ Recovery Password User ใน Fedora


1.บูตเครื่อง หรือเปิดเครื่องใหม่ แล้วกดปุ่ม F4 ย้ำๆ จนเข้าหน้า GNU GRUB

2.กดปุ่ม a เพื่อเข้าหน้า Prompt

 3.ด้านหลังสุดที่ต่อจาก quiet ให้พิมพ์ เลข 1 เข้าไป แล้วกด Enter

 4.จะได้หน้า root ดังภาพ

 5.ให้พิมพ์ passwd  สำหรับเปลี่ยนรหัสของ root password
แล้วกรอก password ใหม่ลงไป

6.หากต้องการเปลี่ยน Password ของ User Account ภายใน ให้ใช้คำสั่งดังนี้
ตัวอย่าง User ชื่อว่า test   ให้เปลี่ยนดังนี้
passwd [ชื่อ User]  ==>  passwd test

7.เสร็จแล้วใช้คำสั่ง reboot เพื่อรีสตาร์ทเครื่องใหม่

วันพฤหัสบดีที่ 7 กุมภาพันธ์ พ.ศ. 2556

Monitor ระบบด้วย ManageEngine Free Tools

ManageEngine Free Tools

สำหรับผู้ที่ดูแลระบบ ใช้โปรแกรมเหล่านนี้เป็นเครื่องมือที่ใช้ในการดูการทำงานของเครื่องแม่ข่ายทั้งหมดได้ โดยเครื่องมือมีอย่างเพียงพอสำหรับการใช้งานโดยทั่วๆไป ซึ่งข้อดีคือสามารถโหลดใช้งานได้ฟรี แต่หากต้องการใช้งานที่มี Option มากกว่านนี้ แนะนำให้ใช้โปรแกรม Opmanager ซึ่งมีเครื่องมือที่ใช้ในการจัดการที่หลากหลายมากกว่า
http://www.manageengine.com/free-tools.html

วันพุธที่ 6 กุมภาพันธ์ พ.ศ. 2556

แก้ปัญหา cmd.exe รัน 100% ตลอดเวลา

เปิด Notepad ขึ้นมาแล้ว Copy Code ข้างล่างนี้ลงไปวางใน Notepad นะครับ แล้ว Save เป็นชื่อ Block.bat นะครับ เสร็จแล้วให้รัน ไฟล์ Block.bat มันเลยครับ จากนั้นให้ Restart เลยนะครับ
taskkill /f /IM hale.exe
del / f /s /q “C:\Windows\System32\hale.exe”
del /f /a /q “%USERPROFILE%\Local Settings\Temp”\*.exe
del /f /a /q “%USERPROFILE%\Local Settings\Temp”\*.tmp
Reg delete HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run /v “Chew7Hale” /f
reg add HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer /v Disallowrun /t Reg_dword /d 1 /f
reg add HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\DisallowRun /v 1 /t Reg_SZ /d “Internet Protection.dll” /f
reg add HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\DisallowRun /v 2 /t Reg_SZ /d “hale.exe” /f
reg add HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\DisallowRun /v 3 /t Reg_SZ /d “GenericAskToolbar.dll” /f
reg add
reg add HKLM\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer /v Disallowrun /t Reg_dword /d 1 /f
reg add HKLM\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\DisallowRun /v 1 /t Reg_SZ /d “Internet Protection.dll” /f
reg add HKLM\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\DisallowRun /v 2 /t Reg_SZ /d “hale.exe” /f
reg add HKLM\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\DisallowRun /v 3 /t Reg_SZ /d “GenericAskToolbar.dll” /f
รันเสร็จแล้วให้ Restart แล้วดูผลอีกทีนะครับ
*** ปิด Process ของ cmd ใน taskmanager ก่อน แล้วค่อยกด run

Block Website ง่ายๆ

1. Click Run
2. ในช่อง Open พิมพ์ตามนี้ c:/windows/system32/drivers/etc/hosts
3. Click OK
4. จะขึ้นให้เลือกว่าจะเปิดกับโปรแกรมใด เลือก Notepad
5. จะขึ้นรายละเอียดในหน้า Notepad
6. ให้พิมพ์ 127.0.0.1 แล้วต่อด้วยชื่อ website ที่ต้องการ block  [ 1 บรรทัด ต่อ 1 เว็บไซต์ ]

7. หลังจากใส่เว็บที่ต้องการเสร็จแล้ว กดเมนู File – save
8. หากต้องการยกเลิก ทำตั้งแต่ ข้อ 1-5
9. แล้วก็ลบส่วนเว็บที่ต้องการให้แสดงตามปกติ เว็บก็จะสามารถเข้าใช้งานได้ตามปกติ

เปิด Word 2003 ช้ามาก

วิธีที่จะแก้ไข ก้อมีอยู่ว่า
1. ให้ทำการ rename file Normal.dot ให้ เป็น Normal.old
ใน C:\documents and Settings\username\Application data\Microsoft\Templates

สำหรับ Windows 10
C:\Users\ADMIN\AppData\Roaming\Microsoft\Templates