{"id":45290,"date":"2024-10-06T21:49:16","date_gmt":"2024-10-06T13:49:16","guid":{"rendered":"https:\/\/server.hk\/cnblog\/45290\/"},"modified":"2024-10-06T21:49:16","modified_gmt":"2024-10-06T13:49:16","slug":"%e5%a6%82%e4%bd%95%e5%9c%a8-centos-8-1-%e4%b8%8a%e5%ae%89%e8%a3%9d%e9%83%a8%e7%bd%b2-nextcloud-%e7%a7%81%e4%ba%ba%e7%b6%b2%e7%9b%a4","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/45290\/","title":{"rendered":"\u5982\u4f55\u5728 CentOS 8.1 \u4e0a\u5b89\u88dd\u90e8\u7f72 NextCloud \u79c1\u4eba\u7db2\u76e4"},"content":{"rendered":"<h1 id=\"%e5%a6%82%e4%bd%95%e5%9c%a8-centos-8-1-%e4%b8%8a%e5%ae%89%e8%a3%9d%e9%83%a8%e7%bd%b2-nextcloud-%e7%a7%81%e4%ba%ba%e7%b6%b2%e7%9b%a4-VPWLxpbhJn\">\u5982\u4f55\u5728 CentOS 8.1 \u4e0a\u5b89\u88dd\u90e8\u7f72 NextCloud \u79c1\u4eba\u7db2\u76e4<\/h1>\n<p>NextCloud \u662f\u4e00\u500b\u958b\u6e90\u7684\u79c1\u4eba\u96f2\u5b58\u5132\u89e3\u6c7a\u65b9\u6848\uff0c\u5141\u8a31\u7528\u6236\u5728\u81ea\u5df1\u7684\u4f3a\u670d\u5668\u4e0a\u5b58\u5132\u548c\u5171\u4eab\u6587\u4ef6\u3002\u9019\u7bc7\u6587\u7ae0\u5c07\u6307\u5c0e\u60a8\u5982\u4f55\u5728 CentOS 8.1 \u4e0a\u5b89\u88dd\u548c\u90e8\u7f72 NextCloud\uff0c\u8b93\u60a8\u80fd\u5920\u8f15\u9b06\u7ba1\u7406\u81ea\u5df1\u7684\u6578\u64da\u3002<\/p>\n<h2 id=\"%e5%89%8d%e6%9c%9f%e6%ba%96%e5%82%99-VPWLxpbhJn\">\u524d\u671f\u6e96\u5099<\/h2>\n<p>\u5728\u958b\u59cb\u5b89\u88dd\u4e4b\u524d\uff0c\u60a8\u9700\u8981\u78ba\u4fdd\u60a8\u7684 CentOS 8.1 \u7cfb\u7d71\u5df2\u7d93\u66f4\u65b0\u5230\u6700\u65b0\u7248\u672c\u3002\u60a8\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u4f86\u66f4\u65b0\u7cfb\u7d71\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-mariadb-%e6%95%b8%e6%93%9a%e5%ba%ab-VPWLxpbhJn\">\u5b89\u88dd MariaDB \u6578\u64da\u5eab<\/h2>\n<p>\u5b89\u88dd\u5b8c MariaDB \u4e4b\u5f8c\uff0c\u60a8\u9700\u8981\u555f\u52d5\u4e26\u8a2d\u7f6e\u5176\u81ea\u52d5\u555f\u52d5\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\u8a2d\u7f6e\u6578\u64da\u5eab\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\u4e00\u500b\u6578\u64da\u5eab\u548c\u7528\u6236\uff1a<\/p>\n<pre><code>sudo mysql -u root -p\nCREATE DATABASE nextcloud;\nCREATE USER 'nextclouduser'@'localhost' IDENTIFIED BY 'yourpassword';\nGRANT ALL PRIVILEGES ON nextcloud.* TO 'nextclouduser'@'localhost';\nFLUSH PRIVILEGES;\nEXIT;<\/code><\/pre>\n<h2 id=\"%e4%b8%8b%e8%bc%89%e5%92%8c%e5%ae%89%e8%a3%9d-nextcloud-VPWLxpbhJn\">\u4e0b\u8f09\u548c\u5b89\u88dd NextCloud<\/h2>\n<p>\u63a5\u4e0b\u4f86\uff0c\u60a8\u9700\u8981\u4e0b\u8f09 NextCloud \u7684\u6700\u65b0\u7248\u672c\u3002\u53ef\u4ee5\u4f7f\u7528 wget \u547d\u4ee4\u4f86\u4e0b\u8f09\uff1a<\/p>\n<pre><code>wget https:\/\/download.nextcloud.com\/server\/releases\/nextcloud-XX.XX.X.zip<\/code><\/pre>\n<p>\u8acb\u5c07\u4e0a\u9762\u7684 URL \u66ff\u63db\u70ba\u6700\u65b0\u7248\u672c\u7684\u4e0b\u8f09\u93c8\u63a5\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 nextcloud-XX.XX.X.zip\nsudo mv nextcloud \/var\/www\/html\/<\/code><\/pre>\n<p>\u63a5\u4e0b\u4f86\uff0c\u60a8\u9700\u8981\u8a2d\u7f6e\u9069\u7576\u7684\u6b0a\u9650\uff1a<\/p>\n<pre><code>sudo chown -R apache:apache \/var\/www\/html\/nextcloud\nsudo chmod -R 755 \/var\/www\/html\/nextcloud<\/code><\/pre>\n<h2 id=\"%e9%85%8d%e7%bd%ae-apache-VPWLxpbhJn\">\u914d\u7f6e Apache<\/h2>\n<p>\u70ba\u4e86\u8b93 Apache \u6b63\u78ba\u904b\u884c NextCloud\uff0c\u60a8\u9700\u8981\u5275\u5efa\u4e00\u500b\u65b0\u7684\u914d\u7f6e\u6587\u4ef6\uff1a<\/p>\n<pre><code>sudo nano \/etc\/httpd\/conf.d\/nextcloud.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\/nextcloud\/&gt;\n   Options +FollowSymlinks\n   AllowOverride All\n   Require all granted\n&lt;\/Directory&gt;\n\nAlias \/nextcloud \"\/var\/www\/html\/nextcloud\/\"\n\n&lt;Location \/nextcloud&gt;\n   Require all granted\n&lt;\/Location&gt;<\/code><\/pre>\n<p>\u4fdd\u5b58\u4e26\u9000\u51fa\u7de8\u8f2f\u5668\u3002\u63a5\u4e0b\u4f86\uff0c\u555f\u7528 Apache \u7684 mod_rewrite \u6a21\u7d44\uff1a<\/p>\n<pre><code>sudo a2enmod rewrite<\/code><\/pre>\n<p>\u7136\u5f8c\uff0c\u91cd\u555f Apache \u670d\u52d9\u4ee5\u61c9\u7528\u66f4\u6539\uff1a<\/p>\n<pre><code>sudo systemctl restart httpd<\/code><\/pre>\n<h2 id=\"%e5%ae%8c%e6%88%90-nextcloud-%e5%ae%89%e8%a3%9d-VPWLxpbhJn\">\u5b8c\u6210 NextCloud \u5b89\u88dd<\/h2>\n<p>\u73fe\u5728\uff0c\u60a8\u53ef\u4ee5\u901a\u904e\u700f\u89bd\u5668\u8a2a\u554f NextCloud\u3002\u6253\u958b\u700f\u89bd\u5668\u4e26\u8f38\u5165\u4ee5\u4e0b\u5730\u5740\uff1a<\/p>\n<pre><code>http:\/\/your-server-ip\/nextcloud<\/code><\/pre>\n<p>\u5728\u9996\u6b21\u8a2a\u554f\u6642\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\u60a8\u5c07\u80fd\u5920\u5275\u5efa\u7ba1\u7406\u54e1\u5e33\u6236\u4e26\u958b\u59cb\u4f7f\u7528 NextCloud\u3002<\/p>\n<h2 id=\"%e7%b8%bd%e7%b5%90-VPWLxpbhJn\">\u7e3d\u7d50<\/h2>\n<p>\u5728\u9019\u7bc7\u6587\u7ae0\u4e2d\uff0c\u6211\u5011\u4ecb\u7d39\u4e86\u5982\u4f55\u5728 CentOS 8.1 \u4e0a\u5b89\u88dd\u548c\u90e8\u7f72 NextCloud \u79c1\u4eba\u7db2\u76e4\u3002\u9019\u500b\u904e\u7a0b\u6d89\u53ca\u5230\u5b89\u88dd\u5fc5\u8981\u7684\u4f9d\u8cf4\u5305\u3001\u914d\u7f6e\u6578\u64da\u5eab\u3001\u4e0b\u8f09 NextCloud \u4ee5\u53ca\u914d\u7f6e Apache \u4f3a\u670d\u5668\u3002\u901a\u904e\u9019\u4e9b\u6b65\u9a5f\uff0c\u60a8\u53ef\u4ee5\u8f15\u9b06\u5730\u8a2d\u7f6e\u81ea\u5df1\u7684\u79c1\u4eba\u96f2\u5b58\u5132\u89e3\u6c7a\u65b9\u6848\u3002\u5982\u679c\u60a8\u9700\u8981\u7a69\u5b9a\u7684 <a href=\"https:\/\/server.hk\">\u9999\u6e2fVPS<\/a> \u4f86\u904b\u884c NextCloud\uff0c\u8acb\u8003\u616e\u4f7f\u7528\u6211\u5011\u7684\u670d\u52d9\uff0c\u78ba\u4fdd\u60a8\u7684\u6578\u64da\u5b89\u5168\u548c\u53ef\u9760\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5b78\u7fd2\u5982\u4f55\u5728 CentOS 8.1 \u4e0a\u5b89\u88dd\u548c\u90e8\u7f72 NextCloud\uff0c\u6253\u9020\u5b89\u5168\u7684\u79c1\u4eba\u7db2\u76e4\uff0c\u8f15\u9b06\u7ba1\u7406\u548c\u5206\u4eab\u60a8\u7684\u6587\u4ef6\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-45290","post","type-post","status-publish","format-standard","hentry","category-setup-tutorials"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/45290","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=45290"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/45290\/revisions"}],"predecessor-version":[{"id":45291,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/45290\/revisions\/45291"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=45290"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=45290"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=45290"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}