????最近在考虑在PVE上使用开源云盘,开源NAS,整合成一个完整的解决方案,目标是可以在生产系统上使用。结合桌面云,提供云盘和NAS功能,统一用户账号,就能提供一个完整的解决方案,还是比较有价值的。

总体思路:

????1、在PVE上创建OMV虚拟机(OpenMediaVault)

????2、将PVE上的NFS盘提供给OMV作为存储资源池;

????3、在PVE上安装nextcloud (LAMP结构)

? ??


一、安装OMV??

????首先,下载OMV安装镜像,下载地址:

????http://www.lpd.5334466.com/project/openmediavault/5.3.9/openmediavault_5.3.9-amd64.iso

????安装过程和安装debian系统差不多,OMV的底层就是debian系统;

????安装完成后,直接使用IP地址就可以登陆。

????web初始账号密码是:admin/openmediavault

????




手工安装:

本想通过snap的方式进行安装,但是由于强国网络的原因安装过程碰到一些问题,果断放弃。最后采用最原始和可靠的方法,手工安装!

手工安装,参考:

http://www.zyy55.com/410/server/stable/admin_manual/installation/example_ubuntu.html

注意ubuntu20对应的php默认版本是7.4?:
apt-get?install?apache2?mariadb-server?libapache2-mod-php7.4
apt-get?install?php7.4-gd?php7.4-json?php7.4-mysql?php7.4-curl?php7.4-mbstring
apt-get?install?php7.4-intl?php-imagick?php7.4-xml?php7.4-zip

安装完成之后,检查apache2、php和maridb是否安装正常:

1、检查apache2:?
systemctl?status?apache2


2、检查mariadb:
systemctl?status?mariadb
3、检查php:
php?-m


下载nextcloud软件包:nextcloud-18.0.4.zip ,下载地址是:

http://www.ib911.com/578/server/releases/nextcloud-18.0.4.zip

下载完成之后上传到服务器/var/www/目录上,解压:

cd?/var/www?&&?unzip?nextcloud-18.0.4.zip

配置apache,以下内容,参考:

http://www.vgl.bo611.com/server/stable/admin_manual/installation/source_installation.html

#?vi?/etc/apache2/sites-available/nextcloud.conf
Alias?/nextcloud?"/var/www/nextcloud/"
<Directory?/var/www/nextcloud/>
??Require?all?granted
??AllowOverride?All
??Options?FollowSymLinks?MultiViews
??Satisfy?Any
??<IfModule?mod_dav.c>
????Dav?off
??</IfModule>
</Directory>

root@nextcloud:/var/www#?a2ensite?nextcloud.conf
Enabling?site?nextcloud.
To?activate?the?new?configuration,?you?need?to?run:
??systemctl?reload?apache2
root@nextcloud:/var/www#?systemctl?reload?apache2
root@nextcloud:/var/www#?a2enmod?rewrite
Enabling?module?rewrite.
To?activate?the?new?configuration,?you?need?to?run:
??systemctl?restart?apache2
root@nextcloud:/var/www#?systemctl?reload?apache2
root@nextcloud:/var/www#?
root@nextcloud:/var/www#?a2enmod?headers
Enabling?module?headers.
To?activate?the?new?configuration,?you?need?to?run:
??systemctl?restart?apache2
root@nextcloud:/var/www#?a2enmod?env
Module?env?already?enabled
root@nextcloud:/var/www#?a2enmod?dir
Module?dir?already?enabled
root@nextcloud:/var/www#?a2enmod?mime
Module?mime?already?enabled
root@nextcloud:/var/www#?

#?chown?-R?www-data:www-data?/var/www/nextcloud/
#?systemctl?restart?apache2


接下来,就可以看到NextCloud的初始化安装界面了:



初始化安装nextcloud:

创建数据库:

create?database?nextcloud?character?set?utf8;?
create?user?nextcloud@localhost?identified?by?'nextcloud';?
grant?all?privileges?on?nextcloud.*?to?nextcloud@localhost?identified?by?'nextcloud';?
flush?privileges;?
exit;

将数据库相关信息填入:

安装手机客户端:

安卓nextcloud客户端下载:

http://www.gcg.ya822.com/zh_Hans/packages/com.nextcloud.client/

安卓nextcloud?talk客户端下载:

http://www.ib128.com/14/en/packages/com.nextcloud.talk2/


苹果手机可以直接在APP?store里面下载安装,直接搜索:?nextcloud ,可以找到nextcloud和nextcloud?talk?

幕后花絮:

安装ubuntu20的时候,发现ubuntu居然可以选择各种snap安装,其中就包括NextCloud的snap安装。

本来想使用snap来安装和管理nextcloud。熟悉一下snap的简单用法:

参考官网教程:http://emb.ib911.com/845/docs/getting-started

snap list? #列出软件包

snap find nextcloud?????#查找nextcloud

snap install nextcloud????#安装nextcloud,默认的channel是stable

snap install --channel=edge?nextcloud? #指定channel


snap info nextcloud????#查看nextcloud信息


由于强国网络的原因,访问不了snap相关的安装源,在执行:snap install nextcloud? 命令的时候提示网络错误,果断放弃。



?曾考虑过在debian10上安装NextCloud,? ?debian10的下载地址:

????http://www.fxs.sbw8822.com/debian-cd/current/amd64/bt-dvd/

参考的相关网站:

安装OMV-Extra:?http://emb.ib911.com/p/4a0aa7e48515

安装nextcloud:http://emb.ib911.com/953/server/18/admin_manual/installation/installation_wizard.html

你的开源 NAS 系统:?http://www.mzv.gan225.com/p/138254689

OpenMediaVault:http://www.rbx.ib377.com/? OMV

搭建家庭 NAS 服务器有什么好方案???http://emb.ib911.com/590/question/21359049

nextcloud官网:??http://www.vig.cao748.com/

seafile官网:http://www.han.8221144.com/home/

LDAP+nextcloud:?http://www.ib911.com/905/2839.html