<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>Bitaholic</title>
    <link>https://bitaholic.tistory.com/</link>
    <description>프로그래밍 블로그</description>
    <language>ko</language>
    <pubDate>Wed, 15 Apr 2026 05:12:29 +0900</pubDate>
    <generator>TISTORY</generator>
    <ttl>100</ttl>
    <managingEditor>Bitaholic</managingEditor>
    <image>
      <title>Bitaholic</title>
      <url>https://tistory1.daumcdn.net/tistory/360236/attach/ffa66d90d2c04a708a61b7a50c2d3351</url>
      <link>https://bitaholic.tistory.com</link>
    </image>
    <item>
      <title>Mac OS X (10.7 lion)에서 Java src.jar 설치</title>
      <link>https://bitaholic.tistory.com/entry/Mac-OS-X-107-lion%EC%97%90%EC%84%9C-Java-srcjar-%EC%84%A4%EC%B9%98</link>
      <description>Mac OS X은 기본적으로 자바가 설치 되어 있다.&amp;nbsp;&lt;br /&gt;
다음 과 같은 경로에 설치가 되어 있다.&lt;br /&gt;
/System/Library/Frameworks/JavaVM.framework/Versions/Current&lt;br /&gt;
하지만 자바 소스 인 src.jar 및 doc.jar는 없는데 이것 은 Java for Mac OS X 10.x Update x Developer Package를 별도로 설치해야 하고 애플 사이트에 계정이 있어야 다운로드를 할 수 있다.&lt;br /&gt;
&lt;br /&gt;여기서 Java Developer Package 를 검색하여 다운 받자.&amp;nbsp;&lt;a href=&quot;http://connect.apple.com/cgi-bin/WebObjects/MemberSite.woa/wa/downloads&quot;&gt;Apple Developer Downloads Website&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;설치를 하면 다음과 같은 경로에서 해당 파일들을 찾을 수 있다.&lt;br /&gt;
/Library/Java/JavaVirtualMachines/1.6.0_29-b11-402.jdk/Contents/Home&lt;br /&gt;
&lt;br /&gt;그리고 해당 IDE에서 소스 연결을 하면 쉽게 소스를 참조할 수 있다.&amp;nbsp;&lt;br /&gt;
&lt;br /&gt;&amp;nbsp;</description>
      <category>Computer/Java</category>
      <category>Java</category>
      <category>lion</category>
      <category>Mac OS X</category>
      <category>src.jar</category>
      <author>Bitaholic</author>
      <guid isPermaLink="true">https://bitaholic.tistory.com/198</guid>
      <comments>https://bitaholic.tistory.com/entry/Mac-OS-X-107-lion%EC%97%90%EC%84%9C-Java-srcjar-%EC%84%A4%EC%B9%98#entry198comment</comments>
      <pubDate>Tue, 7 Feb 2012 09:10:53 +0900</pubDate>
    </item>
    <item>
      <title>.bash_profile VS .bashrc</title>
      <link>https://bitaholic.tistory.com/entry/bashprofile-VS-bashrc</link>
      <description>&lt;span class=&quot;Apple-style-span&quot;&gt;두 파일의 차의가 항상 궁금 했었다.&lt;br /&gt;
좋은 문서를 발견! :&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;border-collapse: collapse; white-space: nowrap; font-family: arial, sans-serif; font-size: 13px; line-height: 19px; &quot;&gt;&lt;a class=&quot;info&quot; href=&quot;http://goo.gl/ZN4vF&quot; title=&quot;goo.gl/ZN4vF&quot; style=&quot;color: black; text-decoration: none; &quot;&gt;goo.gl/ZN4vF&lt;br /&gt;
&lt;br /&gt;
간략히 설명하면 .bash_profile은 login shell 을 위한 것이고, .bash_rc는 interactive non-login shell들을 위해 실행되는&lt;br /&gt;
 파일이다.&lt;br /&gt;
 &lt;/a&gt;&lt;br /&gt;
그럼 login, non-login shell은 무엇인가? &lt;br /&gt;
console에서 바로 로그인을 하던 ssh를 이용해 리모트에서 로그인을 하던 로그인 할 때 단 1회만 .bash_profile은 &lt;br /&gt;
실행이 된다.&amp;nbsp;반면에 로그인한 쉘에서 새로운 배쉬 쉘을 실행한다거나 &amp;nbsp;Gnome 같은 환경에서 터미널 프로그램으로 &lt;br /&gt;
새로운 쉘 창을 열면 열때 마다 .bashrc가 실행이 된다.&amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
단 Mac OS X은 예외 인데 멀로 하던 .bash_profile이 실행이 된다. &lt;br /&gt;
&amp;nbsp;(.bashrc에 써봤자 실행이 안돼 반영이 안된다 -삽질주의)&lt;br /&gt;
&lt;br /&gt;
그럼 문서의 저자가 추천하는 방법은 대부분 .bash_profile에 들어가 있는데 대부분의 내용을 .bashrc에 쓰고&lt;br /&gt;
 .bash_profile에서 해당 파일을 실행하는 방법을 쓰라는 것이다.&lt;br /&gt;
다음과 같이&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;if [ -f ~/.bashrc ]; then&lt;br /&gt;
&amp;nbsp; &amp;nbsp;source ~/.bashrc&amp;nbsp;&lt;br /&gt;
&amp;nbsp;fi&lt;br /&gt;
&lt;br /&gt;
끝!&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&amp;nbsp;&lt;/span&gt;</description>
      <category>Computer/Linux</category>
      <category>bash</category>
      <category>bashrc</category>
      <category>bash_profile</category>
      <category>Linux</category>
      <category>Shell</category>
      <author>Bitaholic</author>
      <guid isPermaLink="true">https://bitaholic.tistory.com/197</guid>
      <comments>https://bitaholic.tistory.com/entry/bashprofile-VS-bashrc#entry197comment</comments>
      <pubDate>Fri, 23 Sep 2011 09:46:27 +0900</pubDate>
    </item>
    <item>
      <title>Spring 3.0 Request Mapping (Suffix Pattern, Path Variable)</title>
      <link>https://bitaholic.tistory.com/entry/Spring-30-Request-Mapping-Suffix-Pattern-Path-Variable</link>
      <description>스프링을 쓰면 Http Request를 적절한 클래스의 적절한 메소드로 연결하는(Mapping) 작업을 비교적 쉽게 할 수 있다. 여러가지 방법이 있지만 Java Annotation (@RequestMapping)을 이용해서 클래스 또는 메소드에다가 쓰면 해당 규칙에 맞는 Http Request가 그 메소드를 호출 할 수 있도록 해준다. 그 규칙은 Request URL, Request Header, Request parameter , Http method 조합으로 정해 주는데 Request URL은 ant 타입으로 쓸 수 있다. ( *, ** 를 쓸 수 있다)&amp;nbsp;&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;ex1)&lt;/div&gt;
&lt;div&gt;아래의 예는 http://host/context/user 로 오는 요청을 &amp;nbsp;handlerUser(..) 메소드에 전달 해준다.&lt;/div&gt;
&lt;div&gt;&lt;div class=&quot;txc-textbox&quot; style=&quot;border-top-style: dashed; border-right-style: dashed; border-bottom-style: dashed; border-left-style: dashed; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-color: rgb(121, 165, 228); border-right-color: rgb(121, 165, 228); border-bottom-color: rgb(121, 165, 228); border-left-color: rgb(121, 165, 228); background-color: rgb(219, 232, 251); padding-top: 10px; padding-right: 10px; padding-bottom: 10px; padding-left: 10px; &quot;&gt;
@RequestMapping(&quot;/user&quot;)&lt;br /&gt;
public void handleUser(...) {...}&lt;/div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;ex2)&lt;/div&gt;
&lt;div&gt;아래의 예는 Header로 content-type이 text/*에 해당되고 /user로 요청만 메소드로 전달해준다.&amp;nbsp;&lt;/div&gt;
&lt;div&gt;&lt;div class=&quot;txc-textbox&quot; style=&quot;border-top-style: dashed; border-right-style: dashed; border-bottom-style: dashed; border-left-style: dashed; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-color: rgb(121, 165, 228); border-right-color: rgb(121, 165, 228); border-bottom-color: rgb(121, 165, 228); border-left-color: rgb(121, 165, 228); background-color: rgb(219, 232, 251); padding-top: 10px; padding-right: 10px; padding-bottom: 10px; padding-left: 10px; &quot;&gt;
@RequestMapping(value = &quot;/user&quot;, headers=&quot;content-type=text/*&quot;)&lt;/div&gt;
&lt;/div&gt;&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;&lt;b&gt;Path Variable&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;Spring 3.0에서는 RESTful webservice를 지원하기 위해 path variable기능이 추가 되었다. 간단하게 설명하면 &quot; /부서/이름&quot; 이런 포맷의 REST요청을 URL을 파싱하지 않고 바로 메소드 인자로 받을 수 있는 기능이다.&amp;nbsp;&lt;/div&gt;
&lt;div&gt;아래와 같이 선언을 하면 각 URL의 부분들이 해당 인자로 매핑이 된다. &amp;nbsp;&lt;/div&gt;
&lt;div&gt;&lt;div class=&quot;txc-textbox&quot; style=&quot;border-top-style: dashed; border-right-style: dashed; border-bottom-style: dashed; border-left-style: dashed; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-color: rgb(121, 165, 228); border-right-color: rgb(121, 165, 228); border-bottom-color: rgb(121, 165, 228); border-left-color: rgb(121, 165, 228); background-color: rgb(219, 232, 251); padding-top: 10px; padding-right: 10px; padding-bottom: 10px; padding-left: 10px; &quot;&gt;
@RequestMapping(value=&quot;/{department}/{employee}&quot;)&lt;br /&gt;
public void handleMethod(@PathVariable String&amp;nbsp;department, @PathVariable String&amp;nbsp;employee) {...)&amp;nbsp;&lt;/div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;&lt;b&gt;Suffix Pattern&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;이때 DefaultAnnotationHandlerMapping 은 @RequestMapping에 자동으로 몇몇 접미어를 붙여서 ReqestMapping 리스트에 추가 한다. 즉 위와 같은 예에서는&lt;/div&gt;
&lt;div&gt;&lt;ul style=&quot;list-style-type: disc; &quot;&gt;
&lt;li&gt;/{department}/{employee}&lt;/li&gt;
&lt;li&gt;/{department}/{employee}.*&lt;/li&gt;
&lt;li&gt;/{department}/{employee}/&lt;/li&gt;
&lt;/ul&gt;&lt;div&gt;
위와 같은 RequestMapping을 자동으로 추가해 준다. 즉 /sales/thomas, /sales/thomas/, /sales/thosmas.add 와같은 URL로 자동으로 매핑이 된다. 이러한 패턴을 쓰기 싫으면&amp;nbsp;DefaultAnnotationHandlerMapping 에서 해당 옵션을 꺼주어야 한다. 스프링 설정 파일에서 다음과 같이 설정을 꺼줄 수 있다.&lt;/div&gt;
&lt;div&gt;&lt;div class=&quot;txc-textbox&quot; style=&quot;border-top-style: dashed; border-right-style: dashed; border-bottom-style: dashed; border-left-style: dashed; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-color: rgb(121, 165, 228); border-right-color: rgb(121, 165, 228); border-bottom-color: rgb(121, 165, 228); border-left-color: rgb(121, 165, 228); background-color: rgb(219, 232, 251); padding-top: 10px; padding-right: 10px; padding-bottom: 10px; padding-left: 10px; &quot;&gt;
&amp;lt;bean class=&quot;org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping&quot;&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;lt;property name=&quot;useDefaultSuffixPattern&quot; value=&quot;false&quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/bean&amp;gt;&lt;/div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;&lt;/div&gt;</description>
      <category>Computer/Spring</category>
      <category>annotation</category>
      <category>requestmapping</category>
      <category>spring3.0</category>
      <category>suffix</category>
      <author>Bitaholic</author>
      <guid isPermaLink="true">https://bitaholic.tistory.com/194</guid>
      <comments>https://bitaholic.tistory.com/entry/Spring-30-Request-Mapping-Suffix-Pattern-Path-Variable#entry194comment</comments>
      <pubDate>Wed, 20 Oct 2010 16:41:09 +0900</pubDate>
    </item>
    <item>
      <title>Eclipse로 여러 O/S 프로젝트를 협업할 때...</title>
      <link>https://bitaholic.tistory.com/entry/Eclipse%EB%A1%9C-%EC%97%AC%EB%9F%AC-OS-%ED%94%84%EB%A1%9C%EC%A0%9D%ED%8A%B8%EB%A5%BC-%ED%98%91%EC%97%85%ED%95%A0-%EB%95%8C</link>
      <description>&lt;br /&gt;
Eclipse 로 여러 다른 O/S ( ex. Mac OS X, Windows 7 ) 에서 협업을 할 때 영문자는 상관이 없지만 자바 파일에 한글로 주석을 달고 SVN 같은 버전관리 저장소에 프로젝트를 공유 할 때 맥에서 한글로 주석을 단 자바 파일을 윈도우에서 열어보면 또한 반대로 했을 때 한글이 깨지는 문제가 생긴다. 이때 파일이나 프로젝트의 프로퍼티에서 인코딩을 바꿔도 되지만 전체 이클립스 설정을 바꾸면 프로젝트를 만들 때 만다 인코딩을 바꾸는 일을 안해도 된다. 이 설정은 아래와 에 있다&lt;br /&gt;
&lt;br /&gt;
1. MacOS X (SnowLeopard), Eclipse 3.5.2&lt;br /&gt;
&amp;nbsp;&amp;nbsp; Eclipse -&amp;gt; Preferences...&amp;nbsp;&lt;div&gt;
&amp;nbsp;&amp;nbsp; General -&amp;gt; Workspace -&amp;gt; Text file encoding 에서 Default에서 Other에서 UTF-8 로 선택하면 된다.&amp;nbsp;&lt;br /&gt;
&lt;div class=&quot;imageblock center&quot; style=&quot;text-align: center; clear: both;&quot;&gt;&lt;img src=&quot;https://t1.daumcdn.net/cfile/tistory/14031D104CB7A4595F&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Ft1.daumcdn.net%2Fcfile%2Ftistory%2F14031D104CB7A4595F&quot; width=&quot;683&quot; height=&quot;641&quot; alt=&quot;&quot; filename=&quot;Screen shot 2010-10-15 at 오전 9.42.19.png&quot; filemime=&quot;image/jpeg&quot;/&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
위에서 보는 거와 같이 Mac OS X은 디폴트 텍스트 인코딩이&amp;nbsp;MacRoman으로 되어 있다 이것을 UTF-8로 바꾸고 OK나 Apply버튼을 누르면 된다. 윈도우7도 마찬가지로 Default가 &quot;Cp1252&quot;으로 되어 있고 UTF-8로 바꾸어 주면된다.]&lt;/div&gt;</description>
      <category>Computer</category>
      <category>Eclipse</category>
      <category>Encoding</category>
      <category>협엄</category>
      <author>Bitaholic</author>
      <guid isPermaLink="true">https://bitaholic.tistory.com/193</guid>
      <comments>https://bitaholic.tistory.com/entry/Eclipse%EB%A1%9C-%EC%97%AC%EB%9F%AC-OS-%ED%94%84%EB%A1%9C%EC%A0%9D%ED%8A%B8%EB%A5%BC-%ED%98%91%EC%97%85%ED%95%A0-%EB%95%8C#entry193comment</comments>
      <pubDate>Fri, 15 Oct 2010 09:31:18 +0900</pubDate>
    </item>
    <item>
      <title>Mysql + Spring에서 Transaction 사용하기</title>
      <link>https://bitaholic.tistory.com/entry/Mysql-Spring%EC%97%90%EC%84%9C-Transaction-%EC%82%AC%EC%9A%A9%ED%95%98%EA%B8%B0</link>
      <description>토비 스프링 책 스터디를 하다 트랜잭션 부분을 하는 데 도대체가 Auto Commit을 끄고 롤백을 시도해도 롤백이 되지 않았다 디비를 살펴보니 Commit 또는 Rollback 하기 전에 디비에 적용한 것들이 바로 디비에 적용이 되는 것이였다. 즉 Transaction 처리가 안된다는 건데 구글링 해보니 문제는 테이블의 Engine type이였다. 내가 만든 테이블은 MyISAM이였는데 트랜잭션은 InnoDB로 해야 한단다 (참고 :&amp;nbsp;http://dev.mysql.com/doc/refman/5.0/en/connector-j-usagenotes-j2ee.html 의&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(0, 0, 0); font-family: helvetica, arial, sans-serif; font-size: 13px; line-height: 23px; &quot;&gt;20.3.5.2.4.2.&amp;nbsp;Transactional JDBC Access)&amp;nbsp;&lt;/span&gt;&lt;div&gt;
&lt;font class=&quot;Apple-style-span&quot; color=&quot;#000000&quot; face=&quot;helvetica, arial, sans-serif&quot; size=&quot;3&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 13px; line-height: 23px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;
&lt;div&gt;&lt;font class=&quot;Apple-style-span&quot; color=&quot;#000000&quot; face=&quot;helvetica, arial, sans-serif&quot; size=&quot;3&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 13px; line-height: 23px;&quot;&gt;테이블의 Engine 타입을 변경하는 것은 아래와 같이 하면 된다.&amp;nbsp;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;
&lt;div&gt;&lt;font class=&quot;Apple-style-span&quot; color=&quot;#000000&quot; face=&quot;helvetica, arial, sans-serif&quot; size=&quot;3&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 13px; line-height: 23px;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/font&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(102, 102, 102); font-family: Tahoma, Verdana, Arial, sans-serif; line-height: normal; &quot;&gt;&lt;em&gt;ALTER TABLE my_table ENGINE = InnoDB;&lt;/em&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(102, 102, 102); font-family: Tahoma, Verdana, Arial, sans-serif; line-height: normal; &quot;&gt;&lt;em&gt;&lt;br /&gt;
&lt;/em&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(102, 102, 102); font-family: Tahoma, Verdana, Arial, sans-serif; line-height: normal; &quot;&gt;&lt;em&gt;&lt;br /&gt;
&lt;/em&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;/div&gt;&lt;/div&gt;</description>
      <category>Computer/Spring</category>
      <category>InnoDB</category>
      <category>MySQL</category>
      <category>Spring</category>
      <category>Transaction</category>
      <author>Bitaholic</author>
      <guid isPermaLink="true">https://bitaholic.tistory.com/191</guid>
      <comments>https://bitaholic.tistory.com/entry/Mysql-Spring%EC%97%90%EC%84%9C-Transaction-%EC%82%AC%EC%9A%A9%ED%95%98%EA%B8%B0#entry191comment</comments>
      <pubDate>Thu, 16 Sep 2010 10:24:13 +0900</pubDate>
    </item>
    <item>
      <title>Apache + Mongrel 설정</title>
      <link>https://bitaholic.tistory.com/entry/Apache-Mongrel-%EC%84%A4%EC%A0%95</link>
      <description>&lt;div class=&quot;imageblock center&quot; style=&quot;text-align: center; clear: both;&quot;&gt;&lt;img src=&quot;https://t1.daumcdn.net/cfile/tistory/1104630B4B0F28B8A4&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Ft1.daumcdn.net%2Fcfile%2Ftistory%2F1104630B4B0F28B8A4&quot; width=&quot;683&quot; height=&quot;61&quot; alt=&quot;&quot; filename=&quot;httpd_logo_wide.gif&quot; filemime=&quot;image/jpeg&quot;/&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;imageblock center&quot; style=&quot;text-align: center; clear: both;&quot;&gt;&lt;img src=&quot;https://t1.daumcdn.net/cfile/tistory/1411BA164B0F29347F&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Ft1.daumcdn.net%2Fcfile%2Ftistory%2F1411BA164B0F29347F&quot; width=&quot;122&quot; height=&quot;125&quot; alt=&quot;&quot; filename=&quot;images.jpg&quot; filemime=&quot;image/jpeg&quot;/&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;imageblock center&quot; style=&quot;text-align: center; clear: both;&quot;&gt;&lt;img src=&quot;https://t1.daumcdn.net/cfile/tistory/19618D104B0F282657&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Ft1.daumcdn.net%2Fcfile%2Ftistory%2F19618D104B0F282657&quot; width=&quot;350&quot; height=&quot;154&quot; alt=&quot;&quot; filename=&quot;mongrel_logo.png&quot; filemime=&quot;image/jpeg&quot;/&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
Mongrel 은 루비웹서버이다. Rails에서 WebBrick과 함께 쉽게 쓸 수 있는 웹서버인데, 하지만 몽그렐은 하나의 프로세스에 하나의 쓰레드로만 돌아가기 때문에 상용서비스를 하려면 아파치 웹서버를 프락시 서버 및 로드 밸런서로 쓰고 뒤에 다수의 몽그렐 서버를 클러스터로 구성 해야 한다. (이때 서버들 간의 세션 공유는 아마 가정하지 않고, 공유 되는 정보는 모두 DB에서 이루어지는 것을 가정해야 한다. 이부분은 아직 자세히 보진 않았다)&amp;nbsp; &lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: 12pt; font-weight: bold;&quot;&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;1. 아파치 웹서버를 프락시 서버로 구성하기&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; a) mod_proxy, mod_rewrite 아파치 모듈이 필요하다 (없으면 다운받아서 아파치 서버 모듈폴더에 넣어두자)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; - 폴더는 CentOS5.x기준으로 '/etc/httpd/modules' 이다&lt;br /&gt;
&amp;nbsp; b) 위의 모듈을 로딩하고 설정을 해준다 (/etc/httpd/conf/httpd.conf)&lt;br /&gt;
&lt;div style=&quot;border: 1px solid rgb(121, 165, 228); padding: 10px; background-color: rgb(219, 232, 251);&quot; class=&quot;txc-textbox&quot;&gt;
LoadModule rewrite_module modules/mod_rewrite.so&lt;br /&gt;
LoadModule proxy_module modules/mod_proxy.so&lt;br /&gt;
LoadModule proxy_balancer_module modules/mod_proxy_balancer.so&lt;br /&gt;
&lt;br /&gt;
&amp;lt;IfModule mod_proxy.c&amp;gt;&lt;br /&gt;
ProxyRequests On&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Proxy *&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Order deny,allow&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; #Deny from all&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Allow from all&lt;br /&gt;
&amp;lt;/Proxy&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
RewriteEngine On&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Proxy balancer://mongrel_cluster&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; BalancerMember http://127.0.0.1:8000 retry=10&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; BalancerMember http://127.0.0.1:8001 retry=10&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; BalancerMember http://127.0.0.1:8002 retry=10&lt;br /&gt;
&amp;lt;/Proxy&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# PERFORMANCE: If no static file exists, let Mongrel handle the request&lt;br /&gt;
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f&lt;br /&gt;
RewriteRule ^/(.*)$ balancer://mongrel_cluster%{REQUEST_URI} [P,QSA,L]&lt;br /&gt;
&lt;/div&gt;
&amp;nbsp; 
&lt;br /&gt;
&lt;span style=&quot;font-size: 12pt; text-decoration: underline; font-weight: bold;&quot;&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;2. &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; text-decoration: underline; font-weight: bold;&quot;&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;Mongrel cluster 설치 &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;border: 1px solid rgb(121, 165, 228); padding: 10px; background-color: rgb(219, 232, 251);&quot; class=&quot;txc-textbox&quot;&gt;
gem install mongrel&lt;br /&gt;
gem install mongrel_cluster&lt;br /&gt;
&lt;/div&gt;
&amp;nbsp;tip) gem 으로 몽그렐 설치시 'make : xxx[fastthred.c] Error 127' 이라는 에러가 나면 gcc가 서버에 설치가 안되있어서 그러니 관련 라이브러리르 설치 하자.&lt;br /&gt;
&amp;nbsp; - centOS에서는 &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; - yum install gcc-c++ kernel-devel&lt;br /&gt;
&amp;nbsp; - Devian계열은&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; - apt-get install build-essentail&lt;br /&gt;
으로 설치 하면 된다. centOS에는 테스트 해서 성공했는에 우분투등 데비안 계열을 해보진 않았다. 아마 되겠지&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: 12pt; font-weight: bold; text-decoration: underline;&quot;&gt;3. &lt;/span&gt;&lt;span style=&quot;font-size: 11pt; font-weight: bold; text-decoration: underline;&quot;&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;Mongrel을 서비스(데몬)으로 등록하고 부팅시 자동 스타트 되게 만들기&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; 몽그렐은 기본적으로 레일스 어플리케이션 폴더에서 실행을 해야 한다. (로그폴더(log), 설정폴더(config), 임시폴더(tmp) 등이 필요하다), 물론 저 폴더들을 따로 옵션으로 지정을 할 수 도 있다.&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&lt;span style=&quot;font-weight: bold;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; i) Mongrel 서버를 띄우 리눅스 계정을 하나 만들어 준다.&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $ adduser -r mongrel&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-weight: bold;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ii) 레일스 어플리케이션 홈폴더에서 &lt;/span&gt;&lt;br /&gt;
&lt;pre class=&quot;code&quot;&gt;    $ mongrel_rails cluster::configure -e production -p 8000 -N 3&lt;br /&gt;
&lt;br /&gt;
    위의 명령으로 기본 설정파일등을 만들어 준다.(위의 설정은, 포트 8000, 8001, 8002로서 서버 3개를 클러스터로 시작한다는 말이다. &lt;br /&gt;
  &lt;br /&gt;
&lt;span style=&quot;font-weight: bold;&quot;&gt;  iii) 그러면 아래와 같은 명령으로 몽그렐클러스터 를 시작하고 종료시킬수 있다.&lt;/span&gt;&lt;br /&gt;
    $ mongrel_rails cluster::start&lt;br /&gt;
    $ mongrel_rails cluster::stop&lt;br /&gt;
  &lt;br /&gt;
 &lt;span style=&quot;font-weight: bold;&quot;&gt; iv) /etc/mongrel_cluster 라는 폴더를 만들어 준다.&lt;/span&gt;&lt;br /&gt;
  &lt;br /&gt;
 &lt;span style=&quot;font-weight: bold;&quot;&gt; v) /etc/mongrel_cluster/yourrailsapp.yum 이라는 링크를 만들어 준다.&lt;/span&gt;&lt;br /&gt;
    $ ln /MyRailsAppHome/config/mongrel_cluster.yml /etc/mongrel_cluster/myrailsapp.yml&lt;br /&gt;
  &lt;br /&gt;
  &lt;span style=&quot;font-weight: bold;&quot;&gt;vi) 자동스타트를 위해 init.d 파일을 /etc/init.d/ 폴더 밑으로 복사한다. (스크립트는 몽그렐을 설치하면&lt;/span&gt;&lt;br /&gt;
     생성되 있다.&lt;br /&gt;
    $ cp /usr/lib/ruby/gems/1.8/gems/mongrel_cluster-1.0.5/resources/mongrel_cluster /etc/init.d&lt;br /&gt;
&lt;br /&gt;
 &lt;span style=&quot;font-weight: bold;&quot;&gt; vii) mongrel_cluster 스크립트의 실행 권한을 주고 자동 실행이되게 관련 값을 변경해 준다.&lt;/span&gt;&lt;br /&gt;
    $ chmod +x /etc/init.d/mongrel_cluster&lt;br /&gt;
    $ service mongrel_cluster start&lt;br /&gt;
    $ chkconfig mongrel_cluster on&lt;br /&gt;
&lt;/pre&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;font-weight: bold;&quot;&gt; viii) /etc/mongrel_cluster/에 복사한 몽그렐 설정 내용은 대충 이럴것 이다.&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;border: 1px solid rgb(121, 165, 228); padding: 10px; background-color: rgb(219, 232, 251);&quot; class=&quot;txc-textbox&quot;&gt;
user: mongrel&lt;br /&gt;
cwd: /myRailsAppHome&lt;br /&gt;
log_file: /myRailsAppHome/log/mongrel.log&lt;br /&gt;
port: &quot;8000&quot;&lt;br /&gt;
environment: production&lt;br /&gt;
group: mongrel&lt;br /&gt;
address: 127.0.0.1&lt;br /&gt;
pid_file: /myRailsAppHome/tmp/pids/mongrel.pid&lt;br /&gt;
servers: 3&lt;br /&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;font-weight: bold;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; iX) 위의 폴더중, log, pid폴더에 접근권한을 mongrel 유저에게 주어야 한다.&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $ chown -R mongrel.mongrel /myRailsAppHome/log&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $ chown -R mongrel.mongrel /myRailsAppHome/tmp/pids &lt;br /&gt;
&lt;br /&gt;
위와같의 하면 서버 실행시 아파치와 몽그렐 클러스터가 실행될 것이다.&lt;br /&gt;
&lt;br /&gt;
Ref) http://www.mygeekproject.com/?p=155&lt;br /&gt;
Ref) http://mongrel.rubyforge.org/&lt;br /&gt;
Ref) http://wiki.rubyonrails.org/deployment/apache-mongrel&lt;br /&gt;</description>
      <category>Computer/Ruby&amp;amp;Rails</category>
      <category>Apache</category>
      <category>gem</category>
      <category>Mongrel</category>
      <category>mongrel cluster</category>
      <category>Proxy</category>
      <category>Rails</category>
      <category>ruby</category>
      <author>Bitaholic</author>
      <guid isPermaLink="true">https://bitaholic.tistory.com/189</guid>
      <comments>https://bitaholic.tistory.com/entry/Apache-Mongrel-%EC%84%A4%EC%A0%95#entry189comment</comments>
      <pubDate>Fri, 27 Nov 2009 11:14:27 +0900</pubDate>
    </item>
    <item>
      <title>Where is the configuration files of Apache Web Server on Linux?</title>
      <link>https://bitaholic.tistory.com/entry/Where-is-the-configuration-files-of-Apache-Web-Server-on-Linux</link>
      <description>&lt;div style=&quot;text-align: left;&quot;&gt;
설정 파일들은 '/etc/httpd/conf'에 있다.&lt;br /&gt;
httpd 실행 파일은 '/usr/sbin/httpd' (cent OS 5 기준)&lt;br /&gt;
&lt;br /&gt;아파치 실행/중단은 &lt;br /&gt;
&amp;nbsp; &lt;span style=&quot;font-weight: bold;&quot;&gt;service httpd start/stop/restart&lt;/span&gt;&lt;br /&gt;
로 하면 된다.&lt;br /&gt;
&lt;/div&gt;</description>
      <category>Computer/Linux</category>
      <category>Apache</category>
      <category>configuration</category>
      <category>PATH</category>
      <category>web server</category>
      <author>Bitaholic</author>
      <guid isPermaLink="true">https://bitaholic.tistory.com/188</guid>
      <comments>https://bitaholic.tistory.com/entry/Where-is-the-configuration-files-of-Apache-Web-Server-on-Linux#entry188comment</comments>
      <pubDate>Wed, 25 Nov 2009 11:00:22 +0900</pubDate>
    </item>
    <item>
      <title>Today's Linux Commands</title>
      <link>https://bitaholic.tistory.com/entry/%EC%98%A4%EB%8A%98%EC%9D%98-%EB%A6%AC%EB%88%85%EC%8A%A4-%EB%AA%85%EB%A0%B9%EC%96%B4</link>
      <description>&lt;span style=&quot;font-weight: bold;&quot;&gt;which &lt;/span&gt;&lt;br /&gt;
&amp;nbsp;- 하는일 : 명령어(프로그램)이 어디에 있는지 경로를 알려주는 놈 (show the full path of (shell) commands)&lt;br /&gt;
&amp;nbsp;- ex) which httpd (아파치 웹서버가 어디에 들어 있는지 알려준다)&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-weight: bold;&quot;&gt;nmap&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;- 하는 일 : port 스캔을 해서 무슨 포트가 열려있는지 검색해준다.(Network exploration tool and security /port scanner &amp;lt;- 보아하니 아주 많은 일을 하는 넘인거 같다&lt;br /&gt;
&amp;nbsp;- ex) nmap localhost (현재 로컬호스트에 어떤 포트가 열려 서비스를 하는지 알려준다)&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-weight: bold;&quot;&gt;ntsysv&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;- 하는 일 : GUI로 전체 서비스를 보여주고, 현재 구동되고 있는 리눅스 서비스를 보여준다. 물로 서비스를 실행할 수도 멈출 수도 있다.&lt;br /&gt;
&amp;nbsp;- ex) ntsysv&lt;br /&gt;
&lt;br /&gt;</description>
      <category>Computer/Linux</category>
      <category>command</category>
      <category>Linux</category>
      <category>nmap</category>
      <category>ntsysv</category>
      <category>Port Scan</category>
      <category>service</category>
      <category>which</category>
      <category>리눅스</category>
      <category>명령어</category>
      <author>Bitaholic</author>
      <guid isPermaLink="true">https://bitaholic.tistory.com/187</guid>
      <comments>https://bitaholic.tistory.com/entry/%EC%98%A4%EB%8A%98%EC%9D%98-%EB%A6%AC%EB%88%85%EC%8A%A4-%EB%AA%85%EB%A0%B9%EC%96%B4#entry187comment</comments>
      <pubDate>Wed, 25 Nov 2009 10:55:40 +0900</pubDate>
    </item>
    <item>
      <title>Ubuntu의 root password</title>
      <link>https://bitaholic.tistory.com/entry/Ubuntu%EC%9D%98-root-password</link>
      <description>&lt;div class=&quot;imageblock center&quot; style=&quot;text-align: center; clear: both;&quot;&gt;&lt;img src=&quot;https://t1.daumcdn.net/cfile/tistory/186C982B4AD804A412&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Ft1.daumcdn.net%2Fcfile%2Ftistory%2F186C982B4AD804A412&quot; width=&quot;500&quot; height=&quot;375&quot; alt=&quot;&quot; filename=&quot;336819697_0888cc5908.jpg&quot; filemime=&quot;image/jpeg&quot;/&gt;&lt;/div&gt;
&lt;br /&gt;
Ubuntu(Desktop)에서 root 패스워드는 기본으로 설정이 안되어 있다. 따라서 쉘에서 su 로 루트계정으로 들어 갈수가 없는데 아래와 같이 root&amp;nbsp; 계정의 패스워드를 정해주면 된다&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;border: 1px solid rgb(203, 203, 203); padding: 10px; background-color: rgb(255, 255, 255);&quot; class=&quot;txc-textbox&quot;&gt;
bitaholic@bitaholic:~$ sudo passwd root&lt;br /&gt;
[sudo] password for bitaholic: &lt;br /&gt;
Enter new UNIX password: &lt;br /&gt;
Retype new UNIX password: &lt;br /&gt;
passwd: password updated successfully&lt;br /&gt;
&lt;/div&gt;
&lt;br /&gt;
그럼 root 계정으로 들어갈 수 있따.&lt;br /&gt;</description>
      <category>Computer/Linux</category>
      <category>Root</category>
      <category>ubuntu</category>
      <author>Bitaholic</author>
      <guid isPermaLink="true">https://bitaholic.tistory.com/186</guid>
      <comments>https://bitaholic.tistory.com/entry/Ubuntu%EC%9D%98-root-password#entry186comment</comments>
      <pubDate>Fri, 16 Oct 2009 14:29:20 +0900</pubDate>
    </item>
    <item>
      <title>Hibernate의 HQL에서 limit 적용</title>
      <link>https://bitaholic.tistory.com/entry/Hibernate%EC%9D%98-HQL%EC%97%90%EC%84%9C-limit-%EC%A0%81%EC%9A%A9</link>
      <description>&lt;span style=&quot;color: rgb(92, 127, 176); font-weight: bold;&quot;&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;HQL 의 limit&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;Hibernate의 HQL 문법은 sql의 limit 가 지원하지 않는다. &lt;br /&gt;
limit를 써 쿼리 결과 갯수를 제한 하고 싶으면, Query 클래스의 setMaxResults(int max) 메소드를 이용하면 된다.&lt;br /&gt;
&lt;br /&gt;&amp;nbsp;결과를 5개 이하로 제한하고 싶으면 아래와 같이 하면된다.&lt;br /&gt;
&lt;div style=&quot;border: 1px dashed rgb(121, 165, 228); padding: 10px; background-color: rgb(219, 232, 251);&quot; class=&quot;txc-textbox&quot;&gt;Query query = session.createQuery(&quot;from BookTable order by book_id asc&quot;);&lt;br /&gt;
query.setMaxResults(5);&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
&amp;nbsp;또한 특정 행부터 시작하고 싶으면 (14행 부터 5개)&lt;br /&gt;
&lt;div style=&quot;border: 1px dashed rgb(121, 165, 228); padding: 10px; background-color: rgb(219, 232, 251);&quot; class=&quot;txc-textbox&quot;&gt;Query query = session.createQuery(&quot;from BookTable order by book_id asc&quot;);&lt;br /&gt;
query.setFirstResult(14);&lt;br /&gt;
query.setMaxResults(5);&lt;/div&gt;
&lt;br /&gt;&lt;br /&gt;
&lt;span style=&quot;font-weight: bold; color: rgb(92, 127, 176);&quot;&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;Spring &amp;amp; Hibernate&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;&lt;/span&gt;Spring과 Hibernate를 연동했을 때 는 HibernateDaoSupport를 상속하여 객체를 만들어서 주로 쓰는데 &lt;br /&gt;
이때 Query를 만들지 않고 getHibernateTemplate().fine(String query) 메소드를 쓸 수 있다. &lt;br /&gt;
이때 getHibernateTemplate().setMaxResults(int) 라는 Query의 메소드와 동일한 메소드가 있다. 하지만 이 객체는 공유가 되서 다음 쿼리 때도 그 값이 쓰인다. 따라서 쓰기전에 '0'으로 초기화 하고 쓰는게 좋다.&lt;br /&gt;
&lt;br /&gt;&lt;div style=&quot;border: 1px dashed rgb(159, 211, 49); padding: 10px; background-color: rgb(231, 253, 181);&quot; class=&quot;txc-textbox&quot;&gt;
if(limit &amp;gt; 0) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; getHibernateTemplate().setMaxResults(limit-1);&lt;br /&gt;
&amp;nbsp;} else {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; getHibernateTemplate().setMaxResults(0);&lt;br /&gt;
&amp;nbsp;}&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
또한 MaxResult에서 정해준 값보다 1개가 더 나와서 위의 코드는 1을 빼주었다. Qeury클래스에도 그런진 확인을 못했다.&lt;br /&gt;
&lt;br /&gt;</description>
      <category>Computer/HIbernate</category>
      <category>hibernate</category>
      <category>HQL</category>
      <category>LIMIT</category>
      <category>Spring</category>
      <author>Bitaholic</author>
      <guid isPermaLink="true">https://bitaholic.tistory.com/185</guid>
      <comments>https://bitaholic.tistory.com/entry/Hibernate%EC%9D%98-HQL%EC%97%90%EC%84%9C-limit-%EC%A0%81%EC%9A%A9#entry185comment</comments>
      <pubDate>Fri, 16 Oct 2009 10:45:24 +0900</pubDate>
    </item>
  </channel>
</rss>