Legacy/Server

[CentOS]Owncloud 권한 문제

Foo 2016. 9. 14. 00:25
728x90

과 클라우드 서버 구축 도중 문제 발생


Can't write into config directory!

This can usually be fixed by giving the webserver write access to the config directory.





semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/html/owncloud/config'

semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/html/owncloud/apps'

semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/html/owncloud/.htaccess'

semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/html/owncloud/.user.ini'


위의 4개의 명령을 친 후 다음도 입력하면 된다.

위의 semanage는 따로 메시지가 출력되진 않는다. 문제가 있을 경우 출력될 것이다. 하지만 문제가 발생하진 않았음.


[root@localhost owncloud]# restorecon -v '/var/www/html/owncloud/config'

restorecon reset /var/www/html/owncloud/config context unconfined_u:object_r:httpd_sys_content_t:s0->unconfined_u:object_r:httpd_sys_rw_content_t:s0

[root@localhost owncloud]# restorecon -v '/var/www/html/owncloud/apps'

restorecon reset /var/www/html/owncloud/apps context unconfined_u:object_r:httpd_sys_content_t:s0->unconfined_u:object_r:httpd_sys_rw_content_t:s0

[root@localhost owncloud]# restorecon -v '/var/www/html/owncloud/.htaccess'

restorecon reset /var/www/html/owncloud/.htaccess context unconfined_u:object_r:httpd_sys_content_t:s0->unconfined_u:object_r:httpd_sys_rw_content_t:s0


[root@localhost owncloud]# restorecon -v '/var/www/html/owncloud/data'

restorecon reset /var/www/html/owncloud/data context unconfined_u:object_r:httpd_sys_content_t:s0->unconfined_u:object_r:httpd_sys_rw_content_t:s0


restorecon 같은 경우 명령어를 하나씩 입력할 때 마다 메시지를 출력해준다.



만약 당신의 웹서버 디렉토리가 /var/www/html이 아니라 다른 디렉토리라면 그게 맞게 수정해주면 되겠다.







출처 - 창현