How to install Owncloud 6 in Ubuntu 13.10 Server

In this tutorial we will learn,how to install Owncloud 6 in Ubuntu 13.10 Server.Recently, the Owncloud community has released its new verison called Owncloud 6. Owncloud is one the best alternative for Dropbox and Google Drive. You can self host the Owncloud very quickly in short span of time.You can access,share and sync the data from owncloud from computers and mobile devices.

Detail of Server in which practical is done

Operating System: Ubuntu 13.10 Server editon
Operating System Architecture: x86_64
IP Address: 192.168.56.102

To install Owncloud 6 in Ubuntu 13.10,follow the given below steps

Step 1: Become a superuser

Login into Ubuntu System.Open the terminal and become a superuser by typing given below password

sudo su -

Step 2: Add Owncloud repository information in Apt source list file

Run the below command to add Owncloud repo URL in Apt source list file

apt-get install -y wget

sh -c "echo 'deb http://download.opensuse.org/repositories/isv:/ownCloud:/community/xUbuntu_13.10/ /' >> /etc/apt/sources.list.d/owncloud.list"

wget http://download.opensuse.org/repositories/isv:ownCloud:community/xUbuntu_13.10/Release.key

apt-key add - < Release.key  

apt-get update

Step 3: Install Web Server,Database Server,Owncloud package and PHP 5

Run the below given command to install apache,mysql-server,owncloud and php version 5. While installation it will ask to give new password for MySQL root user.Hence give new MySQL root password while installation.

apt-get install owncloud apache2 mysql-server php5 php5-mysql

Step 4: Edit the apache2.conf file

First take the backup of apache2.conf file,

cp -p /etc/apache2/apache2.conf /etc/apache2/apache2.conf.orig

Now edit the apache2.conf, find the line <Directory /var/www> .Now replace AllowOverride None to AllowOverride All as given below.
Note: I have edited with vim editor,use your favorite editor

vim /etc/apache2/apache2.conf

<Directory /var/www/>
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
</Directory>

Step 5: Edit the owncloud.conf file

First we will take backup of owncloud.conf file. Clear all the contents from /etc/apache2/conf.d/owncloud.conf and paste below given content.

cp -p /etc/apache2/conf.d/owncloud.conf  /etc/apache2/conf.d/owncloud.conf.orig
vim /etc/apache2/conf.d/owncloud.conf 

<Directory /var/www/owncloud>
    Options Indexes FollowSymLinks MultiViews
    AllowOverride All
    Require all granted
</Directory>

Step 6: Enable rewrite module in apache

Enable rewrite module in apache and restart the apache service

a2enmod rewrite

/etc/init.d/apache2 restart

Step 7: Create Database and user for owncloud in MySQL server

We will create database called owncloud and mysql user called ownclouduser.Now login into mysql server.Create mysql user and database plus grant privileges to user on the database.

First restart the mysql (If mysql server is running then not require)

/etc/init.d/mysql restart
mysql -u root -p
 
After login you will get the mysql prompt like this
mysql >
 
Now create a user and set the password. Use strong password
 
mysql> CREATE USER 'ownclouduser'@'localhost' IDENTIFIED BY 'Password';
 
create database called owncloud
 
mysql> create database owncloud;
 
Grant privileges to owncloud user in owncloud database
 
mysql> GRANT ALL ON owncloud.* TO 'ownclouduser'@'localhost';
 
mysql> flush privileges;
 
mysql> exit

Step 8: Install Owncloud from Web interface

Open the browser and type http://IP-address-Of-Server/owncloud .Fill all the information field as asked in Webinterface

User Name : Give Admin user name
Password : Give Admin user’s password

Click on Advanced button

Data Folder: It will be selected by-default

In “configure the database” section,click on MySQL and fill

MySQL user : ownclouduser
Password : Give mysql ownclouduser password
Database Name : owncloud
Database Host: localhost

Owncloud 6

Now it takes a few seconds to complete and suddenly you will get next screen opened like this

Owncloud 6 dashboard

Now the installation is completed.Now you can start uploading,downloading,sharing the data in owncloud. With Admin user you can create user and install useful apps. Explore owncloud,it is awesome

Further Reading : Setup Owncloud 6 with Self Signed SSL Certificate in Ubuntu 13.10

Comments

  1. David Delorme says

    sh -c ??
    worked fine till last step then i got a garbled screen.
    Apache log said htaccesstest.txt client denied by server configuration.
    tried several times same error ?? I will look at it later.

  2. Michael Elmdal says

    Very helpfull guide!!
    A little typo in the MySQL setup

    The line “GRANT ALL ON owncloud.* TO ‘owncloud’@’localhost';” is not correct
    The user should be ownclouduser as it is created just above.

  3. Rudrugis Nossranie says

    If I would like to change the home folder for all owncloud users to a specific drive is it enough to change owncloud.conf and apache2.conf directory from /var/www to /media/”drive”/ocdata ?

    And to be clear I’m a complete beginner in linux so please be patient. Just newly started playing around with Ubuntu Server and so far it has been a lot of fun. I have been able to set up a few services successfully so far but due to my inexperience it has taken somewhat longer than I thought :)

    • says

      Hello Rudrugis Nossranie,

      Welcome in Linux World.I hope you are enjoying working on Linux OS.

      In short,I would like to share some information on Owncloud and apache web server.

        In owncloud,there is directory called data .Which is one the most important directory because it contains all user data inside.I expect from you to explore this directory and understand its tree.
        Always remember, Apache web server run with its user called www-data(In Debina based OS like Ubuntu) and apache(it is username,in Red Hat based OS like CentOS/Scientific Linux)

      I will recommend you to keep owncloud all files and directory in Apache Webserver default directory like /var/www (In Debian/Ubuntu) or /var/www/html (Red Hat/CentOS)

      Now as per your question.You want to keep Owncloud data in /media/drive/ocdata

      So here is the trick,

      after installing owncloud. Unmount the owncloud data directory and mount point to /media/drive/ocdata

      Before this I will suggest you to take backup of data directory.

      cp -rvf /var/www/data /root/owncloud-data-backup
      

      Now unmount the ownlcoud data directory and mount point to /media/drive/ocdata/ . As I have done given below.
      I will also rename original owncloud data directory. And create new directory with name data

      mv /var/www/data /var/www/data.original
      
      mkdir /var/www/data
      
      umount /var/www/data
      
      mount /media/drive/ocdata/  /var/www/data
      

      After mounting,now copy all files into new data directory (Remember After mounting)

      cp -prvf /var/www/data.original/* /var/www/data/
      

      Run the command, df -h to check mount point of /var/www/data/ .
      data directory should mount point to /media/drive/ocdata

      Restart the apache web server .

      Now Open owncloud and login. Upload any sample file .Now open the terminal and change to /var/www/data/USER-NAME/ .You will some 3-4 more directory. check in all directory, you should see sample file in any of these directory.

      I used same logic in with NAS filesystem. NAS is like a remote storage.Just for a reference, read this Post (This post is for some experienced user)

      Try the method,which I have given you. And also try to troubleshot yourself.Then only you can able to understand the OS.

      Well, let me know the feedback and you can ask your question anytime in this blog.
      Looking further for your response

      • Rudrugis Nossranie says

        Hi, thx for the awesomely quick response. I’m following you guide now.

        I took a look at the data folder found in /var/www/owncloud/ directory as you suggested and think I know what you’re getting at.

        Then I got in some trouble:
        When I do umount I get the following message:
        umount: /var/www/data: not mounted
        which is from my inexperienced point of view a confirmation that the umount was successful but the again that might be an error too for all I know.

        Then when I do the mount with “mount /media/”drive”/ocdata” I get this message:
        mount: /media/”drive”/odata is not a block device”
        which seems to be an error, right? and when I run df -h there is of course no mount for /var/www/data.

        Did I screw things up?
        At least it seems so for I’m not reaching the server any more in my browser.

        Do I need to put things back the way they were and start again from scratch?

        hopefully this is just some small newbie mistake :)

        again thanks for your time and effort in assisting me with this :)

      • Rudrugis Nossranie says

        Hi, thx for the awesomely quick response.

        I took a look at the folder structure in /var/www/owncloud as you suggested and think I get where you’re going with this.

        I went and followed your guide above but ran into some trouble on the way which an inexperienced user like myself don’t understand.

        I changed it a little for the “data” folder is located under owncloud dir to begin with.

        Steps:
        1. -> sudo su
        2 -> cp -rvf /var/www/owncloud/data /root/owncloud-data-backup
        3 -> mv /var/www/owncloud/data /var/www/owncloud/data.original
        4 -> mkdir /var/www/data
        5 -> umount /var/www/data
        Message: umount: /var/www/data: not mounted
        6 -> mount /media/”drive”/ocdata /var/www/data
        Message: Mount: /media/”drive”/ocdata is not a block drive

        df -h shows no mount for /media/”drive”/ocdata

        I have no idea what’s going on here :)

        Some google-ing returns the following: mount –bind

        I’m a little hesitant to use this without at least trying to get a response first because I don’t want to mess things up beyond the point of no return :)

        again thank you for your time and effort, this is greatly appreciated.

        • says

          Hello Rudrugis,

          It was my typo fault,shame on me.(I did typo with owncloud word).
          2nd thing is also, when we rename data dir and after that we used command umount data . The data dir name do not exit after rename.(this is another blunder,I wrote)

          As per default owncloud dir, we should take backup of – /var/www/owncloud/data

          Restore back to old settings.

          • Rudrugis Nossranie says

            Hi again

            I managed to sort things out, and got it working again with home folder for users in /media/drive/ocdata

            I didn’t change anything just restarted the server for maintenance and voila it just worked with no mount for it. Don’t know why though :D

            Thank you very much for your help, now I’m going to take a look at ssl

          • says

            nice, I hope you have checked all things in Server.
            For SSL ,I have written a post . It is not updated post for Ubuntu 13.10,but only difference is Apache 2.4 version.In apache 2.4 ,it uses new term.

      • Evgeniy says

        hello thanks for the quick response sharad
        But I can not help your post. My version (owncloud 6.0.2) and it otlechaetsya location (/ etc / owncloud / htaccess) and I can not find this fayl.Ne could you tell where to make inquiring (owncloud 6.0.2)
        PS thanks in advance

        • says

          Hello Evgeniy,

          Apologise, I am not able to understand your question.
          I assume, you are looking for setting in owncloud dashboard to increase upload limit.Below is the screenshot of settings from owncloud dashboard
          Owncloud upload limit setting

          Edit /etc/php5/apache2/php.ini . and change the value of given below parameter.

          file_uploads = On
          upload_max_filesize = 100M
          post_max_size = 100M
          max_execution_time = 300s
          memory_limit = 128M
          

          After saving the php.ini file. Now restart the apache2 service

          sudo /etc/init.d/apache2 restart
          

          Note: Language is not a barrier, you can write in your country language to describe your question.I generally use google translate.

        • Evgeniy says

          спасибо большое я разобрался c файлами, я нашел файл Htaccess..
          Есть другой вопрос можно разделить owncloud на две части ? а именно mysql на одном сервере под управлением windows 2012, а сам owncloud и apache , php на ubuntu 13.10 . Если можно то не могли бы подсказать как это сделать ?

          • says

            after translation,

            Thank you very much, I figured c files, I found a file Htaccess ..
            There is another question can be divided into two parts owncloud? namely mysql on the same server running windows 2012, and the owncloud and apache, php on ubuntu 13.10. If that is possible could not tell how to do it?

            yes , you can run mysql in other server. In step 8,use the ip address of your mysql server instead of localhost.
            Make your remote database server accessable from owncloud server.
            It will work

  4. Evgeniy says

    Извините Шарад я в всем разобрался все работает спасибо большое за отличный пост !!!

    • says

      after translation,

      Sorry I Sharad all figured out everything works thank you very much for the great post!

      Thankyou Evgeniy,keep reading our blog
      (Спасибо Евгений, продолжайте читать наш блог)

  5. Evgeniy says

    добрый день у меня есть вопрос как настроить отправку ссылок по почте?

    • says

      You have to set mail configuration in file owncloud/config/config.php .
      The owncloud use PHPmailer script.

      Вы должны установить конфигурацию почты в файле OwnCloud / конфигурации / config.php.
      OwnCloud использование PHPMailer сценарий.

  6. Evgeniy says

    и еще один вопрос какие порты использует сервер owncloud для нормальной работы?

    • says

      Owncloud using web server.Hence default port for Web Services is port 80 and 443.
      Mysql use the default port 3306 .

      OwnCloud помощью веб server.Hence порт по умолчанию для веб-служб является порт 80 и 443.
      Mysql использовать порт 3306 по умолчанию.

  7. Evgeniy says

    извиняюсь еще один вопрос как установить модель ldap для аутентификации active directory

    • says

      Login into Owncloud dashboard with Admin user.
      See at right hand side bar, bottom. Click on App button.
      Now list will be open, click on “LDAP user and group backend” , enable it.
      Click on Admin User > Admin (at top right corner of dashboard)
      Now from “LDAP user and group backend” option will be enabled and you can set the configuration

      Вход в OwnCloud приборной панели с пользователем Админ.
      Смотреть на правой стороне панели, внизу. Нажмите на кнопку App.
      Теперь список будет открыт, нажмите на кнопку “пользователь LDAP и группы серверной”, включите его.
      Нажмите на Админ пользователей> Администратор (в верхнем правом углу панели)
      Теперь из “пользователь LDAP и группы серверной” опция активируется, и вы можете настроить конфигурацию

        • says

          Для почтового сервера, у вас есть для устранения себя.
          Вещи, чтобы проверить во время рассылки устранение неполадок
          (1) Является ли от OwnCloud сервере, вы в состоянии связаться с вашим почтовым сервером
          (2) тип аутентификации используется в почтовому серверу
          (3) Проверьте журналы в Mail Server
          (4) Кроме того, проверить журналы в OwnCloud сервере
          (5) Это ваш почтовый сервер учетные данные правильно

          For mail server ,you have to troubleshoot yourself.
          Things to check while mailing troubleshooting
          (1) Is from owncloud server,are you able to contact to your mail server
          (2) type of authentication used in Mail server
          (3) Check the logs in Mail Server
          (4) Also check the logs in owncloud server
          (5) Is your mail server credentials are correct

  8. fawzi says

    hi Sharad,
    Thanks for the tutorial above.
    My ownCloud 6 server works fine on my Ubuntu 13.1, both with HTTP and HTTPS access.
    I also used the instructions from owncloud to allow uploads of files larger that 512MB and it works well in HTTP access. (http://doc.owncloud.org/server/6.0/admin_manual/configuration/configuring_big_file_upload.html)

    However in HTTPS access, my max file size limit is set back to 512MB. Do you know how to address this? is there a php file for https mode?
    thanks,

    • sharadchhetri says

      Hello Armen,

      Thankyou,I have checked your given URL. The post is nice. I have edited your comment because we do not promote backlinks.
      I hope you understand.

  9. Evgeniy Popov says

    Привет есть вопрос как можно убрать вункцую восстановление пароля в owncloud

Leave a Reply

Your email address will not be published. Required fields are marked *