{"id":45300,"date":"2024-10-06T21:53:14","date_gmt":"2024-10-06T13:53:14","guid":{"rendered":"https:\/\/server.hk\/cnblog\/45300\/"},"modified":"2024-10-06T21:53:14","modified_gmt":"2024-10-06T13:53:14","slug":"%e5%a6%82%e4%bd%95%e5%9c%a8-centos-8-%e4%b8%8a%e6%90%ad%e5%bb%ba-owncloud-%e7%a7%81%e6%9c%89%e9%9b%b2%e5%84%b2%e5%ad%98%e7%b6%b2%e7%9b%a4","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/45300\/","title":{"rendered":"\u5982\u4f55\u5728 CentOS 8 \u4e0a\u642d\u5efa OwnCloud \u79c1\u6709\u96f2\u5132\u5b58\u7db2\u76e4"},"content":{"rendered":"<h1 id=\"%e5%a6%82%e4%bd%95%e5%9c%a8-centos-8-%e4%b8%8a%e6%90%ad%e5%bb%ba-owncloud-%e7%a7%81%e6%9c%89%e9%9b%b2%e5%84%b2%e5%ad%98%e7%b6%b2%e7%9b%a4-SMBhRfjBbY\">\u5982\u4f55\u5728 CentOS 8 \u4e0a\u642d\u5efa OwnCloud \u79c1\u6709\u96f2\u5132\u5b58\u7db2\u76e4<\/h1>\n<p>\u5728\u7576\u4eca\u6578\u4f4d\u5316\u7684\u6642\u4ee3\uff0c\u79c1\u6709\u96f2\u5132\u5b58\u89e3\u6c7a\u65b9\u6848\u8d8a\u4f86\u8d8a\u53d7\u5230\u91cd\u8996\u3002OwnCloud \u662f\u4e00\u500b\u958b\u6e90\u7684\u96f2\u5132\u5b58\u5e73\u53f0\uff0c\u5141\u8a31\u7528\u6236\u5728\u81ea\u5df1\u7684\u4f3a\u670d\u5668\u4e0a\u642d\u5efa\u79c1\u6709\u96f2\uff0c\u5f9e\u800c\u5be6\u73fe\u6578\u64da\u7684\u5b89\u5168\u5b58\u5132\u548c\u7ba1\u7406\u3002\u672c\u6587\u5c07\u6307\u5c0e\u60a8\u5982\u4f55\u5728 CentOS 8 \u4e0a\u642d\u5efa OwnCloud \u79c1\u6709\u96f2\u5132\u5b58\u7db2\u76e4\u3002<\/p>\n<h2 id=\"%e5%89%8d%e6%9c%9f%e6%ba%96%e5%82%99-SMBhRfjBbY\">\u524d\u671f\u6e96\u5099<\/h2>\n<p>\u5728\u958b\u59cb\u4e4b\u524d\uff0c\u60a8\u9700\u8981\u78ba\u4fdd\u60a8\u7684 CentOS 8 \u7cfb\u7d71\u5df2\u7d93\u66f4\u65b0\u5230\u6700\u65b0\u7248\u672c\u3002\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u9032\u884c\u66f4\u65b0\uff1a<\/p>\n<pre><code>sudo dnf update -y<\/code><\/pre>\n<p>\u63a5\u4e0b\u4f86\uff0c\u60a8\u9700\u8981\u5b89\u88dd\u4e00\u4e9b\u5fc5\u8981\u7684\u4f9d\u8cf4\u5305\uff0c\u5305\u62ec Apache\u3001MariaDB \u548c PHP\u3002\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u9032\u884c\u5b89\u88dd\uff1a<\/p>\n<pre><code>sudo dnf install httpd mariadb-server php php-mysqlnd php-xml php-mbstring php-curl php-zip php-gd -y<\/code><\/pre>\n<h2 id=\"%e5%ae%89%e8%a3%9d%e5%92%8c%e9%85%8d%e7%bd%ae-mariadb-SMBhRfjBbY\">\u5b89\u88dd\u548c\u914d\u7f6e MariaDB<\/h2>\n<p>\u5b89\u88dd\u5b8c\u6210\u5f8c\uff0c\u555f\u52d5 MariaDB \u670d\u52d9\u4e26\u8a2d\u7f6e\u958b\u6a5f\u81ea\u555f\uff1a<\/p>\n<pre><code>sudo systemctl start mariadb\nsudo systemctl enable mariadb<\/code><\/pre>\n<p>\u63a5\u4e0b\u4f86\uff0c\u60a8\u9700\u8981\u904b\u884c\u5b89\u5168\u6027\u8173\u672c\u4f86\u52a0\u5f37 MariaDB \u7684\u5b89\u5168\u6027\uff1a<\/p>\n<pre><code>sudo mysql_secure_installation<\/code><\/pre>\n<p>\u6839\u64da\u63d0\u793a\u8a2d\u7f6e root \u5bc6\u78bc\uff0c\u4e26\u9078\u64c7\u5176\u4ed6\u5b89\u5168\u9078\u9805\u3002\u63a5\u4e0b\u4f86\uff0c\u767b\u9304\u5230 MariaDB \u4e26\u5275\u5efa OwnCloud \u7684\u6578\u64da\u5eab\u548c\u7528\u6236\uff1a<\/p>\n<pre><code>sudo mysql -u root -p\nCREATE DATABASE owncloud;\nCREATE USER 'ownclouduser'@'localhost' IDENTIFIED BY 'your_password';\nGRANT ALL PRIVILEGES ON owncloud.* TO 'ownclouduser'@'localhost';\nFLUSH PRIVILEGES;\nEXIT;<\/code><\/pre>\n<h2 id=\"%e4%b8%8b%e8%bc%89%e5%92%8c%e5%ae%89%e8%a3%9d-owncloud-SMBhRfjBbY\">\u4e0b\u8f09\u548c\u5b89\u88dd OwnCloud<\/h2>\n<p>\u63a5\u4e0b\u4f86\uff0c\u60a8\u9700\u8981\u4e0b\u8f09 OwnCloud \u7684\u6700\u65b0\u7248\u672c\u3002\u53ef\u4ee5\u4f7f\u7528 wget \u547d\u4ee4\u4f86\u4e0b\u8f09\uff1a<\/p>\n<pre><code>wget https:\/\/download.owncloud.org\/community\/owncloud-x.y.z.zip<\/code><\/pre>\n<p>\u8acb\u5c07 &#8220;x.y.z&#8221; \u66ff\u63db\u70ba\u6700\u65b0\u7248\u672c\u865f\u3002\u4e0b\u8f09\u5b8c\u6210\u5f8c\uff0c\u89e3\u58d3\u7e2e\u6587\u4ef6\u4e26\u5c07\u5176\u79fb\u52d5\u5230 Apache \u7684\u6839\u76ee\u9304\uff1a<\/p>\n<pre><code>unzip owncloud-x.y.z.zip\nsudo mv owncloud \/var\/www\/html\/<\/code><\/pre>\n<p>\u63a5\u4e0b\u4f86\uff0c\u8a2d\u7f6e\u9069\u7576\u7684\u6b0a\u9650\uff1a<\/p>\n<pre><code>sudo chown -R apache:apache \/var\/www\/html\/owncloud\nsudo chmod -R 755 \/var\/www\/html\/owncloud<\/code><\/pre>\n<h2 id=\"%e9%85%8d%e7%bd%ae-apache-SMBhRfjBbY\">\u914d\u7f6e Apache<\/h2>\n<p>\u63a5\u4e0b\u4f86\uff0c\u60a8\u9700\u8981\u70ba OwnCloud \u914d\u7f6e Apache\u3002\u5275\u5efa\u4e00\u500b\u65b0\u7684\u914d\u7f6e\u6587\u4ef6\uff1a<\/p>\n<pre><code>sudo nano \/etc\/httpd\/conf.d\/owncloud.conf<\/code><\/pre>\n<p>\u5728\u6587\u4ef6\u4e2d\u6dfb\u52a0\u4ee5\u4e0b\u5167\u5bb9\uff1a<\/p>\n<pre><code>&lt;Directory \/var\/www\/html\/owncloud\/&gt;\n   Options +FollowSymlinks\n   AllowOverride All\n   Require all granted\n&lt;\/Directory&gt;\n\nAlias \/owncloud \"\/var\/www\/html\/owncloud\/\"\n&lt;Location \/owncloud&gt;\n   Require all granted\n&lt;\/Location&gt;<\/code><\/pre>\n<p>\u4fdd\u5b58\u4e26\u9000\u51fa\u7de8\u8f2f\u5668\u3002\u7136\u5f8c\uff0c\u555f\u7528 Apache \u7684 mod_rewrite \u6a21\u7d44\uff1a<\/p>\n<pre><code>sudo a2enmod rewrite<\/code><\/pre>\n<p>\u6700\u5f8c\uff0c\u555f\u52d5 Apache \u670d\u52d9\u4e26\u8a2d\u7f6e\u958b\u6a5f\u81ea\u555f\uff1a<\/p>\n<pre><code>sudo systemctl start httpd\nsudo systemctl enable httpd<\/code><\/pre>\n<h2 id=\"%e5%ae%8c%e6%88%90%e5%ae%89%e8%a3%9d-SMBhRfjBbY\">\u5b8c\u6210\u5b89\u88dd<\/h2>\n<p>\u73fe\u5728\uff0c\u60a8\u53ef\u4ee5\u901a\u904e\u700f\u89bd\u5668\u8a2a\u554f OwnCloud\u3002\u6253\u958b\u700f\u89bd\u5668\u4e26\u8f38\u5165\u4ee5\u4e0b\u5730\u5740\uff1a<\/p>\n<pre><code>http:\/\/your_server_ip\/owncloud<\/code><\/pre>\n<p>\u5728\u7db2\u9801\u4e0a\uff0c\u60a8\u9700\u8981\u8f38\u5165\u6578\u64da\u5eab\u7684\u8a73\u7d30\u4fe1\u606f\uff0c\u5305\u62ec\u6578\u64da\u5eab\u540d\u7a31\u3001\u7528\u6236\u540d\u548c\u5bc6\u78bc\u3002\u5b8c\u6210\u5f8c\uff0c\u9ede\u64ca\u201c\u5b8c\u6210\u5b89\u88dd\u201d\u3002<\/p>\n<h2 id=\"%e7%b8%bd%e7%b5%90-SMBhRfjBbY\">\u7e3d\u7d50<\/h2>\n<p>\u901a\u904e\u4ee5\u4e0a\u6b65\u9a5f\uff0c\u60a8\u5df2\u7d93\u6210\u529f\u5728 CentOS 8 \u4e0a\u642d\u5efa\u4e86 OwnCloud \u79c1\u6709\u96f2\u5132\u5b58\u7db2\u76e4\u3002\u9019\u4e0d\u50c5\u80fd\u5920\u5e6b\u52a9\u60a8\u66f4\u597d\u5730\u7ba1\u7406\u548c\u5b58\u5132\u6578\u64da\uff0c\u9084\u80fd\u63d0\u9ad8\u6578\u64da\u7684\u5b89\u5168\u6027\u3002\u5982\u679c\u60a8\u9700\u8981\u7a69\u5b9a\u7684\u4f3a\u670d\u5668\u4f86\u904b\u884c OwnCloud\uff0c\u8003\u616e\u4f7f\u7528\u6211\u5011\u7684 <a href=\"https:\/\/server.hk\">\u9999\u6e2fVPS<\/a> \u670d\u52d9\uff0c\u70ba\u60a8\u7684\u79c1\u6709\u96f2\u63d0\u4f9b\u5f37\u5927\u7684\u652f\u6301\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5b78\u7fd2\u5982\u4f55\u5728 CentOS 8 \u4e0a\u642d\u5efa OwnCloud \u79c1\u6709\u96f2\u5132\u5b58\u7db2\u76e4\uff0c\u5be6\u73fe\u5b89\u5168\u3001\u9ad8\u6548\u7684\u6587\u4ef6\u7ba1\u7406\u8207\u5171\u4eab\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4924],"tags":[],"class_list":["post-45300","post","type-post","status-publish","format-standard","hentry","category-setup-tutorials"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/45300","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/comments?post=45300"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/45300\/revisions"}],"predecessor-version":[{"id":45301,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/45300\/revisions\/45301"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=45300"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=45300"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=45300"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}