<?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>Codebreaker &#187; server management</title>
	<atom:link href="http://blog.sumin.us/archives/category/server-management/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.sumin.us</link>
	<description>2bc08752a0894eb2c7afb345286e391d</description>
	<lastBuildDate>Wed, 08 Sep 2010 02:15:36 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Setting up quota on a Partition with Writing Permissions</title>
		<link>http://blog.sumin.us/archives/694</link>
		<comments>http://blog.sumin.us/archives/694#comments</comments>
		<pubDate>Sat, 15 Dec 2007 23:16:26 +0000</pubDate>
		<dc:creator>Sumin</dc:creator>
				<category><![CDATA[server management]]></category>

		<guid isPermaLink="false">http://blog.sumin.us/archives/694</guid>
		<description><![CDATA[It could be danger to set up quota on a partition with writing permissions because the filesystem could be changed during the operations. If you didn't set up quota at the first place and now you want to set it up, this solution might be helpful. Suppose /dev/sda5 is mounted on /home. First of all, [...]]]></description>
			<content:encoded><![CDATA[<p>It could be danger to set up quota on a partition with writing permissions because the filesystem could be changed during the operations. If you didn't set up quota at the first place and now you want to set it up, this solution might be helpful.</p>

<p>Suppose <code>/dev/sda5</code> is mounted on <code>/home</code>. First of all, we need to make following two files and change their permissions to <code>600</code> so that nobody else can access to them. Don't forget you need root privilege in order to perform all these tasks.</p>

<pre><code>touch aquota.user aquota.group
chmod 600 aquota.*
</code></pre>

<p>Then you need to edit <code>/etc/fstab</code>. Add <code>grpquota</code> option if you need group quota.</p>

<pre><code>/dev/sda5      /home        jfs    defaults,usrquota   0       1
</code></pre>

<p>Remount the partition.</p>

<pre><code>mount -o remount /home
</code></pre>

<p>Repair the empty quota files you made.</p>

<pre><code>quotacheck /home
</code></pre>

<p>With <code>repquota -as</code>, you will be able to see something like following</p>

<pre><code>*** Report for user quotas on device /dev/sda5
Block grace time: 7days; Inode grace time: 7days
                    Block limits                File limits
User        used    soft    hard  grace    used  soft  hard  grace
----------------------------------------------------------------------
user1  --  2455M       0       0          43119     0     0
user2  --     56       0       0              5     0     0
user3  --    256       0       0             16     0     0
user4  --   941M       0       0           233k     0     0
</code></pre>

<p>It's done. Think twice before doing this if your server is critical.</p>
<!-- AdSense Now! V1.83 -->
<!-- Post[count: 2] -->
<div class="adsense adsense-leadout" style="text-align:center;margin: 12px;"><script type="text/javascript"><!--
google_ad_client = "pub-2353453386862167";
/* 468x60, created 10/26/09 */
google_ad_slot = "1252542387";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div>]]></content:encoded>
			<wfw:commentRss>http://blog.sumin.us/archives/694/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Automated MySQL Backup Script</title>
		<link>http://blog.sumin.us/archives/678</link>
		<comments>http://blog.sumin.us/archives/678#comments</comments>
		<pubDate>Sat, 15 Sep 2007 09:52:22 +0000</pubDate>
		<dc:creator>Sumin</dc:creator>
				<category><![CDATA[server management]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://blog.sumin.us/archives/678</guid>
		<description><![CDATA[Please leave a comment if you have any suggestions or questions. #!/bin/bash # # Automated MySQL backup script # # @author Sumin Byeon # @since 20070815 # @version 20070927 dir="mysql" databases=( db1 db2 db3 ... ) # The user must be an existing MySQL user with proper preveliges user="backup" password="your password" for db in ${databases[@]}; [...]]]></description>
			<content:encoded><![CDATA[<p>Please leave a comment if you have any suggestions or questions.</p>

<pre><code>#!/bin/bash
#
# Automated MySQL backup script
#
# @author Sumin Byeon
# @since 20070815
# @version 20070927

dir="mysql"
databases=( db1 db2 db3 ... )

# The user must be an existing MySQL user with proper preveliges
user="backup"
password="your password"

for db in ${databases[@]}; do
    timestamp=$(date +%Y%m%d%H%M%S)
    filename=$dir/$db-$timestamp

    mysqldump $db -u $user -p$password &gt; $filename.sql
    chmod 600 $filename.sql

    tar jcf $filename.tar.bz2 $filename.sql
    chmod 600 $filename.tar.bz2

    rm $filename.sql
done
</code></pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.sumin.us/archives/678/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>caught SIGTERM, shutting down</title>
		<link>http://blog.sumin.us/archives/676</link>
		<comments>http://blog.sumin.us/archives/676#comments</comments>
		<pubDate>Mon, 03 Sep 2007 02:01:18 +0000</pubDate>
		<dc:creator>Sumin</dc:creator>
				<category><![CDATA[server management]]></category>

		<guid isPermaLink="false">http://blog.sumin.us/archives/676</guid>
		<description><![CDATA[If you're looking for a solution for this problem, this is not what you're looking for. This is just a personal memo. Sorry. September 2 Apache was dead in this morning again. This is the 4th time that I noticed so far. The Apache error logs said that [Sun Sep 02 06:25:05 2007] [notice] caught [...]]]></description>
			<content:encoded><![CDATA[<p>If you're looking for a solution for this problem, this is not what you're looking for. This is just a personal memo. Sorry.</p>

<h3>September 2</h3>

<p>Apache was dead in this morning again. This is the 4th time that I noticed so far. The Apache error logs said that</p>

<pre><code>[Sun Sep 02 06:25:05 2007] [notice] caught SIGTERM, shutting down
</code></pre>

<p>I suspect <code>mod_ssl</code> does something to this.</p>

<h3>September 9</h3>

<p>It's been a week and it seems working fine. Hopefully it's permanent ;-)</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sumin.us/archives/676/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>아파치 로그 순환</title>
		<link>http://blog.sumin.us/archives/535</link>
		<comments>http://blog.sumin.us/archives/535#comments</comments>
		<pubDate>Sun, 28 Jan 2007 00:59:45 +0000</pubDate>
		<dc:creator>Sumin</dc:creator>
				<category><![CDATA[server management]]></category>
		<category><![CDATA[Apache]]></category>

		<guid isPermaLink="false">http://blog.superwtk.com/archives/535</guid>
		<description><![CDATA[아파치 로그 순환 (영어) 아파치 로그 순환 (한국어) 참고 검색 결과 (rotatelogs) 검색 결과 (logrotate)]]></description>
			<content:encoded><![CDATA[<ul>
<li><a href="http://httpd.apache.org/docs/2.0/en/programs/rotatelogs.html">아파치 로그 순환 (영어)</a></li>
<li><a href="http://httpd.apache.org/docs/2.0/ko/programs/rotatelogs.html">아파치 로그 순환 (한국어)</a></li>
<li><a href="http://www.superuser.co.kr/superuserboard/view.html?id=1037&amp;code=apache&amp;start=0&amp;position">참고</a></li>
<li><a href="http://www.google.com/search?q=rotatelogs">검색 결과 (rotatelogs)</a></li>
<li><a href="http://www.google.com/search?q=logrotate">검색 결과 (logrotate)</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.sumin.us/archives/535/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>데비안 리눅스로 갈아타기</title>
		<link>http://blog.sumin.us/archives/448</link>
		<comments>http://blog.sumin.us/archives/448#comments</comments>
		<pubDate>Sat, 30 Dec 2006 03:29:15 +0000</pubDate>
		<dc:creator>Sumin</dc:creator>
				<category><![CDATA[server management]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Gentoo]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://blog.superwtk.com/archives/448</guid>
		<description><![CDATA[2년간 써온 젠투를 버리고 데비안으로 갈아탔다. 원래 ODD 는 없었는데, 마침 하나 주워다 놓은게 있길래 달아놨다. 배선 정리도 다시 했다. OS 설치하는 모습 개인적으로 데비안 로고를 좋아한다. 데비안에서 가장 마음에 드는걸 꼽는다면 aptitude. 젠투의 emerge 와는 다른 매력이 있다. APM 설치 다음의 패키지들을 설치해준다. apache2 apache2-common libapache2-mod-php4 php4 php4-common php4-gd php4-mysql mysql-client-4.1 mysql-server-4.1 mysql-common-4.1 MySQL [...]]]></description>
			<content:encoded><![CDATA[<p>2년간 써온 젠투를 버리고 데비안으로 갈아탔다.</p>

<p><img id="image445" src="/wp-content/uploads/2006/12/ssl14203.jpg" alt="ssl14203.jpg" /></p>

<p>원래 ODD 는 없었는데, 마침 하나 주워다 놓은게 있길래 달아놨다.</p>

<p><img id="image446" src="/wp-content/uploads/2006/12/ssl14212.jpg" alt="ssl14212.jpg" /></p>

<p>배선 정리도 다시 했다.</p>

<p><img id="image444" src="/wp-content/uploads/2006/12/ssl14140.jpg" alt="ssl14140.jpg" /></p>

<p>OS 설치하는 모습</p>

<p><img id="image447" src="/wp-content/uploads/2006/12/ssl14214.jpg" alt="ssl14214.jpg" /></p>

<p>개인적으로 데비안 로고를 좋아한다.</p>

<p><img id="image450" src="/wp-content/uploads/2006/12/183832.png" alt="183832.png" /></p>

<p>데비안에서 가장 마음에 드는걸 꼽는다면 aptitude. 젠투의 emerge 와는 다른 매력이 있다.</p>

<h1>APM 설치</h1>

<p>다음의 패키지들을 설치해준다.</p>

<pre><code>apache2
apache2-common
libapache2-mod-php4
php4
php4-common
php4-gd
php4-mysql
mysql-client-4.1
mysql-server-4.1
mysql-common-4.1
</code></pre>

<p>MySQL 이 UTF-8 을 사용하도록 /etc/mysql/my.cnf 파일에 다음과 같은 값을 추가해준다.</p>

<pre><code>default-character-set = utf8
</code></pre>

<p>(2007년 1월 28일에 추가됨) Apache2.2 + PHP5 + MySQL5.0 으로 업그레이드 하였더니 한글이 <code>?</code>로 나오는 희한한 현상이 일어났었다. my.cnf 의 mysqld 섹션에 다음과 같은 문구를 추가해주면 해결된다.</p>

<pre><code>init_connect=SET NAMES utf8
</code></pre>

<h1>JDK 설치</h1>

<p>/etc/apt/source.list</p>

<pre><code>deb http://ftp.us.debian.org/debian unstable main
</code></pre>

<p>unstable 패키지를 받을 수 있도록 바꿔준다.</p>

<pre><code>apt-get update
apt-get install sun-java5-jdk
</code></pre>

<p>패키지 리스트 캐시를 업데이트 하고, JDK 를 설치해준다.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sumin.us/archives/448/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>gentoo 패키지 정보 보기</title>
		<link>http://blog.sumin.us/archives/186</link>
		<comments>http://blog.sumin.us/archives/186#comments</comments>
		<pubDate>Wed, 01 Feb 2006 23:59:00 +0000</pubDate>
		<dc:creator>Sumin</dc:creator>
				<category><![CDATA[server management]]></category>
		<category><![CDATA[Gentoo]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://blog.superwtk.com/archives/186</guid>
		<description><![CDATA[qpkg -i packagename gentoolkit 에 포함되어있다고 하는데; 왜 내 시스템엔 없을까-_-;; $ ls /var/db/pkg/* 설치된 모든 패키지를 볼 수 있다.]]></description>
			<content:encoded><![CDATA[<pre><code>qpkg -i packagename
</code></pre>

<p>gentoolkit 에 포함되어있다고 하는데; 왜 내 시스템엔 없을까-_-;;</p>

<pre><code>$ ls /var/db/pkg/*
</code></pre>

<p>설치된 모든 패키지를 볼 수 있다.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sumin.us/archives/186/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL 원격 접속이 안될 때</title>
		<link>http://blog.sumin.us/archives/72</link>
		<comments>http://blog.sumin.us/archives/72#comments</comments>
		<pubDate>Sun, 04 Dec 2005 10:29:43 +0000</pubDate>
		<dc:creator>Sumin</dc:creator>
				<category><![CDATA[server management]]></category>
		<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://blog.superwtk.com/archives/72</guid>
		<description><![CDATA[잡설은 생략하고- # netstat -na &#124; grep 3306 Active Internet connections (servers and established) Proto Recv-Q Send-Q Local Address Foreign Address State tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN 127.0.0.1:3306 이 열려있는것을 볼 수 있다. 이런 상태로는 원격 접속이 불가능하다. 2003번 에러메세지 (Can't connect to MySQL server on '%s' (%d)) 가 뜨는 것을 볼 수 있을것이다. [...]]]></description>
			<content:encoded><![CDATA[<p>잡설은 생략하고-</p>

<pre><code># netstat -na | grep 3306
</code></pre>

<pre><code>Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State
tcp        0      0 127.0.0.1:3306      0.0.0.0:*               LISTEN
</code></pre>

<p>127.0.0.1:3306 이 열려있는것을 볼 수 있다.
이런 상태로는 원격 접속이 불가능하다.
2003번 에러메세지 (Can't connect to MySQL server on '%s' (%d)) 가 뜨는 것을 볼 수 있을것이다.</p>

<p>해결 방법은 -
my.cnf 파일을 수정해주면 된다.
mysqld 섹션을 보면 bind-address라는 설정 항목이 있다.</p>

<pre><code>bind-address = 61.250.92.162
</code></pre>

<p>이렇게 수정해준다.</p>

<p>다시 netstat 로 확인해보면</p>

<pre><code># netstat -na | grep 3306
</code></pre>

<pre><code>Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State
tcp        0      0 61.250.92.162:3306      0.0.0.0:*               LISTEN
</code></pre>

<p>이제 원격 접속 잘 된다 :)</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sumin.us/archives/72/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>메모리 증설</title>
		<link>http://blog.sumin.us/archives/61</link>
		<comments>http://blog.sumin.us/archives/61#comments</comments>
		<pubDate>Sun, 06 Nov 2005 12:44:43 +0000</pubDate>
		<dc:creator>Sumin</dc:creator>
				<category><![CDATA[server management]]></category>

		<guid isPermaLink="false">http://blog.superwtk.com/archives/61</guid>
		<description><![CDATA[256MB 메모리를 2개 더 달아서 512MB -> 1GB로 늘릴려고 분당에 있는 IDC에 갔다. (언제나 느끼는거지만 너무 멀다 ㅠ_ㅠ) 엔지니어한테 부탁해서 랙에서 서버를 꺼내고 케이스를 열어 메모리를 끼워넣었다. 부팅 완료 후 메모리 용량을 확인해봤는데.. 884MB (맙소사 도대체 왜 -_-!!!) 바이오스에서 메모리 체킹할땐 분명히 1048576KB 라고 나왔었다. 뭐가 문제일까 하고 생각해봤는데, 커널 컴파일 할때 high memory supporting인가 [...]]]></description>
			<content:encoded><![CDATA[<p>256MB 메모리를 2개 더 달아서 512MB -> 1GB로 늘릴려고 분당에 있는 IDC에 갔다.</p>

<p>(언제나 느끼는거지만 너무 멀다 ㅠ_ㅠ)</p>

<p>엔지니어한테 부탁해서 랙에서 서버를 꺼내고 케이스를 열어 메모리를 끼워넣었다.</p>

<p>부팅 완료 후 메모리 용량을 확인해봤는데.. 884MB (맙소사 도대체 왜 -_-!!!)</p>

<p>바이오스에서 메모리 체킹할땐 분명히 1048576KB 라고 나왔었다.</p>

<p>뭐가 문제일까 하고 생각해봤는데, 커널 컴파일 할때 high memory supporting인가 하는 기능을 꺼놓은것이 기억났다.</p>

<p>옵션에 체크하고 make bzImage install</p>

<p>reboot 후에 다시 메모리 용량을 보니까 1010MB ...</p>

<p>나머지 14MB는 어디다 삥땅쳤는지 모르겠다. 아, 그중 1MB는 비디오 메모리로 사용된다.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sumin.us/archives/61/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>자동 백업 스크립트</title>
		<link>http://blog.sumin.us/archives/56</link>
		<comments>http://blog.sumin.us/archives/56#comments</comments>
		<pubDate>Mon, 31 Oct 2005 02:07:20 +0000</pubDate>
		<dc:creator>Sumin</dc:creator>
				<category><![CDATA[server management]]></category>

		<guid isPermaLink="false">http://blog.superwtk.com/archives/56</guid>
		<description><![CDATA[!/bin/bash if [ $# -ne 2 ] then echo "usage: backup.sh system&#124;users fast&#124;best" exit fi BACKUPDIR="/home1/backup" DATE=`date +%Y%m%d` case "$2" in "fast") OPTIONS="zcf" EXT="gz" ;; "best") OPTIONS="jcf" EXT="bz2" ;; esac case "$1" in "system") tar $OPTIONS ${BACKUPDIR}/boot-${DATE}.tar.${EXT} /boot tar $OPTIONS ${BACKUPDIR}/var-${DATE}.tar.${EXT} /var tar $OPTIONS ${BACKUPDIR}/etc-${DATE}.tar.${EXT} /etc tar $OPTIONS ${BACKUPDIR}/usr-${DATE}.tar.${EXT} /usr ;; "users") tar $OPTIONS ${BACKUPDIR}/home-${DATE}.tar.${EXT} [...]]]></description>
			<content:encoded><![CDATA[<h1>!/bin/bash</h1>

<pre><code>if [ $# -ne 2 ]
then
        echo "usage: backup.sh system|users fast|best"
        exit
fi

BACKUPDIR="/home1/backup"
DATE=`date +%Y%m%d`

case "$2" in
        "fast")
                OPTIONS="zcf"
                EXT="gz"
                ;;
        "best")
                OPTIONS="jcf"
                EXT="bz2"
                ;;
esac

case "$1" in
        "system")
                tar $OPTIONS ${BACKUPDIR}/boot-${DATE}.tar.${EXT} /boot
                tar $OPTIONS ${BACKUPDIR}/var-${DATE}.tar.${EXT} /var
                tar $OPTIONS ${BACKUPDIR}/etc-${DATE}.tar.${EXT} /etc
                tar $OPTIONS ${BACKUPDIR}/usr-${DATE}.tar.${EXT} /usr
                ;;
        "users")
                tar $OPTIONS ${BACKUPDIR}/home-${DATE}.tar.${EXT} /home
                tar $OPTIONS ${BACKUPDIR}/home2-${DATE}.tar.${EXT} /home2
                tar $OPTIONS ${BACKUPDIR}/home3-${DATE}.tar.${EXT} /home3
                ;;
esac
</code></pre>

<p>후훗; 이제 남이 만들어놓은 쉘스크립트를 베끼지 않아도 된다 :)</p>

<p>스크립트 파일이 ~/backup.sh 에 있다면 cron에 다음과 같이 등록시키면 된다. 일주일에 한번씩 백업하도록 해놨다.</p>

<pre><code>~/backup.sh system best
~/backup.sh users fast
</code></pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.sumin.us/archives/56/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>스패머 호로새끼</title>
		<link>http://blog.sumin.us/archives/46</link>
		<comments>http://blog.sumin.us/archives/46#comments</comments>
		<pubDate>Sat, 22 Oct 2005 18:57:34 +0000</pubDate>
		<dc:creator>Sumin</dc:creator>
				<category><![CDATA[server management]]></category>

		<guid isPermaLink="false">http://blog.superwtk.com/archives/46</guid>
		<description><![CDATA[주기적으로 서버 상태를 이메일로 보고하는 스크립트를 짜놨는데, 메일을 열어보니 qmailr 8019 0.0 0.1 2792 820 ? S 04:00 0:00 qmail-remote hanmail.net afsdhkjhgdfuilr5ikhbfoixdhgdfuilr5ikterkfsdterkfsd@dreamwiz.com wkddlr-6666@hanmail.net qmailr 8021 0.0 0.1 2792 820 ? S 04:00 0:00 qmail-remote hanmail.net afsdhkjhgdfuilr5ikhbfoixdhgdfuilr5ikterkfsdterkfsd@dreamwiz.com wkddlq111@hanmail.net 이런것이.. -_-! 그래서 이것저것 확인해봤다. 앍!! SMTP 사용자 인증도 안켜놓고 뭐한거지 ㅠ_ㅠ superwtk qmail # netstat -a&#124;grep smtp [...]]]></description>
			<content:encoded><![CDATA[<p>주기적으로 서버 상태를 이메일로 보고하는 스크립트를 짜놨는데, 메일을 열어보니</p>

<pre><code>qmailr    8019  0.0  0.1   2792   820 ?        S    04:00   0:00 qmail-remote hanmail.net afsdhkjhgdfuilr5ikhbfoixdhgdfuilr5ikterkfsdterkfsd@dreamwiz.com wkddlr-6666@hanmail.net
qmailr    8021  0.0  0.1   2792   820 ?        S    04:00   0:00 qmail-remote hanmail.net afsdhkjhgdfuilr5ikhbfoixdhgdfuilr5ikterkfsdterkfsd@dreamwiz.com wkddlq111@hanmail.net
</code></pre>

<p>이런것이.. -_-!</p>

<p>그래서 이것저것 확인해봤다.
앍!! SMTP 사용자 인증도 안켜놓고 뭐한거지 ㅠ_ㅠ</p>

<pre><code>superwtk qmail # netstat -a|grep smtp
tcp        0      0 *:smtp                  *:*                     LISTEN
tcp        0      0 superwtk.com:smtp       221.221.233.209:1858    TIME_WAIT
tcp        0      0 superwtk.com:smtp       221.221.233.:tr-rsrb-p2 ESTABLISHED
tcp        0      0 superwtk.com:smtp       221.221.233.20:ninstall ESTABLISHED
tcp        0      0 superwtk.com:smtp       221.221.233.209:1802    ESTABLISHED
tcp        0      0 superwtk.com:smtp       221.221.233.209:1650    TIME_WAIT
tcp        0      0 superwtk.com:smtp       221.221.254.202:4510    ESTABLISHED
tcp        0      0 superwtk.com:smtp       221.221.233.209:2517    ESTABLISHED
tcp        0      8 superwtk.com:smtp       221.221.233.209:2715    ESTABLISHED

superwtk ~ # tcpdump -i eth0 -vx src net 221.221.233.0/24
tcpdump: listening on eth0, link-type EN10MB (Ethernet), capture size 96 bytes
04:38:38.425470 IP (tos 0x0, ttl 111, id 52147, offset 0, flags [DF], length: 71) 221.221.233.243.4303 &gt; superwtk.com.smtp: P [tcp sum ok] 2933512915:2933512946(31) ack 3968985334 win 64032
        0x0000:  4500 0047 cbb3 4000 6f06 dd8f dddd e9f3  E..G..@.o.......
        0x0010:  3dfa 5ca2 10cf 0019 aed9 dad3 ec91 e8f6  =.\.............
        0x0020:  5018 fa20 8629 0000 5243 5054 2054 4f3a  P....)..RCPT.TO:
        0x0030:  203c 6a79 3230 3937 4068 616e 6d61 696c  .&lt;jy2097@hanmail
        0x0040:  2e6e 6574 3e0d 0a                        .net&gt;..
04:38:40.230881 IP (tos 0x0, ttl 111, id 52394, offset 0, flags [DF], length: 40) 221.221.233.243.4303 &gt; superwtk.com.smtp: . [tcp sum ok] ack 9 win 64024
        0x0000:  4500 0028 ccaa 4000 6f06 dcb7 dddd e9f3  E..(..@.o.......
        0x0010:  3dfa 5ca2 10cf 0019 aed9 db10 ec91 e8fe  =.\.............
        0x0020:  5010 fa18 e2ea 0000 e200 0000 0000       P.............
04:38:44.227208 IP (tos 0x0, ttl 111, id 52977, offset 0, flags [DF], length: 70) 221.221.233.243.4303 &gt; superwtk.com.smtp: P [tcp sum ok] 31:61(30) ack 9 win 64024
        0x0000:  4500 0046 cef1 4000 6f06 da52 dddd e9f3  E..F..@.o..R....
        0x0010:  3dfa 5ca2 10cf 0019 aed9 daf2 ec91 e8fe  =.\.............
        0x0020:  5018 fa18 45be 0000 5243 5054 2054 4f3a  P...E...RCPT.TO:
        0x0030:  203c 6f39 3734 3040 6861 6e6d 6169 6c2e  .&lt;o9740@hanmail.
        0x0040:  6e65 743e 0d0a                           net&gt;..
</code></pre>

<p>우리나라 IP 대역이 아닌것 같은데..
LANGuard로 스캔해보니까(221.221.233.0/24) 취약점 하나(POP3 server might be vulnerable to a remote buffer overflow exploit)랑 열린 포트(25, 110) 달랑 2개 나온다. 전문적으로 스팸메일을 발송하는 놈들인것 같다.</p>

<p>아, 그리고.. /var/qmail/queue 디렉토리 용량이 조금씩 늘어난다. 1분 전엔 300K였는데 지금은 470K. 지금 메일 서버를 사용하는 유저는 없는데.. 큐 용량이 늘어나는 또 다른 요인이 있나?</p>

<p>이번엔 traceroute를 해봤다.</p>

<pre><code>superwtk qmail # traceroute 221.221.233.209
traceroute to 221.221.233.209 (221.221.233.209), 30 hops max, 40 byte packets
 1  61.x.x.x (61.x.x.x)  0.501 ms  0.467 ms  0.455 ms
 2  211.239.125.234 (211.239.125.234)  0.308 ms  0.317 ms  0.364 ms
 3  211.115.197.22 (211.115.197.22)  0.395 ms  0.433 ms  0.416 ms
 4  211.115.197.112 (211.115.197.112)  0.619 ms  0.418 ms  0.452 ms
 5  POS0-0-0.GW3.SEL1.ALTER.NET (210.80.253.33)  309.932 ms *  334.612 ms
 6  23.so-6-3-1.XR2.SEL1.Alter.Net (210.80.38.165)  151.090 ms  356.321 ms  174.299 ms
 7  * * *
 8  0.so-5-0-0.IR1.LAX12.Alter.Net (210.80.49.149)  317.172 ms *  508.022 ms
 9  POS2-0.IR1.LAX9.ALTER.NET (137.39.31.222)  518.808 ms *  437.532 ms
10  * 0.so-5-2-0.TL1.LAX9.ALTER.NET (152.63.0.146)  433.642 ms  345.331 ms
11  0.so-5-0-0.XL1.LAX7.ALTER.NET (152.63.116.249)  297.535 ms  394.252 ms  319.109 ms
12  0.so-6-0-0.BR1.LAX7.ALTER.NET (152.63.112.41)  300.859 ms  317.720 ms *
13  204.255.169.38 (204.255.169.38)  325.163 ms  461.848 ms  498.587 ms
14  sl-bb24-ana-9-0.sprintlink.net (144.232.20.68)  436.727 ms  497.051 ms  471.259 ms
15  sl-bb20-ana-11-0.sprintlink.net (144.232.1.137)  301.868 ms * *
16  * * *
17  * sl-china6-1-0.sprintlink.net (160.81.147.166)  546.580 ms  567.681 ms
18  219.158.3.73 (219.158.3.73)  665.839 ms  700.642 ms  685.769 ms
19  * 219.158.4.157 (219.158.4.157)  608.968 ms *
20  * 202.96.12.158 (202.96.12.158)  688.458 ms  635.589 ms
21  * 202.106.192.17 (202.106.192.17)  780.829 ms *
22  61.148.3.86 (61.148.3.86)  568.152 ms *  557.811 ms
23  61.148.5.210 (61.148.5.210)  593.019 ms  657.159 ms *
24  61.148.36.42 (61.148.36.42)  758.224 ms  737.292 ms  574.492 ms
25  * 221.221.233.209 (221.221.233.209)  636.913 ms  619.008 ms
</code></pre>

<p>우와~~ 멀리도 간다.
traceroute를 자주 쓰는건 아니지만, 이런 결과물은 처음 본다. 25홉이라니..</p>

<p>아무튼, 이런 사회악들을 좀 없애버려야 하는데 어떻게 해야 할지 모르겠다.</p>

<p>지금은 방화벽을 이용해서 저 미친새끼가 보내는 모든 패킷을 DROP 시키도록 설정해놓은 상태이다.</p>

<pre><code>Chain INPUT (policy ACCEPT)
target     prot opt source               destination
DROP       icmp --  anywhere             anywhere
DROP       all  --  221.221.233.0/24     anywhere
DROP       all  --  221.221.254.0/24     anywhere
</code></pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.sumin.us/archives/46/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Qmail을 이용한 메일서버 구축</title>
		<link>http://blog.sumin.us/archives/29</link>
		<comments>http://blog.sumin.us/archives/29#comments</comments>
		<pubDate>Wed, 12 Oct 2005 05:28:43 +0000</pubDate>
		<dc:creator>Sumin</dc:creator>
				<category><![CDATA[server management]]></category>

		<guid isPermaLink="false">http://blog.superwtk.com/archives/29</guid>
		<description><![CDATA[젠투리눅스 싸이트에 아주 훌륭한 문서가 있어서 별 어려움 없이 작업을 할 수 있었다. 3번 항목 vpopmail 까지 설정했다. # printf "postmaster@wh0rd.org\0postpass\0blah\0" &#124; vchkpw `which id` 3&#60;&#38;0 이렇게 하면 uid=89(vpopmail) gid=89(vpopmail) groups=0(root) 이런거 비슷한 결과가 나온다고 하는데 난 왜 안나올까 orz 뭔가 문제가 있는것 같다. 시간나면 Courier POP/IMAP 도 설치해야겠다.]]></description>
			<content:encoded><![CDATA[<p>젠투리눅스 싸이트에 <a href="http://www.gentoo.org/doc/en/qmail-howto.xml">아주 훌륭한 문서</a>가 있어서 별 어려움 없이 작업을 할 수 있었다.</p>

<p>3번 항목 vpopmail 까지 설정했다.</p>

<pre><code># printf "postmaster@wh0rd.org\0postpass\0blah\0" | vchkpw `which id` 3&lt;&amp;0
</code></pre>

<p>이렇게 하면</p>

<pre><code>uid=89(vpopmail) gid=89(vpopmail) groups=0(root)
</code></pre>

<p>이런거 비슷한 결과가 나온다고 하는데 난 왜 안나올까 orz
뭔가 문제가 있는것 같다.</p>

<p>시간나면 Courier POP/IMAP 도 설치해야겠다.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sumin.us/archives/29/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>webalizer with geoip patch</title>
		<link>http://blog.sumin.us/archives/12</link>
		<comments>http://blog.sumin.us/archives/12#comments</comments>
		<pubDate>Sat, 17 Sep 2005 03:38:27 +0000</pubDate>
		<dc:creator>Sumin</dc:creator>
				<category><![CDATA[server management]]></category>

		<guid isPermaLink="false">http://www.nefus.net/~superwtk/wordpress/?p=12</guid>
		<description><![CDATA[webalizer에 geoip 패치를 했다. 이제 국가별 로그 분석 된다. 의외로 접속 국가가 많다;; 근데 웬 미국놈이 300MB 짜리 파일을 받아간거지-_-? (390MB중 300MB가 단일 파일;;)]]></description>
			<content:encoded><![CDATA[<p>webalizer에 geoip 패치를 했다.</p>

<p>이제 국가별 로그 분석 된다.</p>

<p><a href="/~superwtk/wordpress/wp-content/userdata/webalizerwithgeoip.png" title=""><img src="/~superwtk/wordpress/wp-content/userdata/webalizerwithgeoip.png" width="500" alt="" /></a></p>

<p>의외로 접속 국가가 많다;;</p>

<p>근데 웬 미국놈이 300MB 짜리 파일을 받아간거지-_-?
(390MB중 300MB가 단일 파일;;)</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sumin.us/archives/12/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>서버 상태 자동 보고 스크립트</title>
		<link>http://blog.sumin.us/archives/6</link>
		<comments>http://blog.sumin.us/archives/6#comments</comments>
		<pubDate>Sat, 17 Sep 2005 02:08:22 +0000</pubDate>
		<dc:creator>Sumin</dc:creator>
				<category><![CDATA[server management]]></category>

		<guid isPermaLink="false">http://www.nefus.net/~superwtk/wordpress/archives/6</guid>
		<description><![CDATA[#!/bin/bash IPADDR="x.x.x.x" FROM="administrator@somewhere.com"; TO="someone@somewhere.com"; SUBJECT="Report status of server ${IPADDR}"; ( echo content-type: "text/html; charset=\"utf-8\"" &#38;&#38; \ echo from:${FROM} &#38;&#38; \ echo to:${TO} &#38;&#38; \ echo subject:${SUBJECT} &#38;&#38; \ echo "&#38;lt;html&#62;&#38;lt;head&#62;&#38;lt;title&#62;${SUBJECT}&#38;lt;/title&#62;&#38;lt;/head&#62;&#38;lt;body&#62;" &#38;&#38; \ echo "&#38;lt;div style=\"font-family:Courier New; font-size:10pt;\"&#62;&#38;lt;pre&#62;" &#38;&#38; \ echo "---------------------------------------------------------------------------" &#38;&#38; \ echo "1. uptime" &#38;&#38; \ echo "---------------------------------------------------------------------------" &#38;&#38; \ uptime &#38;&#38; echo [...]]]></description>
			<content:encoded><![CDATA[<pre><code>#!/bin/bash

IPADDR="x.x.x.x"

FROM="administrator@somewhere.com";
TO="someone@somewhere.com";
SUBJECT="Report status of server ${IPADDR}";

(
echo content-type: "text/html; charset=\"utf-8\"" &amp;&amp; \
echo from:${FROM} &amp;&amp; \
echo to:${TO} &amp;&amp; \
echo subject:${SUBJECT} &amp;&amp; \

echo "&amp;lt;html&gt;&amp;lt;head&gt;&amp;lt;title&gt;${SUBJECT}&amp;lt;/title&gt;&amp;lt;/head&gt;&amp;lt;body&gt;" &amp;&amp; \
echo "&amp;lt;div style=\"font-family:Courier New; font-size:10pt;\"&gt;&amp;lt;pre&gt;" &amp;&amp; \

echo "---------------------------------------------------------------------------" &amp;&amp; \
echo "1. uptime" &amp;&amp; \
echo "---------------------------------------------------------------------------" &amp;&amp; \
uptime &amp;&amp;  echo -e "\n" &amp;&amp; \

echo "---------------------------------------------------------------------------" &amp;&amp; \
echo "2. result of w" &amp;&amp; \
echo "---------------------------------------------------------------------------" &amp;&amp; \
w     &amp;&amp; echo -e "\n" &amp;&amp; \

echo "---------------------------------------------------------------------------" &amp;&amp; \
echo "3. opened ports" &amp;&amp; \
echo "---------------------------------------------------------------------------" &amp;&amp; \
nmap  -p 1-1024 localhost|grep -i "open" &amp;&amp; echo -e "\n" &amp;&amp; \

echo "---------------------------------------------------------------------------" &amp;&amp; \
echo "4. memory usage" &amp;&amp; \
echo "---------------------------------------------------------------------------" &amp;&amp; \
free -m &amp;&amp; echo -e "\n" &amp;&amp; \

echo "---------------------------------------------------------------------------" &amp;&amp; \
echo "5. disk usage" &amp;&amp; \
echo "---------------------------------------------------------------------------" &amp;&amp; \
df -m &amp;&amp; echo -e "\n" &amp;&amp; \

echo "---------------------------------------------------------------------------" &amp;&amp; \
echo "6. result of pstree"  &amp;&amp; \
echo "---------------------------------------------------------------------------" &amp;&amp; \
pstree &amp;&amp; echo -e "\n" &amp;&amp; \

echo "---------------------------------------------------------------------------" &amp;&amp; \
echo "7. process list"  &amp;&amp; \
echo "---------------------------------------------------------------------------" &amp;&amp; \
ps aux &amp;&amp; echo -e "\n" &amp;&amp; \

echo "&amp;lt;/pre&gt;&amp;lt;/div&gt;&amp;lt;/body&gt;&amp;lt;/html&gt;" ) | /var/qmail/bin/qmail-inject

echo "done +";
exit 0;
</code></pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.sumin.us/archives/6/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>새로운걸 알았다</title>
		<link>http://blog.sumin.us/archives/699</link>
		<comments>http://blog.sumin.us/archives/699#comments</comments>
		<pubDate>Thu, 15 Sep 2005 13:09:57 +0000</pubDate>
		<dc:creator>Sumin</dc:creator>
				<category><![CDATA[server management]]></category>

		<guid isPermaLink="false">http://www.nefus.net/~superwtk/wordpress/posts/3</guid>
		<description><![CDATA[# /etc/init.d/named status * status: started # /etc/init.d/named zap * Manually resetting named to stopped state. 뭐.. 사실 메뉴얼에 다 나와있긴 하지만-,.-ㅋ]]></description>
			<content:encoded><![CDATA[<pre><code># /etc/init.d/named status
 * status:  started
</code></pre>

<pre><code># /etc/init.d/named zap
 * Manually resetting named to stopped state.
</code></pre>

<p>뭐.. 사실 메뉴얼에 다 나와있긴 하지만-,.-ㅋ</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sumin.us/archives/699/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
