.htaccess php off

파일 : ~~~~/html/upload/.htaccess 

1.
RemoveHandler .php .phtml .php3 .php4 .php5 .html .htm
RemoveType .php .phtml .php3 .php4 .php5 .html .htm
php_flag engine off

2.
# apache 2.4
<FilesMatch "\.(php|phtml|php3|php4|php5|html|htm|log|txt)$">
  Require all denied
</FilesMatch>

# apache 2.2
#<FilesMatch "\.(php|phtml|php3|php4|php5|html|htm|log|txt)$">
#  Order allow,deny
#  Deny from all
#</FilesMatch>


3.
# apache 2.4
Require all denied

# apache 2.2
#  Order allow,deny
#  Deny from all


해당 폴더에서 php 동작을 중지 시킬때.

php파일 업로드 해킹에 대비.

1번 방법은 php-fpm 일 때 php_flag engine off 에서 에러날 수 있다.
2번 방법은 경로에서 파일 확장자를 체크해서 접근을 막는 방법
3번은 폴더 기준으로 모든 웹 접근을 막는다.

댓글
  • No Nickname
    No Comment
  • 권한이 없습니다.
    {{m_row.m_nick}}
    -
제목 작성자 날짜
공대여자
공대여자
mins01
공대여자
공대여자
공대여자
공대여자
공대여자
공대여자
공대여자
공대여자
공대여자
공대여자
공대여자
공대여자
공대여자
공대여자
공대여자