Showing posts with label owncloud. Show all posts
Showing posts with label owncloud. Show all posts

Friday, January 5, 2018

Goodbye Owncloud, Hello Seafile

I had been an OwnCloud user for several years now. The En0ch team's OwnCloud VM made it easy to deploy and get setup in no time. My configuration was perhaps somewhat unique with the server being a hosted VM and the files being stored on a NTFS drive shared through a CIFS Mount to the VM. Performance was less than stellar, but it worked! For my home needs anyway.

Recently we had a power outage in my neighborhood (a new neighborhood, so this was certainly not the first) and every time this happened, OwnCloud would crash hard. I was always surprised at how much work it took for me to get the service back up and running. I was on the latest stable 9.x build for some time (I think 10.0.4 is the latest at the time of this writing). For a while I had been thinking it was time to either wipe it all and start new, or find a new solution. After this most recent power outage, I figured it was time to start fresh AND look for a new solution.

I soon discovered Seafile and thought the initial configuration looked simple to setup. It's friendly integration with Let's Encrypt and modern UI were also intriguing.

After 30 minutes I had seafile up and running on my LAN. It was extremely simple following their documentation. It wasn't until I tried to enable HTTPS over WAN that I ran into some challenges, but once that was taken care of, I've been able to explore the product more.

Over my own experience with OwnCloud, Seafile is significantly faster. From syncing, to downloading, to streaming media - the overall experience is quite pleasant. It even works well for sharing public download and upload links, which was one of the most useful features of a self-hosted cloud file share.

Here are some of the tricks to my setup I had to configure:

Environment


  • Seafile 6.2.3 on Ubuntu Server 16.04 VM in VMware Workstation (hosted on Windows 10)
  • Storage is 2TB NTFS WD Passport configured as a Shared Folder to the Guest OS via Workstation
  • MySQL DB since storage is on NTFS (per user docs)
  • Let's Encrypt SSL Cert
  • NGINX reverse proxy


The first challenge was making it so I didn't have to run the seafile.sh and seahub.sh services with sudo. Because I'm using shared folders in Workstation, I wasn't the 'owner' of the data folder that get's configured and the services would fail to start unless ran with sudo. I found that if I opened
/etc/init.d/vmware-tools
and used my own GID and UID, it would mount the HGFS share properly and I could start the services without sudo

# Mount all hgfs filesystems
vmware_mount_vmhgfs() {
  if [ "`is_vmhgfs_mounted`" = "no" ]; then
    if [ "`vmware_vmhgfs_use_fuse`" = "yes" ]; then
      mkdir -p $vmhgfs_mnt
      vmware_exec_selinux "$vmdb_answer_BINDIR/vmhgfs-fuse \
         -o subtype=vmhgfs-fuse,allow_other,uid=1000,gid=1000 $vmhgfs_mnt"
    else
      vmware_exec_selinux "mount -t vmhgfs .host:/ $vmhgfs_mnt -o uid=1000,gid=1000"
    fi
  fi
}

The second biggest challenge was getting my nginx configuration right. I found that when I would enter my DDNS address for the server, I would be directed to my router's login - I wasn't getting passed through to the server itself. You can read more about the symptoms in the Seafile Forums. Long story short, I was missing some information shared in the Sample configuration file from the docs. Read those buggers carefully!

Whatever your self-hosted cloud storage provider is (OwnCloud, Seafile, NextCloud, etc), we can at least all agree that we're glad to be off of the big brother alternatives!
Share:

Friday, May 29, 2015

Using OwnCloud with an NTFS file share [Updated]

Trying to use NTFS with your OwnCloud server? You may be running into some challenges.

My setup

I'm running OwnCloud 8 server in a Linux Mint VM (VMware Workstation) for personal use. It uses a USB 3.0 2TB drive formatted as NTFS and it works pretty darn well.

I won't be going over how to setup OwnCloud server in Ubuntu - if you're interested in that, here's a great guide by our friends over at Noobs Lab (I highly recommend using MySQL or any other database solution over the included SQLite.. you will have major performance issues if you use SQLite)

The reason I wanted to go this route with my configuration is because I can have a small (~20GB) Ubuntu Server utilizing a larger external drive that can be easily read by both my Linux Server, as well as my Windows host machine. Smaller VMs means more internal space on my host machine!

At first I thought I could simply "pass through" my drive to the VM for hosting my personal cloud, similar to how I configured my Plex Server. Unfortunately the system was having trouble recognizing the pass-through (even though file syncing actually worked when manually copying files to the share.. very strange). I would see an error similar to the one below:



Data directory (/mnt/hgfs/owncloud/data) is readable by other users.

Please change the permissions to 0770 so that the directory cannot be listed by other users.

I was unable to change the permissions on the NTFS mount when it was configured this way.

Through researching the issue and the options available, I decided the easiest method to continue to use NTFS with this setup is to create a Windows share on my owncloud data folder, and mount it as a CIFS share to the OwnCloud server.

What you'll need

  1. Host machine with VMware Workstation (or similar software)

  2. OwnCloud server in a Ubuntu-based Virtual Machine (~20gb vm)

  3. External USB 3.0 Drive formatted as NTFS

  4. Patience and determination!
On to the how-to:

I should preface this section: this setup works for me and my needs, which is a single-user personal setup. This is not recommended for a multi-user, production configuration.

  1. Remove any VMware Workstation-based pass through you have configured for the NTFS drive. This may require you to power off the VM and delete the pass through.

  2. On the host side (in my case, Windows 8.1 Windows 10) create a local user account dedicated for owning the share. This will be used later when we mount it to Linux. In my example, ocadmin

  3. On the host side, create a normal share on the folder you'll be using as the owncloud data folder (right click, properties, Sharing tab, Share...) and give full permissions to the user account you created. This should create a share location similar to \\hostname\data

  4. Now login to the OwnCloud server, edit your /etc/fstab using vi, or gedit, or what have you. At the bottom of the file, add an entry that looks like this://<ip of host>/data </location/to/put/share> cifs uid=www-data,username=ocadmin,password=<your password>,iocharset=utf8,file_mode=0770,dir_mode=0770,sec=ntlm 0 0Tips:<ip of host> This is the IP of the machine running Workstation
    </location/to/put/share> This is where the share will be mounted to the Linux OwnCloud server. This could be your Linux Home folder, desktop, documents folder.. the options are endless... endless
    www-data is the default OwnCloud server account running the owncloud service
    ocadmin/password is the local host machine account we careated earlier

  5. Now we need to make OwnCloud aware of the location we want it to use for storing files. Edit the config.php file to include the you typed above.sudo vi /var/www/owncloud/config/config.phpModify the 'datadirectory' field to your new location so it reads something like:'datadirectory' => '/var/www/owncloud/data',

    Save and close this file.

  6. Now in the terminal, type sudo mount -a and ensure there are no errors mounting the share we configured in fstab.

  7. Give your Linux system a quick reboot and you should no longer receive the errors at the top of this post when accessing your OwnCloud URL.
[Update, May 13 2016]

If you've followed this method and are planning on an upgrade from OC8 to OC9, be sure to read the OC Upgrade documentation very carefully as it states, "When using an NFS mount for the data directory, do not change its ownership from the default. The simple act of mounting the drive will set proper permissions for ownCloud to write to the directory. Changing ownership as above could result in some issues if the NFS mount is lost."

Did this post help you? Let me know in the comments!
Share: