Monday, July 13, 2015

OwnCloud

Let me begin with the following scenario,

I was looking for a way to backup off site computers' data (not connected to any active directory domain controllers) but still connected to our main network via VPN tunnels.

After discussing this issue with another "techie" he asked if I had heard about OwnCloud, a free version based on Drop Box. So I decided to give this a try.

I will go through the commands I issued and results:

My Scenario, I have VMWare installed and setup a Linux Server (Ubuntu 14.04 LTS). I will no go through the setup of this server as other environments will be different in other situations.

My virt server setup is 500 gb for storage, 4 gig virt memory and 2 cpu's assigned to it.

While going through the setup of Ubuntu 14.04, I did install LAMP, let the server assign ip address via DHCP, also setting passwords for main users, mysql root password. After the setup of Ubuntu finished, I wanted to make sure updates were in place so I issued the following commands.

$ sudo apt-get update

$ sudo apt-get dist-upgrade

when finished I did the following to reboot

$ sudo shutdown -r now

Most of the following commands I used are based on other web sites' how-to's. I am fairly new to Linux and the following sites were GREAT at helping me through the install steps.

http://www.windohs.co.za/install-owncloud-ubuntu-14-04-lts/
http://sharadchhetri.com/2015/04/26/install-owncloud-8-on-ubuntu-server-14-04/
https://doc.owncloud.org/server/8.0/admin_manual/installation/installation_wizard.html

read the tutorials on each site, all have good information

My commands were as follows ( I did a history command and pasted below)

To see what version of apache was installed
    4  apache2 -v
    5  apachectl -v

This command was to install (again) apache with the Maria DB which replaced Mysql use with apache2. Not sure I really needed to do this, could have stayed with MySql, but since I was a "newbie" for this install, I just followed the instructions listed. I believe if you use the installed version of MYSql from LAMP install, you will have the options later with OwnCloud setup to choose which database you want to use, since I installed (Re-installed) apache2 with the MariaDB, with was the option listed later.

    6  sudo apt-get install apache2 mariadb-server libapache2-mod-php5


This installed - updated PHP
    7  sudo apt-get install php5-gd php5-json php5-mysql php5-curl
    8  sudo apt-get install php5-intl php5-mcrypt php5-imagick


Downloaded OwnCloud software from their website
    9  wget https://download.owncloud.org/community/owncloud-8.1.0.tar.bz2

Figured what directory I was currently in, and the "ls" command was to verify the file existed
   10  pwd
   11  ls

This command "unzipped" the file I had previously downloaded into its' own file owncloud
   12  tar -xjf owncloud-8.1.0.tar.bz2 

ls command to verify new file location and contents
   13  ls
   14  cd owncloud/
   15  ls
   16  cd ..

This command copies the owncloud directory into the root of apache2
   17  sudo cp -r owncloud /var/www/

From here I needed to create the owncloud.conf file for apache2, so I changed directory to the /etc/apache2 directory and then changed directory into the conf-available directory ( this could have been done all with one command)
   18  cd /etc/apache2/
   19  ls
   20  cd conf-available/
   21  ls
This is the creation of the owncloud.conf file, which I copied the information listed below into this file.


22  sudo nano owncloud.conf
Alias /owncloud "/var/www/owncloud/"
<Directory "/var/www/owncloud">
    Options +FollowSymLinks
    AllowOverride All
</Directory>
  While sitll in the nano program I issued cntrl 0 to write the file, and cntrl X to exit the nano program

This command created links
   23  ln -s /etc/apache2/conf-available/owncloud.conf /etc/apache2/conf-enabled/owncloud.conf
   24  sudo ln -s /etc/apache2/conf-available/owncloud.conf /etc/apache2/conf-enabled/owncloud.conf

I issued the following command - a2enmode is if you are going to use SSL connections
   25  a2enmod rewrite (didnt work,, needed to be root)
   26  sudo a2enmod rewrite
Needed to restart apache
   27  sudo service apache2 restart

When I tried to browse to http://my ip address/owncloud - I received error messages about not having permissions to write to the directory so I did more research and issued the following:

   28  sudo chown -R www-data:www-data /var/www/owncloud/
   29  sudo find /var/www/owncloud/ -type d -exec chmod 750 {} \;
   30  sudo find /var/www/owncloud/ -type f -exec chmod 640 {} \;

From there.. all was well and I was able to finish the install supplying admin username and password,
configure the data folder and set the username and password for the database.

There are many websites that will go into further detail about configuring and setup of Own Cloud than what I have listed here,, some much simpler and some GREATLY detailed. READ, READ, READ before trying to install and don't get frustrated. My steps listed above worked for me and now I need to setup user accounts for login, get the clients downloaded and installed on the remote computers,, if I have more comments I will post follow ups.

Hope this helps someone..

biz






0 Comments:

Post a Comment

<< Home