ownCloud Installation with Linux Distribution

By | June 10, 2015

Logo_OwnCloud

  1. What is ownCloud?
  2. How to prepare web server for installation?
  3. Installation of ownCloud
  4. Completion of the establishment

First, we’ll see what exactly ownCloud is!

It is an open source application for cloud storage and online file management. Basically it is similar to the famous DropBox, because it can store and synchronize files between one or more work stations or servers and ownCloud server. It is also fulfilling the role of backup server for safekeeping files and server synchronization. To implement this service you must have a web server running PHP and MySQL or SQLite.

Among all these features, there is obviously the possibility to share files; also you can play music directly online with the integrated player, can manage calendar, contact management, viewing and editing documents online, the visualization and filing photos in galleries, etc…. Moreover, many plugins are available in order to insert new functionality to ownCloud.

Here, we took Debian server and we are going to see together how to install ownCloud with Apache on web server that coupled with PHP and SQLite.

But, before we proceed, it is important to know how to prepare web server for the installation!!!

Before installing ownCloud application, ensure that your web server is equipped with essentials. If you haven’t, then first install Apache and PHP libraries for ownCloud’s different needs. We will enter the following commands:

For information, we install apache2, php5 and SQLite and several PHP modules. However, MySQL installs automatically with ownCloud during the installation via apt-get.

Installation of ownCloud

Now we continue with the installation of ownCloud. Following are the commands that we would type:

Here, we just insert a new row to the repository containing ownCloud Addons to our sources.list and then we updated our deposits and installed ownCloud. When installing ownCloud, MySQL database service is also installed, it will then have to indicate a password twice for the “root” or MySQL.

We will then set the “group www-data”, containing the user of the same name used by Apache as a group owner on useful directories in the operation of ownCloud. We will seize it for the following commands:

Then we will move on the change the permission on these directories, the option “-R” allows for recursion, that is to say, rights of the changes will apply to all sub-directories as well:

For ownCloud work correctly in Apache, activate modules rewrite and headers in Apache. Rewrite allows URL rewriting and headers allow managing the headers of HTTP requests and responses:

For security, you must prevent access to “directory data” of ownCloud. For this, a file .htaccess is already present and preconfigured in ownCloud. It contains a directive to deny access to everyone and a second for preventing the listing of any directory contents:

So the .htaccess file is taken into account, the directive allow override of your web server that must be set to “All” and not “None” if the files .htaccess are ignored. Change the default file located in “/etc/apache2/sites-enabled” to obtain this:

Then, finally, we can restart the Apache server:

Access from the browser on data from the data folder should be blocked.

Completion of the establishment!!!

Finally, go to ownCloud from web interface to complete the installation and create the “user admin”. Then, go to the web browser and enter the URL. For example: http://domain_IP/ownCloud.

There you will see that the system SQLite database is sufficient for standard installations. If you do not think you need a very large volume for your ownCloud, simply enter the username and password of your admin user and click “Finish the Installation”.

But if you know your ownCloud will have to handle a certain load, click on “Storage and Database” to access the possibility of using of other database systems. Then select MySQL or MariaDB.

If you are using MySQL, it will go from the command line on your MySQL interface to seize control lines that will create a database and a user dedicated to ownCloud. It creates the user and the database.

We give all the rights to the user on the database:

It will then fill the fields (user, password, name of the database…):

Remember to enter the password for your main administrator and click “Finish the installation”.

OwnCloud is ready, everything is functional. You can log in with the user” admin “by going to the URL” http: // domain_IP / owncloud”

It only remains to have fun with OwnCloud!!!