介绍
官网:https://nextcloud.com/
nextcloud是一个私有云网盘,支持davfs远程挂载,手机客户端等
部署
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
| version: '2' volumes: nextcloud: db: services: nextcloud-db: image: mariadb:10.5 container_name: nextcloud-db restart: always mem_limit: 2000M command: --transaction-isolation=READ-COMMITTED volumes: - /data/nextcloud-db:/var/lib/mysql environment: - MYSQL_ROOT_PASSWORD=moxigame - MYSQL_PASSWORD=moxigame - MYSQL_DATABASE=nextcloud - MYSQL_USER=nextcloud nextcloud: image: nextcloud container_name: nextcloud restart: always mem_limit: 2000M ports: - 9091:80 links: - db volumes: - /data/nextcloud:/var/www/html environment: - MYSQL_PASSWORD=moxigame - MYSQL_DATABASE=nextcloud - MYSQL_USER=nextcloud - MYSQL_HOST=nextcloud-db
|
配置
存储目录:/data/nextcloud/
上传文件位置:/data/nextcloud/data/登录用户名/files/
全局配置文件:/data/nextcloud/config/config.php
添加多域名认证:
1 2 3 4 5 6 7 8 9 10
| vim /data/nextcloud/config/config.php # 修改前: array ( 0 => '192.168.40.100:9091', ), # 修改后: array ( 0 => '192.168.40.100:9091', 1 => '192.168.40.200:9091', ),
|
远程挂载目录
1 2 3 4 5 6 7 8
| yum install davfs2 -y usermod -aG davfs2 root mkdir ~/.davfs2 cp /etc/davfs2/secrets ~/.davfs2/secrets chown root:root ~/.davfs2/secrets chmod 600 ~/.davfs2/secrets echo "/data/nextcloud-davfs 账号 密码" >> ~/.davfs2/secrets mount -t davfs http://10.0.1.120:9091/remote.php/dav/files/root/FrontStatic/ /data/html/game.moxigame.cn/FrontStatic
|