<?xml version="1.0" encoding="utf-8" ?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<title>Go3.co.kr MintState BBS &amp;gt; Tech &amp;gt; Linux</title>
<link>https://go3.co.kr/mintbbs/bbs/board.php?bo_table=linux</link>
<description>테스트 버전 0.2 (2004-04-26)</description>
<language>ko</language>


<item>
<title>apache 명령어</title>
<link>https://go3.co.kr/mintbbs/bbs/board.php?bo_table=linux&amp;amp;wr_id=5360</link>
<description><![CDATA[- 실시간 접속수 파악<br/>watch &#039;netstat -an | grep EST | wc -l’<br/><br/>- 웹 동시 접속목록<br/>netstat -nap | grep 80 | grep ESTABLISHED | wc -l<br/><br/>- 메모리 사용량 측정<br/>ps aux | grep &#039;httpd&#039; | wc -l<br/>ps aux | grep &#039;httpd&#039; | grep -v grep<br/>ps aux | grep &#039;httpd&#039; | grep -v grep | awk &#039;{print $6}’<br/>ps aux | grep &#039;httpd&#039; | grep -v grep | awk &#039;{print $6}&#039; | awk &#039;{avg += ($1 - avg) / NR;} END {print avg}’<br/>ps aux | grep &#039;httpd&#039; | awk &#039;{print $6}&#039; | awk &#039;{total = total + $1} END {print total/1024}’<br/>free -m<br/><br/><br/># 아파치 웹 서버 메모리 사용량을 줄이는 방법<br/>1. 연결 수를 줄인다.<br/>MaxClients, MaxSpareServers, MinSpareServers 조절<br/>KeepAlive 결정, KeepAliveTimeout 줄인다.<br/><br/>2. worker<br/>꼭 prefork를 써야 하는게 아니면? worker 방식 고려<br/><br/>3. 로드 모듈<br/>사용하고 있는 모듈이 아니면 굳이 로드하지 않는다.]]></description>
<dc:creator>MintState</dc:creator>
<dc:date>Tue, 10 Dec 2024 09:35:19 +0900</dc:date>
</item>


<item>
<title>vsftpd 상위폴더 제한 방법</title>
<link>https://go3.co.kr/mintbbs/bbs/board.php?bo_table=linux&amp;amp;wr_id=5359</link>
<description><![CDATA[[U]vsftpd 상위폴더 제한 방법[/U]<br/><br/>FTP 사용시 상위 디렉토리로 올라 가지는 경우가 있습니다. 이는 보안에 문제가 될 수 있으므로 설정 변경을 통해 해당 홈디렉토리만 사용할 수 있게 설정해야 합니다.<br/><br/>1. Vi를 이용해서 Vsftpd.conf 파일 열기 ( /etc/vsftpd/vsftpd.conf)<br/><br/>2. 다음 내용 추가<br/>chroot_local_user=YES // 사용자 디렉토리 위로 이동 제한<br/>chroot_list_enable=YES or NO<br/>// 리스트 파일 목록에 추가된 사용자만 상위폴더 이동이 가능하게 설정<br/>chroot_list_file=/etc/vsfptd/chroot_list // chroot_list_enable 가 Yes일 경우 해당파일에 있는 사용자는 상위폴더 이동가능<br/><br/>3. 서비스 재시작 (service vsftpd restart)]]></description>
<dc:creator>MintState</dc:creator>
<dc:date>Fri, 05 Jun 2020 11:01:36 +0900</dc:date>
</item>


<item>
<title>.htaccess https 리다이렉팅</title>
<link>https://go3.co.kr/mintbbs/bbs/board.php?bo_table=linux&amp;amp;wr_id=5358</link>
<description><![CDATA[[U].htaccess https 리다이렉팅[/U]<br/><br/>아파치에서 http로 시작하는 URL을 https로 Redirect 방법<br/><br/>[CODE]RewriteEngine On<br/>RewriteCond %{HTTPS} off<br/>RewriteCond %{THE_REQUEST} !test.html [NC]<br/>RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301][/CODE]<br/><br/>예외 URL은 RewriteCond %{THE_REQUEST} !test.html [NC] 처럼 추가하면 됩니다.]]></description>
<dc:creator>MintState</dc:creator>
<dc:date>Mon, 30 Jul 2018 16:04:21 +0900</dc:date>
</item>


<item>
<title>vi, vim 에디터 단축키</title>
<link>https://go3.co.kr/mintbbs/bbs/board.php?bo_table=linux&amp;amp;wr_id=5357</link>
<description><![CDATA[[U]vi, vim 에디터 단축키[/U]<br/><br/>※ 커서 이동 명령<br/>j(↓) : 아래로 이동<br/>k(↑) : 위로 이동<br/>h(←) : 왼쪽으로 이동<br/>l (→) : 오른쪽으로 이동<br/>G(go) : 제일 끝줄로 이동<br/>e : 한 단어 뒤로 이동(★)<br/>b : 한 단어 앞으로 이동(★)<br/>0 : 줄의 제일 처음부터 이동(★)<br/>$ : 줄의 제일 끝으로 이동(★)<br/><br/>※ 입력 명령어<br/>i : 현재 커서 위치에 삽입(커서 위치에 문자를 오른쪽으로 한 칸 밀고 삽입)(★)<br/>a : 현재 커서 위치 다음에 삽입(★)<br/>o : 현재 커서가 위치한 줄의 아랫줄에 삽입(★)<br/>I : 현재 커서가 위치한 줄의?맨 앞에 삽입<br/>A : 현재 커서가 위치한 줄의?맨 뒤에 삽입<br/>O : 현재 커서가 위치한 줄의?바로 위에 삽입<br/><br/>※ 지우기 명령어<br/>x : 현재 커서 위치의 문자를 지운다. (nx x를 n번 반복)(★)<br/>dd : 현재 커서가 위치한 줄을 지운다. (ndd dd를 n번 반복)<br/>dw : 현재 커서가 위치한 단어를 지운다.(★)<br/>d$ : 현재 커서가 위치한 곳부터 그 행의 끝까지를 지운다.<br/>dG : 현재 커서가 위치한 행부터 편집문서의 마지막 줄까지 삭제한다.<br/><br/>※ 복사하기와 붙이기<br/>yy(=Y) : 현재 커서가 위치한 줄을 버퍼에 복사한다.(★)<br/>yw : 현재 커서가 위치한 단어를 버퍼에 복사한다.(★)<br/>p : 버퍼에 들어 있는 내용을 현재 커서가 위치한 줄의 아래에 붙인다.(★)<br/><br/>※ 치환<br/>r : 현재 위치의 문자를 한개만 바꾼다.<br/>R : 현재 커서위치에서 오른쪽으로 esc 키를 입력할 때 까지 바꾼다.<br/>cw : 현재 위치의 단어를 바꾼다.(★)<br/>cc : 현재 커서가 위치한 줄을 바꾼다.<br/>C : 현재 커서가 위치한 곳으로부터 줄의 끝까지 바꾼다.<br/>~ : 대소문자를 서로 바꾼다.(★)<br/><br/>※ 기타 명령어<br/>^g : 현재 편집하고 있는 파일의 정보를 보여준다.<br/>u (=undo) : 방금 한 명령을 취소한다. (★★)<br/>^R (=redo) : 취소한 명령을 다시 취소 (vim)(★)<br/><br/>※ 기본 명령어<br/>:! 명령어&nbsp; :&nbsp; 편집기를 벗어나지 않은 상태로 shell command 를 실행한다.(★)<br/>:args : 현재 편집하는 파일명을 보여준다.<br/>:w : 편집하는 내용을 덮어쓰기로 저장한다.(★)<br/>:w 파일명 : 현재 내용을 지정된 파일 이름으로 저장한다.<br/>:e 파일명 : 동일 폴더 내의 다른 파일을 불러와 편집한다.<br/>:w! : 강제로 덮어쓰기를 한다.(★)<br/>:wq : 현재 편집하는 내용을 저장하고 종료한다.(★)<br/>:wq! : 현재 편집하는 내용을 강제로 저장하고 종료한다.(★)<br/>:q! : 강제로 종료한다.(★)<br/><br/>※ set 여러 가지 환경 변수를 설정한다. set all하면 현재 설정되어 있는 환경 변수를 보여준다.<br/>:set nu : 라인 넘버 붙이기 (&lt;=&gt; set nonu)(★)<br/>:set showmode : 현재 명령 상태를 화면 하단에 표시<br/>:set bg=dark : 편집기 글자색을 밝게 표시 (vim)<br/>:set ai : 자동 들여쓰기(★)<br/>:set ic : 문자열 검색시 대소문자 구분 안한다.<br/>:ab문자 문자열? : 문자열을 문자열 앞에 있는 문자로 줄여 사용할 수 있음.(아래아한글의 상용구 기능에 해당)<br/>:set ts=n : 기본 tab size를 n column 으로 한다.<br/>:sp : 편집기 화면 수평 분할(화면을 수평으로 여러 개 분할해서 사용할 때 쓴다) (vim)<br/>:^ww : 분할된 화면으로 커서 이동. (vim)<br/><br/>※ 문자열검색<br/>/패턴 ; 패턴에 해당하는 내용을 현재 커서위치로 부터 오른쪽에서 그리고 아래쪽으로 찾는다.(★★)<br/>n 정방향 다음 찾기 (현재 진행방향으로 =&gt; 아래쪽으로)(★)<br/>N 역방향 다음 찾기 (현재 진행 방향 반대쪽으로 =&gt; 위쪽으로)(★)<br/>? 패턴 패턴에 해당하는 내용을 현재 커서위치로 부터 왼쪽에서 그리고 위쪽으로 찾는다.<br/><br/>[ATTACH]940[/ATTACH]]]></description>
<dc:creator>MintState</dc:creator>
<dc:date>Mon, 16 Oct 2017 10:22:10 +0900</dc:date>
</item>


<item>
<title>vi에서 UTF로 인코딩</title>
<link>https://go3.co.kr/mintbbs/bbs/board.php?bo_table=linux&amp;amp;wr_id=5354</link>
<description><![CDATA[[U]vi에서 UTF로 인코딩[/U]<br/><br/>[B]1. 기본으로 vi를 utf-8로 지정하는 방법[/B]<br/>[CODE]~/.vimrc <br/>set encoding=utf-8 nobomb <br/>set fileencodings=utf-8,cp949[/CODE] <br/><br/>[B]2. 열린 파일에서 utf-8로 변환(깨진 문자 보기)[/B]<br/>명령모드에서<br/>:e ++enc=utf-8<br/><br/>[B]3. utf-8로 파일 저장하기[/B]<br/>명령모드에서<br/>:set fileencoding=utf-8<br/>:wq<br/><br/>또는<br/>:w ++enc=utf-8<br/><br/>[B]4. utf-8로 인코딩 전환[/B]<br/>:set enc=utf-8]]></description>
<dc:creator>MintState</dc:creator>
<dc:date>Tue, 03 Nov 2015 11:45:13 +0900</dc:date>
</item>


<item>
<title>[쉘스크립트]프로세스 감시 죽은 프로세스 자동 살리기</title>
<link>https://go3.co.kr/mintbbs/bbs/board.php?bo_table=linux&amp;amp;wr_id=5353</link>
<description><![CDATA[[U][쉘스크립트]프로세스 감시 죽은 프로세스 자동 살리기[/U]<br/><br/><br/>갑자기 프로세스(Process)가 죽는 경우 버그를 잡아야 하지만 버그 잡는 일이 어렵다.<br/>그래서 그냥 죽은 프로세스를 살리는 방법을 알아본다.<br/>C프로그램이나 Shell 프로그램으로 가능하다 <br/>여기서는 쉘프로그램으로 간단히 해보자.<br/><br/>예제는 60초간격으로 crond 프로세스가 살아 있는지 감시하고 죽었을때 start하는 방법이다.<br/><br/>[CODE]#!/bin/bash<br/>while [ 1 ]<br/>&nbsp; &nbsp; &nbsp; &nbsp; do<br/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pid=`ps -ef | grep &#034;crond&#034; | grep -v &#039;grep&#039; | awk &#039;{print $2}&#039;`<br/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if [ -z $pid ]; then<br/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; /etc/rc.d/init.d/crond start<br/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fi<br/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sleep 60<br/>&nbsp; &nbsp; &nbsp; &nbsp; done[/CODE]<br/><br/>ps -ef | grep &#034;crond&#034; | grep -v &#039;grep&#039; | awk &#039;{print $2}&#039; 부분은 crond 프로세스가 있는지 알아 보는 방법으로 pid를 반환한다. <br/>grep 로 적당히 작성하면 됩니다.<br/><br/>참고로 grep -v 옵션은 해당 내용이 포함되어 있지 않는 경우를 찾는 방법이다.]]></description>
<dc:creator>MintState</dc:creator>
<dc:date>Mon, 10 Aug 2015 17:58:13 +0900</dc:date>
</item>


<item>
<title>[mysql] binary log 관리</title>
<link>https://go3.co.kr/mintbbs/bbs/board.php?bo_table=linux&amp;amp;wr_id=5352</link>
<description><![CDATA[[U][mysql] binary log 관리[/U]<br/><br/>DB에 mysql-bin.000xxx 형식으로 binary log가 생성된다.<br/>이 로그는 추후 mysql 복구등에 쓰이지만 하드의 공간차지를 너무 많이 하게 된다. <br/>이때 rm 으로 삭제 해주면 mysql 데몬이 재부팅이 안되는 경우가 생긴다. <br/><br/>꼭 mysql binary log는 mysql 창에서 삭제해 주자.<br/><br/>우선 mysql 커멘드창에서 아래 명령어를 입력하면 현재의 바이너리 로그가 쭉 나타난다. 파일 사이즈와 같이. <br/>[COLOR=blue]mysql&gt; show binary logs;[/COLOR]<br/><br/>이 로그를 지우기위해서는 아래와 같이 입력하면된다.<br/>100번 미만의 로그는 삭제 하라는 뜻이다.<br/>[COLOR=blue]mysql&gt; purge master logs to &#039;mysql-bin.000100&#039;;[/COLOR]<br/><br/><br/>my.cnf에 설정해 놓으면 자동으로 삭제 관리가 된다.<br/>[CODE]binlog_cache_size&nbsp; &nbsp; &nbsp; =&nbsp; 1M&nbsp; &nbsp; &nbsp; # binlog cache 사이즈 <br/>max_binlog_size&nbsp; &nbsp; &nbsp; &nbsp; =&nbsp; 500M&nbsp; &nbsp; # bin로그 maximum 사이즈 <br/>expire_logs_days&nbsp; &nbsp; &nbsp; &nbsp; = 3&nbsp; &nbsp; &nbsp;  # 로그 만료기간[/CODE]]]></description>
<dc:creator>MintState</dc:creator>
<dc:date>Thu, 21 May 2015 10:14:56 +0900</dc:date>
</item>


<item>
<title>[RewriteRule] URL에서 .html 삭제하기</title>
<link>https://go3.co.kr/mintbbs/bbs/board.php?bo_table=linux&amp;amp;wr_id=5351</link>
<description><![CDATA[[U][RewriteRule] URL에서 .html 삭제하기[/U]<br/><br/>How to remove .html from URL<br/><br/>[CODE]DirectoryIndex index.html<br/>#AddType application/x-httpd-php .jio<br/><br/>RewriteEngine On<br/>RewriteCond %{REQUEST_FILENAME} !-f<br/>RewriteCond %{REQUEST_FILENAME} !-d<br/>RewriteCond %{REQUEST_FILENAME}.html -f<br/>RewriteRule ^(.+)$ $1.html [L,QSA]<br/><br/>#301 from example.com/page.html to example.com/page<br/>RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /.*\.html\ HTTP/<br/>RewriteRule ^(.*)\.html$ /$1 [R=301,L][/CODE]<br/><br/>출처 : <A HREF="http://stackoverflow.com/questions/5730092/how-to-remove-html-from-url" TARGET="_blank"  rel="nofollow">http://stackoverflow.com/questions/5730092/how-to-remove-html-from-url</A>]]></description>
<dc:creator>MintState</dc:creator>
<dc:date>Wed, 14 Jan 2015 11:37:37 +0900</dc:date>
</item>


<item>
<title>아파치 동시접속자수 확인</title>
<link>https://go3.co.kr/mintbbs/bbs/board.php?bo_table=linux&amp;amp;wr_id=5350</link>
<description><![CDATA[[U]아파치 동시접속자수 확인[/U]<br/><br/>#netstat -l 또는 netstat -nap | grep LISTEN (LISTEN 되는 모든 포트)<br/>#netstat -nap | grep ESTABLISHED | wc -l ( 모든 서비스 동시 접속자 수)<br/>#netstat -nap | grep :80 | grep ESTABLISHED | wc -l( 웹 동시 접속자 수)<br/>#netstat -n|grep -F :80|egrep &#039;(ESTAB|SYN)&#039;|awk &#039;{print $5}&#039;|sed &#039;s/:[0-9]*//&#039;|sort -u|wc -l&nbsp; (웹서버 커넥션수 체크)<br/><br/>#netstat -nat | awk &#039;{print $6}&#039; | sort | uniq -c | sort -n (wait 등 정보 보기)<br/>#netstat -tan |grep :80|grep TIME_WAIT |wc -l (TIME_WAIT 보기)<br/><br/>watch &#039;~~~&#039; 를 이용하여 실시간으로 보면 편하다.]]></description>
<dc:creator>MintState</dc:creator>
<dc:date>Tue, 09 Sep 2014 14:04:27 +0900</dc:date>
</item>


<item>
<title>batch ftp from windows to linux using shell scripting</title>
<link>https://go3.co.kr/mintbbs/bbs/board.php?bo_table=linux&amp;amp;wr_id=5349</link>
<description><![CDATA[[U]batch ftp from windows to linux using shell scripting[/U]<br/><br/>I am a beginner. I am trying to write a bat file that I can run as a scheduled task from my windows server that will ftp (put) a file from windows to a linux box. I&#039;ve been experiementing with 2 different scripts, neither are working. Can anyone recommend which path of shell scripting is a better path to work on? and/or any tips? thanks in advance.<br/><br/>option 1.<br/>[CODE]HOST=111.111.111.111<br/>PASSWORD=xxx<br/>USER=ftpuser<br/>FILE_NAME=pg.mdb<br/>ftp -v -n ${HOST} &lt;&lt; cmd<br/>user ${USER} ${PASSWORD}<br/>cd /home/ftp/<br/>lcd C:\test<br/>ls ${FILE_NAME}<br/>put ${FILE_NAME}<br/>quit<br/>cmd[/CODE]<br/><br/>Option 2.<br/>[CODE]cd c:/test<br/>echo open 111.111.111.111/home/ftp&gt;autoxfer.txt<br/>echo user ftpuser&gt;&gt;autoxfer.txt<br/>echo xxxx&gt;&gt;autoxfer.txt<br/>echo binary&gt;&gt;autoxfer.txt<br/>echo put pg.mdb&gt;&gt;autoxfer.txt<br/>echo quit&gt;&gt;autoxfer.txt<br/>ftp -v -n -s:autoxfer.txt[/CODE]<br/><br/>출처 : <A HREF="http://www.unix.com/showthread.php?t=195547" TARGET="_blank"  rel="nofollow">http://www.unix.com/showthread.php?t=195547</A>]]></description>
<dc:creator>MintState</dc:creator>
<dc:date>Thu, 28 Nov 2013 09:49:50 +0900</dc:date>
</item>


<item>
<title>Robot.txt 봇 접근 제한하기</title>
<link>https://go3.co.kr/mintbbs/bbs/board.php?bo_table=linux&amp;amp;wr_id=5348</link>
<description><![CDATA[robot.txt<br/>&nbsp;<br/>로봇이 kensei.co.kr/ 에 방문하면 먼저 kensei.co.kr/robots.txt 파일 호출함<br/>로봇의 접근 권한 및 접근가능한 경로에 대한 정보를 분석하여 자신이 수집해도 되는 콘텐트만을 수집한다<br/>웹 사이트의 최상위 루트에 robots.txt 파일이 있어야함<br/>robots.txt 화일에는 최소한 한개의 &#034;disallow&#034; 필드(field)가 존재해야 함<br/><br/>robot.txt 파일이름은 소문자로 작성 (공백 허용되지 않음)<br/><br/>ex)<br/><br/>홈페이지 전체가 모든 검색엔진에 노출되기를 원치 않음<br/>User-agent: *<br/>Disallow: /<br/><br/>홈페이지 전체가 모든 검색엔진에 노출되기를 원함<br/>User-agent: *<br/>Disallow:<br/><br/>홈페이지 디렉토리중 일부만 검색엔진에 노출하고 싶음<br/>User-agent: *<br/>Disallow: /my_photo/<br/>Disallow: /my_diary/<br/><br/>홈페이지 전체를 노출시키지만 특정 검색엔진 (EvilRobot)만 거부<br/>User-agent: EvilRobot<br/>Disallow: /<br/><br/>홈페이지 전체가 노출되지만 특정검색엔진에서만 노출되기를 원함<br/>User-agent: NaverBot<br/>Disallow:<br/>User-agent: *<br/>Disallow: /<br/><br/>/help.html과 /help/index.html 둘 다 허용 안함<br/>disallow: /help<br/><br/>/help/index.html는 허용 안하나, /help.html은 허용 됨. <br/>disallow: /help/ <br/><br/>루트 하위에 있는 xml 확장자를 가진 모든 파일의 색인을 거부<br/>Disallow: /*.xml$ <br/><br/>루트에 test.html 과 ?가 포함된 파일의 색인을 거부한다<br/>Disallow: /test.html? <br/><br/>User-agent: Googlebot-Image<br/>Disallow: /*.gif$<br/>Disallow: /*.jpg$ 위 문장은 구글의 이미지를 검색하는 로봇에게 gif와 jpg로 된 이미지를 모두 검색하지 않도록 하는 명령어입니다.<br/><br/>HTML (HEAD) 와 (/HEAD) 사이에 (META NAME=&#034;ROBOTS&#034; CONTENT=&#034;NOINDEX, NOFOLLOW&#034;)<br/>라는 메타태크그를 추가함으로써 문서 하나하나에 대해 정확하게 명시를 해주므로 가장 확실하게 로봇 접근을 차단할수 있음<br/><br/>검색엔진에 Robot를 차단하더라도 자신의 페이지중 일부가 나타날수 있음<br/>기타 문서나 사이트들이 자신의 웹 문서를 링크할 경우 자동적으로 생성되어 나타날수 있음<br/>이 경우 Robot 과 무관함 (robots.txt를 무시하는 로봇들도 있을수 있음)<br/>Robot 들의 IP들을 알 경우 IP를 통해 정책수립해도 상관없음<br/><br/>주석문을 작성하기 위해서는 앞에 #를 적어주시면 됩니다. <br/>로봇의 이름은 개별 검색사이트를 방문해야함<br/><br/>구글: Googlebot<br/>구글 이미지 : googlebot-image<br/>네이버 : cowbot<br/>네이버 : User-Agent: Yeti/1.0 (NHN Corp.; <A HREF="http://help.naver.com/robots/)" TARGET="_blank"  rel="nofollow">http://help.naver.com/robots/)</A><br/>야후 : Slurp<br/>야후 이미지 : Yahoo-MMCrawler<br/>엠파스봇 : empas<br/>MSN : MSNBot<br/>첫눈: 1Noonbot 1.0<br/>다음 : daumoa<br/><br/><br/>&nbsp;<br/>실제 Apache Log<br/>&nbsp;<br/>61.247.221.84 - - [22/Aug/2010:06:10:03 +0900] &#034;GET /robots.txt HTTP/1.1&#034; 404 -<br/>61.247.221.84 - - [22/Aug/2010:06:10:03 +0900] &#034;GET /152 HTTP/1.1&#034; 200 54216<br/>&nbsp;<br/>61.247.221.84 로봇이 접근해서 robot.txt 파일을 읽었는데 404에러 robot.txt 파일이 없다.???<br/>없으니깐 /152번 글을 GET 해가지고 갔다? 200 정상 메세지니깐??<br/>&nbsp;<br/>IP 기반으로 차단하기 위해서는 해당 봇들에 대한 아이피 정보들을 가지고 있어야 함<br/>아래 사이트 접근하면 각종 봇들에 대한 아이피 대역 리스트를 받아 볼수 있음...<br/>100% 신뢰할만할까?<br/>&nbsp;<br/><A HREF="http://iplists.com/" TARGET="_blank"  rel="nofollow">http://iplists.com/</A> <br/>&nbsp;<br/>END]]></description>
<dc:creator>MintState</dc:creator>
<dc:date>Fri, 11 Oct 2013 21:05:48 +0900</dc:date>
</item>


<item>
<title>mod_deflate 사용하여 웹페이지 압축 전송</title>
<link>https://go3.co.kr/mintbbs/bbs/board.php?bo_table=linux&amp;amp;wr_id=5347</link>
<description><![CDATA[[U]mod_deflate 사용하여 웹페이지 압축 전송[/U]<br/><br/>아파치(Apache) 모듈중에서 mod_deflate을 사용하여 웹페이지를 압축할 수 있다.<br/><br/>[URL]<A HREF="http://www.whatsmyip.org/http-compression-test/" TARGET="_blank"  rel="nofollow">http://www.whatsmyip.org/http-compression-test/</A>[/URL] 사이트에서 테스트를 해볼 수 있다.<br/><br/>우선 아파치에 mod_deflate 모듈이 올라 왔는지 확인한다. <br/>httpd -l 로 확인.<br/><br/>만일 올라오지 않았을 경우에는 <br/>아파치 소스 /usr/local/src/httpd-2.2.2/modules/filters/ 디렉토리에서 mod_deflate.c 파일을 찾을 수 있다. <br/>[CODE]/usr/local/apache/bin/apxs -aic ./mod_deflate.c[/CODE] <br/>명령으로 해당 모듈을 등록 시킨다. <br/><br/>그리고 아파치 설정파일에 아래와 같이 등록 시키면 된다. <br/>또한&nbsp; 아파치에 zlib 라이브러리가 등록되어 있어야 한다. <br/><br/>[CODE]&lt;IfModule mod_deflate&gt;<br/># 특별한 MIME type만 압축<br/>AddOutputFilterByType DEFLATE text/html text/plain text/xml application/x-javascript text/css<br/># 압축률을 지정합니다. (1~9)<br/>DeflateCompressionLevel 9<br/><br/># Netscape 4.x에 문제가 있다...<br/>BrowserMatch ^Mozilla/4 gzip-only-text/html<br/># Netscape 4.06-4.08에 더 문제가 있다<br/>BrowserMatch ^Mozilla/4\.0[678] no-gzip<br/># MSIE은 Netscape라고 자신을 알리지만, 문제가 없다<br/>BrowserMatch \bMSIE !no-gzip !gzip-only-text/html<br/><br/># 압축하지 않을 파일들을 지정합니다.<br/>SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png|bmp|zip|tar|rar|alz|a00|ace|txt|mp3|mpe?g|wav|asf|wma|wmv|swf|exe|pdf|doc|xsl|hwp|java|c|t?gz|bz2|7z)$ no-gzip dont-vary<br/># 프록시가 잘못된 내용을 전달하지않도록 한다<br/>Header append Vary User-Agent env=!dont-vary<br/>&lt;/IfModule&gt;[/CODE]<br/><br/>아래와 같이 Location을 사용하여 특정 디렉토리에다 적용시킬수 도 있다. <br/>[CODE]&lt;Location&gt;<br/><br/>&lt;/Location&gt;[/CODE] <br/>]]></description>
<dc:creator>MintState</dc:creator>
<dc:date>Mon, 30 Sep 2013 19:10:54 +0900</dc:date>
</item>


<item>
<title>How Do I Secure Grub Boot Loader?</title>
<link>https://go3.co.kr/mintbbs/bbs/board.php?bo_table=linux&amp;amp;wr_id=5346</link>
<description><![CDATA[[U]How Do I Secure Grub Boot Loader?[/U]<br/><br/>Grub 부트로더 에디트를 함부로 하지 못하게 pasword 설정법 입니다.<br/><br/>[B]#1: Create A Password For Grub[/B]<br/><br/>Type grub-md5-crypt command to create password in MD5 format:<br/>[CODE]# grub-md5-crypt[/CODE]<br/>Output:<br/>[CODE]Password:&lt;ENTER-YOUR-PASSWORD&gt;<br/>Retype password:&lt;ENTER-YOUR-PASSWORD&gt;<br/>$1$NYoR71$Sgv6pxQ6LG4GXpfihIJyL0[/CODE]<br/>Please note that you need to copy and paste the MD5 password ($1$NYoR71$Sgv6pxQ6LG4GXpfihIJyL0) to your configuration file. Use mouse to copy the same.<br/><br/><br/>[B]#2 Add MD5 Password To Grub Configuration File[/B]<br/><br/>Under Debian GNU/Linux the Grub configuration file is located at /boot/grub/menu.lst. (Red Hat / Fedora user use /boot/grub/grub.conf file)<br/>[CODE]# vi /boot/grub/menu.lst<br/>or <br/># vi /etc/grub.conf[/CODE]<br/><br/>Edit file and add a password line as follows:<br/>[CODE]password --md5 $1$NYoR71$Sgv6pxQ6LG4GXpfihIJyL0[/CODE]<br/><br/>Here is my sample config file:<br/>[CODE]default&nbsp; &nbsp; &nbsp; &nbsp;  0<br/>timeout&nbsp; &nbsp; &nbsp; &nbsp;  5<br/>password --md5 $1$NYoR71$Sgv6pxQ6LG4GXpfihIJyL0<br/>title&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  Debian GNU/Linux, kernel 2.6.13.4-cust-en-smp<br/>root&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  (hd0,0)<br/>kernel&nbsp; &nbsp; &nbsp; &nbsp; /boot/vmlinuz root=/dev/hda3 ro<br/>savedefault<br/>boot[/CODE]<br/><br/>출처 : [URL]<A HREF="http://www.cyberciti.biz/tips/how-do-i-secure-grub-boot-loader.html" TARGET="_blank"  rel="nofollow">http://www.cyberciti.biz/tips/how-do-i-secure-grub-boot-loader.html</A>[/URL]<br/><br/>[B]추가 적으로 root password 를 삭제 하는 방법[/B]<br/>grub 화면에서 e (edit)로 들어가서 2번째 라인에서 e (edit) 후 마지막에 1 추가후 b (boot) 하신후<br/>/etc/shadow 파일 에서 root 부분의 password 부분 삭제 ( root:: ) 하시면 됩니다.]]></description>
<dc:creator>MintState</dc:creator>
<dc:date>Fri, 23 Aug 2013 15:33:58 +0900</dc:date>
</item>


<item>
<title>리눅스 버전 및 CPU등 환경정보 확인</title>
<link>https://go3.co.kr/mintbbs/bbs/board.php?bo_table=linux&amp;amp;wr_id=5345</link>
<description><![CDATA[[U]리눅스 버전 및 CPU등 환경정보 확인[/U]<br/><br/>프롬프트 명령어를 통해서 리눅스 정보를 알아봅니다.<br/><br/>[B]- 리눅스 버전[/B]<br/>[CODE]# cat /etc/issue<br/>CentOS release 5.7 (Final)<br/>Kernel \r on an \m<br/><br/>또는 <br/><br/># cat /etc/redhat-release<br/>CentOS release 5.7 (Final)[/CODE]<br/><br/>[B]- 리눅스 커널[/B]<br/>[CODE]# cat /proc/version<br/>Linux version 2.6.18-274.3.1.el5PAE (<a href="mailto:mockbuild@builder10.centos.org"  rel="nofollow">mockbuild@builder10.centos.org</a>) (gcc version 4.1.2 20080704 (Red Hat 4.1.2-51)) #1 SMP Tue Sep 6 20:56:05 EDT 2011[/CODE]<br/><br/>[B]- 커널 BIT[/B]<br/>[CODE]# getconf WORD_BIT<br/>32[/CODE]<br/><br/>[B]- Kernel Architecture[/B]<br/>[CODE]# uname -m<br/>i686[/CODE]<br/><br/>[CODE]# uname (옵션)<br/>&gt;&gt; 옵션<br/>-a : All 모든 정보<br/>-i : Platform 정보<br/>-m : System Kernel Architecture 정보<br/>-n : Nodename(Host name) 정보<br/>-p : Processor(Processor type) 정보<br/>-r : System OS Release 정보<br/>-s : System OS 정보<br/>-v : Kernel ID 정보<br/>-X : 조금더 디테일 한 정보<br/>-S : 호스트 이름 변경[/CODE]<br/><br/>[B]- CPU 정보[/B]<br/>[CODE]# cat /proc/cpuinfo<br/>processor&nbsp; &nbsp; &nbsp;  : 0<br/>vendor_id&nbsp; &nbsp; &nbsp;  : GenuineIntel<br/>cpu family&nbsp; &nbsp; &nbsp; : 6<br/>model&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  : 30<br/>model name&nbsp; &nbsp; &nbsp; : Intel(R) Xeon(R) CPU&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  X3430&nbsp; @ 2.40GHz<br/>stepping&nbsp; &nbsp; &nbsp; &nbsp; : 5<br/>cpu MHz&nbsp; &nbsp; &nbsp; &nbsp;  : 2394.221<br/>cache size&nbsp; &nbsp; &nbsp; : 8192 KB<br/>physical id&nbsp; &nbsp;  : 0<br/>siblings&nbsp; &nbsp; &nbsp; &nbsp; : 4<br/>core id&nbsp; &nbsp; &nbsp; &nbsp;  : 0<br/>cpu cores&nbsp; &nbsp; &nbsp;  : 4<br/>apicid&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; : 0<br/>fdiv_bug&nbsp; &nbsp; &nbsp; &nbsp; : no<br/>hlt_bug&nbsp; &nbsp; &nbsp; &nbsp;  : no<br/>f00f_bug&nbsp; &nbsp; &nbsp; &nbsp; : no<br/>coma_bug&nbsp; &nbsp; &nbsp; &nbsp; : no<br/>fpu&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  : yes<br/>fpu_exception&nbsp;  : yes<br/>cpuid level&nbsp; &nbsp;  : 11<br/>wp&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; : yes<br/>flags&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx rdtscp lm constant_tsc nonstop_tsc pni monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr sse4_1 sse4_2 popcnt lahf_lm [8]<br/>bogomips&nbsp; &nbsp; &nbsp; &nbsp; : 4788.44<br/><br/>processor&nbsp; &nbsp; &nbsp;  : 1<br/>vendor_id&nbsp; &nbsp; &nbsp;  : GenuineIntel<br/>cpu family&nbsp; &nbsp; &nbsp; : 6<br/>model&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  : 30<br/>model name&nbsp; &nbsp; &nbsp; : Intel(R) Xeon(R) CPU&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  X3430&nbsp; @ 2.40GHz<br/>stepping&nbsp; &nbsp; &nbsp; &nbsp; : 5<br/>cpu MHz&nbsp; &nbsp; &nbsp; &nbsp;  : 2394.221<br/>cache size&nbsp; &nbsp; &nbsp; : 8192 KB<br/>physical id&nbsp; &nbsp;  : 0<br/>siblings&nbsp; &nbsp; &nbsp; &nbsp; : 4<br/>core id&nbsp; &nbsp; &nbsp; &nbsp;  : 1<br/>cpu cores&nbsp; &nbsp; &nbsp;  : 4<br/>apicid&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; : 2<br/>fdiv_bug&nbsp; &nbsp; &nbsp; &nbsp; : no<br/>hlt_bug&nbsp; &nbsp; &nbsp; &nbsp;  : no<br/>f00f_bug&nbsp; &nbsp; &nbsp; &nbsp; : no<br/>coma_bug&nbsp; &nbsp; &nbsp; &nbsp; : no<br/>fpu&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  : yes<br/>fpu_exception&nbsp;  : yes<br/>cpuid level&nbsp; &nbsp;  : 11<br/>wp&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; : yes<br/>flags&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx rdtscp lm constant_tsc nonstop_tsc pni monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr sse4_1 sse4_2 popcnt lahf_lm [8]<br/>bogomips&nbsp; &nbsp; &nbsp; &nbsp; : 4787.93<br/><br/>processor&nbsp; &nbsp; &nbsp;  : 2<br/>vendor_id&nbsp; &nbsp; &nbsp;  : GenuineIntel<br/>cpu family&nbsp; &nbsp; &nbsp; : 6<br/>model&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  : 30<br/>model name&nbsp; &nbsp; &nbsp; : Intel(R) Xeon(R) CPU&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  X3430&nbsp; @ 2.40GHz<br/>stepping&nbsp; &nbsp; &nbsp; &nbsp; : 5<br/>cpu MHz&nbsp; &nbsp; &nbsp; &nbsp;  : 2394.221<br/>cache size&nbsp; &nbsp; &nbsp; : 8192 KB<br/>physical id&nbsp; &nbsp;  : 0<br/>siblings&nbsp; &nbsp; &nbsp; &nbsp; : 4<br/>core id&nbsp; &nbsp; &nbsp; &nbsp;  : 2<br/>cpu cores&nbsp; &nbsp; &nbsp;  : 4<br/>apicid&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; : 4<br/>fdiv_bug&nbsp; &nbsp; &nbsp; &nbsp; : no<br/>hlt_bug&nbsp; &nbsp; &nbsp; &nbsp;  : no<br/>f00f_bug&nbsp; &nbsp; &nbsp; &nbsp; : no<br/>coma_bug&nbsp; &nbsp; &nbsp; &nbsp; : no<br/>fpu&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  : yes<br/>fpu_exception&nbsp;  : yes<br/>cpuid level&nbsp; &nbsp;  : 11<br/>wp&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; : yes<br/>flags&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx rdtscp lm constant_tsc nonstop_tsc pni monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr sse4_1 sse4_2 popcnt lahf_lm [8]<br/>bogomips&nbsp; &nbsp; &nbsp; &nbsp; : 4787.94<br/><br/>processor&nbsp; &nbsp; &nbsp;  : 3<br/>vendor_id&nbsp; &nbsp; &nbsp;  : GenuineIntel<br/>cpu family&nbsp; &nbsp; &nbsp; : 6<br/>model&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  : 30<br/>model name&nbsp; &nbsp; &nbsp; : Intel(R) Xeon(R) CPU&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  X3430&nbsp; @ 2.40GHz<br/>stepping&nbsp; &nbsp; &nbsp; &nbsp; : 5<br/>cpu MHz&nbsp; &nbsp; &nbsp; &nbsp;  : 2394.221<br/>cache size&nbsp; &nbsp; &nbsp; : 8192 KB<br/>physical id&nbsp; &nbsp;  : 0<br/>siblings&nbsp; &nbsp; &nbsp; &nbsp; : 4<br/>core id&nbsp; &nbsp; &nbsp; &nbsp;  : 3<br/>cpu cores&nbsp; &nbsp; &nbsp;  : 4<br/>apicid&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; : 6<br/>fdiv_bug&nbsp; &nbsp; &nbsp; &nbsp; : no<br/>hlt_bug&nbsp; &nbsp; &nbsp; &nbsp;  : no<br/>f00f_bug&nbsp; &nbsp; &nbsp; &nbsp; : no<br/>coma_bug&nbsp; &nbsp; &nbsp; &nbsp; : no<br/>fpu&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  : yes<br/>fpu_exception&nbsp;  : yes<br/>cpuid level&nbsp; &nbsp;  : 11<br/>wp&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; : yes<br/>flags&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx rdtscp lm constant_tsc nonstop_tsc pni monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr sse4_1 sse4_2 popcnt lahf_lm [8]<br/>bogomips&nbsp; &nbsp; &nbsp; &nbsp; : 4787.93[/CODE]<br/><br/>[B]- 메모리 정보[/B]<br/>[CODE]# cat /proc/meminfo<br/>MemTotal:&nbsp; &nbsp; &nbsp; 4139004 kB<br/>MemFree:&nbsp; &nbsp; &nbsp; &nbsp; 226916 kB<br/>Buffers:&nbsp; &nbsp; &nbsp; &nbsp; 259636 kB<br/>Cached:&nbsp; &nbsp; &nbsp; &nbsp; 3096328 kB<br/>SwapCached:&nbsp; &nbsp; &nbsp; 67732 kB<br/>Active:&nbsp; &nbsp; &nbsp; &nbsp; 1645268 kB<br/>Inactive:&nbsp; &nbsp; &nbsp; 2168300 kB<br/>HighTotal:&nbsp; &nbsp;  3268224 kB<br/>HighFree:&nbsp; &nbsp; &nbsp; &nbsp; 78664 kB<br/>LowTotal:&nbsp; &nbsp; &nbsp;  870780 kB<br/>LowFree:&nbsp; &nbsp; &nbsp; &nbsp; 148252 kB<br/>SwapTotal:&nbsp; &nbsp;  4192924 kB<br/>SwapFree:&nbsp; &nbsp; &nbsp; 4062204 kB<br/>Dirty:&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 3132 kB<br/>Writeback:&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  0 kB<br/>AnonPages:&nbsp; &nbsp; &nbsp; 457476 kB<br/>Mapped:&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 18112 kB<br/>Slab:&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 79916 kB<br/>PageTables:&nbsp; &nbsp; &nbsp;  7592 kB<br/>NFS_Unstable:&nbsp; &nbsp; &nbsp; &nbsp; 0 kB<br/>Bounce:&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0 kB<br/>CommitLimit:&nbsp;  6262424 kB<br/>Committed_AS:&nbsp; 1481748 kB<br/>VmallocTotal:&nbsp;  116728 kB<br/>VmallocUsed:&nbsp; &nbsp; &nbsp; 5796 kB<br/>VmallocChunk:&nbsp;  110800 kB<br/>HugePages_Total:&nbsp; &nbsp;  0<br/>HugePages_Free:&nbsp; &nbsp; &nbsp; 0<br/>HugePages_Rsvd:&nbsp; &nbsp; &nbsp; 0<br/>Hugepagesize:&nbsp; &nbsp;  2048 kB[/CODE]<br/><br/>[B]- DISK 정보[/B]<br/>[CODE]# df -h<br/>Filesystem&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Size&nbsp; Used Avail Use% Mounted on<br/>/dev/sda7&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  5.9G&nbsp; 450M&nbsp; 5.1G&nbsp;  8% /<br/>/dev/sda10&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 239G&nbsp;  63G&nbsp; 164G&nbsp; 28% /home<br/>/dev/sda9&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  2.0G&nbsp;  43M&nbsp; 1.8G&nbsp;  3% /tmp<br/>/dev/sda3&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  9.7G&nbsp; 3.9G&nbsp; 5.3G&nbsp; 43% /log<br/>/dev/sda2&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  9.7G&nbsp; 5.2G&nbsp; 4.1G&nbsp; 56% /db<br/>/dev/sda1&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 99M&nbsp;  17M&nbsp;  77M&nbsp; 18% /boot<br/>tmpfs&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  2.0G&nbsp; &nbsp;  0&nbsp; 2.0G&nbsp;  0% /dev/shm[/CODE]]]></description>
<dc:creator>MintState</dc:creator>
<dc:date>Tue, 14 May 2013 17:15:29 +0900</dc:date>
</item>


<item>
<title>$LANG 설정</title>
<link>https://go3.co.kr/mintbbs/bbs/board.php?bo_table=linux&amp;amp;wr_id=5344</link>
<description><![CDATA[[U]$LANG 설정[/U]<br/><br/>[B]현재 LANG 확인[/B]<br/>$ echo $LANG<br/>[CODE]ko_KR.eucKR[/CODE]<br/><br/>$ vi /etc/sysconfig/i18n<br/>[CODE]#LANG=&#034;ko_KR.eucKR&#034;<br/>LANG=&#034;ko_KR.UTF-8&#034;<br/>SUPPORTED=&#034;ko_KR.UTF-8:ko_KR:ko:en_US.UTF-8:en_US:en&#034;<br/><br/>SYSFONT=&#034;latarcyrhed-sun16&#034;[/CODE]<br/><br/>$ export LANG=&#034;ko_KR.UTF-8&#034;<br/>$ export LC_ALL=&#034;ko_KR.UTF-8&#034;]]></description>
<dc:creator>MintState</dc:creator>
<dc:date>Tue, 29 May 2012 09:21:34 +0900</dc:date>
</item>


<item>
<title>CBL 스펨메일 문제 해결(localhost.localdomain)</title>
<link>https://go3.co.kr/mintbbs/bbs/board.php?bo_table=linux&amp;amp;wr_id=347</link>
<description><![CDATA[[U]CBL 스펨메일 문제 해결(localhost.localdomain)[/U]<br/><br/>어제 마이크로소프트로 메일을 전송시키다 보니 <A HREF="http://www.spamhaus.org/lookup.lasso" TARGET="_blank"  rel="nofollow">http://www.spamhaus.org/lookup.lasso</A> 에 등록되어 스펨 처리가 되어 메일이 리턴이 되었다.<br/><A HREF="http://cbl.abuseat.org/lookup.cgi?ip=xxx.xxx.xxx.xxx" TARGET="_blank"  rel="nofollow">http://cbl.abuseat.org/lookup.cgi?ip=xxx.xxx.xxx.xxx</A> 문서를 살펴보니 아래와 같은 내용이 있다.<br/><br/>This IP address is HELO&#039;ing as &#034;localhost.localdomain&#034; which violates the relevant standards (specifically: RFC5321). <br/><br/>Sendmail에서 메일을 보낼때 HELO localhost.localdomain 로 보내기 때문인 것 같다..<br/><br/>이는 서버 Hostname이 localhost.localdomain로 등록 되어 있기 때문이다.<br/><br/>그래서 hostname을 변경 해주면 해결이 된다.<br/><br/>HostName 도메인 추가<br/>[CODE]# vi /etc/sysconfig/network<br/>NETWORKING=yes<br/>NETWORKING_IPV6=no<br/>HOSTNAME=yesyo.com[/CODE]<br/><br/>Hosts 아이피 도메인 추가<br/>[CODE]# vi /etc/hosts<br/>127.0.0.1&nbsp;  localhost.localdomain&nbsp;  localhost<br/>::1 localhost6.localdomain6 localhost6<br/>xxx.xxx.xxx.xxx&nbsp;  yesyo.com[/CODE]<br/><br/>HostName 바로 적용<br/>[CODE]# hostname yesyo.com[/CODE]]]></description>
<dc:creator>MintState</dc:creator>
<dc:date>Wed, 03 Aug 2011 11:10:14 +0900</dc:date>
</item>


<item>
<title>유용한 find 명령어 예 모음</title>
<link>https://go3.co.kr/mintbbs/bbs/board.php?bo_table=linux&amp;amp;wr_id=346</link>
<description><![CDATA[[U]유용한 find 명령어 예 모음[/U]<br/><br/>[B]1. 현재 디렉토리( . ) 이하에 확장자가 .html( -name &#034;*.html&#034; ) 인 파일만 ( -type -f )[/B]<br/>find . -name &#034;*.html&#034; -type f -ls<br/><br/>[B]2. 파일 크기[/B]<br/># 파일 크기가 300KB 이상( -size +300k )인 파일만 <br/># (호스팅되는 홈피내에 큰 사이트의 파일이 있는지 찾을 때 유용)<br/>find . -size +300k -ls<br/><br/># 파일 크기가 500bytes 이하( -size -500c )인 파일만&nbsp; <br/>find . -size -500c -ls <br/><br/>[B]3. 수정일[/B]<br/># 수정한지 20일 이상( -mtime +20 )된 파일과 디렉토리<br/>find . -mtime +20 -ls <br/><br/># 수정한지 20일 이상된 파일만<br/>find . -mtime +20 -type f -ls<br/><br/># 수정한지 20일 이상된 파일만 삭제 ( -exec rm {} \; ) <br/># (정기적으로 20일이 지난 파일을 삭제할 때 유용)<br/>find . -mtime +20 -type f -ls -exec rm {} \;<br/><br/># 수정한지 3일 이내( -mtime -3 )의 파일만 (백업할 때 유용)<br/>find . -mtime -3 -type f -ls<br/><br/># 수정한지 30분 이내( -mmin -30 )의 파일만<br/>find . -mmin -30 -type f -ls<br/><br/>[B]4. 퍼미션 및 파일 소유[/B]<br/># 파일시스템 전체( / )에서 SUID/SGID가 설정된 모든 파일 목록을 얻음<br/>find / -type f \( -perm -04000 -o -perm -02000 \) -ls<br/><br/># 소유자가 없는 파일 목록을 얻음 (사용자는 이미 삭제했는데, 파일이 남은 경우)<br/>find / -nouser -o -nogroup<br/><br/>[B]5. 출력 형식 지정[/B]<br/># 출력 형식을 printf로 만들어서 (출력 결과를 다른 프로그램에서 받아서 쓸 때 유용)<br/># %h = 경로, %f = 파일명, %k = KB, %s = Bytes<br/><br/># 형식 : &lt;경로/파일명&gt; &lt;파일크기KB&gt;<br/>find . -printf &#034;%h/%f \t %kKB \n&#034;<br/>... 생략 ...<br/>./public_html/phps/icon/type/pcx.gif&nbsp; &nbsp; &nbsp; 4KB<br/>./public_html/phps/icon/type/ra.gif&nbsp; &nbsp; &nbsp;  4KB<br/>./public_html/phps/icon/type/sound.gif&nbsp; &nbsp; 4KB<br/>./public_html/phps/icon/type/text.gif&nbsp; &nbsp;  4KB<br/><br/># 형식 : &lt;경로/파일명&gt; &lt;파일크기Bytes&gt;<br/>find . -printf &#034;%h/%f \t %sKB \n&#034;<br/>... 생략 ...<br/>./public_html/phps/icon/type/movie.gif&nbsp; &nbsp; 912Bytes<br/>./public_html/phps/icon/type/mp3.gif&nbsp; &nbsp; &nbsp; 958Bytes<br/>./public_html/phps/icon/type/pcx.gif&nbsp; &nbsp; &nbsp; 897Bytes<br/>./public_html/phps/icon/type/ra.gif&nbsp; &nbsp; &nbsp;  903Bytes<br/>./public_html/phps/icon/type/sound.gif&nbsp; &nbsp; 932Bytes<br/><br/>[B]6. 홈페이지 포팅할 때 퍼미션 안 맞는 경우 유용한 것[/B]<br/># 확장자가 .htm* .gif, .js, .css 인 것만 퍼미션을 644(rw-r--r--)로<br/>find . -name &#034;*.htm*&#034; -o -name &#034;*.gif&#034; -o -name &#034;*.js&#034; -o -name &#034;*.css&#034; -exec chmod 644 {} \;<br/><br/># 파일은 퍼미션을 644로<br/>find . -type f -exec chmod 644 {} \;<br/><br/># 디렉토리는 퍼미션을 701로<br/>find . -type d -exec chmod 701 {} \;<br/><br/># 하위의 모든 퍼미션을 바꾸지 않고 depth를 지정하여 제한을 둘 때<br/># 옵션 : -maxdepth 숫자&nbsp; (1=현재디렉토리만, 2=현재디렉토리 포함하여 한단계 하위디렉토리까지만)<br/>find . -maxdepth 1 -type d -exec chmod 701 {} \;<br/><br/>※ -maxdepth는 -type나 -perm 등의 조건연산자가 아닌 옵션이다. <br/>&nbsp;  따라서 조건연산자보다 먼저 사용해야한다. (다른 명령처럼 옵션을 먼저쓰는 것으로 이해하면 됨)<br/>&nbsp;  find . -type -d -maxdepth 1 과 같이 사용하는 것은 옳지 않다.<br/><br/><br/>출처 : <A HREF="http://coffeenix.net/board_view.php?bd_code=36" TARGET="_blank"  rel="nofollow">http://coffeenix.net/board_view.php?bd_code=36</A>]]></description>
<dc:creator>MintState</dc:creator>
<dc:date>Wed, 27 Jul 2011 00:20:54 +0900</dc:date>
</item>


<item>
<title>sudo 사용</title>
<link>https://go3.co.kr/mintbbs/bbs/board.php?bo_table=linux&amp;amp;wr_id=345</link>
<description><![CDATA[[U]sudo 사용[/U]<br/><br/>인터넷을 통한 서비스를 위하여 설치된 서버에는 반드시 OS설치시부터 관리자 계정(root 또는 administrator)이 만들어져 있다. 이 계정의 권한은 직원이라 하더라도 함부로 알려줘서는 안되며, 관리자 권한이 필요한 업무를 보는 사람에게, 제한적으로 권한을 수행할 수 있도록 허용하는 보안정책이 필요하다. 작업용 공용계정을 사용하는 경우도 마찬가지이다.(하지만 작업용 공용계정을 없애는것이 보안의 첫걸음이다.)<br/>이 기능을 훌륭히 수행해주는 sudo의 사용법에 대하여 요약해 보았다.<br/><br/>[B]sudo[/B]<br/>* 개발, 운영 등의 작업을 수행함에 있어, 로그인계정 외의 다른 계정의 권한이 요구될 때, 그 계정을 직접 사용하지 않고(혹은, 패스워드를 알아내지 않고), 본인의 로그인계정의 인증을 통해 해당 계정의 권한으로 작업을 수행할 수 있다. <br/>* 용법<br/>[ATTACH]722[/ATTACH]<br/>* 가장 간단한 방법은 sudo &lt;command&gt;이다. 이렇게 하면 &lt;command&gt;에 적은 쉘커맨드가 root권한으로 수행된다. <br/>* root 계정이 아닌 다른 계정의 권한이 필요한 경우엔, sudo -u username &lt;command&gt; 로 수행하면 username 계정의 권한으로 &lt;command&gt;를 수행한다. <br/>&nbsp; &nbsp; ◦ sudo -u #uid &lt;command&gt; 와 같이 uid값을 사용할 수도 있다.<br/>&nbsp; &nbsp; ◦ 이 유저를 Runas user라고 한다.<br/>* sudo로 su - (root계정의 로그인쉘 얻기)를 수행한 예<br/>[ATTACH]723[/ATTACH]<br/><br/>[B]sudoers[/B]<br/>* sudo를 사용하여 권한을 부여할 구체적인 설정을 하는 파일이 &#039;&#039;sudoers&#039;&#039; 파일이다. 시스템에 따라 약간씩 위치는 다르나, 이 파일을 편집할 권한을 얻으면 시스템의 모든 권한을 얻을 수도 있기 때문에 매우 높은 보안 레벨로 보호되어야 한다. <br/>* sudo su - 또는 sudo visudo등의 커맨드를 허용하는 것은 매우 신중해야 한다. <br/>* 이 파일의 편집은 visudo 명령을 실행하여 편집한다. visudo의 기본 편집기(보통은 vi 또는 nano)가 sudoers파일을 열은채로 실행된다. <br/>* visudo가 사용할 기본 편집기 역시 sudoers파일에 설정할 수 있다. <br/>* 각 Alias 설정은 문자열 단위로 매치시키기 때문에 주의깊게 작성해야 한다. <br/>* sudo /usr/bin/su 는 가능하나, cd /usr/bin; sudo ./su는 불가능할 수 있다.<br/><br/>[B]How to Write sudoers[/B]<br/>* Alias 정의 섹션, Default 정의 섹션, Privilege정의 섹션으로 나누어 볼 수 있다. <br/>* 라인당 하나의 정의 <br/>* Aliases <br/>&nbsp; &nbsp; ◦Alias에는 User_Alias, Runas_Alias, Host_Alias, Cmnd_Alias의 4가지 Alias_Type이 있다. <br/>&nbsp; &nbsp; ◦모든 Alias에 대해 ALL은 항상 매치되는 와일드카드로 미리 정의되어 있다(아래 예제 참조) <br/>&nbsp; &nbsp; ◦각 Alias는 NAME = LIST의 형태로 만든다. <br/>&nbsp; &nbsp; &nbsp; &nbsp; ■NAME은 알파벳 대문자로 시작하여야 하고, 두번째 글자부터는 알파벳 대소문자와 숫자, 언더스코어문자(&#039;_&#039;)를 쓸 수 있다. <br/>&nbsp; &nbsp; &nbsp; &nbsp; ■LIST는 콤마(,)로 구분되고 공백은 무시된다. <br/>&nbsp; &nbsp; &nbsp; &nbsp; ■LIST의 item앞에 &#039;!&#039;(negate operator)를 쓰면 리스트에서 해당 아이템만을 배제시킨다.<br/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 예:ALL, !/bin/su&nbsp; &nbsp; # &#034;/bin/su를 제외한 모두&#034;라는 의미<br/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ALL, !!/bin/su&nbsp; &nbsp; # &#034;모두&#034;의 의미, 짝수번 negate 의미 없다.[/CODE] <br/>&nbsp; &nbsp; &nbsp; &nbsp; ■같은 종류의 Alias는 콜론(:)으로 묶을 수 있다. 다른 라인에 새로운 정의로 포함시킬수도 있다.<br/>&nbsp; &nbsp; ◦Alias는 다음과 같은 형태가 된다. <br/>&nbsp; &nbsp; &nbsp; &nbsp; ■Alias_Type NAME = item1, item2, item3, item4<br/>&nbsp; &nbsp; &nbsp; &nbsp; ■Alias_Type NAME = item1, item2, item3 : Name = item4, item5<br/>&nbsp; &nbsp; ◦User_Alias <br/>&nbsp; &nbsp; &nbsp; &nbsp; ■sudo 권한을 적용할 유저의 집합을 정의한다. <br/>&nbsp; &nbsp; &nbsp; &nbsp; ■(sudoer 그룹명) = (List of login names) <br/>&nbsp; &nbsp; &nbsp; &nbsp; ■유저명 대신 %&lt;group&gt; 을 사용할 수도 있다. <br/>&nbsp; &nbsp; &nbsp; &nbsp; ■예: %admin # admin 그룹에 속하는 모든 유저<br/>&nbsp; &nbsp; ◦Runas_Alias <br/>&nbsp; &nbsp; &nbsp; &nbsp; ■어떤 유저 또는 그룹의 권한으로 명령을 수행할지를 지정할 수 있다. <br/>&nbsp; &nbsp; &nbsp; &nbsp; ■정의 방법은 User_Alias와 동일하나, #&lt;uid&gt; 의 형태도 사용할 수 있다. <br/>&nbsp; &nbsp; &nbsp; &nbsp; ■주의: root와 #0은 동일한 유저이지만, 문자열 매치를 하기 때문에 다른 것으로 간주된다. root, %0도 마찬가지.<br/>&nbsp; &nbsp; ◦Host_Alias <br/>&nbsp; &nbsp; &nbsp; &nbsp; ■hostname, IP address, Network address, 다른 Host_Alias를 묶어 호스트 집합을 만들 수 있다.<br/>&nbsp; &nbsp; ◦Cmnd_Alias <br/>&nbsp; &nbsp; &nbsp; &nbsp; ■권한을 허용할 커맨드를 나열하여 집합으로 만든다. <br/>&nbsp; &nbsp; &nbsp; &nbsp; ■커맨드는 full path로 적는다. 디렉토리명을 커맨드로 지정할 수 있다. 디렉토리를 지정하면 그 디렉토리이하의 모든 커맨드에 대해 허용된다.<br/>* Defaults : 권한 부여의 기본 옵션을 지정한다. <br/>&nbsp; &nbsp; ◦라인당 하나의 Default_Entry를 정의 한다. <br/>&nbsp; &nbsp; ◦Default_Entry는 Default_Type Parameter_List로 정의한다. <br/>&nbsp; &nbsp; ◦Default_Type는 다음의 4가지 정의 방법이 있다. <br/>&nbsp; &nbsp; &nbsp; &nbsp; ■Defaults <br/>&nbsp; &nbsp; &nbsp; &nbsp; ■<a href="mailto:Defaults@Host_Alias"  rel="nofollow">Defaults@Host_Alias</a> <br/>&nbsp; &nbsp; &nbsp; &nbsp; ■Defaults:User_Alias <br/>&nbsp; &nbsp; &nbsp; &nbsp; ■Defaults&gt;runas_username<br/>&nbsp; &nbsp; ◦Parameter_List는 Parameter의 리스트를 적는다. Parameter는 다음과 같은 형태가 있다. <br/>&nbsp; &nbsp; &nbsp; &nbsp; ■flag <br/>&nbsp; &nbsp; &nbsp; &nbsp; ■!flag <br/>&nbsp; &nbsp; &nbsp; &nbsp; ■flag=value <br/>&nbsp; &nbsp; &nbsp; &nbsp; ■flag+=value <br/>&nbsp; &nbsp; &nbsp; &nbsp; ■flag-=value <br/>&nbsp; &nbsp; &nbsp; &nbsp; ■other Parameter_Lists<br/>&nbsp; &nbsp; ◦여기서는 유용한 몇개 flag만 소개한다. 자세한 flags는 SUDOERS(5)를 참조한다 (이말을 쓰기 싫어서 작성한 문서에 쓸수 밖에 없다니;;;) <br/>&nbsp; &nbsp; &nbsp; &nbsp; ■lecture: 앞절의 예제 이미지와 같이 타인의 권한으로 수행할때 기억해야 할 것에 대한 짧은 경고문.<br/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; lecture=(never, once, always 중 하나) <br/>&nbsp; &nbsp; &nbsp; &nbsp; ■lecture_file: lecture를 보여줄 때, 이 파일을 보여준다.<br/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; lecture_file=(full path of lecture_file) <br/>&nbsp; &nbsp; &nbsp; &nbsp; ■timestamp_timeout: sudo를 수행한 후 다시 수행할 때, 패스워드를 다시 물어볼지를 결정하는 타임아웃값. 0이면 항상 물어본다.<br/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; timestamp_timeour=(분 단위 정수) <br/>&nbsp; &nbsp; &nbsp; &nbsp; ■editor: visudo에서 사용할 기본 에디터<br/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; editor=(/usr/bin/vim 등의 에디터 full path) <br/>&nbsp; &nbsp; &nbsp; &nbsp; ■passwd_tries: 비밀번호를 틀렸을 경우 다시 물어보는 횟수.<br/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; passwd_tries=(정수) <br/>&nbsp; &nbsp; &nbsp; &nbsp; ■passwd_timeout: 비밀번호 입력대기시간 타임아웃값. 0이면 무한정 기다린다.<br/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; passwd_timeout=(분 단위 정수) <br/>&nbsp; &nbsp; &nbsp; &nbsp; ■fqdn: Host 이름에 Fully Qualified Domain Name을 사용할 것인지의 여부. 이 플래그를 사용하면, sudo수행시에 hostname을 DNS에 쿼리한다.<br/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fqdn (또는 !fqdn) <br/>&nbsp; &nbsp; &nbsp; &nbsp; ■set_logname: runas user(타겟 유저라고도 함)의 LOGNAME과 USER 환경변수값을 가져오지 않고 현재 값을 유지한다.<br/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; set_logname (또는 !set_logname)<br/><br/>[B]sample[/B]<br/>* 가장 소극적인 보안책으로 사용할수 있는 sudoers 예제<br/>[CODE]# 아무런 Alias를 정의하지 않고,<br/># admin group에 속한 계정 전체에 대해서<br/># 모든 커맨드를 root권한으로 수행할수 있도록 허용함<br/># sudo를 사용하기 위해서 항상 패스워드를 물어본다.<br/><br/># Host alias specification<br/><br/># User alias specification<br/><br/>#Cmnd alias specification<br/><br/># Defaults<br/>Defaults&nbsp;  lecture=always,tty_tickets,!fqdn,timestamp_timeout=0,editor=/usr/bin/vi<br/><br/># User privilege specification<br/>root&nbsp; &nbsp; ALL=(ALL) ALL<br/><br/># Members of the admin group may gain root privileges<br/>%admin ALL=(ALL) ALL<br/>[/CODE] <br/>* 다양한 용법과 문법의 예<br/>[CODE]# User alias specification<br/># 3가지의 유저셋을 정의한다.<br/>User_Alias&nbsp; &nbsp;  FULLTIMERS = millert, mikef, dowdy<br/>User_Alias&nbsp; &nbsp;  PARTTIMERS = bostley, jwfox, crawl<br/>User_Alias&nbsp; &nbsp;  WEBMASTERS = will, wendy, wim<br/><br/># Runas alias specification<br/># 2가지 Runas 유저셋을 정의한다.<br/>Runas_Alias&nbsp; &nbsp; OP = root, operator<br/>Runas_Alias&nbsp; &nbsp; DB = oracle, sybase<br/><br/># Host alias specification<br/># 4가지 호스트셋을 정의한다.<br/><br/># IP/NETMASK 지정방법, 호스트명 지정방법의 예가 모두 나와있다.<br/>Host_Alias&nbsp; &nbsp;  CUNETS = 128.138.0.0/255.255.0.0<br/>Host_Alias&nbsp; &nbsp;  CSNETS = 128.138.243.0, 128.138.204.0/24, 128.138.242.0<br/>Host_Alias&nbsp; &nbsp;  SERVERS = master, mail, www, ns<br/>Host_Alias&nbsp; &nbsp;  CDROM = orion, perseus, hercules<br/><br/># Cmnd alias specification<br/># 커맨드셋을 정의한다.<br/>Cmnd_Alias&nbsp; &nbsp;  DUMPS = /usr/bin/mt, /usr/sbin/dump, /usr/sbin/rdump,\<br/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  /usr/sbin/restore, /usr/sbin/rrestore<br/>Cmnd_Alias&nbsp; &nbsp;  KILL = /usr/bin/kill<br/>Cmnd_Alias&nbsp; &nbsp;  SHUTDOWN = /usr/sbin/shutdown<br/>Cmnd_Alias&nbsp; &nbsp;  HALT = /usr/sbin/halt<br/>Cmnd_Alias&nbsp; &nbsp;  REBOOT = /usr/sbin/reboot<br/>Cmnd_Alias&nbsp; &nbsp;  SHELLS = /usr/bin/sh, /usr/bin/csh, /usr/bin/ksh, \<br/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; /usr/local/bin/tcsh, /usr/bin/rsh, \<br/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; /usr/local/bin/zsh<br/>Cmnd_Alias&nbsp; &nbsp;  SU = /usr/bin/su<br/><br/># Override built-in defaults<br/># 기본 옵션을 지정한다.<br/># lecture를 항상 보여준다. fqdn 사용하지 않는다. 3분내에 다시 sudo하면 패스워드를 물어보지 않는다. visudo의 편집기로 /usr/bin/vi를 사용한다.<br/>Defaults&nbsp;  lecture=always,!fqdn,timestamp_timeout=3,editor=/usr/bin/vi<br/><br/># runas user가 root가 될때는 set_logname 하지 않는다.<br/># 즉, root 의 환경을 가져오지 않는다<br/>Defaults&gt;root&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; !set_logname<br/><br/># FULLTIMER에게는 lecture를 보여주지 않는다.<br/>Defaults:FULLTIMERS&nbsp; &nbsp; !lecture<br/><br/># SERVERS에서는 패스워드 입력을 1분내로 해야 한다. sudo 로그 파일을 별도로 지정한다.<br/><a href="mailto:Defaults@SERVERS"  rel="nofollow">Defaults@SERVERS</a>&nbsp; &nbsp; &nbsp;  passwd_timeout=1, logfile=/var/log/sudo.log<br/><br/># User privileges<br/># root도 sudo를 수행할 수 있다.<br/>root&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  ALL = (ALL) ALL<br/><br/># wheel그룹에 속한 모든 유저는 sudo를 통해 모든 명령을 수행할 수 있다.<br/>%wheel&nbsp; &nbsp; &nbsp; &nbsp;  ALL = (ALL) ALL<br/><br/># FULLTIMERS에게는 패스워드를 물어보지 않는다.<br/>FULLTIMERS&nbsp; &nbsp;  ALL = NOPASSWD: ALL<br/><br/># PARTTIMERS에게는 패스워드를 물어본다.<br/>PARTTIMERS&nbsp; &nbsp;  ALL = ALL<br/><br/># operator에게는 패스워드를 물어보고, 지정된 커맨드셋을 허용한다.<br/>operator&nbsp; &nbsp; &nbsp;  ALL = DUMPS, KILL, SHUTDOWN, HALT, REBOOT, PRINTING,\<br/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  sudoedit /etc/printcap, /usr/oper/bin/<br/><br/># joe는 operator가 될수 있다.<br/>joe&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ALL = /usr/bin/su operator<br/><br/># fred는 DB 유저권한이 필요할때에만 패스워드를 물어보지 않고 모든 권한이 허용된다.<br/>fred&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  ALL = (DB) NOPASSWD: ALL<br/><br/># john은 SERVERS호스트셋에서 옵션없이 su를 수행할 수 있다. su에 옵션을 줄수 없고 root로의 su는 불허한다.<br/>john&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  SERVERS = /usr/bin/su [!-]*, !/usr/bin/su *root*<br/><br/># jen은 SERVERS호스트셋을 제외한 모든 호스트에서 모든 권한을 패스워드를 물어본후 얻을 수 있다.<br/>jen&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ALL, !SERVERS = ALL<br/>[/CODE]<br/><br/><br/>출처 : <A HREF="http://lumitech.tistory.com/entry/sudoAndSudoer" TARGET="_blank"  rel="nofollow">http://lumitech.tistory.com/entry/sudoAndSudoer</A>]]></description>
<dc:creator>MintState</dc:creator>
<dc:date>Tue, 26 Jul 2011 23:03:39 +0900</dc:date>
</item>


<item>
<title>리눅스 (Linux) 파일이나 링크, 디렉토리 갯수 확인 명령</title>
<link>https://go3.co.kr/mintbbs/bbs/board.php?bo_table=linux&amp;amp;wr_id=344</link>
<description><![CDATA[[U]리눅스 (Linux) 파일이나 링크, 디렉토리 갯수 확인 명령[/U]<br/><br/>다음 명령은 디렉토리의 갯수를 확인하는 명령어이다.&nbsp; 파일이나 링크의 갯수를 확인하고 싶으면 첫번째 파이프 뒤인 grep ^d를 grep ^- 또는 grep ^l로 수정해서 사용하면 된다.<br/>이때 ^ 기호는 정규화에서 사용되는 문법으로 문자열의 시작을 나타낸다.&nbsp; 아래에서는 ls -l 명령을 실행했을때 출력되는 문자열에서 d로 시작하는 그러니까 디렉토리를 필터링하게 된다.<br/><br/>[CODE]$ ls -l | grep ^d | wc -l [/CODE]<br/><br/>서브디렉토리까지 포함 디렉토리 갯수 구하기<br/>[CODE]$ ls -Rl |grep ^d |wc -l[/CODE]<br/><br/>파일갯수 구하기<br/>[CODE]$ ls -Rl |grep ^- |wc -l[/CODE]<br/><br/>출처 : <A HREF="http://cshong.tistory.com/219" TARGET="_blank"  rel="nofollow">http://cshong.tistory.com/219</A>]]></description>
<dc:creator>MintState</dc:creator>
<dc:date>Wed, 30 Mar 2011 09:18:17 +0900</dc:date>
</item>


<item>
<title>MySQL 튜닝 - 컨넥션과 메모리</title>
<link>https://go3.co.kr/mintbbs/bbs/board.php?bo_table=linux&amp;amp;wr_id=343</link>
<description><![CDATA[[U]MySQL 튜닝 - 컨넥션과 메모리[/U]<br/><br/>MySQL Database의 경우 Oracle 이나 MS SQL Server에 비해서 대용량의 자료를 처리하는 경우가 적기에 튜닝에 필요성이 적은 것 같습니다. 그러나 웹이라는 환경은 많은 사용자가 동시에 접속을 할 수 있기에 항상 모니터링과 최적화는 기본이라고 생각합니다. <br/><br/>본 강좌에서는 기본적인 모니터링 방법과 Connection과 Memory 부분에 대한 튜닝 방법을 소개하도록 하겠습니다.<br/><br/>[B]가. 모니터링 및 초기화 명령어[/B]<br/><br/>[LIST]<br/>[*]show status - MySQL 데이타베이스의 현재 상황 <br/>[*]show Processlist - MySQL 프로세스 목록 <br/>[*]show variables - 설정 가능한 모든 변수 목록 <br/>[*]flush logs - MySQL의 로그파일 초기화 <br/>[*]flush status - MySQL 상태정보 초기화 <br/>[*]flush thread - 쓰레드 캐시에 저장된 쓰레드 초기화 <br/>[*]flush tables - MySQL에 캐싱된 테이블 초기화 <br/>[*]flush privileges - 권한정보 재 설정<br/>[/LIST:u]<br/><br/>[B]나. Connection 튜닝[/B]<br/><br/>[COLOR=blue]1. status[/COLOR] <br/>[LIST]<br/>[*]Aborted_clients - 클라이언트 프로그램이 비 정상적으로 종료된 수 <br/>[*]Aborted_connects - MySQL 서버에 접속이 실패된 수 <br/>[*]Max_used_connections - 최대로 동시에 접속한 수 <br/>[*]Threads_cached - Thread Cache의 Thread 수 <br/>[*]Threads_connected - 현재 연결된 Thread 수 <br/>[*]Threads_created - 접속을 위해 생성된 Thread 수 <br/>[*]Threads_running - Sleeping 되어 있지 않은 Thread 수<br/>[/LIST:u]<br/><br/>[COLOR=blue]2. system variables[/COLOR]<br/>[LIST]<br/>[*]wait_timeout - 종료전까지 요청이 없이 기다리는 시간 ( TCP/IP 연결, Shell 상의 접속이 아닌 경우 ) <br/>[*]thread_cache_size - thread 재 사용을 위한 Thread Cache 수로써, Cache 에 있는 Thread 수보다 접속이 많으면 새롭게 Thread를 생성한다. <br/>[*]max_connections - 최대 동시 접속 가능 수<br/>[/LIST:u]<br/>그외에 status 또는 system variables 값은 참고의 Mysql 메뉴얼을 참조해 주십시요.<br/><br/>[CODE]mysql&gt; show variables like &#039;%max_connection%&#039;;<br/>+-----------------+-------+<br/>| Variable_name&nbsp;  | Value |<br/>+-----------------+-------+<br/>| max_connections | 100&nbsp;  |<br/>+-----------------+-------+<br/>1 row in set (0.00 sec)<br/><br/>mysql&gt; show status like &#039;%connect%&#039;;<br/>+----------------------+---------+<br/>| Variable_name&nbsp; &nbsp; &nbsp; &nbsp; | Value&nbsp;  |<br/>+----------------------+---------+<br/>| Aborted_connects&nbsp; &nbsp;  | 3782&nbsp; &nbsp; |<br/>| Connections&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | 2961108 |<br/>| Max_used_connections | 90&nbsp; &nbsp; &nbsp; |<br/>| Threads_connected&nbsp; &nbsp; | 1&nbsp; &nbsp; &nbsp;  |<br/>+----------------------+---------+<br/>4 rows in set (0.01 sec)<br/><br/>mysql&gt; show status like &#039;%clients%&#039;;<br/>+-----------------+-------+<br/>| Variable_name&nbsp;  | Value |<br/>+-----------------+-------+<br/>| Aborted_clients | 2160&nbsp; |<br/>+-----------------+-------+<br/>1 row in set (0.00 sec)<br/><br/>mysql&gt; show status like &#039;%thread%&#039;;<br/>+------------------------+-------+<br/>| Variable_name&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | Value |<br/>+------------------------+-------+<br/>| Delayed_insert_threads | 0&nbsp; &nbsp;  |<br/>| Slow_launch_threads&nbsp; &nbsp; | 0&nbsp; &nbsp;  |<br/>| Threads_cached&nbsp; &nbsp; &nbsp; &nbsp;  | 7&nbsp; &nbsp;  |<br/>| Threads_connected&nbsp; &nbsp; &nbsp; | 1&nbsp; &nbsp;  |<br/>| Threads_created&nbsp; &nbsp; &nbsp; &nbsp; | 1364&nbsp; |<br/>| Threads_running&nbsp; &nbsp; &nbsp; &nbsp; | 1&nbsp; &nbsp;  |<br/>+------------------------+-------+<br/>6 rows in set (0.00 sec)[/CODE]&nbsp; <br/><br/>[COLOR=green]Cache Miss Rate(%) =&nbsp; Threads_created / Connections * 100<br/>Connection Miss Rate(%) = Aborted_connects / Connections * 100<br/>Connection Usage(%) = Threads_connected / max_connections * 100[/COLOR]<br/><br/>위의 경우는 Cache Miss Rate(%) = 0.05%, Connection Miss Rate(%) = 0.12%, Connection Usage(%) = 1%<br/><br/>[U]3. 튜닝[/U]<br/>[LIST]<br/>[*]Connection Usage(%)가 100% 라면 max_connections 수를 증가시켜 주십시요. Connection 수가 부족할 경우 Too Many Connection Error 가 발생합니다. <br/>[*]DB 서버의 접속이 많은 경우는 wait_timeout 을 최대한 적게 (10~20 정도를 추천) 설정하여 불필요한 연결을 빨리 정리하는 것이 좋습니다. 그러나 Connection Miss Rate(%) 가 1% 이상이 된다면 wait_timeout 을 좀 더 길게 잡는 것이 좋습니다. <br/>[*]Cache Miss Rate(%) 가 높다면 thread_cache_size를 기본값인 8 보다 높게 설정하는 것이 좋습니다. 일반적으로 threads_connected 가 Peak-time 시 보다 약간 낮은 수치로 설정하는 것이 좋습니다. <br/>[*]MySQL 서버는 외부로 부터 접속 요청을 받을 경우 인증을 위해 IP 주소를 호스트네임으로 바꾸는 과정을 수행하여 접속시에 불필요한 부하가 발생하게 됩니다. skip-name-resolve를 설정하시고 접속시에 IP 기반으로 접속을 하게 되면 hostname lookup 과정을 생략하게 되어 좀 더 빠르게 접속을 하실 수 있습니다.<br/>[/LIST:u]<br/><br/><br/>[B]다. Memory 튜닝[/B]<br/><br/>[U]1. status[/U]<br/>[LIST]<br/>[*]key_block_unused - Key Cache에서 사용되고 있지 않은 Block 수 <br/>[*]key_reads - Key Block 읽기 요청시 Disk을 읽은 수 <br/>[*]key_read_requests - Key Block 읽기 요청수<br/>[/LIST:u]<br/><br/>[U]2. system variables[/U]<br/>[LIST]<br/>[*]key_buffer_size - 인덱스를 메모리에 저장하는 버퍼의 크기 <br/>[*]table_cache - 전체 쓰레드가 사용할 오픈 가능한 테이블 수 <br/>[*]myisam_sort_buffer_size - 테이블 repair,Alter table,load data에 사용되는 버퍼 메모리 크기 <br/>[*]join_buffer_size - 조인을 위한 메모리 버퍼 크기 <br/>[*]record_buffer - 순차적인 검색을 위해 사용되는 메모리 버퍼 크기 <br/>[*]record_rnd_buffer - order by 절을 사용할 경우 디스크 사용을 피하기 위하여 사용하는 메모리 버퍼 크기 <br/>[*]sort_buffer - order by 와 group by에 사용되는 메모리 버퍼 크기 <br/>[*]tmp_table_size - group by 시 디스크를 사용하지 않고 임시 테이블을 만들기 위해 사용되는 메모리 크기 <br/>[*]key_cache_block_size - block 의 크기(bytes, 기본값 1024)<br/>[/LIST:u]<br/><br/>[CODE]mysql&gt; show status like &#039;%key%&#039;;<br/>+------------------------+-----------+<br/>| Variable_name&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | Value&nbsp; &nbsp;  |<br/>+------------------------+-----------+<br/>| Com_preload_keys&nbsp; &nbsp; &nbsp;  | 0&nbsp; &nbsp; &nbsp; &nbsp;  |<br/>| Com_show_keys&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | 2945&nbsp; &nbsp; &nbsp; |<br/>| Handler_read_key&nbsp; &nbsp; &nbsp;  | 365020739 |<br/>| Key_blocks_not_flushed | 0&nbsp; &nbsp; &nbsp; &nbsp;  |<br/>| Key_blocks_unused&nbsp; &nbsp; &nbsp; | 222601&nbsp; &nbsp; |<br/>| Key_blocks_used&nbsp; &nbsp; &nbsp; &nbsp; | 231960&nbsp; &nbsp; |<br/>| Key_read_requests&nbsp; &nbsp; &nbsp; | 847204435 |<br/>| Key_reads&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | 4195954&nbsp;  |<br/>| Key_write_requests&nbsp; &nbsp;  | 25034738&nbsp; |<br/>| Key_writes&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  | 16452136&nbsp; |<br/>+------------------------+-----------+<br/>10 rows in set (0.00 sec)[/CODE]<br/><br/>[COLOR=green]Key Buffer Usage = 1 - ((Key_blocks_unused × key_cache_block_size) / key_buffer_size)<br/>Key_reads/Key_read_requests Rate(%) =&nbsp; Key_reads/Key_read_requests * 100 <br/>Key_reads/Key_read_requests Relative Rate(%) = (1- ^Key_reads/^Key_read_requests) * 100[/COLOR]<br/><br/>* ^Key_Reads = Current Key_Rreads - Previous Key_Reads<br/><br/>[U]3. 튜닝[/U]<br/><br/>[LIST]<br/>[*]key_buffer_size는 총 메모리 크기의 25% 정도의 크기로 설정하는 것이 좋습니다. <br/>[*]Key_reads/Key_read_requests Rate(%)은 일반적으로 1%보다 적습니다. 1% 보다 높다면 Key Cache가 아닌 디스크를 읽은 경우가 많다고 판단할 수 있습니다. 또한 Key_reads/Key_reads_requests Relative Rate(%) 값이 지속적으로 90% 이상일 경우는 key_buffer_size가 효율적으로 설정되어 있다고 생각하시면 됩니다. 하지만 데이터베이스가 엄청나게 크거나 여러 데이터를 골고루 많이 읽는 데이터베이스라면 아무리 많은 양의 키 캐시를 설정해도 90% 이상의 적중률을 얻을 수는 없습니다.<br/>[/LIST:u]<br/><br/><br/>[B]라. 적용[/B]<br/><br/>system variables은 my.cnf 또는 my.ini 파일을 수정 후 MySQL Server 를 재시작 해 주십시요.<br/><br/>[CODE][<a href="mailto:www@smson"  rel="nofollow">www@smson</a> www]$ vi /etc/my.cnf&nbsp; <br/># The MySQL server<br/>[mysqld]<br/>port&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = 3306<br/>socket&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = /tmp/mysql.sock<br/>skip-locking<br/>skip-name-resolve<br/>key_buffer = 256M<br/>max_allowed_packet = 1M<br/>table_cache = 256<br/>sort_buffer_size = 1M<br/>read_buffer_size = 1M<br/>read_rnd_buffer_size = 4M<br/>myisam_sort_buffer_size = 64M<br/>thread_cache = 8<br/>query_cache_size= 16M<br/># Try number of CPU&#039;s*2 for thread_concurrency<br/>thread_concurrency = 8<br/>wait_timeout = 120<br/>~~~<br/>[<a href="mailto:root@smson"  rel="nofollow">root@smson</a> mysql]# /usr/local/mysql/share/mysql/mysql.server restart[/CODE]]]></description>
<dc:creator>MintState</dc:creator>
<dc:date>Mon, 07 Mar 2011 10:48:37 +0900</dc:date>
</item>

</channel>
</rss>
