<?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>SpaLinux.com &#187; editor</title>
	<atom:link href="http://spalinux.com/author/editor/feed" rel="self" type="application/rss+xml" />
	<link>http://spalinux.com</link>
	<description>Resources for Relaxing Linux System Administrators</description>
	<lastBuildDate>Mon, 26 Jul 2010 09:51:19 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>รัน SVN แล้วขึ้น error MKACTIVITY request</title>
		<link>http://spalinux.com/2010/07/svn_error_mkactivity_request</link>
		<comments>http://spalinux.com/2010/07/svn_error_mkactivity_request#comments</comments>
		<pubDate>Mon, 26 Jul 2010 09:51:19 +0000</pubDate>
		<dc:creator>editor</dc:creator>
				<category><![CDATA[Troubleshooting]]></category>
		<category><![CDATA[Version Control]]></category>
		<category><![CDATA[subversion]]></category>
		<category><![CDATA[svn]]></category>

		<guid isPermaLink="false">http://spalinux.com/?p=1140</guid>
		<description><![CDATA[เจอปัญหารัน svn แล้วขึ้น error เลยนำมาแชร์ประสบการณ์ให้อ่าน ตัวอย่างการรัน svn แล้วเกิดปัญหา [user1@client ~]$ svn --username user1 import test_project https://192.168.1.1/svn/test_project/trunk/test_project -m 'init release' svn: Server sent unexpected return value (500 Internal Server Error) in response to MKACTIVITY request for '/repos/test_project/!svn/act/...' คอนฟิกที่ใช้เป็นการรัน svn โดยเขียน อ่าน ไฟล์ repos ผ่านทาง Apache DAV ตัวอย่างคอนฟิกไฟล์ของ Apache เพื่อเก็บ svn repos บนเซิร์ฟเวอร์     &#60;Location /svn&#62;         DAV svn [...]]]></description>
			<content:encoded><![CDATA[<p>เจอปัญหารัน svn แล้วขึ้น error เลยนำมาแชร์ประสบการณ์ให้อ่าน</p>
<p>ตัวอย่างการรัน svn แล้วเกิดปัญหา</p>
<pre>[user1@client ~]$ <strong>svn --username user1 import test_project https://192.168.1.1/svn/test_project/trunk/test_project -m 'init release'
</strong>svn: Server sent unexpected return value (500 Internal Server Error) in response to MKACTIVITY request for '/repos/test_project/!svn/act/...'</pre>
<p>คอนฟิกที่ใช้เป็นการรัน svn โดยเขียน อ่าน ไฟล์ repos ผ่านทาง Apache DAV</p>
<p><span id="more-1140"></span></p>
<p>ตัวอย่างคอนฟิกไฟล์ของ Apache เพื่อเก็บ svn repos บนเซิร์ฟเวอร์</p>
<pre>    &lt;Location /svn&gt;
        DAV svn
        SVNParentPath /var/svn/repos</pre>
<pre>        # Limit write permission to list of valid users.
        &lt;LimitExcept GET PROPFIND OPTIONS REPORT&gt;</pre>
<pre>            # Require SSL connection for password protection.
            # SSLRequireSSL</pre>
<pre>            AuthType Basic
            AuthName "Authorization Realm"
            AuthUserFile /var/svn/.htpasswd
            Require valid-user
        &lt;/LimitExcept&gt;
    &lt;/Location&gt;</pre>
<p>ตรวจสอบ error_log ที่เซิร์ฟเวอร์แล้ว มีข้อความประมาณ &#8220;couldn&#8217;t check user&#8221;</p>
<pre>[root@server ~]# <strong>tail /var/log/httpd/ssl_error_log
</strong>[Mon Jul 26 15:56:08 2010] [crit] [client x.x.x.x] configuration error:  <span style="color: #ff0000;">couldn't check <span style="color: #ff0000;">user</span></span><span style="color: #ff0000;">.  No user file?:</span> /repos/test_project/!svn/act/...</pre>
<p>ตอนแรกนึกว่าเป็นปัญหาเกี่ยวกับ permission ของไฟล์หรือไดเร็คทอรี พยายามแก้อยู่นาน จนกระทั่งเปลี่ยน chmod 777 ก็ยังไม่สามารถแก้ปัญหาได้</p>
<p>ลองแก้ปัญหาอยู่นาน ก็พบว่า ดันไปปิด module &#8220;mod_auth_basic&#8221; ในไฟล์คอนฟิก /etc/httpd/conf/httpd.conf ของ apache เลยทดลองเปิดขึ้นมา</p>
<pre>LoadModule auth_basic_module modules/mod_auth_basic.so</pre>
<p>ลองรัน svn อีกครั้ง ก็ยังขึ้น error เหมือนเดิม แต่ครั้งนี้ error_log ที่เซิร์ฟเวอร์เปลี่ยนไปเป็นบ่นเกี่ยวกับ &#8220;No groups file&#8221;</p>
<pre>[user1@client ~]$ <strong>svn --username user1 import test_project </strong><strong>https://192.168.1.1/svn/test_project/trunk/test_project</strong><strong> -m 'init release'
</strong>svn: Server sent unexpected return value (500 Internal Server Error) in response to MKACTIVITY request for '/repos/test_project/!svn/act/...'</pre>
<pre>[Mon Jul 26 16:30:05 2010] [crit] [client x.x.x.x] configuration error:  <span style="color: #ff0000;">couldn't check access.  No groups file?:</span> /repos/test_project/!svn/act/...</pre>
<p>ลองเปิด/ปิด module ต่างๆ อยู่นาน กระทั่งพบว่าต้องเปิดอีก module หนึ่งคือ &#8220;mod_authz_user&#8221;</p>
<pre>LoadModule authz_user_module modules/mod_authz_user.so</pre>
<p>หลังจากเปิด module ทั้งสองแล้วก็สามารถรัน svn ได้ตามปกติ</p>
<pre>[user1@client ~]$ <strong>svn --username user1 import test_project </strong><strong>https://192.168.1.1/svn/test_project/trunk/test_project</strong><strong> -m 'init'
</strong>Authentication realm: &lt;https://192.168.1.1:443&gt; Authorization Realm
Password for 'user1':
Adding         test_project/index.php</pre>
<h4>ข้อมูลอ้างอิง</h4>
<ul>
<li><a href="http://spalinux.com/2008/11/basic_using_subversion">การใช้งาน subversion เบื้องต้น</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://spalinux.com/2010/07/svn_error_mkactivity_request/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>คอนฟิก SNMP บน Solaris 10</title>
		<link>http://spalinux.com/2010/07/configure_snmp_on_solaris_10</link>
		<comments>http://spalinux.com/2010/07/configure_snmp_on_solaris_10#comments</comments>
		<pubDate>Sat, 17 Jul 2010 07:36:11 +0000</pubDate>
		<dc:creator>editor</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Performance]]></category>
		<category><![CDATA[SNMP]]></category>
		<category><![CDATA[Solaris]]></category>
		<category><![CDATA[solaris 10]]></category>

		<guid isPermaLink="false">http://spalinux.com/?p=1132</guid>
		<description><![CDATA[SNMP เป็นเครื่องมือหนึ่งที่สามารถใช้ดูการทำงานของเครื่อง เก็บประวัติการใช้ resource ต่างๆ ของเครื่อง ไม่ว่าจะเป็น CPU, Memory, Disk, Network แล้วสามารถนำมาใช้สร้างเป็นกราฟ รายงาน เพื่อวางแผนการเพิ่ม hardware เมื่อจำเป็นได้ ในบทความนี้จะอธิบายวิธีการคอนฟิกและรัน SNMP Server บน Solaris 10 เพื่อให้สามารถใช้โปรแกรม SNMP เช่น MRTG, Cacti, NMS  มาเก็บค่าต่างๆ ได้ ระบบทดสอบ บทความนี้ทดสอบบน Solaris 10 (x86) 10/09 # cat /etc/release                        Solaris 10 10/09 s10x_u8wos_08a X86            Copyright 2009 Sun Microsystems, Inc.  All Rights Reserved.                         [...]]]></description>
			<content:encoded><![CDATA[<p>SNMP เป็นเครื่องมือหนึ่งที่สามารถใช้ดูการทำงานของเครื่อง เก็บประวัติการใช้ resource ต่างๆ ของเครื่อง ไม่ว่าจะเป็น CPU, Memory, Disk, Network แล้วสามารถนำมาใช้สร้างเป็นกราฟ รายงาน เพื่อวางแผนการเพิ่ม hardware เมื่อจำเป็นได้</p>
<p>ในบทความนี้จะอธิบายวิธีการคอนฟิกและรัน SNMP Server บน Solaris 10 เพื่อให้สามารถใช้โปรแกรม SNMP เช่น MRTG, Cacti, NMS  มาเก็บค่าต่างๆ ได้</p>
<p><span id="more-1132"></span></p>
<h4>ระบบทดสอบ</h4>
<p>บทความนี้ทดสอบบน Solaris 10 (x86) 10/09</p>
<pre># <strong>cat /etc/release
</strong>                       Solaris 10 10/09 s10x_u8wos_08a X86
           Copyright 2009 Sun Microsystems, Inc.  All Rights Reserved.
                        Use is subject to license terms.
                           Assembled 16 September 2009</pre>
<h4>รันเซอร์วิส sma</h4>
<p>โปรแกรมชุด SNMP หรือ System Management Agent ใน Solaris 10 ได้มาจาก Net-SNMP ซึ่งเป็น freeware โดยจะถูกติดตั้งใน path ที่ชื่อ /usr/sfw/ ดังนี้น เวลารันคำสั่ง อาจต้องมีการระบุ PATH เพิ่มเติม</p>
<p>System Management Agent บน Solaris 10 ถูกควบคุมด้วยเซอร์วิสที่ชื่อ sma</p>
<p>ใช้คำสั่ง svcs เพื่อตรวจสอบว่ารันเซอร์วิส sma อยู่หรือไม่</p>
<pre># <strong>svcs -a | grep sma
</strong>disabled       13:50:30 svc:/application/management/sma:default</pre>
<p>หมายเหตุ ต้องระบุออปชั่น &#8216;-a&#8217; เพื่อดูชื่อเซอร์วิสทั้งหมด ทั้งที่ enable และ disable ไว้</p>
<p>ไฟล์คอนฟิกของ SNMP Server คือ /etc/sma/snmp/snmpd.conf</p>
<pre># <strong>cat /etc/sma/snmp/snmpd.conf
</strong>...
###########################################################################
#
# SECTION: Access Control Setup
#
#   This section defines who is allowed to talk to your running
#   snmp agent.</pre>
<pre># rocommunity: a SNMPv1/SNMPv2c read-only access community name
#   arguments:  community [default|hostname|network/bits] [oid]</pre>
<pre>rocommunity  public
...</pre>
<p>ดีฟอลต์ SNMP Community String แบบ read-only คือ &#8220;public&#8221; แนะนำให้เปลี่ยน เช่นเปลี่ยนเป็น &#8220;test_public_read&#8221;</p>
<pre># <strong>cat /etc/sma/snmp/snmpd.conf
</strong>...
rocommunity  <strong>test_public_read
</strong>...</pre>
<p>ใช้คำสั่ง svcadm เพื่อรันเซอร์วิส sma</p>
<pre># <strong>svcadm enable svc:/application/management/sma:default</strong></pre>
<pre># <strong>svcs -a  | grep sma
</strong>online         14:18:37 svc:/application/management/sma:default</pre>
<p>ใช้คำสั่ง ps เพื่อตรวจสอบ process ของ snmpd (SNMP Server)</p>
<pre># <strong>ps -ef | grep snmp
</strong>    root  1008     1   0 14:18:38 ?           0:00 /usr/sfw/sbin/snmpd</pre>
<p>ทดลองใช้คำสั่ง snmpwalk เพื่อ walk ค่าต่างๆ ผ่านทาง SNMP</p>
<pre># <strong>/usr/sfw/bin/snmpwalk -v 1 -c test_public_read 127.0.0.1 system
</strong>SNMPv2-MIB::sysDescr.0 = STRING: SunOS sol10u8-zfs64a 5.10 Generic_141445-09 i86pc
SNMPv2-MIB::sysObjectID.0 = OID: NET-SNMP-MIB::netSnmpAgentOIDs.3
DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (12062) 0:02:00.62
SNMPv2-MIB::sysContact.0 = STRING: "System administrator"
SNMPv2-MIB::sysName.0 = STRING: sol10u8-zfs64a
SNMPv2-MIB::sysLocation.0 = STRING: "System administrators office"
SNMPv2-MIB::sysServices.0 = INTEGER: 72
SNMPv2-MIB::sysORLastChange.0 = Timeticks: (64) 0:00:00.64
SNMPv2-MIB::sysORID.1 = OID: IF-MIB::ifMIB
SNMPv2-MIB::sysORID.2 = OID: SNMPv2-MIB::snmpMIB
SNMPv2-MIB::sysORID.3 = OID: TCP-MIB::tcpMIB
...</pre>
<h4>ข้อมูลอ้างอิง</h4>
<ul>
<li><a href="http://docs.sun.com/app/docs/doc/817-3000/introduction-1?l=en&amp;a=view" target="_blank">Solaris System Management Agent Administration Guide</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://spalinux.com/2010/07/configure_snmp_on_solaris_10/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ติดตั้ง OpenLDAP Server บน Fedora 13</title>
		<link>http://spalinux.com/2010/07/install_openldap_server_on_fedora_13</link>
		<comments>http://spalinux.com/2010/07/install_openldap_server_on_fedora_13#comments</comments>
		<pubDate>Fri, 16 Jul 2010 08:19:45 +0000</pubDate>
		<dc:creator>editor</dc:creator>
				<category><![CDATA[Authentication]]></category>
		<category><![CDATA[Directory Server]]></category>
		<category><![CDATA[ldap]]></category>
		<category><![CDATA[fedora 13]]></category>
		<category><![CDATA[openldap]]></category>

		<guid isPermaLink="false">http://spalinux.com/?p=1126</guid>
		<description><![CDATA[การเปลี่ยนแปลงอย่างหนึ่งใน Fedora เวอร์ชั่นหลังๆ คือการเปลี่ยนวิธีการคอนฟิก OpenLDAP ซึ่งจะเป็นรูปแบบใหม่ที่มีมาตั้งแต่ OpenLDAP เวอร์ชั่น 2.3 เป็นต้นมา แต่ทาง Fedora เพิ่งเริ่มนำมาใช้ แบบเก่าไฟล์คอนฟิกหลักจะอยู่ในไฟล์ /etc/openldap/slapd.conf แต่แบบใหม่คอนฟิกจะถูกเก็บแยกเป็นไฟล์ LDIF เป็นโครงสร้างอยู่ในไดเร็คทอรี /etc/openldap/slapd.d/ และเมื่อรันเซอร์วิส ไฟล์เหล่านี้จะถูกอ่านเข้าไปใน LDAP เลย ซึ่งทำให้เราสามารถแก้ไขคอนฟิกเซิร์ฟเวอร์ ได้ เหมือนกับการแก้ไขข้อมูลอื่นๆ ใน LDAP รายละเอียดเพิ่มเติมหาอ่านได้จาก ข้อมูลอ้างอิง Configuring slapd เพื่อความสะดวก ทางทีมพัฒนา OpenLDAP ได้สร้างคำสั่ง slaptest เพื่อใช้ในการเปลี่ยนคอนฟิกแบบเก่าไฟล์เดียว ให้เป็นรูปแบบใหม่ได้ ในบทความนี้จะแสดงขั้นตอนการติดตั้งและคอนฟิก OpenLDAP บนเครื่อง Fedora 13 (x86_64) ติดตั้ง openldap ใช้คำสั่ง rpm เพื่อตรวจสอบการติดตั้ง openldap ว่ามีอยู่แล้วหรือไม่ [root@fc13-64a ~]# rpm [...]]]></description>
			<content:encoded><![CDATA[<p>การเปลี่ยนแปลงอย่างหนึ่งใน Fedora เวอร์ชั่นหลังๆ คือการเปลี่ยนวิธีการคอนฟิก OpenLDAP ซึ่งจะเป็นรูปแบบใหม่ที่มีมาตั้งแต่ OpenLDAP เวอร์ชั่น 2.3 เป็นต้นมา แต่ทาง Fedora เพิ่งเริ่มนำมาใช้</p>
<p>แบบเก่าไฟล์คอนฟิกหลักจะอยู่ในไฟล์ /etc/openldap/slapd.conf แต่แบบใหม่คอนฟิกจะถูกเก็บแยกเป็นไฟล์ LDIF เป็นโครงสร้างอยู่ในไดเร็คทอรี /etc/openldap/slapd.d/ และเมื่อรันเซอร์วิส ไฟล์เหล่านี้จะถูกอ่านเข้าไปใน LDAP เลย ซึ่งทำให้เราสามารถแก้ไขคอนฟิกเซิร์ฟเวอร์ ได้ เหมือนกับการแก้ไขข้อมูลอื่นๆ ใน LDAP</p>
<p>รายละเอียดเพิ่มเติมหาอ่านได้จาก ข้อมูลอ้างอิง Configuring slapd</p>
<p>เพื่อความสะดวก ทางทีมพัฒนา OpenLDAP ได้สร้างคำสั่ง slaptest เพื่อใช้ในการเปลี่ยนคอนฟิกแบบเก่าไฟล์เดียว ให้เป็นรูปแบบใหม่ได้</p>
<p>ในบทความนี้จะแสดงขั้นตอนการติดตั้งและคอนฟิก OpenLDAP บนเครื่อง Fedora 13 (x86_64)</p>
<p><span id="more-1126"></span></p>
<h4>ติดตั้ง openldap</h4>
<p>ใช้คำสั่ง rpm เพื่อตรวจสอบการติดตั้ง openldap ว่ามีอยู่แล้วหรือไม่</p>
<pre>[root@fc13-64a ~]# <strong>rpm -qa | grep openldap
</strong>openldap-2.4.21-4.fc13.x86_64</pre>
<p>เพื่อจะคอนฟิกเป็นเซิร์ฟเวอร์ได้ ต้องติดตั้งไฟล์ rpm เพิ่มเติม บางไฟล์หาได้จากแผ่นดีวีดีติดตั้ง</p>
<pre>[root@fc13-64a ~]# <strong>mount /dev/scd0 /media
</strong>mount: block device /dev/sr0 is write-protected, mounting read-only
[root@fc13-64a ~]# <strong>cd /media/Packages/</strong></pre>
<pre>[root@fc13-64a Packages]# <strong>rpm -i libtool-ltdl-2.2.6-20.fc13.x86_64.rpm
</strong>[root@fc13-64a Packages]# <strong>rpm -i openldap-clients-2.4.21-4.fc13.x86_64.rpm</strong></pre>
<p>ดาวน์โหลดไฟล์เพิ่มเติมจาก fc13 Everything แล้วติดตั้ง</p>
<pre>[root@fc13-64a Everything]# <strong>rpm -i openldap-servers-2.4.21-4.fc13.x86_64.rpm</strong></pre>
<p>ไฟล์คอนฟิกดีฟอลต์ของ OpenLDAP จะถูกติดตั้งอยู่ใน /etc/openldap/</p>
<pre>[root@fc13-64a ~]# <strong>cd /etc/openldap/</strong></pre>
<pre>[root@fc13-64a openldap]# <strong>ls -l
</strong>total 24
drwxr-xr-x. 2 root root 4096 Feb 24 16:19 cacerts
-rw-r--r--. 1 root root  245 Feb 24 16:19 ldap.conf
drwxr-xr-x  3 root root 4096 Jul 16 20:37 schema
-rw-r-----  1 root ldap 4153 Feb 24 16:19 slapd.conf.bak
drwx------  3 ldap ldap 4096 Jul 16 20:37 slapd.d</pre>
<h4>รันเซอร์วิส</h4>
<p>ใช้คำสั่ง service เพิ่มรัน slapd (OpenLDAP server)</p>
<pre>[root@fc13-64a ~]# <strong>service slapd start
</strong>/var/lib/ldap/__db.004<span style="color: #ff0000;"> is not owned by "ldap" </span>             [WARNING]
/var/lib/ldap/__db.001 is not owned by "ldap"              [WARNING]
/var/lib/ldap/__db.002 is not owned by "ldap"              [WARNING]
/var/lib/ldap/__db.006 is not owned by "ldap"              [WARNING]
/var/lib/ldap/__db.005 is not owned by "ldap"              [WARNING]
/var/lib/ldap/alock is not owned by "ldap"                 [WARNING]
/var/lib/ldap/__db.003 is not owned by "ldap"              [WARNING]
ln: accessing `/var/run/openldap/slapd.pid': No such file or directory</pre>
<p>มีข้อผิดพลาดฟ้องเรื่อง permission ไม่ถูกต้อง</p>
<pre>[root@fc13-64a ~]# <strong>ls -l /var/lib/ldap/
</strong>total 884
-rw------- 1 <span style="color: #ff0000;">root root</span>   2048 Jul 16 20:37 alock
-rw------- 1 root root  24576 Jul 16 20:37 __db.001
-rw------- 1 root root 212992 Jul 16 20:37 __db.002
-rw------- 1 root root 270336 Jul 16 20:37 __db.003
-rw------- 1 root root 163840 Jul 16 20:37 __db.004
-rw------- 1 root root 802816 Jul 16 20:37 __db.005
-rw------- 1 root root  32768 Jul 16 20:37 __db.006</pre>
<p>ใช้คำสัง chown เพื่อเปลี่ยนเจ้าของไฟล์ (owner)</p>
<pre>[root@fc13-64a ldap]# <strong>chown ldap.ldap *
</strong>[root@fc13-64a ldap]# <strong>ls -l
</strong>total 884
-rw------- 1 <span style="color: #0000ff;">ldap ldap   </span>2048 Jul 16 20:37 alock
-rw------- 1 ldap ldap  24576 Jul 16 20:37 __db.001
-rw------- 1 ldap ldap 212992 Jul 16 20:37 __db.002
-rw------- 1 ldap ldap 270336 Jul 16 20:37 __db.003
-rw------- 1 ldap ldap 163840 Jul 16 20:37 __db.004
-rw------- 1 ldap ldap 802816 Jul 16 20:37 __db.005
-rw------- 1 ldap ldap  32768 Jul 16 20:37 __db.006</pre>
<p>ใช้คำสั่ง service เพื่อรันเซอร์วิสอีกครั้ง</p>
<pre>[root@fc13-64a ldap]# <strong>service slapd start
</strong>Starting slapd:                                            [  OK  ]</pre>
<p>ใช้คำสั่ง ps เพื่อตรวจสอบ process</p>
<pre>[root@fc13-64a ldap]# <strong>ps -ef | grep ldap
</strong>ldap     22636     1  0 21:18 ?        00:00:00 /usr/sbin/slapd -h  ldap:/// -u ldap</pre>
<p>ใช้คำสั่ง service เพื่อปิดเซอร์วิส</p>
<pre>[root@fc13-64a ldap]# <strong>service slapd stop
</strong>Stopping slapd:                                            [  OK  ]</pre>
<p>แล้วทดลองรันเซอร์วิสอีกครั้ง จะมีข้อความฟ้องเรื่อง performance</p>
<pre>[root@fc13-64a ldap]# <strong>service slapd start
</strong>Checking configuration files for slapd:                    [WARNING]
<span style="color: #ff0000;">bdb_db_open: warning - no DB_CONFIG file found in directory /var/lib/ldap: (2).
Expect poor performance for suffix "dc=my-domain,dc=com".
</span>config file testing succeeded
Starting slapd:                                            [  OK  ]</pre>
<p>ปิดเซอร์วิสอีกครั้ง</p>
<pre>[root@fc13-64a ldap]# <strong>service slapd stop
</strong>Stopping slapd:                                            [  OK  ]</pre>
<p>เพื่อปรับปรุงเรื่อง performance ต้องสร้างไฟล์ DB_CONFIG  จากตัวอย่างไฟล์ใน /usr/share/doc/openldap-servers-2.4.21/</p>
<pre>[root@fc13-64a ldap]# <strong>cp /usr/share/doc/openldap-servers-2.4.21/DB_CONFIG.example DB_CONFIG
</strong>[root@fc13-64a ldap]# <strong>chown ldap.ldap DB_CONFIG
</strong>[root@fc13-64a ldap]# <strong>chmod 600 DB_CONFIG</strong></pre>
<p>ทดสอบการเปิด/ปิด เซอร์วิส ครั้งแรกจะมีฟ้องว่า มีการปรับเปลี่ยนคอนฟิก แล้วหลังจากนั้นก็สามารถรันได้ตามปกติ</p>
<pre>[root@fc13-64a ldap]# <strong>service slapd start
</strong>Checking configuration files for slapd:                    [WARNING]
<span style="color: #0000ff;">bdb_db_open: DB_CONFIG for suffix "dc=my-domain,dc=com" has changed.
Performing database recovery to activate new settings.
</span>bdb_db_open: database "dc=my-domain,dc=com": recovery skipped in read-only mode. Run manual recovery if errors are encountered.
config file testing succeeded
Starting slapd:                                            [  OK  ]</pre>
<pre>[root@fc13-64a ldap]# <strong>service slapd stop</strong>
Stopping slapd:                                            [  OK  ]</pre>
<pre>[root@fc13-64a ldap]# <strong>service slapd start</strong>
Starting slapd:                                            [  OK  ]</pre>
<h4>ข้อมูลอ้างอิง</h4>
<ul>
<li><a href="http://spalinux.com/2009/05/install_openldap_server_on_fedora_10">ติดตั้ง OpenLDAP Server บน Fedora 10</a></li>
<li><a href="http://www.openldap.org/doc/admin24/slapdconf2.html" target="_blank">OpenLDAP Software 2.4 Administrator&#8217;s Guide: Configuring slapd</a></li>
<li><a href="http://www.mirror.in.th/osarchive/fedora/releases/13/Everything/x86_64/os/Packages/" target="_blank">Fedora 13 x86_64 Everything</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://spalinux.com/2010/07/install_openldap_server_on_fedora_13/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>แก้ปัญหาติดตั้ง CentOS 5.5 ใน VirtualBox Guest ไม่ได้</title>
		<link>http://spalinux.com/2010/07/cannot_intall_centos_5-5_in_virtualbox_guest</link>
		<comments>http://spalinux.com/2010/07/cannot_intall_centos_5-5_in_virtualbox_guest#comments</comments>
		<pubDate>Sun, 11 Jul 2010 14:45:51 +0000</pubDate>
		<dc:creator>editor</dc:creator>
				<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Linux Installation]]></category>
		<category><![CDATA[VirtualBox]]></category>
		<category><![CDATA[Virtualization]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[I/O APIC]]></category>

		<guid isPermaLink="false">http://spalinux.com/?p=1118</guid>
		<description><![CDATA[ช่วงนี้ทดสอบ VirtualBox บนหลายๆ OS ทั้งเป็น Host และ Guest มาติดปัญหาตอนพยายามลง CentOS 5.5 ใน Guest คือบู๊ตเครื่องแล้วค้างไม่สามารถติดตั้งได้ หลังจากหาวิธีการแก้ไขปัญหาได้แล้ว เลยมาแชร์กัน PCI: Using ACPI for IRQ routing PCI: If a device doesn't work, try "pci=routeirq".  If it helps, post a report NetLabel: Initializing NetLabel:  domain hash size = 128 NetLabel:  protocols = UNLABELED CIPSOv4 NetLabel:  unlabeled traffic allowed by default ACPI: [...]]]></description>
			<content:encoded><![CDATA[<p>ช่วงนี้ทดสอบ VirtualBox บนหลายๆ OS ทั้งเป็น Host และ Guest มาติดปัญหาตอนพยายามลง CentOS 5.5 ใน Guest คือบู๊ตเครื่องแล้วค้างไม่สามารถติดตั้งได้ หลังจากหาวิธีการแก้ไขปัญหาได้แล้ว เลยมาแชร์กัน</p>
<pre><span id="more-1118"></span>PCI: Using ACPI for IRQ routing
PCI: If a device doesn't work, try "pci=routeirq".  If it helps, post a report
NetLabel: Initializing
NetLabel:  domain hash size = 128
NetLabel:  protocols = UNLABELED CIPSOv4
NetLabel:  unlabeled traffic allowed by default
ACPI: DMAR not present
<span style="color: #ff0000;">PCI-GART: No AMD northbridge found.
</span>NET: Registered protocol family 2</pre>
<p>คอนฟิกที่ใช้สร้าง Guest คือ</p>
<pre>$ <strong>VBoxManage showvminfo "CentOS-5.5"
</strong>Oracle VM VirtualBox Command Line Management Interface Version 3.2.6
(C) 2005-2010 Oracle Corporation
All rights reserved.</pre>
<pre>Name:            CentOS-5.5
Guest OS:        Red Hat (64 bit)
UUID:            xxx
...
Memory size:     2048MB
Page Fusion:     off
VRAM size:       8MB
HPET:            off
Number of CPUs:  1
Synthetic Cpu:   off
CPUID overrides: None
Boot menu mode:  message and menu
Boot Device (1): Floppy
Boot Device (2): DVD
Boot Device (3): HardDisk
Boot Device (4): Not Assigned
ACPI:            on
<strong><span style="color: #0000ff;">IOAPIC:          off
</span></strong>PAE:             on
...</pre>
<p>หลังจากค้นหาวิธีการแก้ไขด้วย google ก็พบวิธีแก้ไข คือต้องเปิดคุณสมบัติ I/O APIC</p>
<p>ปิด Guest OS แล้วใช้คำสั่ง VBomxManage modifyvm เพื่อแก้ไขคอนฟิกของ Guest วิธีการเปิด/ปิด คุณสมบัติ I/O APIC</p>
<pre>$ VBoxManage modifyvm &lt;uuid|name&gt; [--ioapic on|off]</pre>
<p>ตัวอย่างการเปิดคุณสมบัติ I/O APIC</p>
<pre>$ <strong>VBoxManage modifyvm "CentOS-5.5" --ioapic on
</strong>Oracle VM VirtualBox Command Line Management Interface Version 3.2.6
(C) 2005-2010 Oracle Corporation
All rights reserved.</pre>
<p>ตรวจสอบคอนฟิกหลังการแก้ไข</p>
<pre>$ <strong>VBoxManage showvminfo "CentOS-5.5"
</strong>...
ACPI:            on
<strong><span style="color: #0000ff;">IOAPIC:          on
</span></strong>PAE:             on
...</pre>
<p>เปิด Guest OS อีกครั้งแล้วทดลองติดตั้ง CentOS 5.5 อีกที</p>
<h4>ข้อมูลอ้างอิง</h4>
<ul>
<li><a href="http://forums.virtualbox.org/viewtopic.php?f=3&amp;t=19658" target="_blank">Unable to install Centos 5.2 64bit as guest.</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://spalinux.com/2010/07/cannot_intall_centos_5-5_in_virtualbox_guest/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>เปลี่ยน MySQL Prompt</title>
		<link>http://spalinux.com/2010/07/change_mysql_prompt</link>
		<comments>http://spalinux.com/2010/07/change_mysql_prompt#comments</comments>
		<pubDate>Fri, 02 Jul 2010 08:17:18 +0000</pubDate>
		<dc:creator>editor</dc:creator>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[mysql prompt]]></category>

		<guid isPermaLink="false">http://spalinux.com/?p=1115</guid>
		<description><![CDATA[เริ่มมีหลายฐานข้อมูลมากขึ้น เวลาใช้คำสั่ง mysql เพื่อจัดการฐานข้อมูลอาจงงๆ ว่าตอนนี้แก้ไขฐานข้อมูลใดอยู่ การเปลี่ยน prompt ในคำสั่ง mysql จะช่วยคุณได้ วิธีง่ายๆ คือตั้งค่าตัวแปรใน shell ที่ชื่อ MYSQL_PS1 ก่อนที่จะรันคำสั่ง ซึ่งวิธีการตั้งค่าจะแตกต่างกันในแต่ละ shell สำหรับ BASH shell ดีฟอลต์ของลีนุกซ์ส่วนใหญ่ทำได้โดย $ export MYSQL_PS1="\u@\d&#62; " $ mysql -u root -p Enter password: root@(none)&#62; root@(none)&#62; connect project1 root@project1&#62; สังเกตว่า prompt จะเปลี่ยนไปตามชื่อ user &#8220;\u&#8221; กับชื่อฐานข้อมูล &#8220;\d&#8221; ที่ใช้ หรือถ้าสามารถแก้ไขไฟล์ /etc/my.cnf ได้ ก็สามารถทำได้โดยเพิ่มคอนฟิก prompt ลงไปในส่วนที่คอนฟิกของ [mysql] [mysql] prompt="\u@\d&#62; [...]]]></description>
			<content:encoded><![CDATA[<p>เริ่มมีหลายฐานข้อมูลมากขึ้น เวลาใช้คำสั่ง mysql เพื่อจัดการฐานข้อมูลอาจงงๆ ว่าตอนนี้แก้ไขฐานข้อมูลใดอยู่ การเปลี่ยน prompt ในคำสั่ง mysql จะช่วยคุณได้</p>
<p><span id="more-1115"></span></p>
<p>วิธีง่ายๆ คือตั้งค่าตัวแปรใน shell ที่ชื่อ MYSQL_PS1 ก่อนที่จะรันคำสั่ง ซึ่งวิธีการตั้งค่าจะแตกต่างกันในแต่ละ shell สำหรับ BASH shell ดีฟอลต์ของลีนุกซ์ส่วนใหญ่ทำได้โดย</p>
<pre>$ <strong>export MYSQL_PS1="\u@\d&gt; "</strong></pre>
<pre>$ <strong>mysql -u root -p
</strong>Enter password:</pre>
<pre>root@(none)&gt;
root@(none)&gt; <strong>connect project1
</strong>root@project1&gt;</pre>
<p>สังเกตว่า prompt จะเปลี่ยนไปตามชื่อ user &#8220;\u&#8221; กับชื่อฐานข้อมูล &#8220;\d&#8221; ที่ใช้</p>
<p>หรือถ้าสามารถแก้ไขไฟล์ /etc/my.cnf ได้ ก็สามารถทำได้โดยเพิ่มคอนฟิก prompt ลงไปในส่วนที่คอนฟิกของ [mysql]</p>
<pre>[mysql]
prompt="\u@\d&gt; "</pre>
<p>มีค่าอื่นๆ ที่สามารถตั้งเป็น prompt ได้ ดูรายละเอียดเพิ่มเติมในส่วนข้อมูลอ้างอิง</p>
<h4>ข้อมูลอ้างอิง</h4>
<ul>
<li><a href="http://dev.mysql.com/doc/refman/5.1/en/mysql-commands.html" target="_blank">MySQL 5.1 Reference Manual :: mysql Commands</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://spalinux.com/2010/07/change_mysql_prompt/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ปัญหาการใช้ SSH Public Key Authentication บน Solaris</title>
		<link>http://spalinux.com/2010/06/ssh_public_key_authentication_problem_on_solaris</link>
		<comments>http://spalinux.com/2010/06/ssh_public_key_authentication_problem_on_solaris#comments</comments>
		<pubDate>Sat, 05 Jun 2010 10:40:51 +0000</pubDate>
		<dc:creator>editor</dc:creator>
				<category><![CDATA[Authentication]]></category>
		<category><![CDATA[SSH]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Solaris]]></category>
		<category><![CDATA[Troubleshooting]]></category>
		<category><![CDATA[secure shell]]></category>

		<guid isPermaLink="false">http://spalinux.com/?p=1110</guid>
		<description><![CDATA[พยายามคอนฟิก Public Key Authentication เพื่อ login เข้าสู่เครื่องที่ติดตั้ง Solaris อยู่นาน ก็ไม่สามารถทำได้ แต่ในที่สุดก็สามารถหาปัญหาได้ เลยมาแชร์ประสบการณ์เผื่อจะเป็นประโยชน์ ทดสอบปัญหา เริ่มต้นเพิ่ม user บนเครื่องที่ติดตั้ง Solaris 10 สมมติว่าชื่อ user1 [root@solaris ~]# useradd user1 [root@solaris ~]# id user1 uid=502(user1) gid=1(other) groups=1(other) แก้ไข home ของ user1 ให้อยู่ใน /export/home/ และสร้างไดเร็คทอรี [root@solaris ~]# cat /etc/passwd ... user1:x:502:1::/export/home/user1:/bin/sh [root@solaris ~]# cd /export/home [root@solaris home]# mkdir user1 [root@solaris home]# chown [...]]]></description>
			<content:encoded><![CDATA[<p>พยายามคอนฟิก Public Key Authentication เพื่อ login เข้าสู่เครื่องที่ติดตั้ง Solaris อยู่นาน ก็ไม่สามารถทำได้ แต่ในที่สุดก็สามารถหาปัญหาได้ เลยมาแชร์ประสบการณ์เผื่อจะเป็นประโยชน์</p>
<p><span id="more-1110"></span></p>
<h4>ทดสอบปัญหา</h4>
<p>เริ่มต้นเพิ่ม user บนเครื่องที่ติดตั้ง Solaris 10 สมมติว่าชื่อ user1</p>
<pre>[root@solaris ~]# <strong>useradd user1
</strong>[root@solaris ~]# <strong>id user1
</strong>uid=502(user1) gid=1(other) groups=1(other)</pre>
<p>แก้ไข home ของ user1 ให้อยู่ใน /export/home/ และสร้างไดเร็คทอรี</p>
<pre>[root@solaris ~]# <strong>cat /etc/passwd
</strong>...
user1:x:502:1::<span style="color: #0000ff;">/export/home/user1</span>:/bin/sh</pre>
<pre>[root@solaris ~]# <strong>cd /export/home
</strong>[root@solaris home]# <strong>mkdir user1
</strong>[root@solaris home]# <strong>chown user1 user1/
</strong>[root@solaris home]# <strong>su - user1
</strong>[user1@solaris ~]$ <strong>pwd
</strong>/export/home/user1</pre>
<p>ต้องการให้ admin1 จากเครื่องที่ติดตั้ง linux สามารถ ssh ด้วย public key authentication เป็น user1 บนเครื่อง Solaris ได้</p>
<p>สร้าง public, private key ของ admin1</p>
<pre>[admin1@linux ~]$ <strong>ssh-keygen -t rsa
</strong>Generating public/private rsa key pair.
Enter file in which to save the key (/home/admin1/.ssh/id_rsa):
Created directory '/home/admin1/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/admin1/.ssh/id_rsa.
Your public key has been saved in /home/admin1/.ssh/id_rsa.pub.</pre>
<pre>[admin1@linux ~]$ <strong>cat .ssh/id_rsa.pub
</strong><span style="color: #0000ff;">ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAtMbbgeFnn6vEo3IAVh... admin1@linux</span></pre>
<p>copy ไฟล์ id_rsa.pub ของ admin1 ไปใส่ไว้ในไฟล์ authorized_keys ของ user1 บนเครื่อง Solaris</p>
<pre>[user1@solaris ~]$ <strong>cat .ssh/authorized_keys
</strong><span style="color: #0000ff;">ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAtMbbgeFnn6vEo3IAVh... admin1@linux</span></pre>
<p>ทดสอบ ssh จากเครื่อง linux</p>
<pre>[admin1@linux ~]$ <strong>ssh -l user1 solaris
</strong>The authenticity of host 'solaris (192.168.1.2)' can't be established.
RSA key fingerprint is ...
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'solaris' (RSA) to the list of known hosts.
Password:</pre>
<p>ขึ้นให้ใส่ password ไม่สามารถ login ด้วย public key authentication ได้</p>
<h4>วิธีการแก้ไขปัญหา</h4>
<p>หลังจากพยายามอยู่นาน ก็พบว่า ssh จะตรวจสอบสถานะ password ของผู้ใช้ด้วย ซึ่งถ้าดูในไฟล์ /etc/shadow จะเห็นว่า user1 จะถูก lock อยู่</p>
<pre>[root@solaris ~]# <strong>cat /etc/shadow
</strong>...
user1:<span style="color: #ff0000;"><strong>*LK*</strong></span>:::::::</pre>
<p>ฟิลด์ที่สองในไฟล์ /etc/shadow คือ encrypted password คำอธิบายจาก man ของ shadow คือ</p>
<pre># <strong>man shadow
</strong>...
     password        An encrypted password for the user generated
                     by crypt(3C), a lock string to indicate that
                     the login is not accessible, or  no  string,
                     which  shows  that  there is no password for
                     the login.</pre>
<pre>                     The lock string is defined as <span style="color: #ff0000;"> *LK*</span>  in  the
                     first four characters of the password field.
...</pre>
<p>การแก้ไขคือ ลบตัวอักษร LK ออก เช่นให้เหลือแต่เครื่องหมาย *</p>
<pre>[root@solaris ~]# <strong>cat /etc/shadow
</strong>...
user1:<span style="color: #ff0000;">*</span>:::::::</pre>
<p>ทดสอบ ssh จากเครื่อง linux อีกครั้ง ก็จะได้ตามที่ต้องการ</p>
<pre>[admin1@linux ~]$ <strong>ssh -l user1 solaris
</strong>[user1@solaris ~]$</pre>
<h4>ข้อมูลอ้างอิง</h4>
<ul>
<li><a href="http://spalinux.com/2008/10/ssh_secure_shell_login_using_public_key_authentication">SSH – Secure Shell ล็อกอินด้วย Public Key Authentication</a></li>
<li><a href="http://forums.sun.com/thread.jspa?threadID=5229706" target="_blank">Sun Networking Services and Protocols &#8211; SSH PermitEmptyPasswords with PASSREQ</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://spalinux.com/2010/06/ssh_public_key_authentication_problem_on_solaris/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>คอนฟิก Solaris IP Filter</title>
		<link>http://spalinux.com/2010/05/configure_solaris_ip_filter</link>
		<comments>http://spalinux.com/2010/05/configure_solaris_ip_filter#comments</comments>
		<pubDate>Sat, 22 May 2010 08:46:27 +0000</pubDate>
		<dc:creator>editor</dc:creator>
				<category><![CDATA[Firewall]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Solaris]]></category>
		<category><![CDATA[ip filter]]></category>
		<category><![CDATA[solaris 10]]></category>

		<guid isPermaLink="false">http://spalinux.com/?p=1104</guid>
		<description><![CDATA[บทความนี้กล่าวถึงวิธีการใช้คำสั่ง ipf เพื่อสร้าง rule ของ Solaris IP Filter แบบง่ายๆ เพื่อใช้กำหนด packet เข้าออกเครื่อง Solaris IP Filter เป็นโปรแกรม Firewall ที่ควบคุม packet เข้า/ออก เครื่องที่ติดตั้ง Solaris ได้ ipf เป็นคำสั่งที่ใช้ในการแก้ไขกฎ (rule) ของ Solaris IP Filter หมายเหตุ ตัวอย่างในบทความนี้ทดสอบบนเครื่องที่ติดตั้ง Solaris 10 10/09 s10x_u8wos_08a X86 ทดสอบกับเครื่องที่สามารถคอนโซลหน้าจอได้เท่านั้น เพราะถ้าคอนฟิก rule ของ Firewall ผิดพลาด อาจทำให้คุณไม่สามารถ remote เช่น Secure Shell ได้ 1. เปิด (Start) เซอร์วิส ipfilter โดยดีฟอลต์จากการติดตั้ง [...]]]></description>
			<content:encoded><![CDATA[<p>บทความนี้กล่าวถึงวิธีการใช้คำสั่ง ipf เพื่อสร้าง rule ของ Solaris IP Filter แบบง่ายๆ เพื่อใช้กำหนด packet เข้าออกเครื่อง</p>
<p><span id="more-1104"></span></p>
<p>Solaris IP Filter เป็นโปรแกรม Firewall ที่ควบคุม packet เข้า/ออก เครื่องที่ติดตั้ง Solaris ได้</p>
<p>ipf เป็นคำสั่งที่ใช้ในการแก้ไขกฎ (rule) ของ Solaris IP Filter</p>
<p>หมายเหตุ</p>
<ul>
<li>ตัวอย่างในบทความนี้ทดสอบบนเครื่องที่ติดตั้ง Solaris 10 10/09 s10x_u8wos_08a X86</li>
<li>ทดสอบกับเครื่องที่สามารถคอนโซลหน้าจอได้เท่านั้น เพราะถ้าคอนฟิก rule ของ Firewall ผิดพลาด อาจทำให้คุณไม่สามารถ remote เช่น Secure Shell ได้</li>
</ul>
<h4>1. เปิด (Start) เซอร์วิส ipfilter</h4>
<p>โดยดีฟอลต์จากการติดตั้ง เซอร์วิส IP Filter จะถูกปิดการใช้งาน</p>
<p>ใช้คำสั่ง svcs ตรวจสอบสถานะ</p>
<pre># <strong>svcs -av | grep ipfilter
</strong>disabled       -             15:25:36      - svc:/network/ipfilter:default</pre>
<p>ใช้คำสั่ง svcadm เพื่อเปิดการเซอร์วิส</p>
<pre># <strong>svcadm enable ipfilter</strong></pre>
<pre># <strong>svcs -av | grep ipfilter
</strong>online         -             15:27:14      - svc:/network/ipfilter:default</pre>
<h4>2. เปิดคุณสมบัติ (Enable) IP Filter</h4>
<p>ขั้นต่อมา ใช้คำสั่ง ipf -E เพื่อเปิดคุณสมบัติ IP Filter</p>
<pre># <strong>ipf -E</strong></pre>
<h4>3. ทดลองการสร้าง rule แบบง่ายๆ</h4>
<p>สร้างไฟล์ /etc/ipf/ipf.conf เพื่อกำหนด rule ที่ต้องการ</p>
<p>ตัวอย่างเช่น ต้องการสร้าง rule เพื่อกำหนดให้เฉพาะเครื่องที่มี IP 192.168.1.2 เท่านั้นที่สามารถ ping (ICMP) เข้ามาที่เครื่องทางพอร์ต e1000g0 ได้</p>
<pre># <strong>cat /etc/ipf/ipf.conf</strong></pre>
<pre>block in on e1000g0 proto icmp from any to any
pass in on e1000g0 proto icmp from 192.168.1.2/32 to any</pre>
<p>หลังจากสร้างไฟล์เรียบร้อย พิมพ์คำสั่ง ipf -f ตามด้วยไฟล์ ipf.conf เพื่อเริ่มการบังคับใช้ rule ที่สร้างขึ้น</p>
<pre># <strong>ipf -f /etc/ipf/ipf.conf</strong></pre>
<p>*** 4. ลบ (Flush) rule ออกไป ***</p>
<p>หากต้องการยกเลิก rule ที่สร้างขึ้น ใช้คำสั่ง ipf -F เพื่อ ลบ (flush) rule ที่มีออกไป</p>
<pre># <strong>ipf -F a</strong></pre>
<h4>5. ปิดคุณสมบัติ (Disable) IP Filter</h4>
<p>ใช้คำสั่ง ipf -D เพื่อปิดคุณสมบัติ IP Filter</p>
<pre># <strong>ipf -D</strong></pre>
<h4>ตัวอย่าง rule</h4>
<p>มีตัวอย่างการสร้างไฟล์ ipf.conf เพื่อกำหนด rule แบบต่างๆ /usr/share/ipfilter/examples/</p>
<h4>ข้อมูลอ้างอิง</h4>
<ul>
<li>man ipf</li>
<li><a href="http://docs.sun.com/app/docs/doc/816-4554/eupsq?l=en&amp;a=view" target="_blank">System Administration Guide: Solaris IP Filter (Overview)</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://spalinux.com/2010/05/configure_solaris_ip_filter/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>เพิ่มดิสก์ใหม่บน Solaris 10</title>
		<link>http://spalinux.com/2010/03/add_new_disk_on_solaris_10</link>
		<comments>http://spalinux.com/2010/03/add_new_disk_on_solaris_10#comments</comments>
		<pubDate>Sun, 07 Mar 2010 16:02:40 +0000</pubDate>
		<dc:creator>editor</dc:creator>
				<category><![CDATA[Disk]]></category>
		<category><![CDATA[Filesystem]]></category>
		<category><![CDATA[Solaris]]></category>
		<category><![CDATA[solaris 10]]></category>

		<guid isPermaLink="false">http://spalinux.com/?p=1100</guid>
		<description><![CDATA[เช่นเดียวกับระบบปฏิบัติการ OS อื่นๆ เมื่อมีการเพิ่มดิสก์ก้อนใหม่เข้าไปในเครื่องที่ติดตั้ง Solaris 10 ต้องมีกระบวนการ หรือต้องรันคำสั่งก่อนที่จะเริ่มใช้ดิสก์ก้อนใหม่ได้ ในบทความนี้ทดสอบการเพิ่มดิสก์ก้อนใหม่ 1 ก้อน บน Solaris 10 (x86) ใช้คำสั่ง format เพื่อดูว่า Solaris มองเห็นดิสก์อะไรบ้าง # format Searching for disks...done AVAILABLE DISK SELECTIONS:        0. c1t0d0 &#60;DEFAULT cyl 4866 alt 2 hd 255 sec 63&#62;           /pci@0,0/pci1000,30@10/sd@0,0        1. c1t1d0 &#60;DEFAULT cyl 4867 alt 2 hd 255 sec 63&#62;           [...]]]></description>
			<content:encoded><![CDATA[<p>เช่นเดียวกับระบบปฏิบัติการ OS อื่นๆ เมื่อมีการเพิ่มดิสก์ก้อนใหม่เข้าไปในเครื่องที่ติดตั้ง Solaris 10 ต้องมีกระบวนการ หรือต้องรันคำสั่งก่อนที่จะเริ่มใช้ดิสก์ก้อนใหม่ได้</p>
<p><span id="more-1100"></span></p>
<p>ในบทความนี้ทดสอบการเพิ่มดิสก์ก้อนใหม่ 1 ก้อน บน Solaris 10 (x86)</p>
<p>ใช้คำสั่ง format เพื่อดูว่า Solaris มองเห็นดิสก์อะไรบ้าง</p>
<pre># <strong>format</strong>
Searching for disks...done</pre>
<pre>AVAILABLE DISK SELECTIONS:
       0. c1t0d0 &lt;DEFAULT cyl 4866 alt 2 hd 255 sec 63&gt;
          <a>/pci@0,0/pci1000,30@10/sd@0,0</a>
       <span style="color: #0000ff;"><strong>1. c1t1d0</strong></span> &lt;DEFAULT cyl 4867 alt 2 hd 255 sec 63&gt;
          <a>/pci@0,0/pci1000,30@10/sd@1,0</a>
Specify disk (enter its number):</pre>
<p>ดิสก์ก้อนใหม่ที่เพิ่มเข้ามาคือดิสก์หมายเลข 1 &#8220;c1t1d0&#8243;</p>
<p>พิมพ์หมายเลขของดิสก์แล้วกด [Enter] เพื่อเข้าสู่โหมดจัดการของดิสก์ก้อนที่ระบุ</p>
<pre>Specify disk (enter its number): <strong>1</strong>
selecting c1t1d0
[disk formatted]</pre>
<pre>FORMAT MENU:
        disk       - select a disk
        type       - select (define) a disk type
        partition  - select (define) a partition table
        current    - describe the current disk
        format     - format and analyze the disk
        fdisk      - run the fdisk program
        repair     - repair a defective sector
        label      - write label to the disk
        analyze    - surface analysis
        defect     - defect list management
        backup     - search for backup labels
        verify     - read and display labels
        save       - save new disk/partition definitions
        inquiry    - show vendor, product and revision
        volname    - set 8-character volume name
        !&lt;cmd&gt;     - execute &lt;cmd&gt;, then return
        quit</pre>
<p>พิมพ์คำสั่ง partition เพื่อเข้าสู่โหมดการแบ่ง partition</p>
<pre>format&gt; <strong>partition</strong>
<span style="color: #ff0000;">WARNING - This disk may be in use by an application that has
          modified the fdisk table. Ensure that this disk is
          not currently in use before proceeding to use fdisk.</span></pre>
<p>หากเจอข้อความ WARNING แบบด้านบน ให้พิมพ์คำสั่ง fdisk เพื่อแก้ไข</p>
<pre>format&gt; <strong>fdisk</strong>
No fdisk table exists. The default partition for the disk is:</pre>
<pre>  a 100% "SOLARIS System" partition</pre>
<pre>Type "y" to accept the default partition,  otherwise type "n" to edit the
 partition table.
<strong>y</strong>
format&gt;</pre>
<p>พิมพ์คำสั่ง partition อีกครั้ง</p>
<pre>format&gt; <strong>partition</strong></pre>
<pre>PARTITION MENU:
        0      - change `0' partition
        1      - change `1' partition
        2      - change `2' partition
        3      - change `3' partition
        4      - change `4' partition
        5      - change `5' partition
        6      - change `6' partition
        7      - change `7' partition
        select - select a predefined table
        modify - modify a predefined partition table
        name   - name the current table
        print  - display the current table
        label  - write partition map and label to the disk
        !&lt;cmd&gt; - execute &lt;cmd&gt;, then return
        quit
partition&gt;</pre>
<p>พิมพ์คำสั่ง print เพื่อแสดงการแบ่ง partition</p>
<pre>partition&gt; <strong>print</strong>
Current partition table (original):
Total disk cylinders available: 4866 + 2 (reserved cylinders)</pre>
<pre>Part      Tag    Flag     Cylinders        Size            Blocks
<span style="color: #0000ff;">  0 unassigned    wm       0               0         (0/0/0)           0
</span>  1 unassigned    wm       0               0         (0/0/0)           0
  2     backup    wu       0 - 4865       37.28GB    (4866/0/0) 78172290
  3 unassigned    wm       0               0         (0/0/0)           0
  4 unassigned    wm       0               0         (0/0/0)           0
  5 unassigned    wm       0               0         (0/0/0)           0
  6 unassigned    wm       0               0         (0/0/0)           0
  7 unassigned    wm       0               0         (0/0/0)           0
  8       boot    wu       0 -    0        7.84MB    (1/0/0)       16065
  9 unassigned    wm       0               0         (0/0/0)           0</pre>
<pre>partition&gt;</pre>
<p>เริ่มต้น ทดลองสร้าง partition 0 มีขนาด 10 GB</p>
<pre>partition&gt; <strong>0</strong>
Part      Tag    Flag     Cylinders        Size            Blocks
  0 unassigned    wm       0               0         (0/0/0)           0</pre>
<pre>Enter partition id tag[unassigned]:
Enter partition permission flags[wm]:
Enter new starting cyl[0]:
Enter partition size[0b, 0c, 0e, 0.00mb, 0.00gb]: <strong>10gb</strong></pre>
<p>ใช้คำสั่ง print เพื่อแสดง partition</p>
<pre>partition&gt; <strong>print</strong>
Current partition table (unnamed):
Total disk cylinders available: 4866 + 2 (reserved cylinders)</pre>
<pre>Part      Tag    Flag     Cylinders        Size            Blocks
<span style="color: #0000ff;">  0 unassigned    wm       0 - 1305       10.00GB    (1306/0/0) 20980890
</span>  1 unassigned    wm       0               0         (0/0/0)           0
  2     backup    wu       0 - 4865       37.28GB    (4866/0/0) 78172290
  3 unassigned    wm       0               0         (0/0/0)           0
  4 unassigned    wm       0               0         (0/0/0)           0
  5 unassigned    wm       0               0         (0/0/0)           0
  6 unassigned    wm       0               0         (0/0/0)           0
  7 unassigned    wm       0               0         (0/0/0)           0
  8       boot    wu       0 -    0        7.84MB    (1/0/0)       16065
  9 unassigned    wm       0               0         (0/0/0)           0</pre>
<p>หลังจากแก้ไข partition พิมพ์คำสั่ง label เพื่อบันทึกข้อมูลลงดิสก์</p>
<pre>partition&gt; <strong>label</strong>
Ready to label disk, continue? <strong>y</strong></pre>
<pre>partition&gt; <strong>^D</strong></pre>
<p>กดปุ่ม [Ctrl]+[D] เพื่อออกจากคำสั่ง format</p>
<p>ใช้คำสั่ง newfs เพื่อสร้าง filesystem บน partition ที่เพิ่งสร้างขึ้น</p>
<p>หมายเหตุ ชื่อไฟล์ device ของดิสก์ c1t1d0 &#8211; partition 0 คือ /dev/rdsk/c1t1d0s0</p>
<pre># <strong>newfs /dev/rdsk/c1t1d0s0
</strong>newfs: construct a new file system /dev/rdsk/c1t1d0s0: (y/n)? y
Warning: 870 sector(s) in last cylinder unallocated
/dev/rdsk/c1t1d0s0:     20980890 sectors in 3415 cylinders of 48 tracks, 128 sectors
        10244.6MB in 214 cyl groups (16 c/g, 48.00MB/g, 5824 i/g)
super-block backups (for fsck -F ufs -o b=#) at:
 32, 98464, 196896, 295328, 393760, 492192, 590624, 689056, 787488, 885920,
 20055584, 20154016, 20252448, 20350880, 20449312, 20547744, 20646176,
 20744608, 20843040, 20941472</pre>
<p>แนะนำให้ใช้คำสั่ง fsck เพื่อตรวจสอบความถูกต้องของ filesystem ที่สร้างขึ้น ต้องไม่มีข้อความ error ใดๆ</p>
<pre># <strong>fsck -y /dev/rdsk/c1t1d0s0
</strong>** /dev/rdsk/c1t1d0s0
** Last Mounted on
** Phase 1 - Check Blocks and Sizes
** Phase 2 - Check Pathnames
** Phase 3a - Check Connectivity
** Phase 3b - Verify Shadows/ACLs
** Phase 4 - Check Reference Counts
** Phase 5 - Check Cylinder Groups
2 files, 9 used, 10331200 free (16 frags, 1291398 blocks, 0.0% fragmentation)</pre>
<p>สร้าง mount point สำหรับ partition ใหม่</p>
<pre># <strong>mkdir /mnt/new-disk0
</strong># <strong>mount /dev/rdsk/c1t1d0s0 /mnt/new-disk0
</strong><span style="color: #ff0000;">mount: /dev/rdsk/c1t1d0s0 not a block device</span></pre>
<p>สำหรับ Solaris เวลาใช้คำสั่ง newfs หรือ fsck ชื่อ device ที่ระบุคือ /dev/rdsk/&#8230; แต่เวลาใช้คำสั่ง mount ต้องระบุชื่อ device เป็น /dev/dsk/&#8230;</p>
<pre># <strong>mount /dev/dsk/c1t1d0s0 /mnt/new-disk0</strong></pre>
<p>ใช้คำสั่ง df เพื่อตรวจสอบ mount point</p>
<pre># <strong>df -h
</strong>Filesystem             size   used  avail capacity  Mounted on
/dev/dsk/c1t0d0s0       34G   3.7G    30G    11%    /
/devices                 0K     0K     0K     0%    /devices
ctfs                     0K     0K     0K     0%    /system/contract
proc                     0K     0K     0K     0%    /proc
mnttab                   0K     0K     0K     0%    /etc/mnttab
swap                   1.6G   932K   1.6G     1%    /etc/svc/volatile
objfs                    0K     0K     0K     0%    /system/object
sharefs                  0K     0K     0K     0%    /etc/dfs/sharetab
/usr/lib/libc/libc_hwcap1.so.1
                        34G   3.7G    30G    11%    /lib/libc.so.1
fd                       0K     0K     0K     0%    /dev/fd
swap                   1.6G     8K   1.6G     1%    /tmp
swap                   1.6G    20K   1.6G     1%    /var/run
/dev/dsk/c1t0d0s7      1.9G   210M   1.6G    12%    /export/home
<span style="color: #0000ff;">/dev/dsk/c1t1d0s0      9.9G    10M   9.7G     1%    /mnt/new-disk0</span></pre>
<p>หากใช้งาน partition ใหม่ได้ถูกต้องเรียบร้อยแล้ว ต้องเพิ่มคอนฟิกเข้าไปในไฟล์ /etc/vfstab เพื่อให้เวลาบู๊ตเครื่องใหม่ มีการ mount partition ใหม่นี้โดยอัตโมมัติ</p>
<pre># <strong>cat /etc/vfstab
</strong>#device         device          mount           FS      fsck    mount   mount
#to mount       to fsck         point           type    pass    at boot options
#
fd      -       /dev/fd fd      -       no      -
/proc   -       /proc   proc    -       no      -
/dev/dsk/c1t0d0s1       -       -       swap    -       no      -
/dev/dsk/c1t0d0s0       /dev/rdsk/c1t0d0s0      /       ufs     1       no      -
/dev/dsk/c1t0d0s7       /dev/rdsk/c1t0d0s7      /export/home    ufs     2       yes     -
/devices        -       /devices        devfs   -       no      -
sharefs -       /etc/dfs/sharetab       sharefs -       no      -
ctfs    -       /system/contract        ctfs    -       no      -
objfs   -       /system/object  objfs   -       no      -
swap    -       /tmp    tmpfs   -       yes     -
# new disk
<span style="color: #0000ff;">/dev/dsk/c1t1d0s0       /dev/rdsk/c1t1d0s0      /mnt/new-disk0  ufs     2       yes     -</span></pre>
]]></content:encoded>
			<wfw:commentRss>http://spalinux.com/2010/03/add_new_disk_on_solaris_10/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>ขนาดหน่วยความจำกับการติดตั้ง Solaris 10_u8 x86</title>
		<link>http://spalinux.com/2010/03/memory_size_with_solaris_10_u8_x86_installation</link>
		<comments>http://spalinux.com/2010/03/memory_size_with_solaris_10_u8_x86_installation#comments</comments>
		<pubDate>Sat, 06 Mar 2010 07:15:25 +0000</pubDate>
		<dc:creator>editor</dc:creator>
				<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Solaris]]></category>
		<category><![CDATA[solaris 10]]></category>

		<guid isPermaLink="false">http://spalinux.com/?p=1092</guid>
		<description><![CDATA[ช่วงนี้รับงานที่ต้องใช้ Solaris 10 เป็นหลัก เลยติดตั้ง Solaris ใน VMware Server เพื่อไว้เป็นเครื่องทดสอบคำสั่ง และโปรแกรมต่างๆ บทความนี้ขอนำประสบการณ์มาแชร์ให้กัน เผื่อเป็นประโยชน์สำหรับผู้ติดปัญหาการติดตั้ง Solaris 10 x86 เหมือนผู้เขียน ในที่นี้ใช้ไฟล์ iso (sol-10-u8-ga-x86-dvd.iso) จากเว็บไซต์ sun.com เพื่อติดตั้งบน VMware Server คอนฟิก guest ที่สร้างไว้ บน VMware Server เวอร์ชั่น 1.0.10 คือ Guest Operating System: Solaris 10 64-bit Memory 512 MB Disk 37.3 GB พยายามติดตั้งอยู่นานก็ไม่สามารถติดตั้งได้ ขึ้น error SunOS Release 5.10 Version Generic_141445-09 32-bit [...]]]></description>
			<content:encoded><![CDATA[<p>ช่วงนี้รับงานที่ต้องใช้ Solaris 10 เป็นหลัก เลยติดตั้ง Solaris ใน VMware Server เพื่อไว้เป็นเครื่องทดสอบคำสั่ง และโปรแกรมต่างๆ</p>
<p>บทความนี้ขอนำประสบการณ์มาแชร์ให้กัน เผื่อเป็นประโยชน์สำหรับผู้ติดปัญหาการติดตั้ง Solaris 10 x86 เหมือนผู้เขียน</p>
<p><span id="more-1092"></span></p>
<p>ในที่นี้ใช้ไฟล์ iso (sol-10-u8-ga-x86-dvd.iso) จากเว็บไซต์ sun.com เพื่อติดตั้งบน VMware Server</p>
<p>คอนฟิก guest ที่สร้างไว้ บน VMware Server เวอร์ชั่น 1.0.10 คือ</p>
<p>Guest Operating System: Solaris 10 64-bit<br />
Memory 512 MB<br />
Disk 37.3 GB</p>
<p>พยายามติดตั้งอยู่นานก็ไม่สามารถติดตั้งได้ ขึ้น error</p>
<pre>SunOS Release 5.10 Version Generic_141445-09 32-bit
Copyright 1983-2009 Sun Microsystems, Inc.  All rights reserved.
Use is subject to license terms.</pre>
<pre><span style="color: #ff0000;">panic[cpu0]/thread=fec20160: page_unlock: page fe2b57d0 is not locked.</span></pre>
<p><a href="http://spalinux.com/wp-content/uploads/2010/03/01-Install_Solaris_10_x86_panic_with_memory_512MB.png"><img title="Install Solaris 10 x86 - panic with memory 512MB" src="http://spalinux.com/wp-content/uploads/2010/03/01-Install_Solaris_10_x86_panic_with_memory_512MB.png" alt="" width="720" height="400" /></a></p>
<p>หลังจากค้นหาข้อมูลอยู่นาน ก็พบต้นตอของปัญหาจากเว็บไซต์ <a href="http://forums.sun.com/thread.jspa?threadID=5411801" target="_blank">Installation &#8211; Solaris 10 Installation error on Thinkpad A20m &#8211; Please help!!!!!!! PLEASE!<br />
</a></p>
<blockquote><p>S10U8 cannot hit a 512Mb memory system and I suspect you are there. In Parallels you can just up the memory slightly. At least in virtual box 512</p>
<p>will give the same error while 609mb does not.</p></blockquote>
<p>ทดลองเปลี่ยนคอนฟิกของ memory เป็น 768 MB ผลเป็นว่าสามารถติดตั้ง Solaris 10 ได้ แต่สังเกตว่าน่าจะเป็นการติดตั้ง Solaris 10 แบบ 32-bit</p>
<pre>SunOS Release 5.10 Version Generic_141445-09 <span style="color: #0000ff;">32-bit</span></pre>
<p><a href="http://spalinux.com/wp-content/uploads/2010/03/02-Install_Solaris_10_x86_32-bit_with_memory_768MB.png"><img title="Install Solaris 10 x86 32-bit with memory 768MB" src="http://spalinux.com/wp-content/uploads/2010/03/02-Install_Solaris_10_x86_32-bit_with_memory_768MB.png" alt="" width="720" height="400" /></a></p>
<p>ทดลองเพิ่มขนาด memory เป็น 1024 MB ผลที่ได้ จะเป็นการติดตั้ง Solaris 10 แบบ 64-bit</p>
<pre>SunOS Release 5.10 Version Generic_141445-09 64-bit</pre>
<p><a href="http://spalinux.com/wp-content/uploads/2010/03/03-Install_Solaris_10_x86_64-bit_with_memory_1024MB.png"><img title="Install Solaris 10 x86 64-bit with memory 1024MB" src="http://spalinux.com/wp-content/uploads/2010/03/03-Install_Solaris_10_x86_64-bit_with_memory_1024MB.png" alt="" width="720" height="400" /></a></p>
<p>แต่ไม่ว่าจะคอนฟิกขนาด Memory 768 MB หรือ 1024 MB ตอนติดตั้ง สุดท้าย Solaris ที่ได้จะเป็นแบบ 64-bit</p>
<p>หมายเหตุ ไม่ได้ทดสอบบนเครื่อง PC จริงๆ ว่าได้ผลเหมือนกันหรือไม่ ลองกันดูนะครับ</p>
<h4>ข้อมูลอ้างอิง</h4>
<ul>
<li><a href="http://www.sun.com/software/solaris/get.jsp" target="_blank">Get Solaris 10</a></li>
<li><a href="http://forums.sun.com/thread.jspa?threadID=5411801" target="_blank">Installation &#8211; Solaris 10 Installation error on Thinkpad A20m &#8211; Please help!!!!!!! PLEASE!</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://spalinux.com/2010/03/memory_size_with_solaris_10_u8_x86_installation/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>รันโปรเซสเป็น user อื่น</title>
		<link>http://spalinux.com/2010/03/run_process_as_another_user</link>
		<comments>http://spalinux.com/2010/03/run_process_as_another_user#comments</comments>
		<pubDate>Sat, 06 Mar 2010 05:52:51 +0000</pubDate>
		<dc:creator>editor</dc:creator>
				<category><![CDATA[Authentication]]></category>
		<category><![CDATA[Linux Shell]]></category>
		<category><![CDATA[UNIX]]></category>
		<category><![CDATA[Users]]></category>
		<category><![CDATA[Utility]]></category>
		<category><![CDATA[unix process]]></category>

		<guid isPermaLink="false">http://spalinux.com/?p=1088</guid>
		<description><![CDATA[เป็นวิธีง่ายๆ เพื่อให้ผู้ใช้ root สามารถรันโปรเซสหรือโปรแกรมบน Linux/UNIX ภายใต้สิทธิหรือ permission ผู้ใช้ user อื่นบนเครื่องเดียวกัน คำสั่งที่ใช้คือ su ตามด้วยออปชั่น &#8216;-c&#8217; รูปแบบการใช้คำสั่งคือ # su - &#60;user_name&#62; -c "&#60;command&#62;" ตัวอย่าง root รันคำสั่ง id ภายใต้สิทธิผู้ใช้ชื่อ user1 # su - user1 -c "id" uid=501(user1) gid=100(users) groups=100(users) ข้อมูลอ้างอิง &#8216;su&#8217; man page]]></description>
			<content:encoded><![CDATA[<p>เป็นวิธีง่ายๆ เพื่อให้ผู้ใช้ root สามารถรันโปรเซสหรือโปรแกรมบน Linux/UNIX ภายใต้สิทธิหรือ permission ผู้ใช้ user อื่นบนเครื่องเดียวกัน</p>
<p><span id="more-1088"></span>คำสั่งที่ใช้คือ su ตามด้วยออปชั่น &#8216;-c&#8217; รูปแบบการใช้คำสั่งคือ</p>
<pre># su - &lt;user_name&gt; -c "&lt;command&gt;"</pre>
<p>ตัวอย่าง root รันคำสั่ง id ภายใต้สิทธิผู้ใช้ชื่อ user1</p>
<pre># <strong>su - user1 -c "id"
</strong>uid=501(user1) gid=100(users) groups=100(users)</pre>
<h4>ข้อมูลอ้างอิง</h4>
<ul>
<li>&#8216;su&#8217; man page</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://spalinux.com/2010/03/run_process_as_another_user/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
