httpd (no pid file) not running
find / -name httpd.pid (httpd.pid 파일 찻기)
/var/run/httpd.pid
/usr/local/apache2/logs/httpd.pid (경로로 파일 복사)
-- httpd.conf -- (PidFile 경로추가)
:
ServerRoot "/usr/local/apache2"
PidFile /usr/local/apache2/logs/httpd.pid
:
:
-- httpd.conf -- (경로: /usr/local/apache2/bin)
# apachectl start
# ps aux | grep httpd
root 30008 0.0 0.6 6344 3440 ? Ss 01:52 0:00 /usr/local/apache/bin/httpd
nobody 30009 0.0 0.5 6344 2752 ? S 01:52 0:00 /usr/local/apache/bin/httpd
nobody 30010 0.0 0.5 6344 2752 ? S 01:52 0:00 /usr/local/apache/bin/httpd
nobody 30011 0.0 0.5 6344 2752 ? S 01:52 0:00 /usr/local/apache/bin/httpd
nobody 30012 0.0 0.5 6344 2752 ? S 01:52 0:00 /usr/local/apache/bin/httpd
nobody 30013 0.0 0.5 6344 2752 ? S 01:52 0:00 /usr/local/apache/bin/httpd
root 30033 0.0 0.0 1944 512 pts/2 R+ 01:55 0:00 grep httpd
- pid 파일을 삭제하면 apachectl로 아파치데몬을 stop 시킬 수 없다.
# rm -f /usr/local/apache2/logs/httpd.pid
# apachectl stop
/usr/bin/apachectl stop: httpd (no pid file) not running
# netstat -nltp | grep 80
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 30008/httpd
# ps aux | grep httpd | grep root
root 30008 0.0 0.6 6344 3440 ? Ss 01:52 0:00 /usr/local/apache/bin/httpd
root 30098 0.0 0.0 1944 484 pts/2 R+ 01:59 0:00 grep httpd
PidFile /usr/local/apache/logs/httpd.pid
# echo 30008 > /usr/local/apache/logs/httpd.pid
# apachectl stop