How to set up smartphones and PCs. Informational portal

Own cloud. owncloud installation

Here we will talk about. Since there is no unambiguous manual on the offsite, here I will write a compiled installation guide.

is free software designed to build private storage clouds at its own facilities. There is a commercial license (support for mobile applications and other goodies). We'll talk about the free version (as well as connecting to the folder storage via samba protocol, ftp and sftp, user authorization from Active Directory ). free access to the storage is possible through the web interface or connection network drive on webdav.

I. Preparing for installation, installation (working with the console)

Here we will expand it. First we will install LAMP, and then we will add the packages we need.

1) Full system update and installation of necessary packages

sudo apt-get update -y && sudo apt-get upgrade -y && sudo apt-get dist-upgrade -y && sudo apt-get autoremove -y && sudo apt-get autoclean -y sudo tasksel install lamp-server sudo apt- get install php5-gd php5-json php5-mysql php5-curl php5-intl php5-mcrypt php5-imagick php5-ldap smbclient

2) Apache web server setup

Let's set it up first Apache by activating .htaccess files:

sudo nano /etc/apache2/apache2.conf AccessFileName .htaccess ... Options Indexes FollowSymLinks AllowOverride All Require all granted

Let's restart the service:

Now let's activate additional Apache modules:

sudo a2enmod rewrite sudo a2enmod headers sudo a2enmod env sudo a2enmod dir sudo a2enmod mime sudo a2enmod setenvif sudo a2enmod ssl sudo a2ensite default-ssl

Let's restart the service:

sudo service apache2 restart

3) PHP setup

sudo nano /etc/php5/apache2/php.ini upload_max_filesize post_max_size

Reboot:

sudo reboot

4) Create a MySQL database (via Webmin, optional)

I personally do not like to create databases through the command line and do it through Webmin. It is installed like this:

sudo nano /etc/apt/sources.list deb http://download.webmin.com/download/repository sarge contrib deb http://webmin.mirror.somersettechsolutions.co.uk/repository sarge contrib

Add and activate the key:

Wget http://www.webmin.com/jcameron-key.asc sudo apt-key add jcameron-key.asc

Update the list of sources:

Sudo apt-get update

Install webmin:

5) Installation

Left a little. Install from the repository:

sudo sh -c "echo "deb http://download.opensuse.org/repositories/isv:/ownCloud:/community/xUbuntu_14.04/ /" >> /etc/apt/sources.list.d/owncloud.list " wget http://download.opensuse.org/repositories/isv:ownCloud:community/xUbuntu_14.04/Release.key sudo apt-key add -< Release.key

Installation and update:

sudo apt-get update sudo apt-get install owncloud

We issue rights:

sudo chown www-data:www-data -R /var/www

II. Setting up ownCloud (working with the web interface)

Further configuration takes place via the web interface. There, in principle, everything is clear. Additional functions connected through some "applications" (add-ons). We'll talk about two of them here, one for authorization from AD, and the second for connecting various network folders etc. The user already at the start can connect the storage via webdav via https (it will have a link in the web interface).

6) Application "LDAP" (authorization from AD)

login: [email protected]




7) Application "External Storage"

There is different variants its connection, well, for example, like this (with technical accounting):

Conclusion

Actually, that's all, it's basic setup. There are also many additional useful applications, which can also be used. In the context of corporate use, it also makes sense to force-redirect from http > https, but I will not dwell on such basic things, it is not difficult there and depends on the current config of the server itself.

In total, we have a good corporate solution in the form of a ready-made cloud.)

It is a free and open web application for data synchronization, file sharing and remote storage of documents in the "cloud". Capabilities

  • Storing files using regular directory structures, or using WebDAV
  • Cryptography
  • Synchronization between clients Windows control(Windows XP, Vista, 7 and 8), Mac OS X (10.6 or later) or Linux
  • Calendar (also like CalDAV)
  • Task Manager
  • Address Book (same as CardDAV)
  • Streaming Media (Used by Ampache)
  • User and group administration (using OpenID or LDAP)
  • Sharing content between groups or using public URLs
  • Online text editor with syntax highlighting and folding
  • Bookmarks
  • URL Shortening Mechanism
  • Photo gallery
  • PDF viewer (using PDF.js)
  • Viewer for ODF files (.odt, .odp, .ods)
  • Logging module

Installation I decided to greatly simplify the installation of ownCloud, using a ready-made distribution from Bitnami, which integrates Apache and PHP. Download and run setup file. Select a folder for installation.
We create account administrator.
Specify the server host. I have provided an IP address.
Setting up mail. You can skip this step and set up mail later.
We skip the offer to visit the Bitnami website.
Everything is ready for installation, click Next.
We are waiting for the installation to complete.
After the installation is complete, launch the Bitnami ownCloud Stack.

ownCloud setup. In Bitnami ownCloud Stack, click Go To Application, a welcome page opens in the browser. Click the link "Access Bitnami ownCloud Stack".
The ownCloud login window opens.
Enter the registration data specified at the installation stage. We get a fully functional cloud service!
AT top menu Select Applications on the left.
For some reason, my list of applications was loading for a very long time. In it, select the LDAP User and Group backend and turn on the application.
Next, go to Administration.
We go down to the LDAP section and see a message that the LDAP module for PHP is not installed. Enable (uncomment) the extension=php_ldap.dll line in php.ini . Don't forget to restart the servers in the Bitnami ownCloud Stack on the Manage Servers tab for the changes to take effect.

Setting up ownCloud integration with LDAP. We go under the administrator account in the Administration menu. Scroll down and check the box next to Enable LDAP Backend.
Next, we return to the LDAP section and fill it out. Previously, I created the owncloudaduser user in the Users container. He does not need membership in any groups stern Domain Users. Let's make the password indefinite. In the second field, write the contents of the distinguishedName attribute from the Attribute Editor tab. It will become available in the account properties if you enable Advanced Features in the Active Directory Users and Computers snap-in in the View menu.
On the Login tab, set the login attribute. I have this LDAP username.
Next, on the Advanced tab, set the connection parameters. We make our configuration active.
Fill in the directory settings.
Then Special Attributes. It is important to complete the mail field if you plan to use mail notifications.
Don't forget to Save settings. Back to the Users tab. I specified User as objects, and 1483 users were immediately found.
That's it, ownCloud's LDAP integration is complete.

The editors of our magazine were inundated with letters asking them to describe the installation of the popular free software ownCloud, which is used to create private cloud storage.

ownCloud version selection

There is no version of ownCloud in the Debian repositories at all, not even an outdated one. Perhaps this is for the best. Ubuntu has this program, but it has recently caused a scandal. In short, the ownCloud developers asked to remove their software from the Ubuntu repository, because Ubuntu developers left holes in ownCloud even after official patches were released. Apparently, they were very busy integrating the next store into Unity. But now is not about that.

We will take the version not from the repositories, but from the official site, the latest (from the stable ones). Go to the downloads page and select the Archive Files option ( server owners). In the window that opens, click on the word Unix. Starts downloading the archive from ownCloud. At the time of this writing, version 7.0.2 is in use. Direct link: https://download.owncloud.org/community/owncloud-7.0.2.tar.bz2 .

Before closing the browser window, let's also download the admin manual: http://doc.owncloud.org/server/7.0/ownCloudAdminManual.pdf . According to one well-known rule, if nothing works out, you will finally have to read the manual. But it is better not to take it to extremes and run through section Installation before installing ownCloud.

LAMP

Installs LAMP in 2 minutes. The same amount will be spent on editing the configuration files and everything will work right away. On Debian. Other distributions are not covered by my warranty. And here is the tuning individual components LAMP is a real art. There are specialists in MySQL, there are in Apache, tuning can take a lot of time, effort, and sometimes money. Especially in conditions of limited resources (if you run ownCloud on a third-party hosting). But we don't need it now.

ownCloud and Apache

We take the archive from ownCloud and unpack it into the /var/www directory.

cp owncloud-7.0.2.tar.bz2 / var/ www/ cd / var/ www/ tar xf owncloud-7.0.2.tar.bz2

Of course, all operations under root. Then you need to rename the owncloud directory to the name of your site. For example, if the mysupercloud.ru domain will be used to access the cloud storage, then rename it like this:

Mv owncloud mysupercloud.ru

Renaming is optional, but very useful. If there are several sites on the server, then naming the directories according to domains will allow you not to forget where you have what. For convenience, I'll leave the name as it is.

Now very important step, which many people forget about, but then suffer with access rights. And in the end, they put up all 777, putting their system in danger. Apache web server works under a separate user and in separate group. This is due to the fact that if an attacker can hack Apache through a hole in the server itself or through a hole in the site scripts, he will only get limited access to the system. In fact, kakker will only be able to overwrite the contents of some files in /var/www. Let's give Apache the rights to ownCloud files:

Chown -R www-data:www-data owncloud

Let's make sure everything is in order:

Ls-al

Now let's create a virtual Web site by properly configuring Apache. Since the Debian developers love users, the monolithic configuration file has been neatly split into pieces that are already easier to work with. The surprises from the Debian developers don't stop there. A convenient toolkit a2ensite/a2dissite/a2enmod/a2dismond is at the service of users. These are Perl scripts that shorten the work with configuration file Apache to the bare minimum.

We go to the /etc/apache2/sites-available directory, take the default blank and copy it under a new name. As in the case of the directory name with owncloud, it is advisable to use the domain name:

cp default owncloud

Open the copied file for editing. It is very important to accurately specify the values ​​for three variables: ServerName, DocumentRoot, and Directory. No typos, otherwise it won't work!

ServerName owncloud ServerAdmin [email protected] DocumentRoot /var/www/owncloud Options FollowSymLinks -MultiViews AllowOverride All Order allow,deny allow from all ErrorLog $(APACHE_LOG_DIR)/error.log CustomLog $(APACHE_LOG_DIR)/access.log combined

That is, in ServerName we prescribe the domain name (what the user will type in address bar browser to access ownCloud). DocumentRoot and Directory point to the directory with ownCloud files.

Now let's start the site:

A2ensite owncloud service apache2 restart

The site is already responding to us, although the installation is far from complete. Attention: if a "fake" domain is used, then it should be explicitly registered in /etc/hosts!

On this apache setup completes and proceed to MySQL setup.

ownCloud and MySQL

The whole setup is only that we need to create a separate user in MySQL (not to be confused with users operating system), create a database, link one to the other and set access rights.

If you are MySQL savvy, you can easily do this with command line and great utility mysql. For the rest, I recommend using the MySQL web interface called phpmyadmin. This software is in the standard Debian repository, it is installed with the apt-get install phpmyadmin command and it starts working almost immediately, because you already have LAMP configured. The user just needs to launch a browser and navigate to http://localhost/phpmyadmin . For security reasons, I recommend tweaking the Apache configuration so that only users from local network. The fact is that phpmyadmin is an extremely leaky software and hackers often scan sites in search of exactly phpmyadmin.

So, we create an owncloud user in phpmyadmin and assign a tricky password to it. We create a base owncloud data. We give the user owncloud full rights to access the owncloud database. On this MySQL setup ends. We proceed directly to the installation.

Attention: when creating a database, specify utf8_general_ci in the "comparison" paragraph.

ownCloud setup

Launch a browser and go to http://owncloud (in your case, the address will be the one you specified in ServerName). In the window that appears, set the administrator name and password for this account. A little lower, click on the link "Data storage system", click on the MySQL button and provide information to access the database created in MySQL database data - database name, username and password. Click the "Finish Installation" button.

Ops! The screen warns that Apache does not support the WebDAV protocol. Actually, through this protocol, the user works with his files on the server. Since ownCloud is asking for WebDAV, I think it needs to be given this:

A2enmod dav a2enmod dav_fs service apache2 restart

We go to again home page owncloud and see a joyful greeting. The gracious ownCloud is ready to start serving us.

In custody

If there is further interest in this topic, then I will talk about how to set up beautiful URLs(http://owncloud/settings/admin instead of http://owncloud/index.php/settings/admin) how to enable secure protocol HTTPS instead of HTTP and how to extend the capabilities of ownCloud. Thank you for your attention!

OwnCloud is a free and open web application for organizing your own "cloud" file storage. Differs in providing the user full control above their data - information is placed on systems controlled by the user. In other words, with the help of ownCloud you can make your own version of drumbox, yandex disk or skydrive, but using your cloud you will get rid of one of the shortcomings of the clouds of other companies providing this service, all data will be stored on your drives (drives under your control). OwnCloud can be done both on VDS/VPS ( virtual servers rented from the host), and on home computer. In this article, I will focus on home version, although the installation and features will not differ from the installation on VDS/VPS.

First, let's take a look at what OwnCloud provides so special:

1 The first thing that comes to mind is the storage of files (photos, videos, documents). If you are deploying OwnCloud on your computer, you can not be limited to 10-20 GB (as in third party services), but feel free to use 500 GB, 1 TB, etc.

2 You will be able to share your files with other users.

3 Can open/create test files (.ODF .odt, ODP, . ods extensions), listen to music, watch videos.

4 You can synchronize data with your computer (Windows, Mac, Linux).

5 If the installed functionality is not enough for you, you can expand it by installing additional applications and expand the possibilities of cloud storage.

I suggest moving on to installing OwnCloud. In this article, I will be installing Ubuntu Server 12.04. Installing OwnCloud requires a minimum of effort, just run the command

sudo apt-get install owncloud

You will need to confirm the installation of additional packages.

During installation, you will need to enter a password for SQL, I recommend using a password of at least 8 characters with capital letters, numbers and special characters (!"№#$).

After a few seconds, the installation will be completed. Now you need to create a database to work with cloud storage, to do this, run the commands:

mysql -u root -p
create database<имя_базы_mysql>;
grant all privileges on owncloud.* to<имя_пользователя_mysql>@localhost identified by "mysql_user_password";
exit

For example:

mysql -u root -p
create database owncloud;
grant all privileges on owncloud.* to [email protected] identified by "Cloud50$";
exit

Now you can configure ownCloud, for this you need to follow the link in your browser

/owncloud

In my case:

192.168.1.6/owncloud

In the web interface that opens, you must enter your login credentials. cloud storage(I recommend to specify complex password with capital letters, numbers and special characters ( [email protected]#!"№)), file storage path and SQL data(login and password).

Let me explain that you specify a unique login and password, the path where the files will be stored can be left by default, the login in SQL database login - root, the password that you specified when SQL installation and the name of the database that you specified earlier. Click " Finish installation".

After that, you will be taken to the web interface of your cloud.

To upload a file, click the arrow button and select required file For loading. As you can see, files can be uploaded in a limited size (this size is taken from the volume random access memory). This value can be changed in the settings.

OwnCloud allows you to access your data and files through a web interface. It also implements capabilities for synchronizing and exchanging data between devices. With ownCloud, you can very easily set file access restrictions by ACL for each user. The program has its own clients for systems such as Windows, Linux and MacOS, as well as mobile applications for Android and iOS. With them, you can keep your data in sync across all your devices.

This tutorial will cover the installation of OwnCloud 9 Ubuntu 16.04. All of the steps below will also work for others. Ubuntu versions, Linux Mint or even Debian.

OwnCloud is written in php, so before installing the program itself, we first need to install a LAMP server. This set includes Apache web server, database server MySQL data and the PHP programming language.

We will not be using the Ubuntu repositories as we need OwnCloud 9 ubuntu 16.04 installed and the official repositories may already have outdated version. To download, run the following commands:

cd /opt
$ wget https://download.owncloud.org/community/owncloud-9.0.1.tar.bz2

Now let's extract all the downloaded files to root folder web server and set up required permissions on our files and directories:

cd /var/www/html
$ sudo tar xjf /opt/owncloud-9.0.1.tar.bz2
$ sudo chown -R www-data:www-data owncloud
$ sudo chmod -R 755 owncloud

Step 3: Prepare your computer

After the code is unpacked, you need to create a MySQL database and a user account for owncloud settings. To do this, run the following commands:

mysql -u root -p
Enter password:

mysql> CREATE DATABASE owncloud;
mysql> GRANT ALL ON owncloud.* to "owncloud"@"localhost" IDENTIFIED BY "_password_";
mysql> FLUSH PRIVILEGES;
mysql> quit

OwnCloud requires a few more packages for its work, this is the gd and curl library, they also need to be installed:

sudo apt install php-gd php-curl

The php work also needs to be tweaked a bit so that the installation of owncloud ubuntu 16.04 is done correctly. By default, the size of uploaded files is limited, so you need to remove these restrictions. Open the /etc/php/apache/php.ini file and change the upload_max_filesize and post_upload_filesize lines:

upload_max_filesize=100M
post_max_filesize=100M

Step 4Run OwnCloud Installer

You can now access OwnCloud from a web browser. Just use localhost address: http://localhost/owncloud/

Enter the administrator details to create an administrator account and specify the location of the folder with the files:

Now scroll down the page and enter the data to connect to the database we just set up:

After the configuration is completed, the admin panel will open, where you can create users, groups and assign access rights to them:

conclusions

That's it, the installation of owncloud ubuntu 16.04 is complete. Now you can share your files with other computers. If you have any questions, ask in the comments!

Related posts:


Top Related Articles