Adding self-registration by users in ownCloud 6


Good day, habravchane!

In my publication I would like to share with you my personal experience in adding a module for self-registration by users in a cloud service. There will be no description about setting up LAMP and installing ownCloud, since there are already a lot of instructions and various articles on this topic.

I found a lot of articles about setting up my ownCloud, and many were from this resource, but on the question: "how to add the ability to register?" in RuNet, I found only one source, which, in my opinion, seemed not very informative and not complete enough. Based on this, the idea was born for writing this post.

Let's start

Let's say we have a web server with ownCloud installed on Debian Wheezy. The main condition is that the service has never been started and configured.

Now, let's go in order:

1. First of all, we need to download the archive , which has everything you need:


2. Unpack the downloaded archive and copy the registration folder from it to the directory with the cloud service in the core folder :

unzip registration-final
cp -R registration /var/www/owncloud/core/

Next, you also need to copy the files from the unpacked archive with replacement:
  • db_structure.xml to the main folder of the cloud service;
  • routes.php to the core folder ;
  • login.php to the core / templates folder .

cp -f db_structure.xml /var/www/owncloud/
cp -f routes.php /var/www/owncloud/core/
cp -f login.php /var/www/owncloud/core/templates/

On this all manipulations with the archive ended.

3. Launch your ownCloud browser, register an administrative account, connect the database. After we exit the service and see the register link on the login and password entry page below . But this is not the end of the module setup.

4. Since, in order for the user to receive a letter to his e-mail with a registration link, you need to install and configure some kind of MTA . To do this, I used postfix as a relay so that it would send emails from my gmail mail.

Install postfix and mailutils:

apt-get install postfix mailutils

Open the config and add it with the lines:

nano /etc/postfix/

relayhost = []: 587
smtp_use_tls = yes
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash: / etc / postfix / sasl_passwd
smtp_tls_CAfile = /etc/ssl/ certs/ca-

Open (create) the sasl_passwd file :

nano /etc/postfix/sasl_passwd

Add the line there:

[]: 587 username: password

Next we do:

postmap /etc/postfix/sasl_passwd
cd /etc/postfix
chown postfix sasl_passwd*

And reboot postfix:

/etc/init.d/postfix reload

We send a test letter to check the health of postfix:

echo "Test mail from postfix" | mail -s "Test Postfix"

If the letter did not arrive, look at the error logs:

tail /var/log/mail.log

On this setup is over, it remains to check the operability of the registration itself.

Again, open our cloud service in the browser, click on register , write e-mail and check the mail, where we should see an email with a link for further registration.

After the work done, the result will be a cloud service with the possibility of self-registration of the user.

UPD: For everyone who wants to add registration to the latest versions of ownCloud, you can use this module. By clicking on the link, you will find all the necessary information to add. From the above article, it remains to configure only postfix.

Also popular now: