千辛萬苦搭好owncloud,哪想到會遇到:Data directory (/mnt/usbdrive/owncloud/) is readable for other users. Please change the permissions to 0770 so that the directory cannot be listed by other users.
Linux基礎雖然是有的,但是chmod chown在/mnt/hgfs下都做不了任何微小的工作。無奈google:using-owncloud-with-an-ntfs-file-share,多次嘗試后終于成功,獻給每一個不愿意被百度RAPE的泥。
VMware中ubuntu14.04安裝owncloud
ubuntu1404網卡選NAT。
進入ubuntu,按照官網的命令download and install on ubuntu進行owncloud的安裝
sudo -i
wget -nv https://download.owncloud.org/download/repositories/stable/Ubuntu_14.04/Release.key -O Release.key
apt-key add - < Release.key
sh -c "echo 'deb http://download.owncloud.org/download/repositories/stable/Ubuntu_14.04/ /' > /etc/apt/sources.list.d/owncloud.list"
apt-get update
apt-get install owncloud
在ubuntu的firefox里打開http://localhost/owncloud,設置管理員用戶名密碼,數據存放目錄使用默認/var/www/owncloud/data。
在虛擬機中掛載移動硬盤并設置正確權限
確認“共享文件夾”已禁用:
在HOST(我的是windows 10)上,打開移動硬盤,建立目錄oc,并設置共享給自己(如用戶名為Yikesaiting,即windows 10上的登陸賬戶名)。該文件夾即為最后存放owncloud數據庫的datadirectory。
打開VMware中的ubuntu,在/etc/fstab中加入如下語句,將windows 10的網絡共享文件夾掛載為一個CIFS目錄:
//<ip of host>/data </location/to/put/share> cifs uid=www-data,gid=www-data,username=Yikesaiting,password=<your password>,iocharset=utf8,file_mode=0770,dir_mode=0770,sec=ntlm 0 0
其中<ip of host>是相對于虛擬機的內網ip,一般為192.168.XXX.XXX。</location/to/put/share>是掛載點,暫取/home/username/oc_username
修改owncloud的存儲目錄到移動硬盤
修改/var/www/owncloud/config/config.php由
'datadirectory' => '/var/www/owncloud/data',
變?yōu)椋?/p>
'datadirectory' => '/home/username/oc_username/data',
掛載:sudo mount -a
,并將數據轉移進去:sudo -u www-data mv /var/www/owncloud/data /home/username/oc_username
最后重啟:sudo init 6