Tuesday, February 16, 2016

Owncloud, your own dropbox-like storage server installed in your home or business. Imagine something just like dropbox but without the monthly fees!

This runs on linux.
Before you run off in fear because your a Windows person. Check my other post on a Windows alternative. Remember, you can always install linux in a virtual machine and run it in a virtual environment in Windows! Take a look at virtualbox if you your interested to run owncloud in a virtual linux  environment ON Windows ! :)

BEFORE YOU COMMIT TO INSTALLING, PLEASE SEE MY IMPORTANT NOTES HIGHLIGHTED JUST LIKE THIS ONE!


So what's the point?


  1. Chuck all your data in one single location.
  2. Avoid data spread all over the place on multiple drives.
  3. Access data from any location
  4. Share data to others
  5. Share data to others but don't let them alter that data
  6. Let data shared to re-shared.
  7. Store your data in your own home or premises
  8. If you're paranoid about your data being lost to a third party organisation or falling into the wrong hands, store it yourself
  9. Sync your data to multiple devices
  10. Access your data from a web portal running on your own premises
  11. Avoid on-going fees to a third party cloud provider such as dropbox, google drive and others
  12. Storage limited only to the size of your drive.
  13. Mount separate and physical drives to the system and make them available to users
  14. etc etc


Intro:
If you are a newbie at all this server configuration stuff, I highly recommend the install method of using a bitnami stack. The bitnami guys really make things simpler and even pro's are opting to take this route. You'll even be able to install on an enterprise cloud server such as Oracle, Microsoft, Google and the like. All the information is there. This post however is all about hosting owncloud yourself on your own premises.


First, I recommend manually setting your OS (Operating System) to use an IP address of your choosing. ie Do not configure your OS to acquire the IP address automatically  as it is quite likely that one day your OS will decide to use a different IP address and from that point on you won't be able to access the server. Re-boot your system and make sure your system is coming back online with the manually configured IP address. Check for Internet access while your at it.

At some point the installation wizard is going to ask where you want owncloud to be installed. You need to choose a folder. For me my OS is installed on a very small drive. NOT actually enough space to host owncloud together with all the files I intend to sync. I could install owncloud entirely on the USB drive and actually this is what I would prefer but in my experience, acceptable speed of syncing can be unpredictable so I'm going to install on the OS drive which is an SSD drive and add extra storage within ownclouds administration portal page. The extra storage will be a non-SSD external USB drive pluged into a USB 3.0 port. By doing this I get reasonable speed with default settings. I won't bugger around with cache memory and performance tweeks. 
If your taking the install route that I'm taking then DO make sure there is enough space to accommodate deleted files.. ie ownclouds trash bin (which can be emptied at will through the admin page).

A few things to consider...

    1. Data transfer speed. If your drive can handle USB 3 then obviously you'll want the drive to be plugged into a USB 3 port. Choose the fastest USB port your system has. By the time you get to read this, USB 4 or even 5 might be available.
    2. An SSD drive might be able to give you faster transfers.
    3. Speed?? perhaps your network will run slower than your drives can read & write anyway so drive speed might not be an issue.
    4. etc etc.. You get the picture!

  • Head over to https://bitnami.com/ and download the bitnami stack. Im going for the 64bit version. Can't actually remember if there is a 32bit version.
  • Once you have downloaded the install file you'll need to make sure it's able to be executed else when you double click it to install you'll probably get errors and nothing much will happen. Using your file manager just right click the downloaded file, choose properties & follow your nose to make it executable. This is key.!
  • Now double click to install
  • As mentioned already the install wizard is going to ask you where you want to install owncloud. Go back and read the section on that!
  • The install wizard is also going to ask you to populate some fields. Just follow your nose. Enter some login details etc. Keep it simple for now. You can always make amends later on. Once you see the kewlness of owncloud you'll probably want to change the login details anyway!
  • The install will ask you to fill in some smtp email sending details used for username recovery and notification purposes. I highly recommend creating a special email account for this purpose and NOT to use your personal address. That way if owncloud emails you then it won't appear to come from yourself. Choose a fictitious name that owncloud can use. Emails sent from owncloud can then present to users email coming from this account. Possible bug on this date... Once email sending had been set and working, changing to a different email account proved to be problematic. Another reason to put in the effort now and use an account NOT of your own. If you use your own personal account then decide to change back for reasons just mentioned, you might run into problems as I have!
  • Eventually the install wizard will also ask you for a hostname. I would suggest making this the IP address of the computer owncloud will run on so the server can be accessed from outside the local network. Last time I used the localhost address of 127.0.1.1 , owncloud only allowed me to access from the same machine. It's for security reasons! Choose the IP address you configured at step #1.This address will be added to a trusted domains list in a configuration file meaning it can be altered later on AND other domains can be added! Try get it right first time around so you won't be disappointed. Last I checked this configuration file was located in yourServerFolder/apps/owncloud/htcdocs/config/config.php
  • Once installation has completed, look in the installed folder that you chose and look for the file named something like  manager-linux-x64.run and double click to run. Once you see the bitnami stack window come up, choose the Manage Servers tab and start both the database and apache server. On the same computer launch your browser and go to http://localhost:8080 and follow your nose and try login to the web portal.
  • Have a play around. Figure out how to add and remove users and try dragging some files into the browser window to upload some files. Also download!
  • Now try from another computer, launch a browser and go to http://xxx.xxx.xxx.xxx:8080/owncloud where xxx etc is the IP address of the computer where owncloud is running. All good????
  • If your wanting to use a domain name resolution to an IP address such as http://yourDomain.com:8080/owncloud then your going to need to edit the config.php file already mentioned in this post. Look for the listed array of domains and then add your domain to the list. Remember to bump up the array number! :)


  • Referring to the image above, you might enter owncloud.yourOwnDomain.com:8080 for example. Save and restart server.
  • For remote access your going to need to open a pinhole in your router and configure port forwarding etc.
  • You might end up with the pain of needing a different URL depending if your on the same local network as owncloud or if your on an a different internet connection which is likely the case for domestic users. This won't be a big deal if your installation is offsite in a remote location and your internet connection is always different from that of owncloud. If you want to solve this issue and use the same URL regardless, have a google for a router that supports NAT-Loopback! :) Thats what I'm using.
  • Go visit https://owncloud.org/ to download a sync client onto your computer, phone, tablet or what-have-you. This is a client-app similar to what dropbox might provide. It keeps files synced between the device and owncloud. The android client is great. You can configure it to sync pictures back to your server the instant you take a photo!
  • For linux users running the client? A key piece of information I have discovered depending on client version and OS... If your client is syncing but you can't see the icon in the system tray try the following??? 

    1. Check your applet settings to ensure the icon will be seen when shown??? ie, it may be there  but your applet tray may be poorly adjusted to show it. Using Skype to display it's icon is a good place to start.
    2. Check the checkbox is checked in the client settings under [General] tab that it will launch at Startup.
    3. The client should be starting up automatically when you start your computer. If the icon is not there just check that syncing is indeed working! If it is??? Then you probably need to set a delay at before the client starts at boot time. It's easy. Again depending on version of your OS. For linux Mint Mate I click the menu. Look for the search bar and enter in Start. You'll be looking for the Startup Applications in the menu. Look for the owncloud client and If your lucky you will have an option there to insert a delay. If you do have this option??? Insert something like 20 seconds. Reboot the PC and hopefully you'll magically have the icon present!! (after 20 seconds of course) NOTE: I have also discovered that at any time you add an account to the sync client then that delay will annoyingly get reset back to zero then you loose the icon again. Hopefully these things will get resolved over time with OS updates, client updates etc etc. If you don't have the delay option then your going to need to create a delay using old-school techniques. I won't go into that here. Google it if you need to.

  • IMPORTANT NOTE: If you're getting a very low maximum upload limit of around 500M using the web portal, you can increase this limit. So why the hell is it limited anyway? Well it's actually imposed by the apache web server and not really owncloud! To increase... open the file installdir/apps/owncloud/conf/htaccess.conf and look for...
    • <IfModule mod_php5.c>
      php_value upload_max_filesize 513M
      php_value post_max_size 513M
      php_value memory_limit 512M
      ...
    • Experiment with what-ever settings you want. Bitnami's wiki is stating to try changing to 2000M for all 3 settings. Restart the server. Now login to owncloud as an admin and go to the admin page. Check if the max upload limit setting is reflecting your new settings. Now try uploading a large file!
        I entered 16000M and the portal admin page is now indicating almost 16Gig max upload. More than enough for me! At the time of writing I have only tested an upload of 1.7Gig working brilliantly! Will update this post when I get to test something much larger!
  • IMPORTANT NOTE: There appears to be a limit of 100 files that can be uploaded in one-go when using the web portal. ie... when you drag a folder containing more than 100 files, you don't get get them all! This is NOT a problem when using the sync client. The annoying thing is, you might not have sufficient drive space at your client computer. If anyone out there has a solution to this, please share with a comment, especially if you have installed via a bitnami stack. Use a WEBDAV client if you don't want to go through the web portal OR use the sync client! Owncloud has some info on WEBDAV
  • IMPORTANT NOTE: If you consider file sync integrity important like I do then I recommend you treat the web portal as a second choice to get files uploaded. There seems to be issues uploading really large files and large quantities of files via the web portal. Just Google the issue and you'll see what I mean.
  • Follow your nose from here-on and enjoy
  • If you're using any USB drives in your configuration and have issues with the hard-drive dis-mounting, it could be one of the following...
    • The USB port of your computer drive can't provide the power to the drive and so the drive powers down. Try a powered USB hub.
    • Some drives can power down when idle after a certain period which can in turn cause the computer to dis-mount the drive. All you have to do is create some periodic activity to keep it awake. If you're installing some other server to access this same drive, then often the processes from such apps activity is enough to keep it alive and mounted! Note: 9 times out of 10 this won't be a problem for you as it hasn't been for me but I have seen it!
Cheers

No comments:

Post a Comment

Kotlin (Programming language)

Todo