千辛萬苦搭好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基礎(chǔ)雖然是有的樟遣,但是chmod chown在/mnt/hgfs下都做不了任何微小的工作缤骨。無奈google:using-owncloud-with-an-ntfs-file-share族操,多次嘗試后終于成功停忿,獻(xiàn)給每一個不愿意被百度RAPE的泥。
VMware中ubuntu14.04安裝owncloud
ubuntu1404網(wǎng)卡選NAT可婶。
進(jìn)入ubuntu沿癞,按照官網(wǎng)的命令download and install on ubuntu進(jìn)行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,設(shè)置管理員用戶名密碼矛渴,數(shù)據(jù)存放目錄使用默認(rèn)/var/www/owncloud/data椎扬。
在虛擬機(jī)中掛載移動硬盤并設(shè)置正確權(quán)限
確認(rèn)“共享文件夾”已禁用:
在HOST(我的是windows 10)上,打開移動硬盤具温,建立目錄oc蚕涤,并設(shè)置共享給自己(如用戶名為Yikesaiting,即windows 10上的登陸賬戶名)铣猩。該文件夾即為最后存放owncloud數(shù)據(jù)庫的datadirectory揖铜。
打開VMware中的ubuntu,在/etc/fstab中加入如下語句达皿,將windows 10的網(wǎng)絡(luò)共享文件夾掛載為一個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>是相對于虛擬機(jī)的內(nèi)網(wǎng)ip天吓,一般為192.168.XXX.XXX贿肩。</location/to/put/share>是掛載點(diǎn),暫取/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
龄寞,并將數(shù)據(jù)轉(zhuǎn)移進(jìn)去:sudo -u www-data mv /var/www/owncloud/data /home/username/oc_username
最后重啟:sudo init 6