Linux/centos

httpd + php + selinux..

구차니 2019. 3. 20. 10:59

언제나 그렇듯 selinux는 만악의 근원이구만?


80번 포트가 아닌 다른 포트를 쓰려고 할때 httpd 데몬이 실행안되는 경우

(아래는 5000번 포트를 웹 서버로 쓰려고 할 경우)

# semanage port -m -t http_port_t -p tcp  5000

# semanage port -a -t http_port_t -p tcp  5000

[링크 : http://egloos.zum.com/dochi575/v/4867779]

[링크 : https://stackoverflow.com/questions/17079670/]


php 페이지가 열리지 않을 경우

# ls -Z

# sudo chcon -t httpd_sys_content_t /var/www/html -R

[링크 : https://blog.lysender.com/2015/07/centos-7-selinux-php-apache-cannot-writeaccess-file-no-matter-what/]