Posted
Filed under Linux
스프링의 web.xml에 utf-8 filter 를 추가 해주고도  한글이 께진다면 
tomcat 서버의 다음과 같이 설정을 해주면 한글 깨짐을 방지 할 수 있다.

/usr/local/tomcat/conf/server.xml

 <Connector port="8080" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" URIEncoding="UTF-8"  />

2015/11/10 10:03 2015/11/10 10:03
Posted
Filed under Linux
jobs 명령어, 리눅스

shell> ctrl + z 

- 현재 보던 창이 닫힌다.

 

shell> jobs 

- 작업중인 목록이 보인다.


shell> fg

- 가장 최근에 편집한 파일이 열린다.

 

shell> fg [n]

- jobs 명령을 내렸을 때 보였던 작업번호를 치면, 해당 작업이 수행된다.

 

shell> kill %n

- n번 작업 삭제

2015/05/09 17:25 2015/05/09 17:25
Posted
Filed under Linux
00 09 * * * root rdate -s time.bora.net && /sbin/clock -w
2015/04/15 10:25 2015/04/15 10:25
Posted
Filed under Linux

[원문]http://openwiki.kr/tech/sulinux#rewrite_module_활성화

Rewrite module 활성화

* 일단 모듈이 올라가있는지 확인..(phpinfo) * /usr/local/apache/conf/httpd.conf 수정

# rewriteEngine On
<IfModule mod_rewrite.c>
rewriteEngine On
</IfModule>

* 다음을 찾아서 AllowOverride All로 수정

<Directory />
    Options FollowSymLinks
    AllowOverride All
    Order deny,allow
    #Deny from all
</Directory>
2015/04/14 09:12 2015/04/14 09:12
Posted
Filed under Linux
SSL 인증서 발급 절차
 
1. 서버에서 인증서 CSR 발급
 1) openssl genrsa -des3 -out www.abc.co.kr.key 2048
 2) openssl rsa -noout -text -in www.abc.co.kr.key
 3) openssl req -new -days 365 -key www.abc.co.kr.key -out www.abc.co.kr.csr
 * CN 값은 도메인명 입력
 4) openssl req -noout -text -in www.abc.co.kr.csr
 
2. PC로 CSR 다운로드
 
3. 신청 사이트에서 SSL 발급 신청
 
4. 인증서 발급 받은 후 key 파일과 함게 제공
2015/02/25 15:50 2015/02/25 15:50
Posted
Filed under Linux
[원문]:http://ns.actrun.com/bbs/board.php?bo_table=adm_server&wr_id=563

첫페이지 로딩속도는 그 사이트의 운명을 좌우할 만큼 중요합니다.

왜냐면 대부분의 웹사용자는 3초를 기다리지 못하고 사이트를 떠나는게 현실이며

0.1초라도 더 빨리 첫페이지를 보여주는 것이 운영자의 사업이익과도 직결된다고 할 수 있겠습니다.

공통된 문제는 대부분의 사이트 첫페이지가 실시간으로 DB에 접속하고 DB에서 게시물을 가져온다는 것입니다.

이러다 보니 동시접속자가 많아지면 자연 로딩속도가 늘여지고 이탈현상이 발생되는 것이지요.

보여줄 메인HTML(최근 게시물 등 기타 MySQL쿼리 결과물 포함)을 미리 만들어 놓고 운영하는 방법입니다.

자세히 설명드리면

Linux에는 cron이라는 것이 있는데 이는 특정시간에 특정Job을 수행하는 시스템유틸리티 입니다.

이를 이용하여 매시간 5,15,25,35,45,55분에 10분뒤에 사용할 메인HTML을 만들고

사용자에게는 10분전에 만들어진 현재 시간대의 메인HTML을 보여주는것이지요.

예로 13:15이면 cron에 의해 main_1320.htm을 만들고 사용자는 main_1310.htm을 보여주고 main_1300.htm은 지웁니다.

이를 구현한 Full Source입니다.

1) cron의 내용

   $ crontab -l [Enter]
     5,15,25,35,45,55 * * * * /절대PATH/make_main.sh
   $

   크론과 쉘이 무었인지 잘 모르시면 Linux 참고문헌을 보세요.

  
2) make_main.sh의 내용

   cd /절대PATH/
   php < ./make_main.php
  
  
3) make_main.php의 내용

   <?php
   $main_path = "/절대PATH/main_";
   $before    = $main_path.substr(date("Hi",strtotime("-10 minute")),0,3)."0.htm";
   $after     = $main_path.substr(date("Hi",strtotime("+10 minute")),0,3)."0.htm";
  
   $falg = 0;
   $fi   = fopen ("http://도메인/main.php", "r");
   $fo   = fopen ($after, "w");
   while (!feof ($fi)) {
           $buff = fgets($fi,4096);
           if (ereg("<!-- MAIN.HTM 시작 -->",$buff)) $flag = 1;  //앞부분 버림
           if ($flag == 1) fputs($fo, $buff);
   }
   fclose ($fo);
   fclose ($fi);
   if (file_exists($before)) unlink($before);
   ?>

4) index.html의 내용

   <?php
    include("상단HTML");
    $main_path = "/절대PATH/main_";
    $current = $main_path.substr(date("Hi",strtotime("now")),0,3)."0.htm";
    include($current);
    include("하단HTML");
   ?>
2015/02/12 10:40 2015/02/12 10:40
Posted
Filed under Linux
common.lib.php  파일의  2788번째 줄의 소스를 아래와 같이 아이피로 수정 한다.

// 아이코드 사용자정보
function get_icode_userinfo($id, $pass)
{
    //$res = get_sock('http://www.icodekorea.com/res/userinfo.php?userid='.$id.'&userpw='.$pass);
    $res = get_sock('http://211.172.232.124/res/userinfo.php?userid='.$id.'&userpw='.$pass);
    $res = explode(';', $res);
    $userinfo = array(
        'code'      => $res[0], // 결과코드
        'coin'      => $res[1], // 고객 잔액 (충전제만 해당)
        'gpay'      => $res[2], // 고객의 건수 별 차감액 표시 (충전제만 해당)
        'payment'   => $res[3]  // 요금제 표시, A:충전제, C:정액제
    );

    return $userinfo;
}
2015/01/12 16:39 2015/01/12 16:39
Posted
Filed under Linux
명령어
1. service httpd stop
(아파치 80포트 사용 여부 확인)

2. apachectl startssl
(비밀번호 입력);
2014/12/08 17:18 2014/12/08 17:18
Posted
Filed under Linux
##### APM 컴파일 설치시 ##### cd /usr/local/src wget http://h264.code-shop.com/download/apache_mod_h264_streaming-2.2.7.tar.gz tar -zxvf apache_mod_h264_streaming-2.2.7.tar.gz cd mod_h264_streaming-2.2.7 ./configure --with-apxs='/usr/local/apache/bin/apxs' make make install # so파일 있는지 확인 ll /usr/local/apache/modules/mod_h264_streaming.so # httpd.conf 파일 수정 # LoadModule h264_streaming_module modules/mod_h264_streaming.so AddHandler h264-streaming.extensions .mp4 ##### APM rpm 설치시 ##### cd /usr/local/src wget http://h264.code-shop.com/download/apache_mod_h264_streaming-2.2.7.tar.gz tar -zxvf apache_mod_h264_streaming-2.2.7.tar.gz cd mod_h264_streaming-2.2.7 find / -name "*apxs*" ./configure --with-apxs='/usr/sbin/apxs' make make install # so파일 있는지 확인 ll /etc/httpd/modules/mod_h264_streaming.so # httpd.conf 파일 수정 # LoadModule h264_streaming_module modules/mod_h264_streaming.so AddHandler h264-streaming.extensions .mp4
2014/03/18 00:50 2014/03/18 00:50
Posted
Filed under Linux
[원문]: http://sudarmuthu.com/blog/rotating-apache-log-files-using-cronolog/ - 파일 다운로드 체크 - [참고] : https://github.com/jamiew/apache-file-download-stats Rotating Apache log files using Cronolog Published Mar 9, 2008 | In Unix/Server Stuff I must confess that I am a stats freak. If you are a long time reader of my blog, then you would have known that by now yourself. ;-) This explains the reason why I want to preserve my Apache log files in spite of using a variety of stat services like Google Analytics, WordPress stats, statscounter, performancing metrics (before it was closed). The default Apache configuration preserves the log files only for the last 10 days, but I wanted to permanently archive this files. After some searches in Google I came across an excellent program called Cronolog. Cronolog is a simple filter program which writes each log entry to a separate log file named after the filename format specified. You can use a variety of parameters like current date, time etc to define the filename template. First we have to install cronolog, either by using aptitude or by downloading it from its download page. Then you have to change the log file name path in the virtual host file. (In Ubuntu Gusty, the virtual host files are situated in the path /etc/apache2/sites-enabled). I am using the following file format for this blog # Custom log file locations LogLevel warn ErrorLog "|/usr/sbin/cronolog /path/to/logs/%Y/%m/%Y-%m-%d-sudarmuthu.com-error.log" CustomLog "|/usr/sbin/cronolog /path/to/logs/%Y/%m/%Y-%m-%d-sudarmuthu.com-access.log" combined which will store my log files in separate folders for each year and for each month, like the below hierarchy /2007/12/2007-11-01-sudarmuthu.com-access.log /2007/12/2007-11-02-sudarmuthu.com-access.log ...... /2008/01/2008-01-01-sudarmuthu.com-access.log /2008/01/2008-01-02-sudarmuthu.com-access.log ...... You can use a variety of modifiers for the filename and I have documented some of them in the below table. You can get more information from its documentation. Specifier Description Time fields %H hour (00..23) %I hour (01..12) %p the locale’s AM or PM indicator %M minute (00..59) %S second (00..61, which allows for leap seconds) %X the locale’s time representation (e.g.: “15:12:47″) %Z time zone (e.g. GMT), or nothing if the time zone cannot be determined Date fields %a the locale’s abbreviated weekday name (e.g.: Sun..Sat) %A the locale’s full weekday name (e.g.: Sunday .. Saturday) %b the locale’s abbreviated month name (e.g.: Jan .. Dec) %B the locale’s full month name, (e.g.: January .. December) %c the locale’s date and time (e.g.: "Sun Dec 15 14:12:47 GMT 1996") %d day of month (01 .. 31) %j day of year (001 .. 366) %m month (01 .. 12) %U week of the year with Sunday as first day of week (00..53, where week 1 is the week containing the first Sunday of the year) %W week of the year with Monday as first day of week (00..53, where week 1 is the week containing the first Monday of the year) %w day of week (0 .. 6, where 0 corresponds to Sunday) %x locale’s date representation (e.g. today in Britain: “15/12/96″) %y year without the century (00 .. 99) %Y year with the century (1970 .. 2038)
2014/03/18 00:39 2014/03/18 00:39