<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Just My Life &#187; Server</title>
	<atom:link href="http://imrgill.com/category/server/feed/" rel="self" type="application/rss+xml" />
	<link>http://imrgill.com</link>
	<description>I&#039;m mrGilL, I&#039;m Newbie Admin</description>
	<lastBuildDate>Fri, 18 May 2012 06:47:32 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Zentyal RADIUS EAP/TLS Authentication Fail</title>
		<link>http://imrgill.com/2012/05/18/zentyal-radius-eaptls-authentication-fail.html</link>
		<comments>http://imrgill.com/2012/05/18/zentyal-radius-eaptls-authentication-fail.html#comments</comments>
		<pubDate>Fri, 18 May 2012 06:44:10 +0000</pubDate>
		<dc:creator>mrgill</dc:creator>
				<category><![CDATA[Daily tips]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[802.1x]]></category>
		<category><![CDATA[EAP/TLS]]></category>
		<category><![CDATA[File Sharing]]></category>
		<category><![CDATA[MSCHAPv2]]></category>
		<category><![CDATA[PEAP]]></category>
		<category><![CDATA[zentyal-radius]]></category>

		<guid isPermaLink="false">http://imrgill.com/?p=697</guid>
		<description><![CDATA[คาใจอยู่หลายวันครับกับ zentyal radius กับการ config ieee 802.1x แล้วเจอปัญหาดังด้านล่าง Fri May 18 12:53:37 2012 : Auth: Login incorrect: [mrgill] (from client 172.11.5.64/26 port 0 via TLS tunnel) Fri May 18 12:53:37 2012 : Auth: Login incorrect: [mrgill] (from client 172.11.5.64/26 port 16814082 cli 8c73-6eb7-b57d) การติดตั้ง ผมติดตั้งตัว zentyal-users, zentyal-userconrner และ zentyal-radius ทำยังไงตอน authen 802.1x ก็ไม่ผ่านโดยฟ้อง error ใน [...]]]></description>
			<content:encoded><![CDATA[<p>คาใจอยู่หลายวันครับกับ zentyal radius กับการ config ieee 802.1x แล้วเจอปัญหาดังด้านล่าง</p>
<div class="codesnip-container" >
<pre>
Fri May 18 12:53:37 2012 : Auth: Login incorrect: [mrgill] (from client 172.11.5.64/26 port 0 via TLS tunnel)
Fri May 18 12:53:37 2012 : Auth: Login incorrect: [mrgill] (from client 172.11.5.64/26 port 16814082 cli 8c73-6eb7-b57d)
</pre>
</div>
<p>การติดตั้ง<br />
ผมติดตั้งตัว zentyal-users, zentyal-userconrner และ zentyal-radius ทำยังไงตอน authen 802.1x ก็ไม่ผ่านโดยฟ้อง error ใน /var/log/freeradius/radius.log ตามด้านบน</p>
<p>สุดท้ายไป Search เจอใน <a href="http://trac.zentyal.org/ticket/3579" rel="nofollow"  target="_blank">http://trac.zentyal.org/ticket/3579</a> บอกว่าถ้าต้องการจะให้ zentyal-radius รองรับ PEAP หรือ MSCHAPv2 <strong>ต้องติดตั้ง</strong>ตัว File Sharing เข้าไปด้วยหรือก็คือตัว zentyal-samba นั้นเอง<br />
หลังจากสั่ง apt-get install zentyal-samba ผมปรากฏว่า Authen ผ่านทันที</p>
<div class="codesnip-container" >
<pre>
Fri May 18 13:27:57 2012 : Auth: Login OK: [mrgill] (from client 172.11.5.64/26 port 0 via TLS tunnel)
Fri May 18 13:27:57 2012 : Auth: Login OK: [mrgill] (from client 172.11.5.64/26 port 16814082 cli 8c73-6eb7-b57d)
</pre>
</div>
<p>ปัญหาต่อมาตอนนี้คือ Authen ที่ Radius ผ่านแล้วแต่ตัว Port ไม่ยอม Enable จงสู้ต่อไป Takashi</p>
]]></content:encoded>
			<wfw:commentRss>http://imrgill.com/2012/05/18/zentyal-radius-eaptls-authentication-fail.html/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>การ Config SAN Multipath I/O บน Ubuntu Server</title>
		<link>http://imrgill.com/2012/05/15/how-to-config-multipath-io-san-storage-on-ubuntu-server.html</link>
		<comments>http://imrgill.com/2012/05/15/how-to-config-multipath-io-san-storage-on-ubuntu-server.html#comments</comments>
		<pubDate>Tue, 15 May 2012 08:36:13 +0000</pubDate>
		<dc:creator>mrgill</dc:creator>
				<category><![CDATA[Daily tips]]></category>
		<category><![CDATA[How to]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[msa p2000]]></category>
		<category><![CDATA[multipath]]></category>
		<category><![CDATA[multipath i/o]]></category>
		<category><![CDATA[multipath-tools]]></category>
		<category><![CDATA[san]]></category>
		<category><![CDATA[storage]]></category>
		<category><![CDATA[ubuntu server]]></category>

		<guid isPermaLink="false">http://imrgill.com/?p=695</guid>
		<description><![CDATA[สวัสดีครับ วันนี้จะมาแนะนำวิธีการคอนฟิก Multipath I/O สำหรับ SAN Storage บน Ubuntu Server กันครับ อะไรคือ Multipath ตามความเข้าใจของผมคือ สมมติว่าเราสร้าง Volume หรือ LUN ไว้บน Storage ไว้ 1 Volume/LUN แต่เรา Present Volume หรือ LUN นั้นออกมาจาก Port FC 2 Port เพื่อป้องกันการ Fail ของอุปกรณ์ จะทำให้เครื่อง Server เห็น Volume/LUN นั้นเป็น Disk 2 ลูก ทั้งที่จริงแล้วมันคือ Volume/LUN เดียวกัน ดังนั้นเราจำเป็นต้องทำการ Map ให้เครื่อง Server ของเราเห็น Disk เพียงลูกเดียวด้วยการทำ Multipath [...]]]></description>
			<content:encoded><![CDATA[<p>        สวัสดีครับ วันนี้จะมาแนะนำวิธีการคอนฟิก Multipath I/O สำหรับ SAN Storage บน Ubuntu Server กันครับ<br />
อะไรคือ Multipath ตามความเข้าใจของผมคือ สมมติว่าเราสร้าง Volume หรือ LUN ไว้บน Storage ไว้ 1 Volume/LUN แต่เรา Present Volume หรือ LUN นั้นออกมาจาก Port FC 2 Port เพื่อป้องกันการ Fail ของอุปกรณ์ จะทำให้เครื่อง Server เห็น Volume/LUN นั้นเป็น Disk 2 ลูก ทั้งที่จริงแล้วมันคือ Volume/LUN เดียวกัน ดังนั้นเราจำเป็นต้องทำการ Map ให้เครื่อง Server ของเราเห็น Disk เพียงลูกเดียวด้วยการทำ Multipath</p>
<p>ในตัวอย่างนี้ผมใช้ Ubuntu 10.04.3 LTS Server กับ SAN Storage HP MSA P2000 นะครับ</p>
<p>สำหรับ Ubuntu นั้นมี Package ตัวนึงที่ชื่อ multipath-tools ซึ่งเราสามารถติดตั้งด้วยใช้คำสั่ง</p>
<div class="codesnip-container" >
<pre>
root@server1:~# apt-get install multipath-tools
</pre>
</div>
<p>ติดตั้งเสร็จแล้วก็ทำการสร้างไฟล์ /etc/multipath.conf โดยจะคำสั่ง vi สร้างไฟล์ขึ้นมาใหม่หรือจะใช้ cat ตามตัวอย่างด้านล่างก็ได้</p>
<div class="codesnip-container" >
<pre>
root@server1:~# cat &#60;&#60;EOF > /etc/multipath.conf
defaults {
       user_friendly_names     yes
       path_grouping_policy    group_by_serial
       path_checker            tur
}

blacklist {
       devnode "^(ram|raw|loop|fd|md|dm-|sr|scd|st)[0-9]*"
       devnode "^sda"
       # blacklist any other locally attached block devices here
}
EOF
</pre>
</div>
<p>จากนั้นสั่ง restart service multipath-tools สักรอบ</p>
<div class="codesnip-container" >
<pre>
root@agoldap:~# /etc/init.d/multipath-tools restart
</pre>
</div>
<p>ดูผลด้วยคำสั่ง multipath -lv</p>
<div class="codesnip-container" >
<pre>
root@server1:~# multipath -lv
mpath0 (3600c0ff000134ec320b7334f02000000) dm-0 ,
[size=149G][features=0][hwhandler=0]
\_ round-robin 0 [prio=0][active]
 \_ #:#:#:#  -   #:#   [active][undef]
\_ round-robin 0 [prio=0][enabled]
 \_ 0:0:1:14 sdb 8:16  [active][undef]
\_ round-robin 0 [prio=0][enabled]
 \_ 1:0:0:14 sdc 8:32  [active][undef]
\_ round-robin 0 [prio=0][enabled]
 \_ 1:0:1:14 sdd 8:48  [active][undef]
</pre>
</div>
<p>ผมก็จะได้ประมาณนี้ โดยเวลาเราจะอ้างถึง raw disk ก็อ้างชื่อเป็น mpath0 ซึ่งอยู่ใน /dev/mapper/mpath0<br />
ลองทดสอง fdisk กันเลย</p>
<div class="codesnip-container" >
<pre>
root@server1:~# fdisk /dev/mapper/mpath0

WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
         switch off the mode (command 'c') and change display units to
         sectors (command 'u').

Command (m for help): p

Disk /dev/mapper/mpath0: 160.0 GB, 160000000000 bytes
255 heads, 63 sectors/track, 19452 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x8ca1da99

              Device Boot      Start         End      Blocks   Id  System
/dev/mapper/mpath0p1   *           1       19452   156248158+  83  Linux

Command (m for help): d
Selected partition 1

Command (m for help): p

Disk /dev/mapper/mpath0: 160.0 GB, 160000000000 bytes
255 heads, 63 sectors/track, 19452 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x8ca1da99

              Device Boot      Start         End      Blocks   Id  System

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-19452, default 1):
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-19452, default 19452):
Using default value 19452

Command (m for help): p

Disk /dev/mapper/mpath0: 160.0 GB, 160000000000 bytes
255 heads, 63 sectors/track, 19452 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x8ca1da99

              Device Boot      Start         End      Blocks   Id  System
/dev/mapper/mpath0p1               1       19452   156248158+  83  Linux

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.

WARNING: Re-reading the partition table failed with error 22: Invalid argument.
The kernel still uses the old table. The new table will be used at
the next reboot or after you run partprobe(8) or kpartx(8)
Syncing disks.
</pre>
</div>
<p>ดู Partition ที่เราสร้างโดยการเข้าไปเช็คที่ /dev/mapper</p>
<div class="codesnip-container" >
<pre>
root@server1:~# cd /dev/mapper/
root@server1:/dev/mapper# ls -l
total 0
crw-rw---- 1 root root  10, 59 2012-05-15 14:14 control
brw-rw---- 1 root disk 251,  0 2012-05-15 15:25 mpath0
brw-rw---- 1 root disk 251,  1 2012-05-15 15:25 mpath0-part1
root@server1:/dev/mapper#
</pre>
</div>
<p>Partition ที่เราเพิ่งสร้างคือ mpath0-part1<br />
ทีนี้ลองมา format มันเป็น ext4 กัน</p>
<div class="codesnip-container" >
<pre>
root@server1:~# mkfs.ext4 /dev/mapper/mpath0-part1
mke2fs 1.41.11 (14-Mar-2010)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
9773056 inodes, 39062039 blocks
1953101 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
1193 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
	32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
	4096000, 7962624, 11239424, 20480000, 23887872

Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 34 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.
</pre>
</div>
<p>เสร็จแล้วก็ลอง mount ไปใช้ดู</p>
<div class="codesnip-container" >
<pre>
root@server1:~# mount /dev/mapper/mpath0-part1 /backup
root@server1:~# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/cciss/c0d0p1     130G  2.1G  121G   2% /
none                  3.9G  236K  3.9G   1% /dev
none                  4.0G     0  4.0G   0% /dev/shm
none                  4.0G  104K  3.9G   1% /var/run
none                  4.0G     0  4.0G   0% /var/lock
none                  4.0G     0  4.0G   0% /lib/init/rw
none                  130G  2.1G  121G   2% /var/lib/ureadahead/debugfs
/dev/mapper/mpath0-part1
                      147G  188M  140G   1% /backup
</pre>
</div>
<p>หากต้องการจะให้มัน mount เองทุกครั้งตอนเปิดเครื่องก็เข้าไปแก้ไขไฟล์ /etc/fstab เองนะครับ<br />
เป็นอันเสร็จครับ</p>
<p>แหล่งข้อมูล : <a href="https://www.sit.auckland.ac.nz/Configuring_SAN_access_with_Linux_multipath" rel="nofollow"  target="_blank">https://www.sit.auckland.ac.nz/Configuring_SAN_access_with_Linux_multipath</a></p>
]]></content:encoded>
			<wfw:commentRss>http://imrgill.com/2012/05/15/how-to-config-multipath-io-san-storage-on-ubuntu-server.html/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>การเคลียร์ history log ของ bash shell บน linux</title>
		<link>http://imrgill.com/2012/03/22/%e0%b8%81%e0%b8%b2%e0%b8%a3%e0%b9%80%e0%b8%84%e0%b8%a5%e0%b8%b5%e0%b8%a2%e0%b8%a3%e0%b9%8c-history-log-%e0%b8%82%e0%b8%ad%e0%b8%87-bash-shell-%e0%b8%9a%e0%b8%99-linux.html</link>
		<comments>http://imrgill.com/2012/03/22/%e0%b8%81%e0%b8%b2%e0%b8%a3%e0%b9%80%e0%b8%84%e0%b8%a5%e0%b8%b5%e0%b8%a2%e0%b8%a3%e0%b9%8c-history-log-%e0%b8%82%e0%b8%ad%e0%b8%87-bash-shell-%e0%b8%9a%e0%b8%99-linux.html#comments</comments>
		<pubDate>Thu, 22 Mar 2012 03:48:58 +0000</pubDate>
		<dc:creator>mrgill</dc:creator>
				<category><![CDATA[Daily command]]></category>
		<category><![CDATA[Daily tips]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[Unix]]></category>
		<category><![CDATA[clear]]></category>
		<category><![CDATA[history]]></category>
		<category><![CDATA[log]]></category>

		<guid isPermaLink="false">http://imrgill.com/?p=693</guid>
		<description><![CDATA[มาเร็วไปเร็วอีกแล้วครับ ปกติเวลาเราสั่ง history มันก็จะแสดง list คำสั่งที่เราเคยสั่งไปก่อนหน้ามา root@mrgill-laptop:~# history ... 1785 transcode 1786 transcode -h 1787 apt-get update 1788 apt-get upgrade 1789 cd Desktop/ 1790 dpkg -i virtualbox-4.1_4.1.10-76795~Ubuntu~oneiric_amd64.deb 1791 apt-get update 1792 apt-get upgrade 1793 apt-get update 1794 ssh sysadmin@172.11.99.67 1795 apt-get update 1796 apt-get upgrade 1797 apt-get dist-upgrade 1798 apt-get update 1799 apt-get upgrade 1800 [...]]]></description>
			<content:encoded><![CDATA[<p>มาเร็วไปเร็วอีกแล้วครับ<br />
ปกติเวลาเราสั่ง history มันก็จะแสดง list คำสั่งที่เราเคยสั่งไปก่อนหน้ามา</p>
<pre>
<div class="codesnip-container" >root@mrgill-laptop:~# history
...
 1785  transcode
 1786  transcode -h
 1787  apt-get update
 1788  apt-get upgrade
 1789  cd Desktop/
 1790  dpkg -i virtualbox-4.1_4.1.10-76795~Ubuntu~oneiric_amd64.deb
 1791  apt-get update
 1792  apt-get upgrade
 1793  apt-get update
 1794  ssh sysadmin@172.11.99.67
 1795  apt-get update
 1796  apt-get upgrade
 1797  apt-get dist-upgrade
 1798  apt-get update
 1799  apt-get upgrade
 1800  clear
 1801  history
root@mrgill-laptop:~#</div>
</pre>
<p>หากต้องการเคลียร์ทั้งหมดใช้</p>
<pre>
<div class="codesnip-container" >root@mrgill-laptop:~# history -c</div>
</pre>
<p>หากต้องการเคลียร์เฉพาะ current session ใช้ -r</p>
<pre>
<div class="codesnip-container" >root@mrgill-laptop:~# history -r</div>
</pre>
<p>จบ</p>
]]></content:encoded>
			<wfw:commentRss>http://imrgill.com/2012/03/22/%e0%b8%81%e0%b8%b2%e0%b8%a3%e0%b9%80%e0%b8%84%e0%b8%a5%e0%b8%b5%e0%b8%a2%e0%b8%a3%e0%b9%8c-history-log-%e0%b8%82%e0%b8%ad%e0%b8%87-bash-shell-%e0%b8%9a%e0%b8%99-linux.html/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>คำสั่งสำหรับใช้ตรวจสอบ Serial Number ของเครื่อง Server บน Linux</title>
		<link>http://imrgill.com/2012/02/20/how-to-find-the-model-and-serial-number-of-a-linux-server.html</link>
		<comments>http://imrgill.com/2012/02/20/how-to-find-the-model-and-serial-number-of-a-linux-server.html#comments</comments>
		<pubDate>Mon, 20 Feb 2012 08:47:09 +0000</pubDate>
		<dc:creator>mrgill</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Server]]></category>

		<guid isPermaLink="false">http://imrgill.com/?p=687</guid>
		<description><![CDATA[วันนี้มาสั้นๆ หลังจากไม่ได้เขียนมาหลายเดือน สำหรับใครที่อยากทราบว่าเครื่องที่ใช้อยุ่ serial อะไรก็ใช้คำสั่งด้านล่างได้เลยครับ # dmidecode -t system SMBIOS 2.3 present. Handle 0x0100, DMI type 1, 25 bytes. System Information Manufacturer: HP Product Name: ProLiant DL380 G4 Version: Not Specified Serial Number: XXXXXXXXXXX UUID: XXXXXXX-XXXXX-XXXXXXX-XXXXXXXX-XXXXXXXX Wake-up Type: Power Switch Handle 0x2000, DMI type 32, 11 bytes. System Boot Information Status: No errors detected]]></description>
			<content:encoded><![CDATA[<p>วันนี้มาสั้นๆ หลังจากไม่ได้เขียนมาหลายเดือน สำหรับใครที่อยากทราบว่าเครื่องที่ใช้อยุ่ serial อะไรก็ใช้คำสั่งด้านล่างได้เลยครับ</p>
<pre>
<div class="codesnip-container" ># dmidecode -t system

SMBIOS 2.3 present.

Handle 0x0100, DMI type 1, 25 bytes.
System Information
        Manufacturer: HP
        Product Name: ProLiant DL380 G4
        Version: Not Specified
        Serial Number: XXXXXXXXXXX
        UUID: XXXXXXX-XXXXX-XXXXXXX-XXXXXXXX-XXXXXXXX
        Wake-up Type: Power Switch

Handle 0x2000, DMI type 32, 11 bytes.
System Boot Information
        Status: No errors detected</div>
</pre>
]]></content:encoded>
			<wfw:commentRss>http://imrgill.com/2012/02/20/how-to-find-the-model-and-serial-number-of-a-linux-server.html/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>สูตรคำนวณพื้นที่ Disk สำหรับติดตั้ง Zimbra</title>
		<link>http://imrgill.com/2011/12/07/example-formula-for-calculate-disk-storage-for-install-zimbra.html</link>
		<comments>http://imrgill.com/2011/12/07/example-formula-for-calculate-disk-storage-for-install-zimbra.html#comments</comments>
		<pubDate>Wed, 07 Dec 2011 07:11:26 +0000</pubDate>
		<dc:creator>mrgill</dc:creator>
				<category><![CDATA[Daily tips]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[mail server]]></category>
		<category><![CDATA[storage]]></category>
		<category><![CDATA[zimbra]]></category>

		<guid isPermaLink="false">http://imrgill.com/?p=678</guid>
		<description><![CDATA[STORAGE CALCULATION EXAMPLE (Based on ‘Mailbox Usage of 200 MB’ and 500 users) + User Data: 500 users with 200 MB = 100 GB user data + MySQL data: 5% of 100 GB (User Data): 5 GB + Zimbra binaries: 10 GB + Zimbra logs: 20 GB + Zimbra indexes: 25% of 100GB (User Data) [...]]]></description>
			<content:encoded><![CDATA[<p><strong>STORAGE CALCULATION EXAMPLE</strong><span style="font-size: x-small;"><br />
(Based on ‘Mailbox Usage of 200 MB’ and 500 users)<br />
</span><br />
+ User Data: 500 users with 200 MB = 100 GB user data<br />
+ MySQL data: 5% of 100 GB (User Data): 5 GB<br />
+ Zimbra binaries: 10 GB<br />
+ Zimbra logs: 20 GB<br />
+ Zimbra indexes: 25% of 100GB (User Data) = 25 GB<br />
<strong><br />
SUBTOTAL:</strong> 100 + 5 + 10 + 20 + 25 = 160 GB<br />
<strong>Backups:</strong> 160 % of Subtotal: 160 * 160% = 256 GB for backups<br />
<strong>TOTAL:</strong> 160 + 256 = 416 GB</p>
<p>อ้างอิง : <a href="http://blog.zimbra.com/blog/archives/2009/05/6-tips-for-a-smooth-zimbra-server-install.html" rel="nofollow" >http://blog.zimbra.com/blog/archives/2009/05/6-tips-for-a-smooth-zimbra-server-install.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://imrgill.com/2011/12/07/example-formula-for-calculate-disk-storage-for-install-zimbra.html/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ubuntu Server x86_64 error : bash: ./xxxxx: No such file or directory</title>
		<link>http://imrgill.com/2011/10/11/how-to-fix-ubuntu-server-x86_64-error-bash-dot-slash-xxx-no-such-file-or-directory.html</link>
		<comments>http://imrgill.com/2011/10/11/how-to-fix-ubuntu-server-x86_64-error-bash-dot-slash-xxx-no-such-file-or-directory.html#comments</comments>
		<pubDate>Tue, 11 Oct 2011 09:38:13 +0000</pubDate>
		<dc:creator>mrgill</dc:creator>
				<category><![CDATA[Daily tips]]></category>
		<category><![CDATA[How to]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[ia32-libs]]></category>
		<category><![CDATA[troubleshooting]]></category>

		<guid isPermaLink="false">http://imrgill.com/?p=656</guid>
		<description><![CDATA[วันนี้ remote ไปแก้ปัญหาบน server ของเพื่อนมาครับ คือ เขาจะรัน shoutcast บน ubuntu 10.04 เขาก็โหลด shoutcast มาแล้วแตก tar.gz ออกมาให้เรียบร้อยแล้ว แต่รัน ./sc_serv ไม่ได้มันจะ error bash: ./sc_serv: No such file or directory ตลอดเวลาเลยทั้งๆ ที่มีไฟล์ sc_serv อยู่ในเครื่อง ครั่นว่าจะลืม chmod ก็ลอง chmode +x sc_serv ก็ทำแล้ว แต่ก็ยัง error เห็นดังนั้นก็เอะใจว่าต้องมีอะไรผิดปกติแน่นอนเลยเอา error ไป search ใน google ดู ก็ไปเจอในกระทู้ต่างประเทศ ซึ่งบอกว่า Ubuntu เป็นตัว 64bit แต่ไม่ได้ติดตั้ง packages สำหรับรันโปรแกรม [...]]]></description>
			<content:encoded><![CDATA[<p>วันนี้ remote ไปแก้ปัญหาบน server ของเพื่อนมาครับ คือ เขาจะรัน shoutcast บน ubuntu 10.04 เขาก็โหลด shoutcast มาแล้วแตก tar.gz ออกมาให้เรียบร้อยแล้ว แต่รัน ./sc_serv ไม่ได้มันจะ error </p>
<div class="codesnip-container" >bash: ./sc_serv: No such file or directory</div>
<p>ตลอดเวลาเลยทั้งๆ ที่มีไฟล์ sc_serv อยู่ในเครื่อง ครั่นว่าจะลืม chmod ก็ลอง chmode +x sc_serv ก็ทำแล้ว แต่ก็ยัง error เห็นดังนั้นก็เอะใจว่าต้องมีอะไรผิดปกติแน่นอนเลยเอา error ไป search ใน google ดู ก็ไปเจอในกระทู้ต่างประเทศ ซึ่งบอกว่า Ubuntu เป็นตัว 64bit แต่ไม่ได้ติดตั้ง packages สำหรับรันโปรแกรม 32bit ไว้จึงทำให้เกิด error ดังกล่าว วิธีแก้ไขปัญหานี้ไม่ยากครับแค่ใช้คำสั่ง</p>
<pre>
<div class="codesnip-container" >sudo apt-get install ia32-libs</div>
</pre>
<p>แล้วก็ลองไปสั่งรัน ./sc_serv ก็รันผ่านฉลุยครับ</p>
]]></content:encoded>
			<wfw:commentRss>http://imrgill.com/2011/10/11/how-to-fix-ubuntu-server-x86_64-error-bash-dot-slash-xxx-no-such-file-or-directory.html/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>วิธีเพิ่ม Memory บนเครื่อง RHEL 5.5 Xen Host</title>
		<link>http://imrgill.com/2011/08/03/how-to-increase-the-memory-size-of-domain-0-or-dom0-on-rhel-xen-host.html</link>
		<comments>http://imrgill.com/2011/08/03/how-to-increase-the-memory-size-of-domain-0-or-dom0-on-rhel-xen-host.html#comments</comments>
		<pubDate>Wed, 03 Aug 2011 10:18:05 +0000</pubDate>
		<dc:creator>mrgill</dc:creator>
				<category><![CDATA[Daily command]]></category>
		<category><![CDATA[Daily tips]]></category>
		<category><![CDATA[How to]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Network]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[increase]]></category>
		<category><![CDATA[memory]]></category>
		<category><![CDATA[network latency]]></category>
		<category><![CDATA[rhel 5.5]]></category>
		<category><![CDATA[xen]]></category>

		<guid isPermaLink="false">http://imrgill.com/?p=650</guid>
		<description><![CDATA[วันนี้เจอปัญหาจากทีม Developer แจ้งว่า Network ในระบบช้าซึ่งความจึงแล้วมันไม่น่าจะช้าเพราะ Network เป็น 10GbE ทั้งหมดแต่ Developer แจ้งมาว่ามันวิ่งแค่หน่วยเป็น Kbps [root@javacluster ~]# scp vm.tar root@192.191.3.17:~/. root@192.191.3.17's password: vm.tar 0% 34MB 47.5KB/s 119:38:22 EKilled by signal 2. เมื่อดูจาก log ที่เขาส่งมาให้ก็แปลกใจมากๆ เพราะมันไม่น่าจะช้าขนาดนั้นเลย วันนี้เข้ามาทำงานเลยตรวจสอบทั้งอุปกรณ์ Network และเครื่อง Server ก็ปกติ แต่ที่ไม่ปกติก็คือ Memory ของเครื่องที่ Developer ใช้งานถึงได้น้อยแค่ 512MB [root@javacluster ~]# free -m total used free shared buffers cached Mem: 512 [...]]]></description>
			<content:encoded><![CDATA[<p>วันนี้เจอปัญหาจากทีม Developer แจ้งว่า Network ในระบบช้าซึ่งความจึงแล้วมันไม่น่าจะช้าเพราะ Network เป็น 10GbE ทั้งหมดแต่ Developer แจ้งมาว่ามันวิ่งแค่หน่วยเป็น Kbps</p>
<pre>
<div class="codesnip-container" >[root@javacluster ~]# scp vm.tar root@192.191.3.17:~/.

root@192.191.3.17's password:

vm.tar                                                     0%   34MB  47.5KB/s 119:38:22 EKilled by signal 2.</div>
</pre>
<p>เมื่อดูจาก log ที่เขาส่งมาให้ก็แปลกใจมากๆ เพราะมันไม่น่าจะช้าขนาดนั้นเลย วันนี้เข้ามาทำงานเลยตรวจสอบทั้งอุปกรณ์ Network และเครื่อง Server ก็ปกติ<br />
แต่ที่ไม่ปกติก็คือ Memory ของเครื่องที่ Developer ใช้งานถึงได้น้อยแค่ 512MB</p>
<pre>
<div class="codesnip-container" >[root@javacluster ~]# free -m
             total       used       free     shared    buffers     cached
Mem:           512        503          8          0          2        169
-/+ buffers/cache:        331        180
Swap:        29631          0      29631</div>
</pre>
<p>ทั้งที่จริงมันมีมากถึง 64GB ก็มาพบสาเหตุของปัญหาเป็นเพราะว่าเครื่อง Server ดังกล่าวรันเป็น Xen Host ซึ่ง Default ของ Parameter ตอนน boot เข้า RHEL ถูกตั้งไว้ที่ 512MB เท่านั้น เลยทำการเปลี่ยนให้เป็น 4GB โดยการเข้าไปแก้ไขไฟล์ /etc/grub.conf</p>
<p>จาก</p>
<pre>
<div class="codesnip-container" >title Red Hat Enterprise Linux Server (2.6.18-194.el5xen)
        root (hd0,0)
        kernel /xen.gz-2.6.18-194.el5 <u>dom0_mem=512MB</u>
        module /vmlinuz-2.6.18-194.el5xen ro root=/dev/VolGroup00/LogVol00 rhgb quiet
        module /initrd-2.6.18-194.el5xen.img</div>
</pre>
<p>เป็น</p>
<pre>
<div class="codesnip-container" >title Red Hat Enterprise Linux Server (2.6.18-194.el5xen)
        root (hd0,0)
        kernel /xen.gz-2.6.18-194.el5 <u>dom0_mem=4096MB</u>
        module /vmlinuz-2.6.18-194.el5xen ro root=/dev/VolGroup00/LogVol00 rhgb quiet
        module /initrd-2.6.18-194.el5xen.img</div>
</pre>
<p>เปลี่ยนเสร็จแล้วอย่าลืม reboot เครื่องนะครับ<br />
ความเร็วของ Network หลังจากเพิ่ม Memory ของเครื่อง Xen Host เพิ่มขึ้นทันตาครับ</p>
<pre>
<div class="codesnip-container" >[root@javacluster ~]# scp vm.tar root@192.191.3.17:~/.

root@192.191.3.17's password:

vm.tar                                                     19%   340MB  41.5MB/s 20:22 EKilled by signal 2.</div>
</pre>
<p>ขอบคุณแหล่งข้อมูล : <a href="http://helpinlinux.blogspot.com/2011/06/how-to-increase-memory-size-of-domain-0.html" rel="nofollow"  target=_blank>http://helpinlinux.blogspot.com/2011/06/how-to-increase-memory-size-of-domain-0.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://imrgill.com/2011/08/03/how-to-increase-the-memory-size-of-domain-0-or-dom0-on-rhel-xen-host.html/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>วิธีทำ Local Repository สำหรับ RHEL 5.5 จากแผ่น DVD</title>
		<link>http://imrgill.com/2011/07/19/how-to-create-local-yum-repository-in-rhel-5-5-from-dvd-source.html</link>
		<comments>http://imrgill.com/2011/07/19/how-to-create-local-yum-repository-in-rhel-5-5-from-dvd-source.html#comments</comments>
		<pubDate>Tue, 19 Jul 2011 11:26:20 +0000</pubDate>
		<dc:creator>mrgill</dc:creator>
				<category><![CDATA[Daily command]]></category>
		<category><![CDATA[Daily tips]]></category>
		<category><![CDATA[How to]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[local repository]]></category>
		<category><![CDATA[offline]]></category>
		<category><![CDATA[rhel 5.5]]></category>
		<category><![CDATA[yum]]></category>
		<category><![CDATA[yum offline]]></category>

		<guid isPermaLink="false">http://imrgill.com/?p=648</guid>
		<description><![CDATA[วันนี้ขอไม่ลงรายละเอียดมากนะครับ เน้นกันลืม Local Repository ก็คือการทำให้เครื่อง Server RHEL ของเราสามารถสั่ง yum แบบ offline ได้นั้นเองครับ คือไม่ต้องต่อ Internet (ถึงต่อก็ yum ไม่ได้ถ้าไม่ซื้อ Subscription License) วิธีนี้เป็นการนำ rpm จากแผ่น dvd ที่ใช้ติดตั้งมาเก็บไว้ในเครื่อง ทำให้สามารถสั่ง yum เพื่อช่วยในการติดตั้ง package ต่างๆ ได้สะดวกขึ้น ใครที่เคยติดตั้ง rpm เองคงรู้ดีว่า dependency package นั้นเป็นอะไรที่จุกจิกกวนใจ จะติดตั้ง package นี้ต้องไปติดตั้งไอ้โน้น ไอ้นี้ มาก่อนนะ แต่ด้วยคำสั่ง yum install xxxx มันเข้ามาช่วยทำให้อะไรๆ ง่ายขึ้นเยอะ กล่าวคือ yum จะตรวจสอบหา dependent package ให้เอง จะติดตั้ง package [...]]]></description>
			<content:encoded><![CDATA[<p>วันนี้ขอไม่ลงรายละเอียดมากนะครับ เน้นกันลืม</p>
<p>Local Repository ก็คือการทำให้เครื่อง Server RHEL ของเราสามารถสั่ง yum แบบ offline ได้นั้นเองครับ<br />
คือไม่ต้องต่อ Internet (ถึงต่อก็ yum ไม่ได้ถ้าไม่ซื้อ Subscription License) วิธีนี้เป็นการนำ rpm จากแผ่น dvd ที่ใช้ติดตั้งมาเก็บไว้ในเครื่อง<br />
ทำให้สามารถสั่ง yum เพื่อช่วยในการติดตั้ง package ต่างๆ ได้สะดวกขึ้น ใครที่เคยติดตั้ง rpm เองคงรู้ดีว่า dependency package นั้นเป็นอะไรที่จุกจิกกวนใจ จะติดตั้ง package นี้ต้องไปติดตั้งไอ้โน้น ไอ้นี้ มาก่อนนะ</p>
<p>แต่ด้วยคำสั่ง yum install xxxx มันเข้ามาช่วยทำให้อะไรๆ ง่ายขึ้นเยอะ กล่าวคือ yum จะตรวจสอบหา dependent package ให้เอง จะติดตั้ง package a อะไรที่ a ต้องใช้ yum ก็จะติดตั้งให้เอง โอ้สะดวกดีแท้</p>
<p><strong>ขั้นตอนมีคร่าวๆ ดังนี้</strong><br />
1. mount dvd iso<br />
2. ใช้คำสั่ง createrepo เพื่อสร้าง package list และ group list</p>
<p>มาดู detail กันครับ<br />
1. ผมมี .iso ของ rhel 5.5 อยู่ใน hdd ครับผมก็เลย upload rhel-server-5.5-x86_64-dvd.iso ไปไว้ที่ Server ที่ต้องการจะ config local repository ใครไม่มี .iso ก็เอาแผ่น dvd ที่มีอยู่ใน burn เป็น .iso ก่อนก็ได้ครับ (หรือจะ copy path Server ในแผ่นไปไว้ที่เครื่องก็ได้ แต่วิธีที่ผมจะสอนวันนี้ใช้ .iso) ผมเอาไฟล์ rhel-server-5.5-x86_64-dvd.iso ไปไว้ที่ /opt</p>
<p>/opt/rhel-server-5.5-x86_64-dvd.iso</p>
<p>2. สร้าง Mount Point สำหรับใช้เก็บไฟล์ที่ Mount มาจาก rhel-server-5.5-x86_64-dvd.iso</p>
<div class="codesnip-container" >mkdir -p /dvd/actual</div>
<p>3. มา Mount กันเลย</p>
<div class="codesnip-container" >mount -r -t iso9660 -o loop /opt/rhel-server-5.5-x86_64-dvd.iso /dvd/actual</div>
<p>4. Mount เสร็จแล้วก็ติดตั้ง Package createrepo ก่อน</p>
<div class="codesnip-container" >cd /dvd/actual/Server<br />
rpm -ivh createrepo*.rpm</div>
<p>5. กลับมายัง ณ ตำแหน่ง /dvd</p>
<div class="codesnip-container" >cd /dvd</div>
<p>6. ติดตั้ง Package createrepo เสร็จแล้วก็สามารถ Repository file กันต่อ อย่าลืมว่าตอนนี้คุณต้องอยู่ที่ /dvd pwd ดูก็ได้</p>
<div class="codesnip-container" >createrepo .</div>
<p>**อย่าลืมใส่ . ด้วยนะ</p>
<p>7. เสร็จแล้วเราจะได้ /dvd/repodata ข้างในมีไฟล์ .gz กับ .xml 2-3 ไฟล์</p>
<p>8. ทำการ copy GPG Key จากในแผ่นไปไว้ที่ /opt</p>
<div class="codesnip-container" >cp /dvd/actual/*GPG* /opt</div>
<p>9. ที่นี้มาก็มาสร้าง /etc/yum.repos.d/dvd.repo กันจะ vi หรือ nano หรือ pico ก็แล้วแต่สะดวก แต่ขอให้ข้างในไฟล์มีเนื้อหาดังนี้</p>
<div class="codesnip-container" >[dvd]<br />
name=RHEL5DVD<br />
baseurl=file:///dvd<br />
enabled=1<br />
gpgcheck=1<br />
gpgkey=file:///opt/RPM-GPG-KEY-redhat-release file:///opt/RPM-GPG-KEY-redhat-beta</div>
<p>10. แค่ 9 ขั้นตอนข้างต้นก็เพียงพอสำหรับ yum install xxxx แต่มันจะยัง yum grouplist ไม่ได้ นั้นคือไม่สามารถติดตั้ง Package แบบ Group ได้ เช่น yum groupinstall &#8220;Web Server&#8221; จะยังไม่ได้ ประเด็นที่เขียนบทความนี้ก็เพราะลองทำตอนแรกมันสั่ง yum grouplist ไม่ได้นี่หละครับ เลยต้องมาเขียนกันลืมไว้ เรามาแก้ปัญหานี้ไปพร้อมๆ กัน ขั้นตอนต่อมา คือทำการ copy ไฟล์ /dvd/actual/Server/repodata/comps-rhel5-server-core.xml ไปไว้ที่ /dvd/repodata</p>
<div class="codesnip-container" >cp /dvd/actual/Server/repodata/comps-rhel5-server-core.xml /dvd/repodata</div>
<p>11. ทำการ regenerate เนื้อหาของไฟล์ /dvd/repodata/comps-rhel5-server-core.xml ซะใหม่โดย</p>
<div class="codesnip-container" >cd /dvd<br />
createrepo -g repodata/comps-rhel5-server-core.xml .</div>
<p>** อย่าลืมเติม .</p>
<p>12. ลอง recheck ขั้นตอนกันหน่อย</p>
<p>- mount .iso ไปไว้ที่ /dvd/actual หรือยัง</p>
<p>- ติดตั้ง createrepo แล้ว ?</p>
<p>- สั่ง createrepo ซึ่งจะได้ /dvd/repodata แล้ว ?</p>
<p>- ทำการ copy GPG Key จากแผ่นไปไว้ที่ /opt แล้ว ?</p>
<p>- สร้างไฟล์ /etc/yum.repos.d/dvd.repo แล้ว ?</p>
<p>- copy ไฟล์ comps-rhel5-server-core.xml ไปเก็บไว้ที่ /dvd/repodata/ และทำการ regenerate ไฟล์ใหม่ด้วยคำสั่ง creatererp -g แล้ว ?</p>
<p>ถ้าคุณทำครบทุกขั้นตอนก็ตามข้างต้นก็ลองมา yum กันเลย</p>
<p>13. สั่ง yum กันโลด</p>
<div class="codesnip-container" >yum clean all</p>
<p>yum update</p>
<p>yum makecache</p>
<p>yum install httpd</p>
<p>yum grouplist</p>
<p>yum groupinstall &#8220;Web Server&#8221;</p></div>
<p>14. yum ผ่านแล้วอยากให้ yum ได้ทุกครั้งที่เปิดเครื่องก็เอา</p>
<p>/opt/rhel-server-5.5-x86_64-dvd.iso /dvd/actual iso9660 defaults,ro,loop 0 0</p>
<p>ไปใส่ไว้ในไฟล์ /etc/fstab ก็เป็นอันจบข่าว</p>
<p>ใครทำไม่ได้หรือติดตรงไหน comment บอกกันไว้ได้เลย</p>
<p>Good Luck <img src='http://imrgill.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>แหล่งข้อมูล :</p>
<p><a href="http://openbysource.blogspot.com/2007/02/configuring-yum-in-rhel5-for-dvd-source.html">http://openbysource.blogspot.com/2007/02/configuring-yum-in-rhel5-for-dvd-source.html<br />
</a><a href="http://www.linuxquestions.org/questions/linux-software-2/yum-grouplist-setup-on-custom-repo-655529/" rel="nofollow" >http://www.linuxquestions.org/questions/linux-software-2/yum-grouplist-setup-on-custom-repo-655529/</a><a href="http://openbysource.blogspot.com/2007/02/configuring-yum-in-rhel5-for-dvd-source.html" rel="nofollow" > </a></p>
]]></content:encoded>
			<wfw:commentRss>http://imrgill.com/2011/07/19/how-to-create-local-yum-repository-in-rhel-5-5-from-dvd-source.html/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>วิธีเพิ่ม Swap โดยไม่ต้องสร้าง Partition ใหม่</title>
		<link>http://imrgill.com/2011/07/13/how-to-increase-swap-size-with-out-add-new-partition.html</link>
		<comments>http://imrgill.com/2011/07/13/how-to-increase-swap-size-with-out-add-new-partition.html#comments</comments>
		<pubDate>Wed, 13 Jul 2011 10:01:29 +0000</pubDate>
		<dc:creator>mrgill</dc:creator>
				<category><![CDATA[Daily command]]></category>
		<category><![CDATA[Daily tips]]></category>
		<category><![CDATA[How to]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[dd]]></category>
		<category><![CDATA[swap]]></category>
		<category><![CDATA[swapoff]]></category>
		<category><![CDATA[swapon]]></category>

		<guid isPermaLink="false">http://imrgill.com/?p=647</guid>
		<description><![CDATA[ขั้นตอนง่ายๆ ครับ ไม่มีอะไร ไม่ต้องแบ่ง partition ใหม่ให้ยุ่งยาก แค่สร้าง dump file ขึ้นมาให้เท่ากับขนาดของ swap ที่ต้องการได้เลยโดยใช้คำสั่ง 1. สร้างพื้นที่สำหรับใช้เป็น swap root@mrgill-laptop:~# dd if=/dev/zero of=/tmp/newswap bs=1MB count=1024 ตัวอย่างผมสร้างไฟล์ขนาด 1GB เพื่อจะใช้เป็น swap (อยากได้กี่ GB ก็คำนวนเอานะครับ x * 1024) 2. เมื่อได้ไฟล์ /tmp/newswap มาแล้วก็ถึงขั้นตอนการสร้าง newswap ให้เป็น swap โดยใช้คำสั่ง root@mrgill-laptop:~# mkswap /tmp/newswap 3. เรียกใช้งาน newswap ที่เพิ่งสร้างไปจากขั้นตอนที่ 2 โดยใช้คำสั่ง root@mrgill-laptop:~# swapon /tmp/newswap 4. ทดสอบเรียกดูว่า swap เพิ่มขึ้นหรือเปล่าด้วยคำสั่ง [...]]]></description>
			<content:encoded><![CDATA[<p>ขั้นตอนง่ายๆ ครับ ไม่มีอะไร ไม่ต้องแบ่ง partition ใหม่ให้ยุ่งยาก แค่สร้าง dump file ขึ้นมาให้เท่ากับขนาดของ swap ที่ต้องการได้เลยโดยใช้คำสั่ง</p>
<p>1. สร้างพื้นที่สำหรับใช้เป็น swap</p>
<div class="codesnip-container" >root@mrgill-laptop:~# dd if=/dev/zero of=/tmp/newswap bs=1MB count=1024</div>
<p>ตัวอย่างผมสร้างไฟล์ขนาด 1GB เพื่อจะใช้เป็น swap (อยากได้กี่ GB ก็คำนวนเอานะครับ x * 1024)</p>
<p>2. เมื่อได้ไฟล์ /tmp/newswap มาแล้วก็ถึงขั้นตอนการสร้าง newswap ให้เป็น swap โดยใช้คำสั่ง</p>
<div class="codesnip-container" >root@mrgill-laptop:~# mkswap /tmp/newswap</div>
<p>3. เรียกใช้งาน newswap ที่เพิ่งสร้างไปจากขั้นตอนที่ 2 โดยใช้คำสั่ง</p>
<div class="codesnip-container" >root@mrgill-laptop:~# swapon /tmp/newswap</div>
<p>4. ทดสอบเรียกดูว่า swap เพิ่มขึ้นหรือเปล่าด้วยคำสั่ง</p>
<div class="codesnip-container" >root@mrgill-laptop:~# free -m</div>
<p>5. หากต้องการให้ swap ที่สร้างถูกเรียกใช้งานเองทุกครั้งที่ restart server ก็ให้ไปเพิ่มบรรทัดด้านล่างเข้าไปในไฟล์ /etc/fstab ดังนี้ครับ</p>
<div class="codesnip-container" >/tmp/newswap       swap           swap             defaults            0    0</div>
<p>ถ้าต้องการเอาไฟล์ swap ไฟล์ที่สร้างเองออกก็ใช้คำสั่ง</p>
<div class="codesnip-container" >root@mrgill-laptop:~# swapoff /tmp/newswap<br />
root@mrgill-laptop:~# rm -rf /tmp/newswap</div>
<p>ลบแล้วก็อย่าลืมไปเอาบรรทัดที่เพิ่มเข้าไปในไฟล์ /etc/fstab ออกด้วยนะครับ<br />
ไม่งั้นเดี่ยวจะติดปัญหาตอน boot ต้องใช้แผ่น rescure เข้าไปแก้ไฟล์ /etc/fstab ยุ่งยากไปกันใหญ่</p>
<p>แหล่งข้อมูล : <a href="http://www.linuxreaders.com/2009/10/28/how-to-modify-swap-size/" rel="nofollow"  target="_blank">http://www.linuxreaders.com/2009/10/28/how-to-modify-swap-size/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://imrgill.com/2011/07/13/how-to-increase-swap-size-with-out-add-new-partition.html/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Shell In A Box ลองใช้กันดู</title>
		<link>http://imrgill.com/2011/03/11/what-is-shell-in-a-box.html</link>
		<comments>http://imrgill.com/2011/03/11/what-is-shell-in-a-box.html#comments</comments>
		<pubDate>Fri, 11 Mar 2011 04:21:36 +0000</pubDate>
		<dc:creator>mrgill</dc:creator>
				<category><![CDATA[Daily tips]]></category>
		<category><![CDATA[How to]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[browser]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[shell in a box]]></category>
		<category><![CDATA[shell in browser]]></category>
		<category><![CDATA[shellinabox]]></category>
		<category><![CDATA[terminal]]></category>

		<guid isPermaLink="false">http://imrgill.com/?p=638</guid>
		<description><![CDATA[สวัสดีครับ ห่างหายกันไปนานกับการเขียน blog เรื่อง linux วันนี้มาเขียนเรื่อง shell in a box ครับ พอดีได้รู้จักเจ้า Package ตัวนี้โดยบังเอิญเพราะลองติดตั้ง Zimbra Turnkey Linux แล้วสะดุดใจกับ Web Shell ของมันที่มี Port 12320 ว่ามันคืออะไรก็เลยลองเปิด Browser ไปที่ http://zimbrahost:12320 ดูก็เลยรู้ว่ามันเป็น Web Shell อย่างที่ชื่อมันบอกจริงๆ คือมีหน้าจอให้เรา Login Shell ผ่านหน้า Browser กันเลย แล้วผมก็ลอง netstate ดูใน Terminal ก็พบว่า Port 12320 เป็นของ Service ที่มีชื่อว่า shellinabox root@zimbra:~# netstat -pant Active Internet connections (servers [...]]]></description>
			<content:encoded><![CDATA[<p>สวัสดีครับ ห่างหายกันไปนานกับการเขียน blog เรื่อง linux วันนี้มาเขียนเรื่อง shell in a box ครับ<br />
พอดีได้รู้จักเจ้า Package ตัวนี้โดยบังเอิญเพราะลองติดตั้ง Zimbra Turnkey Linux แล้วสะดุดใจกับ Web Shell ของมันที่มี Port 12320 ว่ามันคืออะไรก็เลยลองเปิด Browser ไปที่ http://zimbrahost:12320 ดูก็เลยรู้ว่ามันเป็น Web Shell อย่างที่ชื่อมันบอกจริงๆ คือมีหน้าจอให้เรา Login Shell ผ่านหน้า Browser กันเลย แล้วผมก็ลอง netstate ดูใน Terminal ก็พบว่า Port 12320 เป็นของ Service ที่มีชื่อว่า shellinabox</p>
<pre>
<div class="codesnip-container" >root@zimbra:~# netstat -pant
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
<span style="background-color: #ffff00;"><span style="text-decoration: underline;">tcp        0      0 0.0.0.0:12320           0.0.0.0:*               LISTEN      11602/shellinaboxd</span></span>
tcp        0      0 0.0.0.0:12321           0.0.0.0:*               LISTEN      11631/perl
tcp        0      0 0.0.0.0:7780            0.0.0.0:*               LISTEN      13272/httpd
tcp        0      0 127.0.0.1:389           0.0.0.0:*               LISTEN      11752/slapd
tcp        0      0 127.0.0.1:10024         0.0.0.0:*               LISTEN      13153/amavisd (mast
tcp        0      0 127.0.0.1:10025         0.0.0.0:*               LISTEN      13973/master
tcp        0      0 127.0.0.1:7306          0.0.0.0:*               LISTEN      12440/mysqld
tcp        0      0 127.0.0.1:7307          0.0.0.0:*               LISTEN      12171/mysqld
tcp        0      0 0.0.0.0:3310            0.0.0.0:*               LISTEN      13214/clamd
tcp        0      0 0.0.0.0:465             0.0.0.0:*               LISTEN      13973/master
tcp        0      0 0.0.0.0:25              0.0.0.0:*               LISTEN      13973/master
tcp        0      0 127.0.0.1:7306          127.0.0.1:56248         ESTABLISHED 12440/mysqld</div>
</pre>
<p style="text-align: left;">การตามหา Shell In A Box ยังไม่เสร็จสิ้นหลังจากทราบข้อมูลเบื้องต้นมาแล้วก็เลยเข้าไปหาข้อมูลเพิ่มเติมใน Google ก็ได้ทราบว่า Shell In A Box อยู่ใน Google Code : <a href="http://code.google.com/p/shellinabox/" rel="nofollow" >http://code.google.com/p/shellinabox/</a> รายละเอียดเข้าไปดูกันได้ครับ ผมเลยลองโหลดตัว shell in a box ที่เป็น .deb มาลองติดตั้งบน Ubuntu Desktop ของผมดู </p>
<pre>
<div class="codesnip-container" >mrgill@mrgill-laptop:~$ dpkg -i shellinabox_2.10-1_amd64.deb</div>
</pre>
<p>ติดตั้งเสร็จก็สามารถเรียกใช้งานได้เลยครับที่ Port 4200 ผลการทดสอบก็ได้ผลดังนี้ครับ</p>
<p style="text-align: left;">
<a href="http://farm6.static.flickr.com/5175/5516745010_cb93475714_b.jpg" rel="nofollow"  rel="lightbox[638]"><img class="aligncenter" src="http://farm6.static.flickr.com/5175/5516745010_cb93475714.jpg" alt="Shell In A Box" width="500" height="281" /></a></p>
<p>สำหรับใครที่ต้องการเปลี่ยน Port 4200 เป็น Port อื่นก็สามารถเข้าไปแก้ไขได้ที่ /etc/default/shellinabox ครับ</p>
<pre>
<div class="codesnip-container" >root@mrgill-laptop:/etc/default# cat shellinabox
# Should shellinaboxd start automatically
SHELLINABOX_DAEMON_START=1

# TCP port that shellinboxd's webserver listens on
<span style="text-decoration: underline;"><span style="background-color: #ffff00;">SHELLINABOX_PORT=4200</span></span>

# Parameters that are managed by the system and usually should not need
# changing:
# SHELLINABOX_DATADIR=/var/lib/shellinabox
# SHELLINABOX_USER=shellinabox
# SHELLINABOX_GROUP=shellinabox

# Any optional arguments (e.g. extra service definitions)
# We disable beeps, as there have been reports of the VLC plugin crashing
# Firefox on Linux/x86_64.
SHELLINABOX_ARGS=--no-beep</div>
</pre>
<p>อยากเปลี่ยนเป็น Port อะไรก็ตามใจชอบกันเลยครับ<br />
สำหรับ Production Server ก็ต้องคิดกันหนักหน่อยนะครับว่าจะอนุญาตในระดับไหน ยิ่งเราเปิดช่องทางให้ Remote เข้าไปถึง Server เยอะเท่าไหร่ความเสี่ยงด้านความปลอดภัยก็ยิ่งเพิ่มมากขึ้นตามไปด้วย</p>
]]></content:encoded>
			<wfw:commentRss>http://imrgill.com/2011/03/11/what-is-shell-in-a-box.html/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

