1. 程式人生 > 其它 >部署私有云盤

部署私有云盤

部署私有云盤Nextcloud

Nextcloud外掛多,功能較強,不僅支援檔案同步,還支援日曆,通訊錄,視訊會議等等

Nextcloud特點

  • 開源

  • 各個平臺都有客戶端,方便管理

  • 功能很完善

docker 部署

#安裝docker環境
#cat > docker.sh <<EOF # step 1: 安裝必要的一些系統工具 sudo yum install -y yum-utils device-mapper-persistent-data lvm2 # Step 2: 新增軟體源資訊 sudo yum-config-manager --add-repo https://
mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo # Step 3 sudo sed -i 's+download.docker.com+mirrors.aliyun.com/docker-ce+' /etc/yum.repos.d/docker-ce.repo # Step 4: 更新並安裝Docker-CE sudo yum makecache fast sudo yum -y install docker-ce # Step 4: 開啟Docker服務 sudo service docker start EOF #docker 啟動 docker run
-d \ --name nextcloud \ -p 8000:80 \ -v /data/nextcloud:/var/www/html \ nextcloud #安裝資料庫 #yum -y install mariadb-server #systemctl restart mariadb.service #ss -tnl State Recv-Q Send-Q Local Address:Port Peer Address:Port LISTEN 0 128 *:8000 *:* LISTEN 0 50
*:3306 *:* #mysql > create database nextcloud; > show databases; MariaDB [(none)]> create user 'next'@'%' IDENTIFIED BY 'password'; Query OK, 0 rows affected (0.00 sec) MariaDB [(none)]> grant all on *.* to 'next'@'%'; MariaDB [mysql]> grant all on *.* to 'root'@'%'; MariaDB [mysql]> grant all on *.* to 'oc_admin'@'%'; MariaDB [mysql]> grant all on *.* to 'oc_admin1'@'%'; MariaDB [mysql]> grant all on *.* to 'oc_admin2'@'%'; MariaDB [mysql]> grant all on *.* to 'oc_admin3'@'%'; MariaDB [mysql]> grant all on *.* to 'oc_admin4'@'%'; MariaDB [mysql]> grant all on *.* to next@'%' identified by 'password' with grant option; Query OK, 0 rows affected (0.00 sec) MariaDB [nextcloud]> flush privileges; Query OK, 0 rows affected (0.00 sec) #瀏覽器訪問IP:8000輸入使用者名稱和密碼,資料庫即可 建立使用者名稱/密碼 admin/admin 資料庫使用者名稱: next 資料庫密碼: password 資料庫名: nextcloud 地址埠: 10.0.0.117:3306

 

報錯資訊

`ERROR 1045 (28000): Access denied for user 'root'@'10.0.0.127' (using password: NO)
報錯原因: 未授權
解決:
MariaDB [(none)]> grant all on *.* to 'next'@'%';
MariaDB [mysql]> grant all on *.* to 'root'@'%';
MariaDB [mysql]> grant all on *.* to 'oc_admin'@'%';
MariaDB [mysql]> grant all on *.* to 'oc_admin1'@'%';
MariaDB [mysql]> grant all on *.* to 'oc_admin2'@'%';
MariaDB [mysql]> grant all on *.* to 'oc_admin3'@'%';
MariaDB [mysql]> grant all on *.* to 'oc_admin4'@'%';
MariaDB [mysql]> grant all on *.* to next@'%' identified by 'password' with grant option;
MariaDB [nextcloud]> flush privileges;
 

 

訪問瀏覽器

http://10.0.0.117:8000

 

 

 

 

 

 

 

 

官方連結

https://docs.nextcloud.com

https://docs.nextcloud.com/server/latest/admin_manual/installation/source_installation.html