선 밖에 선 자유인

웹 서버 보안 설정 변경 (간단히) 본문

IT/Security

웹 서버 보안 설정 변경 (간단히)

Hotman 2014. 2. 5. 13:44

php.ini, httpd.conf 가 /etc 하위에 존재할 때 (/etc/php.ini,  /etc/httpd/conf/httpd.conf)


find /etc -name php.ini -exec perl -pi -e 's/expose_php = On/expose_php = Off/g' {} \;

find /etc -name httpd.conf -exec perl -pi -e 's/ServerSignature On/ServerSignature Off/g' {} \;

find /etc -name httpd.conf -exec perl -pi -e 's/ServerTokens OS/ServerTokens Prod/g' {} \;

or

find /etc -name php.ini -exec sed -i 's/expose_php = On/expose_php = Off/g' {} \;

find /etc -name httpd.conf -exec sed -i 's/ServerSignature On/ServerSignature Off/g' {} \;

find /etc -name httpd.conf -exec sed -i 's/ServerTokens OS/ServerTokens Prod/g' {} \;


.. 기타 수정 후


kill -HUP <PID>


Comments