差别
这里会显示出您选择的修订版和当前版本之间的差别。
| 两侧同时换到之前的修订记录 前一修订版 后一修订版 | 前一修订版 | ||
| 软件:nextcloud [2025/10/22 01:14] – admin | 软件:nextcloud [2025/10/26 19:50] (当前版本) – [Nginx配置] admin | ||
|---|---|---|---|
| 行 3: | 行 3: | ||
| 网盘 | 网盘 | ||
| - | 安装环境依赖 | + | ===== 安装环境依赖 |
| <code -> | <code -> | ||
| 行 10: | 行 10: | ||
| </ | </ | ||
| - | SQL配置 | + | ===== SQL配置 |
| <code -> | <code -> | ||
| - | sudo mysql | + | # |
| - | CREATE USER 'username' | + | mysql -u root -p |
| - | CREATE DATABASE IF NOT EXISTS nextcloud CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci; | + | # |
| - | GRANT ALL PRIVILEGES ON nextcloud.* TO 'username' | + | CREATE DATABASE IF NOT EXISTS nextcloud_db CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci; |
| + | CREATE USER 'admin' | ||
| + | GRANT ALL PRIVILEGES ON nextcloud_db.* TO 'admin' | ||
| FLUSH PRIVILEGES; | FLUSH PRIVILEGES; | ||
| quit; | quit; | ||
| </ | </ | ||
| - | Nginx配置 | + | ===== Nginx配置 |
| NGINX configuration — Nextcloud latest Administration Manual latest documentation | NGINX configuration — Nextcloud latest Administration Manual latest documentation | ||
| [[https:// | [[https:// | ||
| + | |||
| + | vi / | ||
| <code nginx nextcloud.conf> | <code nginx nextcloud.conf> | ||
| 行 31: | 行 35: | ||
| upstream php-handler { | upstream php-handler { | ||
| - | server 127.0.0.1: | + | |
| - | | + | server unix:/ |
| } | } | ||
| 行 54: | 行 58: | ||
| server { | server { | ||
| - | listen 443 ssl http2; | + | |
| - | listen [::]:443 ssl http2; | + | |
| # With NGinx >= 1.25.1 you should use this instead: | # With NGinx >= 1.25.1 you should use this instead: | ||
| - | | + | listen 443 ssl; |
| - | | + | listen [::]:443 ssl; |
| - | | + | http2 on; |
| server_name cloud.example.com; | server_name cloud.example.com; | ||
| 行 67: | 行 71: | ||
| # Use Mozilla' | # Use Mozilla' | ||
| # https:// | # https:// | ||
| - | ssl_certificate | + | ssl_certificate |
| - | ssl_certificate_key /etc/ssl/ | + | ssl_certificate_key /etc/nginx/ |
| # Prevent nginx HTTP Server Detection | # Prevent nginx HTTP Server Detection | ||
| 行 241: | 行 245: | ||
| } | } | ||
| </ | </ | ||
| + | |||
| + | |||
| + | ===== Nextcloud部署 ===== | ||
| 现在下载最新 Nextcloud 版本的存档: | 现在下载最新 Nextcloud 版本的存档: | ||
| 行 255: | 行 262: | ||
| <code -> | <code -> | ||
| - | tar -xjvf nextcloud-x.y.z.tar.bz2 | + | scp .\nextcloud.zip user@127.0.0.1:/ |
| - | unzip nextcloud-x.y.z.zip | + | |
| - | sudo cp -r nextcloud /var/www | + | unzip nextcloud.zip |
| + | sudo mv ./nextcloud /var/www/ | ||
| sudo chown -R www-data: | sudo chown -R www-data: | ||
| </ | </ | ||
| + | |||
| + | 浏览器访问向导安装 | ||
| + | |||
| + | 管理员 admin | ||
| + | |||
| + | 密码 123456 | ||
| + | |||
| + | 路径默认 / | ||
| + | |||
| + | 数据库用户 admin | ||
| + | |||
| + | 数据库密码 123456 | ||
| + | |||
| + | 数据库名称 nextcloud_db | ||
| + | |||
| + | 数据库地址 localhost: | ||