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

Server and Desktop Differences

Server and Desktop Differences

There are a few differences between the Ubuntu Server Edition and the Ubuntu Desktop Edition. It should be noted that both editions use the same apt repositories. Making it just as easy to install a server application on the Desktop Edition as it is on the Server Edition.
The differences between the two editions are the lack of an X window environment in the Server Edition, the installation process, and different Kernel options.

Kernel Differences:

  • The Server Edition uses the Deadline I/O scheduler instead of the CFQ scheduler used by the Desktop Edition.
  • Preemption is turned off in the Server Edition.
  • The timer interrupt is 100 Hz in the Server Edition and 250 Hz in the Desktop Edition.
  • The Server Edition is optimized for i686 processors while the Desktop Edition is optimized for both the i586 and i686.
  • Virtualization is better supported in the Server Edition through the enabling of IPC namespaces, and the Xenhypervisor.
  • Multiple routing tables for the IPv6 protocol are also supported in the Server Edition.
  • For 32-bit systems the Server Edition is configured to use PAE which allows addressing up to 64GB of memory while the Desktop Edition is configured for 4GB.
[Note]
When running a 64-bit version of Ubuntu on 64-bit processors you are not limited by memory addressing space.
To see all kernel configuration options you can look through /boot/config-2.6.22-server. Also, Linux Kernel in a Nutshell is a great resource on the options available.

Backing Up

  • Before installing Ubuntu Server Edition you should make sure all data on the system is backed up. See Chapter 16,Backups for backup options.
    If this is not the first time an operating system has been installed on your computer, it is likely you will need to re-partition your disk to make room for Ubuntu.
    Any time you partition your disk, you should be prepared to lose everything on the disk should you make a mistake or something goes wrong during partitioning. The programs used in installation are quite reliable, most have seen years of use, but they also perform destructive actions.

คำสั่งตรวจสอบเครือข่าย

คำสั่งพื้นฐานในการตรวจสอบระบบเครือข่าย 
การเข้าใช้งาน Command Line
Start > Run...> cmd [enter] > Demo

คำสั่งทดสอบการเชื่อมต่อไปยังเครื่องปลายทาง
ping pc1 [enter] ทดสอบ computer name
ping 192.168.0.15 [enter] ทดสอบโดยใช้หมายเลขไอพีเครื่องที่ต้องการ
ping www.yahoo.com [enter] ทดสอบเว็บไซต์ภายนอก > Demo
ping www.yahoo.com -t [enter] ทดสอบเว็บไซต์ภายนอกแบบต่อเนื่อง > Demo
pathping 192.168.0.15 [enter] ตรวจสอบระยะห่างของเครื่องคอมพิวเตอร์ปลายทาง > Demo

ตรวจสอบรายละเอียดเครื่องคอมฯ ออนไลน์
net   view  [enter] ตรวจสอบ computer name ใน workgroup เดียวกัน > Demo
net  view /domain [enter] ตรวจสอบรายชื่อโดเมนในระบบเครือข่าย > Demo
ืnet   view /domain:PHP [enter] ตรวจสอบรายชื่อ computer name ในโดเมน PHP > Demo
net   share [enter] ดูไฟล์ในเครื่องที่แชร์อยู่ > Demo
net   session [enter] ตรวจสอบผู้ใช้ที่เข้าใช้งานเครื่องเรา > Demo
net   help [enter] แสดงออปชั่นย่อยภายในคำ net > Demo
net  help time [enter] แสดงวิธีการเรียกใช้งานคำสั่งย่อย > Demo

ตรวจสอบสถิติการใช้งาน
netstat -n [enter] ตรวจสอบสถิติไอพี/บริการ ที่เราใช้งานอยู่ > Demo
netstat -an [enter] ตรวจสอบสถิติทั้งโปรโตคอล TCP และ UDP > Demo
netstat -s -p tcp [enter] ตรวจสอบ Retransmission บน TCP/IP > Demo

ตรวจสอบรายละเอียด IP Address / Hostname
ipconfig > ตรวจสอบ ip address / subnet mask / gateway > Demo
ipconfig /all > ตรวจสอบ ip address / subnet mask / gateway / dns > Demo
ipconfig /displaydns > ตรวจสอบ DNS > Demo 

nbtstat -A 192.168.3.148 [enter] ดูตารางชื่อเครื่องและรายละเอียดต่างๆ (NetBIOS Remote Machine Name Table) > Demo

telnet 192.168.0.12 [enter] ทำการ remote ไปยังเครื่อง Linux Server ที่เปิดบริการ Telnet

route print [enter] ดูตาราง Routing table > Demo

tracert www.redhat.com [enter] แกะรอยแส้นทางเครือข่ายโดยใช้ domain name > Demo
tracert 203.107.139.192 [enter] แกะรอยแส้นทางเครือข่ายโดยใช้ ip address

ftp ftp.redhat.com [enter] ใช้บริการ file transfer protocol


ตรวจสอบ Name Server
nslookup www.nortbkk.ac.th [enter] สอบถามชื่อโฮสต์และไอพี
nslookup [enter]
> www.northbkk.ac.th
> mail.northbkk.ac.th
> proxy.northbkk.ac.th
> set type=ns ตรวจสอบ Name Server  
> northbkk.ac.th
> set type=mx ตรวจสอบ Mail Exchange    
> northbkk.ac.th
> exit

การตรวจสอบรายละเอียดเครื่องเซิร์ฟเวอร์
hostname > ตรวจสอบ host name > Demo
net config server > ตรวจสอบการคอนฟิกเซิร์ฟเวอร์ เช่น ชื่อเครื่อง, OS ที่ใช้ > Demo
net config workstation > ตรวจสอบการคอนฟิกเซิร์ฟเวอร์ เช่น ชื่อเครื่อง, OS ที่ใช้ > Demo
net statistics server > ดูสถิติเซิร์ฟเวอร์ > Demo
net statistics workstation > ดูสถิติไคลเอนต์ > Demo

การเปลี่ยนรายละเอียด Computer Description ทาง Command
รูปแบบnet config server  /srvcommant: "รายละเอียดที่ต้องการ"
เช่น 

net config server  /srvcommant: "Arnut Ruttanatirakul"
การตรวจสอบ- ไปคลิกขวาที่ My Computer > Properties > คลิกแท็บ Computer name > ดูผลการเปลี่ยนแปลงที่ Computer Description
Windows Utility - คำสั่งในการจัดการด้านฮาร์ดแวร์
taskmgr > เรียกใช้งาน Task Manager
msconfig > เรียกใช้งาน System Configuration Utility
sysedit > เรียกใช้งาน System Configuration Editor
inetmgr
 > เรียกใช้งาน Internet Information Services (กรณีมีบริการติดอยู่ก่อนหน้าแล้ว)
regedit > เรียกใช้งาน Registry Editor
services.msc 
   > เรียกใช้งานหน้าต่าง Services ของระบบ Windows
gpedit.msc > เรียกใช้งาน Group Policy
mmc > เรียกใช้งาน Microsoft Management Console 
perfmon > เรียกใช้งาน Performace
net start > ตรวจสอบเซอร์วิสที่รันอยู่ > Demo 

Windows Components - โปรแกรมที่ติดมาพร้อมวินโดส์ว
notepad > เรียกใช้งาน Notepad
calc > เรียกใช้งาน Calculator
winchat > เรียกใช้งาน Winchat
winmine > เรียกใช้งานเกมส์ Winmine


คำสั่งอื่นๆ ที่ควรรู้จัก
path > ตรวจสอบพาท
ver > ตรวจสอบเวอร์ชั่นของ windows
set > ตรวจสอบค่าของระบบที่ใช้งานอยู่


คำสั่งสำหรับตรวจสอบพาทระบบ
สามารถเข้าตรวจสอบได้ผ่านทาง DOS Prompt
- Start > Run > cmd > OK
echo %OS%  > ตรวจสอบชื่อ OS
echo %PATH% > ตรวจสอบพาทระบบที่ใช้งานอยู่
echo %PATHEXT% > ตรวจสอบนามสกุลไฟล์ประเภท Exceute
echo %Temp%  > ห้องเก็บ Temp ไฟล์
echo %Number_of_Processors%  > จำนวน CPU ที่ใช้งานอยู่
echo %WinDir%  > ห้องเก็บระบบปฏิบัติการ
echo %Processor_Architecture%  > ตรวจาสอบสถาปัตยกรรม CPU
echo %SystemRoot% > ตรวจสอบระบบปฏิบัติการ

Bonus

การตั้งเวลาให้เครื่องลูกข่ายทุกเครื่องใช้เวลาเดียวกันกับเครื่องเซิร์ฟเวอร์
net time \\server_name /set /yes

การเปลี่ยนสีของ Command Line
รูปแบบ
color [background][foreground]
เข่น
color 2A [enter]
color /?   ค่าสีต่างๆ 

0 = Black
8 = Gray
1 = Blue
9 = Light Blue
2 = Green
A = Light Green
3 = Aqua
B = Light Aqua
4 = Red
C = Light Red
5 = Purple
D = Light Purple
6 = Yellow
E = Light Yellow
7 = White
F = Bright White

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

Endian บล็อกคำในเว็บ

ใครต้องการให้ Endian บล็อกคำต้องห้ามได้ ลองตามนี้ดูครับ

1. remote
เข้า endian ด้วย puty
2.
แก้ไขไฟล์ squid.conf ด้วยคำสั่ง   nano /etc/squid/squid.conf
3. 
ในช่วง ของ #network-acls  ให้เพิ่ม  
acl lock url_regex -i
ตามด้วยคำที่ต้องการ block  เช่น ต้องการบล็อกคำว่า nude clip porn adult

acl lock url_regex -i nude clip porn adult
http_access deny lock

4.
บันทึกไฟล์ squid.conf ด้วยคำสั่ง Ctrl+O กด Enter 1 ครั้ง และ Ctrl +X)
5.
ทำการรีสตาร์ squid ด้วยคำสั่ง  squid -k reconfigure
เท่านี้เองครับ

Restart Auto Linux


เข้าไปใส่ใน /etc/crontab ด้วยคำสั่ง nano /etc/crontab 

SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=
HOME=/

#
&nolog */1 * * * *      [ -x /bin/run-parts ] && run-parts --report /etc/cron.minutely
&nolog */5 * * * *      [ -x /bin/run-parts ] && run-parts --report /etc/cron.cyclic
01  * * * *     [ -x /bin/run-parts ] && run-parts --report /etc/cron.hourly
25  1 * * *     [ -x /bin/run-parts ] && run-parts --report /etc/cron.daily
47  2 * * 0     [ -x /bin/run-parts ] && run-parts --report /etc/cron.weekly
52  3 1 * *     [ -x /bin/run-parts ] && run-parts --report /etc/cron.monthly

#เพิ่มบรรทัดนี้เพื่อ  Shutdown Endian
00  20 * * *     /sbin/poweroff

#เพิ่มบรรทัดนี้เพื่อ  Reboot Endian
00 19 * * *  /sbin/reboot

#
@nolog 5        [ -x /bin/run-parts ] && run-parts --report /etc/anacron.cyclic
@ 1h    [ -x /bin/run-parts ] && run-parts --report /etc/anacron.hourly
@ 1d    [ -x /bin/run-parts ] && run-parts --report /etc/anacron.daily
@ 1w    [ -x /bin/run-parts ] && run-parts --report /etc/anacron.weekly
@ 1m    [ -x /bin/run-parts ] && run-parts --report /etc/anacron.monthly

# Summarize ip accounting info:
2 1 * * *       /usr/sbin/ipacsum -r -H `/bin/hostname` -t "the day 2 days ago" >/dev/null
3 1 * * 0       /usr/sbin/ipacsum -r -H `/bin/hostname` -t "the week 4 weeks ago" >/dev/null
4 1 1 2 *       /usr/sbin/ipacsum -r -H `/bin/hostname` -t "the year 2 years ago" >/dev/null


แล้ว กด ctrt+x แล้ว กด Y ครับ
restart crontab
ด้วยคำสั่ง /etc/init.d/fcron restart

iFolder-Open Source


ทำไมต้องใช้ iFolder ?
ถ้า พูดถึืงเรื่องการแชร์ไฟล์ โดยมีเซิร์ฟเวอร์เป็นศูนย์กลางข้อมูลนั้น ถ้าให้ใช้โปรแกรมในระดับ Enterprise ที่ไม่ใช้ Open Source ก็คงหลายแสนบาทครับ ในจะค่า Implement, Install, Support เป็นต้น
ใน ปัจจุบัน หลายๆ องค์กรที่มีสาขาอยู่ต่างจังหวัด ในการเข้าถึงข้อมูลยังต้องใช้งานผ่าน vpn (site-to-site) แล้วทำการ remote มาใช้โปรแกรมหรือ ข้อมูลต่างๆ ที่ Center (กรุงเทพฯ) โดยผ่านโปรแกรมที่ได้รับความนิยมอย่างเช่น Citrix ICA เป็นต้น
หรือ บางองค์กรที่มีสาขาไม่มาก ก็ใช้ vpn pptp เข้ามาที่เซิร์ฟเวอร์ แล้วใช้ smb เข้าสู่ข้อมูลที่แชร์ไว้ ซึ่งทุกๆ กรณีที่กล่างมา ถ้า อินเทอร์เน็ตลิงค์ vpn ลุ่ม สาขาก็ไม่สามารถใช้งานข้อมูลต่างๆ ได้.
หลักการทำงานของ iFolder Enterprise Server คราวๆ ไฟล์จะถูกเก็บไว้ที่ local ของสาขาแต่ละที่ ถึืงลิงค์ vpn ลุ่ม ผู้ใช้งานยังสามารถใช้ไฟล์ต่างๆ ได้ เมื่อลิงค์ up ขึ้นมา ข้อมูลจะทำการ Sync ไปยัง iFolder Server เองอัตโมนัติ.
Data Access & Security
เข้าถึง ไฟล์ด้วยการพิสุทธิตัวตน (Authentication) จาก LDAP Server
Encryption
สนับสนุนการเข้ารหัส ระหว่างการสื่อสารด้วย SSL
Cross-Platform
สนับ สนุน Linux, Macintosh, Windows
Multi-Server
สามารถทำงานร่วมกันหลายๆ เซิร์ฟเวอร์ได้ และสนับสนุนระบบ Clustering
(Master/Slave Server)
LDAPGroup
สนับสนุนการตรวจสอบตัวตนด้วย Group Users จาก LDAP Server
Web Administration Management
ควบคุมและบริหารไฟล์ที่ศูนย์กลาง ข้อมูลผ่าน web-base
Policies
สามารถ กำหนดนโยบายต่างๆ ได้ เช่น Limit per User, Disk Quota, Disable Account, File size limit, Limit Create folder, Synchronization Interval เป็นต้น.
Accessible From Anywhere
เข้าถึงการ ใช้ไฟล์ของคุณจากทุกๆ ที่