티스토리 뷰

회사에서

apache core dump 떨어 뜨리기

쌀맛나는세상 2009. 7. 3. 19:16

apache dump 떨어뜨리는 방법에 대해서 몇자 적어본다.

 1. limits.conf 정보 변경
 - /etc/security/limits.conf 에 다음 추가
   * core unlimited

 2. profile 정보 변경
 - /etc/profile 변경
 - ulimit -S -c 0 > /dev/null 2>1 를 ulimit -S -c unlimited > /dev/null 2>1 로 수정한다.

 3. functions 정보 변경
 - /etc/init.d/functions 주석 추가
 - #ulimit -S -c 0 >/dev/null 2>1

 4. httpd 정보 변경
 - /etc/init.d/httpd 에  start() 섹션에 다음 추가“ulimit -c unlimited”
 - start() {
   ulimit -c unlimited
   echo -n $”Starting $prog: “

 5. sysctl.conf 정보 변경
 kernel.core_uses_pid = 1
 # Following needed for Enterprise Linux 3 servers
 kernel.core_setuid_ok = 1

 Also, echo this value into proc with the following command in order for this configuration change to take effect immediately:

 # echo 1 > /proc/sys/kernel/core_uses_pid
 # echo 1 > /proc/sys/kernel/core_setuid_ok

 6. httpd.conf 파일 수정
 - /k2/server/httpd/conf/httpd.conf 에 다음 추가
 - CoreDumpDirectory /logs/apache_dump

 7. /logs/apache_dump 폴더 생성 그리고 권한 부여

 8. 리부팅과 아파치 리스타트
 - reboot
 - /k2/server/httpd/bin/apachectl stop;apachectl start

 9. http PID 정보를 가지고 kill -11 수행
 - kill -11 1333

 10. core dump 디렉토리에서 확인
 - ls -l /logs/apache_dump