{"id":17,"date":"2026-01-07T08:10:11","date_gmt":"2026-01-07T08:10:11","guid":{"rendered":"https:\/\/ceshi.303333.xyz\/?p=17"},"modified":"2026-01-07T08:10:44","modified_gmt":"2026-01-07T08:10:44","slug":"debian-%e5%ae%89%e8%a3%85-nextcloud-%e6%9c%8d%e5%8a%a1%e7%ab%af","status":"publish","type":"post","link":"https:\/\/www.yun.com.mp\/?p=17","title":{"rendered":"Debian \u5b89\u88c5 Nextcloud \u670d\u52a1\u7aef"},"content":{"rendered":"\n<p>\u672c\u6587\u5c06\u6307\u5bfc\u5982\u4f55\u5728 Debian \u4e0b\u5b89\u88c5\u5e76\u914d\u7f6e Nextcloud \u670d\u52a1\u7aef\u3002<\/p>\n\n\n\n<p>\u672c\u6587\u6700\u540e\u66f4\u65b0\u4e8e 2025 \u5e74 10 \u6708 20 \u65e5\uff0c\u5728\u5982\u4e0b\u7cfb\u7edf\u4e2d\u7ecf\u8fc7\u5b8c\u6574\u7684\u624b\u5de5\u6d4b\u8bd5\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Debian 13 Trixie (Stable)<\/li>\n\n\n\n<li>Debian 12 Bookworm (OldStable)<\/li>\n\n\n\n<li>Debian 11 Bullseye (OldOldStable)<\/li>\n<\/ul>\n\n\n\n<p>\u5176\u4ed6\u7cfb\u7edf\u6ca1\u6709\u624b\u5de5\u6d4b\u8bd5\uff0c\u8bf7\u81ea\u884c\u6d4b\u8bd5\uff0c\u7406\u8bba\u4e0a\u672c\u6587\u7684\u6559\u7a0b\u540c\u65f6\u9002\u7528\u4e8e&nbsp;<a href=\"https:\/\/www.debian.org\/releases\/stable\/\">Debian Stable<\/a>&nbsp;\u4ee5\u53ca&nbsp;<a href=\"https:\/\/releases.ubuntu.com\/\">Ubuntu LTS<\/a>\u3002<\/p>\n\n\n\n<p>\u4ee5\u4e0b\u64cd\u4f5c\u9700\u8981\u5728 root \u7528\u6237\u4e0b\u5b8c\u6210\uff0c\u8bf7\u4f7f\u7528&nbsp;<code>sudo -i<\/code>&nbsp;\u6216&nbsp;<code>su root<\/code>&nbsp;\u5207\u6362\u5230 root \u7528\u6237\u8fdb\u884c\u64cd\u4f5c\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"shi-me-shi-nextcloud\">\u4ec0\u4e48\u662f Nextcloud\uff1f<\/h2>\n\n\n\n<p><a href=\"https:\/\/nextcloud.com\/\">Nextcloud<\/a>&nbsp;\u662f\u4e00\u5957\u7528\u4e8e\u5efa\u7acb\u7f51\u7edc\u786c\u76d8\u7684\u5ba2\u6237\u7aef\u548c\u670d\u52a1\u5668\u8f6f\u4ef6\u3002\u5176\u529f\u80fd\u548c Dropbox \u76f8\u8fd1\uff0c\u4f46 Nextcloud \u662f\u5f00\u6e90\u7684\uff0c\u4efb\u4f55\u4eba\u90fd\u53ef\u4ee5\u5728\u81ea\u5df1\u7684\u670d\u52a1\u5668\u4e0a\u5b89\u88c5\u5e76\u8fd0\u884c\u5b83\u3002<\/p>\n\n\n\n<p>\u867d\u7136 Nextcloud \u6027\u80fd\u6bd4\u8f83\u5f31\uff0c\u4f46\u662f\u5b9e\u9645\u6d4b\u8bd5\u4e0b\u6765\u51e0\u4e2a\u4eba\u7684\u5c0f\u56e2\u961f\u7528\u7528\u4e5f\u8db3\u591f\u4e86\u3002<\/p>\n\n\n\n<p>\u5b89\u88c5\u4e4b\u524d\u4f60\u53ef\u4ee5\u5148\u53bb\u5b98\u65b9\u7684&nbsp;<a href=\"https:\/\/try.nextcloud.com\/access\">Demo<\/a>&nbsp;\u4f53\u9a8c\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"zhun-bei-huan-jing\">\u51c6\u5907\u73af\u5883<\/h2>\n\n\n\n<p>\u7531\u4e8e Nextcloud \u6d88\u8017\u8d44\u6e90\u6bd4\u8f83\u5927\uff0c\u4e00\u822c\u6211\u4eec\u4e0d\u5efa\u8bae\u5728 4GB \u5185\u5b58\u4ee5\u4e0b\u7684 VPS \u5b89\u88c5\uff0c\u5b98\u65b9<a href=\"https:\/\/docs.nextcloud.com\/server\/stable\/admin_manual\/installation\/system_requirements.html\">\u63a8\u8350\u914d\u7f6e<\/a>\u4e3a 512MB \u5185\u5b58\uff0c\u5b9e\u9645\u4f53\u9a8c\u4e0b\u6765\u5b89\u88c5\u5728 8GB \u5185\u5b58\u4e0a\u8dd1 Nextcloud \u4f1a\u6bd4\u8f83\u6d41\u7545\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"pei-zhi-lemp-huan-jing\">\u914d\u7f6e LEMP \u73af\u5883<\/h2>\n\n\n\n<p>\u9996\u5148\uff0c\u53ef\u4ee5\u53c2\u8003\u672c\u7ad9<a href=\"https:\/\/u.sb\/debian-install-nginx-php-mysql\/\">\u6559\u7a0b<\/a>\u914d\u7f6e\u597d LEMP \u73af\u5883\uff0c\u5728\u5b89\u88c5 PHP \u7684\u65f6\u5019\uff0c\u8bf7\u9009\u62e9 PHP 8.3 \u4ee5\u53ca\u4ee5\u4e0b\u6a21\u5757\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>apt install php8.4-{common,fpm,mysql,curl,gd,mbstring,xml,xmlrpc,zip,bz2,intl,ldap,smbclient,bcmath,gmp,imap,opcache,imagick,redis} imagemagick redis-server -y\n<\/code><\/pre>\n\n\n\n<p>\u8fd9\u91cc\u6211\u4eec\u4f7f\u7528\u4e86 Redis \u4f5c\u4e3a\u7f13\u5b58\uff0c\u6240\u4ee5\u9700\u8981\u5b89\u88c5&nbsp;<code>redis-server<\/code>&nbsp;\u548c&nbsp;<code>php8.4-redis<\/code>\uff0c\u8bf7\u4e0d\u8981\u76f4\u63a5\u5b89\u88c5&nbsp;<code>php-redis<\/code>\uff0c\u5426\u5219\u7cfb\u7edf\u4f1a\u9ed8\u8ba4\u628a\u6240\u6709\u7684 PHP \u7248\u672c\u90fd\u7ed9\u4f60\u5b89\u88c5\u4e00\u904d\u54e6\u3002<\/p>\n\n\n\n<p>\u5982\u679c\u60f3\u7528\u6700\u65b0\u7684\u5b98\u65b9 Redis \u7684\u8bdd\u53ef\u4ee5\u6dfb\u52a0\u5b98\u65b9\u6e90\uff1a\u4f20\u7edf One-Line-StyleDEB822extrepo (\u4ec5\u9002\u7528\u4e8e Debian)<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>curl -sSL https:\/\/packages.redis.io\/gpg | gpg --dearmor &gt; \/usr\/share\/keyrings\/redis-archive-keyring.gpg\n\necho \"deb &#91;arch=$(dpkg --print-architecture) signed-by=\/usr\/share\/keyrings\/redis-archive-keyring.gpg] https:\/\/packages.redis.io\/deb $(lsb_release -cs) main\" &gt; \/etc\/apt\/sources.list.d\/redis.list\n\napt update\napt install redis-server -y\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"you-hua-php-fpm-she-zhi\">\u4f18\u5316 PHP-FPM \u8bbe\u7f6e<\/h2>\n\n\n\n<p>\u7531\u4e8e\u9ed8\u8ba4\u7684 PHP-FPM \u8bbe\u7f6e\u53ea\u9002\u5408\u5c0f\u578b\u5e94\u7528\uff0c\u4e0d\u9002\u5408 Nextcloud \u8fd9\u79cd\u6d88\u8017\u8d44\u6e90\u6bd4\u8f83\u5927\u7684\u7a0b\u5e8f\uff0c\u6240\u4ee5\u6211\u4eec\u53ef\u4ee5\u4fee\u6539\u5982\u4e0b\u53c2\u6570\uff0c\u8fd9\u91cc\u7684\u4f8b\u5b50\u662f\u4f60\u60f3\u8bbe\u7f6e\u6700\u5927\u4e0a\u4f20\u7684\u6587\u4ef6\u4e3a 10GB\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sed -i 's\/;cgi.fix_pathinfo=1\/cgi.fix_pathinfo=0\/' \/etc\/php\/8.4\/fpm\/php.ini \nsed -i 's\/upload_max_filesize = 2M\/upload_max_filesize = 10240M\/' \/etc\/php\/8.4\/fpm\/php.ini\nsed -i 's\/post_max_size = 8M\/post_max_size = 10240M\/' \/etc\/php\/8.4\/fpm\/php.ini\nsed -i 's\/memory_limit = 128M\/memory_limit = 512M\/' \/etc\/php\/8.4\/fpm\/php.ini\nsed -i 's\/;opcache.interned_strings_buffer=8\/opcache.interned_strings_buffer=16\/' \/etc\/php\/8.4\/fpm\/php.ini\nsed -i 's\/;listen.mode = 0660\/listen.mode = 0660\/' \/etc\/php\/8.4\/fpm\/pool.d\/www.conf\nsed -i 's\/pm.max_children = 5\/pm.max_children = 20\/' \/etc\/php\/8.4\/fpm\/pool.d\/www.conf\nsed -i 's\/pm.start_servers = 2\/pm.start_servers = 4\/' \/etc\/php\/8.4\/fpm\/pool.d\/www.conf\nsed -i 's\/pm.min_spare_servers = 1\/pm.min_spare_servers = 2\/' \/etc\/php\/8.4\/fpm\/pool.d\/www.conf\nsed -i 's\/pm.max_spare_servers = 3\/pm.max_spare_servers = 8\/' \/etc\/php\/8.4\/fpm\/pool.d\/www.conf\nsed -i 's\/;clear_env = no\/clear_env = no\/' \/etc\/php\/8.4\/fpm\/pool.d\/www.conf\n<\/code><\/pre>\n\n\n\n<p>\u5177\u4f53\u914d\u7f6e\u53ef\u4ee5\u53c2\u8003<a href=\"https:\/\/docs.nextcloud.com\/server\/stable\/admin_manual\/installation\/source_installation.html\">\u5b98\u7f51\u6559\u7a0b<\/a>\u3002<\/p>\n\n\n\n<p>\u7136\u540e\u6211\u4eec\u91cd\u542f PHP-FPM \u751f\u6548\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>systemctl restart php8.4-fpm.service\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"pei-zhi-nginx\">\u914d\u7f6e Nginx<\/h2>\n\n\n\n<p>\u6211\u4eec\u5047\u8bbe\u4f60\u7684 Nextcloud \u9700\u8981\u5b89\u88c5\u5728&nbsp;<code>\/var\/www\/nextcloud<\/code>&nbsp;\u76ee\u5f55\uff0c\u914d\u7f6e\u7684\u57df\u540d\u662f&nbsp;<code>cloud.example.com<\/code>\uff0c\u8bc1\u4e66\u6587\u4ef6\u4f4d\u4e8e&nbsp;<code>\/etc\/nginx\/ssl\/cloud.example.com.crt<\/code>\uff0c\u8bc1\u4e66\u79c1\u94a5\u4f4d\u4e8e&nbsp;<code>\/etc\/nginx\/ssl\/cloud.example.com.key<\/code>\uff0c\u90a3\u4e48\u6211\u4eec\u76f4\u63a5\u53c2\u8003\u5b98\u7f51\u4e0a\u7684<a href=\"https:\/\/docs.nextcloud.com\/server\/stable\/admin_manual\/installation\/nginx.html\">\u7b2c\u4e09\u65b9\u6559\u7a0b<\/a>\u914d\u7f6e Nginx\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>upstream php-handler {\n    #server 127.0.0.1:9000;\n    server unix:\/var\/run\/php\/php8.4-fpm.sock;\n}\n\n# Set the `immutable` cache control options only for assets with a cache busting `v` argument\nmap $arg_v $asset_immutable {\n    \"\" \"\";\n    default \"immutable\";\n}\n\n\nserver {\n    listen 443 ssl;\n    listen &#91;::]:443 ssl;\n    listen 443 quic;\n    listen &#91;::]:443 quic;\n\n    http2 on;\n\n    server_name cloud.example.com;\n\n    # Path to the root of your installation\n    root \/var\/www\/nextcloud;\n\n    ssl_session_timeout 1d;\n    ssl_session_cache shared:MozSSL:10m;  # about 40000 sessions\n    ssl_session_tickets off;\n\n    # curl https:\/\/ssl-config.mozilla.org\/ffdhe2048.txt &gt; \/etc\/nginx\/ssl\/dhparam\n    ssl_dhparam \/etc\/nginx\/ssl\/dhparam;\n\n    ssl_protocols TLSv1.2 TLSv1.3;\n    ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384;\nssl_prefer_server_ciphers off;\n\n    ssl_certificate \/etc\/nginx\/ssl\/cloud.example.com.crt;\n    ssl_certificate_key \/etc\/nginx\/ssl\/cloud.example.com.key;\n\n    # HSTS settings\n    # WARNING: Only add the preload option once you read about\n    # the consequences in https:\/\/hstspreload.org\/. This option\n    # will add the domain to a hardcoded list that is shipped\n    # in all major browsers and getting removed from this list\n    # could take several months.\n    add_header Strict-Transport-Security \"max-age=63072000; includeSubDomains; preload\" always; \n    add_header Alt-Svc 'h3=\":443\"; ma=86400' always;\n\n    # set max upload size and increase upload timeout:\n    client_max_body_size 10240M;\n    client_body_timeout 300s;\n    fastcgi_buffers 64 4K;\n\n    # Enable gzip but do not remove ETag headers\n    gzip on;\n    gzip_vary on;\n    gzip_comp_level 4;\n    gzip_min_length 256;\n    gzip_proxied expired no-cache no-store private no_last_modified no_etag auth;\n    gzip_types application\/atom+xml application\/javascript application\/json application\/ld+json application\/manifest+json application\/rss+xml application\/vnd.geo+json application\/vnd.ms-fontobject application\/wasm application\/x-font-ttf application\/x-web-app-manifest+json application\/xhtml+xml application\/xml font\/opentype image\/bmp image\/svg+xml image\/x-icon text\/cache-manifest text\/css text\/plain text\/vcard text\/vnd.rim.location.xloc text\/vtt text\/x-component text\/x-cross-domain-policy;\n\n    # Pagespeed is not supported by Nextcloud, so if your server is built\n    # with the `ngx_pagespeed` module, uncomment this line to disable it.\n    #pagespeed off;\n\n    # HTTP response headers borrowed from Nextcloud `.htaccess`\n    add_header Referrer-Policy                      \"no-referrer\"   always;\n    add_header X-Content-Type-Options               \"nosniff\"       always;\n    add_header X-Download-Options                   \"noopen\"        always;\n    add_header X-Frame-Options                      \"SAMEORIGIN\"    always;\n    add_header X-Permitted-Cross-Domain-Policies    \"none\"          always;\n    add_header X-Robots-Tag                         \"none\"          always;\n    add_header X-XSS-Protection                     \"1; mode=block\" always;\n\n    # Remove X-Powered-By, which is an information leak\n    fastcgi_hide_header X-Powered-By;\n\n    # Specify how to handle directories -- specifying `\/index.php$request_uri`\n    # here as the fallback means that Nginx always exhibits the desired behaviour\n    # when a client requests a path that corresponds to a directory that exists\n    # on the server. In particular, if that directory contains an index.php file,\n    # that file is correctly served; if it doesn't, then the request is passed to\n    # the front-end controller. This consistent behaviour means that we don't need\n    # to specify custom rules for certain paths (e.g. images and other assets,\n    # `\/updater`, `\/ocm-provider`, `\/ocs-provider`), and thus\n    # `try_files $uri $uri\/ \/index.php$request_uri`\n    # always provides the desired behaviour.\n    index index.php index.html \/index.php$request_uri;\n\n    # Rule borrowed from `.htaccess` to handle Microsoft DAV clients\n    location = \/ {\n        if ( $http_user_agent ~ ^DavClnt ) {\n            return 302 \/remote.php\/webdav\/$is_args$args;\n        }\n    }\n\n    location = \/robots.txt {\n        allow all;\n        log_not_found off;\n        access_log off;\n    }\n\n    # Make a regex exception for `\/.well-known` so that clients can still\n    # access it despite the existence of the regex rule\n    # `location ~ \/(\\.|autotest|...)` which would otherwise handle requests\n    # for `\/.well-known`.\n    location ^~ \/.well-known {\n        # The rules in this block are an adaptation of the rules\n        # in `.htaccess` that concern `\/.well-known`.\n\n        location = \/.well-known\/carddav { return 301 \/remote.php\/dav\/; }\n        location = \/.well-known\/caldav  { return 301 \/remote.php\/dav\/; }\n\n        location \/.well-known\/acme-challenge    { try_files $uri $uri\/ =404; }\n        location \/.well-known\/pki-validation    { try_files $uri $uri\/ =404; }\n\n        # Let Nextcloud's API for `\/.well-known` URIs handle all other\n        # requests by passing them to the front-end controller.\n        return 301 \/index.php$request_uri;\n    }\n\n    # Rules borrowed from `.htaccess` to hide certain paths from clients\n    location ~ ^\/(?:build|tests|config|lib|3rdparty|templates|data)(?:$|\/)  { return 404; }\n    location ~ ^\/(?:\\.|autotest|occ|issue|indie|db_|console)                { return 404; }\n\n    # Ensure this block, which passes PHP files to the PHP process, is above the blocks\n    # which handle static assets (as seen below). If this block is not declared first,\n    # then Nginx will encounter an infinite rewriting loop when it prepends `\/index.php`\n    # to the URI, resulting in a HTTP 500 error response.\n    location ~ \\.php(?:$|\/) {\n        # Required for legacy support\n        rewrite ^\/(?!index|remote|public|cron|core\\\/ajax\\\/update|status|ocs\\\/v&#91;12]|updater\\\/.+|oc&#91;ms]-provider\\\/.+|.+\\\/richdocumentscode\\\/proxy) \/index.php$request_uri;\n\n        fastcgi_split_path_info ^(.+?\\.php)(\/.*)$;\n        set $path_info $fastcgi_path_info;\n\n        try_files $fastcgi_script_name =404;\n\n        include fastcgi_params;\n        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;\n        fastcgi_param PATH_INFO $path_info;\n        fastcgi_param HTTPS on;\n        fastcgi_param HTTP_HOST $host;\n\n        fastcgi_param modHeadersAvailable true;         # Avoid sending the security headers twice\n        fastcgi_param front_controller_active true;     # Enable pretty urls\n        fastcgi_pass php-handler;\n\n        fastcgi_intercept_errors on;\n        fastcgi_request_buffering off;\n\n        fastcgi_max_temp_file_size 0;\n    }\n\n    location ~ \\.(?:css|js|svg|gif|png|jpg|ico|wasm|tflite|map)$ {\n        try_files $uri \/index.php$request_uri;\n        add_header Cache-Control \"public, max-age=15778463, $asset_immutable\";\n        access_log off;     # Optional: Don't log access to assets\n\n        location ~ \\.wasm$ {\n            default_type application\/wasm;\n        }\n    }\n\n    location ~ \\.woff2?$ {\n        try_files $uri \/index.php$request_uri;\n        expires 7d;         # Cache-Control policy borrowed from `.htaccess`\n        access_log off;     # Optional: Don't log access to assets\n    }\n\n    # Rule borrowed from `.htaccess`\n    location \/remote {\n        return 301 \/remote.php$request_uri;\n    }\n\n    location \/ {\n        try_files $uri $uri\/ \/index.php$request_uri;\n    }\n}\n<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<p>\u5982\u679c\u8981\u4fee\u6539\u4e0a\u4f20\u6587\u4ef6\u5927\u5c0f\u9650\u5236\uff0c\u8bf7\u6c42\u6539 Nginx \u914d\u7f6e\u91cc\u7684&nbsp;<code>client_max_body_size 10240M;<\/code>&nbsp;\u548c PHP \u914d\u7f6e\u91cc\u7684&nbsp;<code>upload_max_filesize<\/code>&nbsp;\u548c&nbsp;<code>post_max_size<\/code>&nbsp;\u53c2\u6570\uff0c\u672c\u6559\u7a0b\u4e3e\u4f8b\u662f\u4e0a\u4f20\u6587\u4ef6\u6700\u5927\u9650\u5236 10GB\u3002<\/p>\n\n\n\n<p>\u68c0\u67e5\u65e0\u8bef\u540e\u91cd\u542f Nginx \u751f\u6548<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>nginx -t\nnginx -s reload\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"an-zhuang-nextcloud\">\u5b89\u88c5 Nextcloud<\/h2>\n\n\n\n<p>\u9996\u5148\u8fdb\u5165&nbsp;<code>\/var\/www<\/code>&nbsp;\u76ee\u5f55\uff0c\u4e0b\u8f7d\u5e76\u89e3\u538b\u6700\u65b0\u7684 Nextcloud\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cd \/var\/www\nwget -O nextcloud.zip https:\/\/download.nextcloud.com\/server\/releases\/latest.zip\nunzip nextcloud.zip\n<\/code><\/pre>\n\n\n\n<p>\u7136\u540e\u6211\u4eec\u8bbe\u7f6e\u89e3\u538b\u51fa\u6765\u7684&nbsp;<code>nextcloud<\/code>&nbsp;\u6587\u4ef6\u5939\u6743\u9650\u548c PHP \u4ee5\u53ca Nginx \u5bf9\u5e94\uff0c\u8bbe\u7f6e\u4e3a&nbsp;<code>www-data<\/code>&nbsp;\u7528\u6237\uff0c\u56e0\u4e3a Debian \u4e0b\u9ed8\u8ba4&nbsp;<code>www-data<\/code>&nbsp;\u7528\u6237\/\u7528\u6237\u7ec4\u7684 uid \u548c gid \u662f 33\uff0c\u6240\u4ee5\u76f4\u63a5\u4f7f\u7528&nbsp;<code>chown 33:33<\/code>&nbsp;\u5373\u53ef\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>chown 33:33 nextcloud -R\nfind nextcloud\/ -type d -exec chmod 750 {} \\;\nfind nextcloud\/ -type f -exec chmod 640 {} \\;\n<\/code><\/pre>\n\n\n\n<p>\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u76f4\u63a5\u8bbf\u95ee&nbsp;<code>https:\/\/cloud.example.com<\/code>&nbsp;\u586b\u5165\u4f60\u914d\u7f6e\u597d\u7684\u6570\u636e\u5e93\u4fe1\u606f\u4ee5\u53ca\u7ba1\u7406\u5458\u5e10\u53f7\u5bc6\u7801\u5373\u53ef\u767b\u5f55\u4f60\u7684 Nextcloud\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"pei-zhi-redis-huan-cun\">\u914d\u7f6e Redis \u7f13\u5b58<\/h2>\n\n\n\n<p>Debian \u9ed8\u8ba4\u5b89\u88c5\u7684&nbsp;<code>redis-server<\/code>&nbsp;\u5df2\u7ecf\u7ed9\u4f60\u57fa\u672c\u914d\u7f6e\u597d\u4e86\uff0c\u53ea\u76d1\u542c\u5728\u672c\u5730&nbsp;<code>127.0.0.1<\/code>&nbsp;\u7684&nbsp;<code>6379<\/code>&nbsp;\u7aef\u53e3\uff0c\u5982\u679c\u6ca1\u6709\u7279\u6b8a\u9700\u6c42\u4e0d\u9700\u8981\u4fee\u6539\u3002<\/p>\n\n\n\n<p>\u9996\u5148\uff0c\u6211\u4eec\u628a&nbsp;<code>redis<\/code>&nbsp;\u7528\u6237\u52a0\u5165&nbsp;<code>www-data<\/code>&nbsp;\u7528\u6237\u7ec4\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>usermod -a -G redis www-data\n<\/code><\/pre>\n\n\n\n<p>\u7136\u540e\u4fee\u6539&nbsp;<code>\/var\/www\/nextcloud\/config\/config.php<\/code>&nbsp;\u6587\u4ef6\uff0c\u5728\u6700\u540e\u4e00\u884c&nbsp;<code>);<\/code>&nbsp;\u5b57\u7b26\u524d\u52a0\u5165\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>  'memcache.locking' =&gt; '\\\\OC\\\\Memcache\\\\Redis',\n  'memcache.distributed' =&gt; '\\\\OC\\\\Memcache\\\\Redis',\n  'memcache.local' =&gt; '\\\\OC\\\\Memcache\\\\Redis',\n  'redis' =&gt; \n  array (\n    'host' =&gt; '127.0.0.1',\n    'port' =&gt; 6379,\n  ),\n<\/code><\/pre>\n\n\n\n<p>\u91cd\u542f PHP-FPM \u751f\u6548\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>systemctl restart php8.4-fpm\n<\/code><\/pre>\n\n\n\n<p>\u5176\u4ed6\u7f13\u5b58\u65b9\u5f0f\u53ef\u4ee5\u53c2\u8003<a href=\"https:\/\/docs.nextcloud.com\/server\/stable\/admin_manual\/configuration_server\/caching_configuration.html\">\u5b98\u65b9\u6587\u6863<\/a>\u3002<\/p>\n\n\n\n<p>\u5982\u679c\u6ca1\u6709\u95ee\u9898\uff0c\u53ef\u4ee5\u8bbf\u95ee&nbsp;<code>https:\/\/cloud.example.com\/settings\/admin\/serverinfo<\/code>&nbsp;\u67e5\u770b\u670d\u52a1\u5668\u4fe1\u606f\u4e86\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"pei-zhi-crontab\">\u914d\u7f6e Crontab<\/h2>\n\n\n\n<p>\u6211\u4eec\u9700\u8981\u4f7f\u7528 Linux \u5185\u7f6e\u7684 cron \u6765\u8fd0\u884c\u81ea\u52a8\u5316\u4efb\u52a1\uff0c\u76f4\u63a5\u4f7f\u7528 www-data \u7528\u6237\u4fee\u6539\u5b9a\u65f6\u4efb\u52a1\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>crontab -u www-data -e\n<\/code><\/pre>\n\n\n\n<p>\u9009\u62e9\u4e00\u6b3e\u4f60\u559c\u6b22\u7684\u7f16\u8f91\u5668\u7136\u540e\u52a0\u5165\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>*\/5  *  *  *  * \/usr\/bin\/php -f \/var\/www\/nextcloud\/cron.php\n<\/code><\/pre>\n\n\n\n<p>\u8fd9\u4e2a\u547d\u4ee4\u7684\u542b\u4e49\u662f\u6bcf 5 \u5206\u949f\u6267\u884c\u4e00\u6b21 Nextcloud \u7684\u5b9a\u65f6\u4efb\u52a1\uff0c\u5177\u4f53\u53ef\u4ee5\u53c2\u8003<a href=\"https:\/\/docs.nextcloud.com\/server\/stable\/admin_manual\/configuration_server\/background_jobs_configuration.html\">\u5b98\u7f51\u6559\u7a0b<\/a>\u3002<\/p>\n\n\n\n<p>\u4fdd\u5b58\u540e\u53ef\u4ee5\u4f7f\u7528&nbsp;<code>crontab -u www-data -l<\/code>&nbsp;\u547d\u4ee4\u67e5\u770b\u5f53\u524d&nbsp;<code>www-data<\/code>&nbsp;\u7528\u6237\u4e0b\u7684\u5b9a\u65f6\u4efb\u52a1\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"an-zhuang-nextcloud-ke-hu-duan\">\u5b89\u88c5 Nextcloud \u5ba2\u6237\u7aef<\/h2>\n\n\n\n<p>\u8fd9\u91cc\u5c31\u4e0d\u518d\u8d58\u8ff0\u4e86\uff0c\u76f4\u63a5\u4ece<a href=\"https:\/\/nextcloud.com\/install\/\">\u5b98\u7f51<\/a>\u4e0b\u8f7d\u5e76\u5b89\u88c5\u5bf9\u5e94\u64cd\u4f5c\u7cfb\u7edf\u7684\u8f6f\u4ef6\u5373\u53ef\uff0c\u767b\u5f55\u7684\u65f6\u5019\u8f93\u5165\u5b8c\u6574\u7684\u7f51\u5740&nbsp;<code>https:\/\/cloud.example.com\/<\/code>&nbsp;\u5373\u53ef\u767b\u5f55\u4f60\u81ea\u5df1\u7684 Nextcloud\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/s.u.sb\/2025\/10\/20\/nextcloud_KAJxG.webp\" alt=\"Nextcloud Demo\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"nextcloud-geng-xin\">Nextcloud \u66f4\u65b0<\/h2>\n\n\n\n<p>\u5982\u679c\u4f60\u7684\u7528\u6237\u548c\u6570\u636e\u4e0d\u591a\uff0c\u76f4\u63a5\u7528\u7ba1\u7406\u5458\u8bbf\u95ee&nbsp;<code>https:\/\/cloud.example.com\/updater\/<\/code>&nbsp;\u5373\u53ef\u66f4\u65b0\u5230\u6700\u65b0\u7a33\u5b9a\u7248\u672c\u3002<\/p>\n\n\n\n<p>\u5982\u679c\u670d\u52a1\u5668\u7684\u8d1f\u8f7d\u8f83\u9ad8\u6216\u81ea\u52a8\u4e0b\u8f7d\u7f51\u901f\u8f83\u6162\uff0c\u53ef\u4ee5\u4f7f\u7528\u547d\u4ee4\u884c\u66f4\u65b0\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cd \/var\/www\/nextcloud\nsudo -u www-data php .\/updater\/updater.phar --no-interaction\n<\/code><\/pre>\n\n\n\n<p>\u5177\u4f53\u53ef\u4ee5\u53c2\u8003\u5b98\u7f51\u6559\u7a0b\uff1a<a href=\"https:\/\/docs.nextcloud.com\/server\/stable\/admin_manual\/maintenance\/update.html\">\u66f4\u65b0<\/a>\u3001<a href=\"https:\/\/docs.nextcloud.com\/server\/stable\/admin_manual\/maintenance\/upgrade.html\">\u5347\u7ea7<\/a>\u548c<a href=\"https:\/\/docs.nextcloud.com\/server\/stable\/admin_manual\/maintenance\/manual_upgrade.html\">\u624b\u5de5\u5347\u7ea7<\/a>\u3002<\/p>\n\n\n\n<p><strong>\u5207\u8bb0\u66f4\u65b0\u4e4b\u524d\u5148\u5907\u4efd\u6570\u636e\uff0c\u907f\u514d\u4e22\u5931\u91cd\u8981\u6570\u636e\u54e6\u3002<\/strong><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"nextcloud-bei-fen\">Nextcloud \u5907\u4efd<\/h2>\n\n\n\n<p>Nextcloud \u76ee\u524d\u8fd8\u662f\u4e2a\u5178\u578b\u7684 PHP + MySQL \u7a0b\u5e8f\uff0c\u6240\u4ee5\u7406\u8bba\u4e0a\u53ea\u8981\u5907\u4efd&nbsp;<code>\/var\/www\/nextcloud<\/code>&nbsp;\u76ee\u5f55\uff0c\u4f60\u7684\u6587\u4ef6\u50a8\u5b58\u76ee\u5f55 (\u9ed8\u8ba4\u5728&nbsp;<code>\/var\/www\/nextcloud\/data<\/code>) \u4ee5\u53ca MySQL \u6570\u636e\u5e93\u5373\u53ef\uff0c\u8fd9\u91cc\u4e0d\u518d\u8d58\u8ff0\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u672c\u6587\u5c06\u6307\u5bfc\u5982\u4f55\u5728 Debian \u4e0b\u5b89\u88c5\u5e76\u914d\u7f6e Nextcloud \u670d\u52a1\u7aef\u3002 \u672c\u6587\u6700\u540e\u66f4\u65b0\u4e8e 2025 \u5e74 10 \u6708 20 \u65e5\uff0c\u5728\u5982\u4e0b\u7cfb\u7edf\u4e2d\u7ecf\u8fc7\u5b8c\u6574\u7684\u624b\u5de5\u6d4b\u8bd5\uff1a \u5176\u4ed6\u7cfb\u7edf\u6ca1\u6709\u624b\u5de5\u6d4b\u8bd5\uff0c\u8bf7\u81ea\u884c\u6d4b\u8bd5\uff0c\u7406\u8bba\u4e0a\u672c\u6587\u7684\u6559\u7a0b\u540c\u65f6\u9002\u7528\u4e8e&nbsp;Debian Stable&nbsp;\u4ee5\u53ca&nbsp;Ubuntu LTS\u3002 \u4ee5\u4e0b\u64cd\u4f5c\u9700\u8981\u5728 root \u7528\u6237\u4e0b\u5b8c\u6210\uff0c\u8bf7\u4f7f\u7528&nbsp;sudo -i&nbsp;\u6216&nbsp;su root&nbsp;\u5207\u6362\u5230 root \u7528\u6237\u8fdb\u884c\u64cd\u4f5c\u3002 \u4ec0\u4e48\u662f Nextcloud\uff1f Nextcloud&nbsp;\u662f\u4e00\u5957\u7528\u4e8e\u5efa\u7acb\u7f51\u7edc\u786c\u76d8\u7684\u5ba2\u6237\u7aef\u548c\u670d\u52a1\u5668\u8f6f\u4ef6\u3002\u5176\u529f\u80fd\u548c Dropbox \u76f8\u8fd1\uff0c\u4f46 Nextcloud \u662f\u5f00\u6e90\u7684\uff0c\u4efb\u4f55\u4eba\u90fd\u53ef\u4ee5\u5728\u81ea\u5df1\u7684\u670d\u52a1\u5668\u4e0a\u5b89\u88c5\u5e76\u8fd0\u884c\u5b83\u3002 \u867d\u7136 Nextcloud \u6027\u80fd\u6bd4\u8f83\u5f31\uff0c\u4f46\u662f\u5b9e\u9645\u6d4b\u8bd5\u4e0b\u6765\u51e0\u4e2a\u4eba\u7684\u5c0f\u56e2\u961f\u7528\u7528\u4e5f\u8db3\u591f\u4e86\u3002 \u5b89\u88c5\u4e4b\u524d\u4f60\u53ef\u4ee5\u5148\u53bb\u5b98\u65b9\u7684&nbsp;Demo&nbsp;\u4f53\u9a8c\u3002 \u51c6\u5907\u73af\u5883 \u7531\u4e8e Nextcloud \u6d88\u8017\u8d44\u6e90\u6bd4\u8f83\u5927\uff0c\u4e00\u822c\u6211\u4eec\u4e0d\u5efa\u8bae\u5728 4GB \u5185\u5b58\u4ee5\u4e0b\u7684 VPS \u5b89\u88c5\uff0c\u5b98\u65b9\u63a8\u8350\u914d\u7f6e\u4e3a 512MB \u5185\u5b58\uff0c\u5b9e\u9645\u4f53\u9a8c\u4e0b\u6765\u5b89\u88c5\u5728 8GB \u5185\u5b58\u4e0a\u8dd1 Nextcloud \u4f1a\u6bd4\u8f83\u6d41\u7545\u3002 \u914d\u7f6e LEMP \u73af\u5883 \u9996\u5148\uff0c\u53ef\u4ee5\u53c2\u8003\u672c\u7ad9\u6559\u7a0b\u914d\u7f6e\u597d LEMP \u73af\u5883\uff0c\u5728\u5b89\u88c5 PHP \u7684\u65f6\u5019\uff0c\u8bf7\u9009\u62e9 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-17","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/www.yun.com.mp\/index.php?rest_route=\/wp\/v2\/posts\/17","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.yun.com.mp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.yun.com.mp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.yun.com.mp\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.yun.com.mp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=17"}],"version-history":[{"count":2,"href":"https:\/\/www.yun.com.mp\/index.php?rest_route=\/wp\/v2\/posts\/17\/revisions"}],"predecessor-version":[{"id":20,"href":"https:\/\/www.yun.com.mp\/index.php?rest_route=\/wp\/v2\/posts\/17\/revisions\/20"}],"wp:attachment":[{"href":"https:\/\/www.yun.com.mp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=17"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.yun.com.mp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=17"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.yun.com.mp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=17"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}