{"id":18592,"date":"2014-11-09T06:53:13","date_gmt":"2014-11-08T22:53:13","guid":{"rendered":"https:\/\/2blog.ilc.edu.tw\/25793\/2014\/11\/09\/centos-6-x-7-x-%e4%b8%8a%e5%ae%89%e8%a3%9d-owncloud-7-x\/"},"modified":"2021-03-18T17:24:10","modified_gmt":"2021-03-18T09:24:10","slug":"centos-6-x-7-x-%e4%b8%8a%e5%ae%89%e8%a3%9d-owncloud-7-x","status":"publish","type":"post","link":"https:\/\/2blog.ilc.edu.tw\/25793\/2014\/11\/09\/centos-6-x-7-x-%e4%b8%8a%e5%ae%89%e8%a3%9d-owncloud-7-x\/","title":{"rendered":"CentOS 6.x\/7.x \u4e0a\u5b89\u88dd ownCloud 7.x"},"content":{"rendered":"<p>\u6700\u8fd1\u5728 CentOS 6.x \/ 7.x\u00a0\u5b89\u88dd ownCloud\u00a0\u6642\uff0c\u90fd\u6703\u51fa\u73fe\u4e0b\u9762\u7684\u756b\u9762<br \/><a id=\"res_2749944\" href=\"https:\/\/2blog.ilc.edu.tw\/wp-content\/uploads\/sites\/985\/25793\/25793-2749944.png\"><img decoding=\"async\" src=\"https:\/\/2blog.ilc.edu.tw\/wp-content\/uploads\/sites\/985\/25793\/previews-med\/25793-2749944.png\" border=\"0\" alt=\"\" \/><\/a>[@more@]\u7d93\u904e\u53cd\u8986\u7684\u6e2c\u8a66\uff0c\u767c\u73fe\u61c9\u8a72\u662f SElinux\u00a0\u9020\u6210\u7684\u554f\u984c<br \/>\u53ea\u8981\u66ab\u4e14\u628a SELinux\u00a0\u95dc\u9589<br \/># <span style=\"color: #ff0000\">setenforce 0<\/span><\/p>\n<p>\u7cfb\u7d71\u5c31\u53ef\u4ee5\u6b63\u5e38\u5b89\u88dd<br \/><a id=\"res_2749945\" href=\"https:\/\/2blog.ilc.edu.tw\/wp-content\/uploads\/sites\/985\/25793\/25793-2749945.png\"><img decoding=\"async\" src=\"https:\/\/2blog.ilc.edu.tw\/wp-content\/uploads\/sites\/985\/25793\/previews-med\/25793-2749945.png\" border=\"0\" alt=\"\" \/><\/a><\/p>\n<p>\u53ef\u4ee5\u5728 owncloud\u00a0\u76ee\u9304\u4e0b\u7684 README.SELinux\u00a0\u4e2d\u63d0\u5230<br \/><span style=\"color: #ff0000\">NOTE: IF YOU INSTALLED FROM THE OFFICIAL OWNCLOUD RPM, YOU DO NOT NEED TO<\/span><br \/><span style=\"color: #ff0000\">\u00a0\u00a0\u00a0\u00a0\u00a0 FOLLOW THE INSTRUCTIONS BELOW! THEY HAVE ALREADY BEEN DONE FOR YOU!<\/span><\/p>\n<p><span style=\"color: #0000ff\">If you are running Fedora 16 with SELinux enabled, you need to relabel the<\/span><br \/><span style=\"color: #0000ff\">ownCloud installation directory to allow the webserver to store files there.<\/span><\/p>\n<p><span style=\"color: #0000ff\">To do that, execute the following commands as user root AFTER you installed<\/span><br \/><span style=\"color: #0000ff\">ownCloud:<\/span><\/p>\n<p><span style=\"color: #0000ff\"># semanage fcontext -a -t httpd_sys_rw_content_t &#8216;\/var\/www\/html\/owncloud\/data&#8217;<\/span><br \/><span style=\"color: #0000ff\"># restorecon &#8216;\/var\/www\/html\/owncloud\/data&#8217;<\/span><br \/><span style=\"color: #0000ff\"># semanage fcontext -a -t httpd_sys_rw_content_t &#8216;\/var\/www\/html\/owncloud\/config&#8217;<\/span><br \/><span style=\"color: #0000ff\"># restorecon &#8216;\/var\/www\/html\/owncloud\/config&#8217;<\/span><\/p>\n<p><span style=\"color: #0000ff\">To remove the ownCloud directory label execute the following commands as<\/span><br \/><span style=\"color: #0000ff\">user root AFTER you uninstalled ownCloud:<\/span><\/p>\n<p><span style=\"color: #0000ff\"># semanage fcontext -d -t httpd_sys_rw_content_t &#8216;\/var\/www\/html\/owncloud\/data&#8217;<\/span><br \/><span style=\"color: #0000ff\"># restorecon &#8216;\/var\/www\/html\/owncloud\/data&#8217;<\/span><br \/><span style=\"color: #0000ff\"># semanage fcontext -d -t httpd_sys_rw_content_t &#8216;\/var\/www\/html\/owncloud\/config&#8217;<\/span><br \/><span style=\"color: #0000ff\"># restorecon &#8216;\/var\/www\/html\/owncloud\/config&#8217;<\/span><\/p>\n<p><span style=\"color: #0000ff\">Note: all of the above applies only to the default policies. If you modified<\/span><br \/><span style=\"color: #0000ff\">\u00a0\u00a0\u00a0\u00a0\u00a0 them, please give the webserver write-access to the directories<\/span><br \/><span style=\"color: #0000ff\">\u00a0\u00a0\u00a0\u00a0\u00a0 \/var\/www\/html\/owncloud\/data and \/var\/www\/html\/owncloud\/config<\/span><\/p>\n<p><span style=\"color: #0000ff\">Note: for non-Fedora \/ Redhat systems running SELinux the policy might be <\/span><br \/><span style=\"color: #0000ff\">\u00a0\u00a0\u00a0\u00a0\u00a0 called differently.<\/span><\/p>\n<p><span style=\"color: #0000ff\">Enjoy you own Cloud!<\/span><\/p>\n<p>\u53ea\u8981\u662f\u7528 rpm\u00a0\u4f86\u5b89\u88dd\u7684\uff0c\u5c31\u53ef\u4ee5\u4e0d\u7528\u505a\u8a2d\u5b9a\uff0c\u4f46\u5373\u4f7f\u505a\u4e86\u8a2d\u5b9a\u4e5f\u6c92\u6709\u7528<\/p>\n<p>\u89e3\u6c7a\u65b9\u5f0f\uff1a<br \/>1.\u00a0\u95dc\u9589 SELinux\uff0c\u9019\u662f\u6211\u6700\u4e0d\u5efa\u8b70\u7684<br \/># <span style=\"color: #ff0000\">sed -i &#8216;s\/SELINUX=enforcing\/SELINUX=disabled\/&#8217; \/etc\/selinux\/config<\/span><\/p>\n<p>\u91cd\u65b0\u958b\u6a5f<br \/># <span style=\"color: #ff0000\">reboot<\/span><\/p>\n<p>2.\u00a0\u8a2d\u5b9a\u76ee\u9304\u64c1\u6709\u8005\u53ca SELinux<br \/># <span style=\"color: #ff0000\">chown -R apache:apache \/var\/www\/html\/owncloud\/data<\/span><br \/># <span style=\"color: #ff0000\">chown -R apache:apache \/var\/www\/html\/owncloud\/config<\/span><br \/># <span style=\"color: #ff0000\">chcon -R -t httpd_sys_rw_content_t \/var\/www\/html\/owncloud\/config<\/span><br \/># <span style=\"color: #ff0000\">chcon -R -t httpd_sys_rw_content_t \/var\/www\/html\/owncloud\/data<\/span><br \/># <span style=\"color: #ff0000\">chcon -R -t httpd_sys_rw_content_t \/var\/www\/html\/owncloud\/apps<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6700\u8fd1\u5728 CentOS 6.x \/ 7.x\u00a0\u5b89\u88dd ownCloud\u00a0\u6642\uff0c\u90fd\u6703\u51fa\u73fe\u4e0b\u9762\u7684\u756b\u9762[@more@]\u7d93\u904e\u53cd &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/2blog.ilc.edu.tw\/25793\/2014\/11\/09\/centos-6-x-7-x-%e4%b8%8a%e5%ae%89%e8%a3%9d-owncloud-7-x\/\" class=\"more-link\">\u95b1\u8b80\u5168\u6587<span class=\"screen-reader-text\">\u3008CentOS 6.x\/7.x \u4e0a\u5b89\u88dd ownCloud 7.x\u3009<\/span><\/a><\/p>\n","protected":false},"author":55,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[117,106,136],"tags":[],"class_list":["post-18592","post","type-post","status-publish","format-standard","hentry","category-c-78462","category-c-79900","category-c-78481"],"meta_key":{"_pingme":["1"],"_encloseme":["1"],"lt_post_id":["531263"]},"_links":{"self":[{"href":"https:\/\/2blog.ilc.edu.tw\/25793\/wp-json\/wp\/v2\/posts\/18592"}],"collection":[{"href":"https:\/\/2blog.ilc.edu.tw\/25793\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/2blog.ilc.edu.tw\/25793\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/2blog.ilc.edu.tw\/25793\/wp-json\/wp\/v2\/users\/55"}],"replies":[{"embeddable":true,"href":"https:\/\/2blog.ilc.edu.tw\/25793\/wp-json\/wp\/v2\/comments?post=18592"}],"version-history":[{"count":1,"href":"https:\/\/2blog.ilc.edu.tw\/25793\/wp-json\/wp\/v2\/posts\/18592\/revisions"}],"predecessor-version":[{"id":20219,"href":"https:\/\/2blog.ilc.edu.tw\/25793\/wp-json\/wp\/v2\/posts\/18592\/revisions\/20219"}],"wp:attachment":[{"href":"https:\/\/2blog.ilc.edu.tw\/25793\/wp-json\/wp\/v2\/media?parent=18592"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/2blog.ilc.edu.tw\/25793\/wp-json\/wp\/v2\/categories?post=18592"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/2blog.ilc.edu.tw\/25793\/wp-json\/wp\/v2\/tags?post=18592"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}