.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}}
    -
목록형 📷 갤러리형
제목
[기본형] HTML (with 부트스트랩5.3 , jquery 3.7, vue.js)
유용한 리눅스(LINUX) 명령어
[공지] 기술 게시판
2.1
2.2
2.3
2.4
2.5
2.6
2.7
2.8
2.9
2.10
2.11
2.12
2.13
2.14
2.15
2.16
2.17
2.18
2.19
2.20
2.21
2.22
2.23
2.24
2.25
2.26
2.27
2.28