CentOS7 Apache file upload 안되는 문제

in #apache7 years ago

images.png

CentOS7 Apache file upload 안되는 문제

이어서...
가끔가다보면, CentOS7 에서 파일 업로드시켜야하는데 안될때가 있다.
Apache 권한 문제이다. 역시나 보안 쪽 문제...

sudo chcon -t httpd_sys_rw_content_t /var/www/html/upload/ -R
sudo chown apache:apache -R /var/www/html/upload/

위 명령어를 입력해주게되면, 해당 폴더에 업로드 할 수 있게 된다.
(업로드 폴더에만 꼭 적용시켜주자)

Sort:  

CetnOS7 에서 SELinux 보안 때문에, 아파치에서 쓰기가 안되는 문제가 발생한다.
(윈도우에서 라라벨 작업 후에 리눅스로 옮겼더니 안되는 현상 발생)

#해결 방법 설명#

: 권한 설정
sudo chown apache:apache -R /var/www/laravel

: Allow write to specific directories
sudo chcon -t httpd_sys_content_t /var/www/laravel-R
sudo chcon -t httpd_sys_rw_content_t /var/www/laravel/storage -R

Coin Marketplace

STEEM 0.20
TRX 0.14
JST 0.030
BTC 67698.91
ETH 3266.83
USDT 1.00
SBD 2.64