How to create own online file sharing like Dropbox - Pydio

To create own online file sharing like Dropbox in Linux

Pydio is a powerful, secure and open source software for online file sharing as like cloud storage systems.


Features of Pydio

  • Preview user files like video, audio, and documents like PDFs and Office documents.
  • SSO Support with various Content Management Systems (CMS) like Joomla, Xibo, WordPress, Drupal and so on.
  • User Notification of folder or file modifications.
  • Workspace Creation from user shared folders.
  • User activities Monitoring on the system.
  • Integration with AD/LDAP server for user authentication.
  • Safe links and Secure passwords with an expiration date.

Setting up Pydio file sharing and synchronization portal on CentOS/RHEL and Fedora are explained in this article.


Installation of Web Server and Dependencies

You have to enable EPEL repository, before the installation.

[root@linuxhelp ~]# yum install epel-release -y
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: mirror.dhakacom.com
 * extras: mirror.dhakacom.com
 * updates: mirror.dhakacom.com
Resolving Dependencies
-->  Running transaction check
--->  Package epel-release.noarch 0:7-6 will be installed
.
.
.
Installed:
  epel-release.noarch 0:7-6                                                                                                                 

Complete!

Install the php extensions, Apache web server and its libraries.

[root@linuxhelp ~]# yum install httpd -y
Loaded plugins: fastestmirror, langpacks
Resolving Dependencies
-->  Running transaction check
--->  Package httpd.x86_64 0:2.4.6-40.el7.centos.1 will be installed
-->  Processing Dependency: httpd-tools = 2.4.6-40.el7.centos.1 for package: httpd-2.4.6-40.el7.centos.1.x86_64
-->  Processing Dependency: /etc/mime.types for package: httpd-2.4.6-40.el7.centos.1.x86_64
.
.
.
Installed:
  httpd.x86_64 0:2.4.6-40.el7.centos.1                                                                                                      
Dependency Installed:
  apr.x86_64 0:1.4.8-3.el7   apr-util.x86_64 0:1.5.2-6.el7   httpd-tools.x86_64 0:2.4.6-40.el7.centos.1   mailcap.noarch 0:2.1.41-2.el7  

Complete!
[root@linuxhelp ~]# yum install php php-gd php-ldap php-pear php-xml php-xmlrpc php-mbstring curl php-mcrypt* php-mysql -y
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
Resolving Dependencies
-->  Running transaction check
--->  Package curl.x86_64 0:7.29.0-19.el7 will be updated
--->  Package curl.x86_64 0:7.29.0-25.el7.centos will be an update
-->  Processing Dependency: libcurl = 7.29.0-25.el7.centos for package: curl-7.29.0-25.el7.centos.x86_64
--->  Package php.x86_64 0:5.4.16-36.1.el7_2.1 will be installed
.
.               
Updated:
  curl.x86_64 0:7.29.0-25.el7.centos                                                                                                        

Dependency Updated:
  libcurl.x86_64 0:7.29.0-25.el7.centos                                                                                                     

Complete!


Open HTTPS ports and Apache HTTP on firewall

--------------- On IPtables for CentOS 6 and Fedora ---------------

[root@linuxhelp ~]# iptables -A INPUT -p tcp -m tcp --dport 80 -j ACCEPT
[root@linuxhelp ~]# iptables -A INPUT -p tcp -m tcp --dport 443 -j ACCEPT
[root@linuxhelp ~]# /etc/init.d/iptables save

--------------- On FirewallD for CentOS 7 and Fedora 22+ ---------------

[root@linuxhelp ~]# firewall-cmd --permanent --zone=public --add-service=http
success
[root@linuxhelp ~]# firewall-cmd --permanent --zone=public --add-service=https
success
[root@linuxhelp ~]# firewall-cmd --reload
Success


Pydio Database Creation

You should have MariaDB/MySQL server installed on the system.

[root@linuxhelp ~]# yum install mariadb mariadb-server -y
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: mirror.dhakacom.com
 * epel: epel.mirror.net.in
 * extras: mirror.dhakacom.com
 * updates: mirror.dhakacom.com
Resolving Dependencies
-->  Running transaction check
--->  Package mariadb.x86_64 1:5.5.47-1.el7_2 will be installed
-->  Processing Dependency: mariadb-libs(x86-64) = 1:5.5.47-1.el7_2 for package: 1:mariadb-5.5.47-1.el7_2.x86_64
--->  Package mariadb-server.x86_64 1:5.5.47-1.el7_2 will be installed
.
.
Dependency Updated:
  mariadb-libs.x86_64 1:5.5.47-1.el7_2                                                                                                      
Complete!        

Now restart and enable the mariadb service.

[root@linuxhelp ~]# systemctl restart mariadb
[root@linuxhelp ~]# systemctl enable mariadb
ln -s ' /usr/lib/systemd/system/mariadb.service'  ' /etc/systemd/system/multi-user.target.wants/mariadb.service' 

With the help of mysql_secure_installation command, install the secure mysql. During the installation we need to set the new root password for mariadb.

[root@linuxhelp ~]# mysql_secure_installation
/usr/bin/mysql_secure_installation: line 379: find_mysql_client: command not found

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!

In order to log into MariaDB to secure it, we' ll need the current
password for the root user.  If you' ve just installed MariaDB, and
you haven' t set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none):
OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorization.

Set root password? [Y/n] y
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
 ... Success!

By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them.  This is intended only for testing, and to make the installation
go a bit smoother.  You should remove them before moving into a
production environment.

Remove anonymous users? [Y/n] y
 ... Success!

Normally, root should only be allowed to connect from ' localhost' .  This
ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] y
 ... Success!

By default, MariaDB comes with a database named ' test'  that anyone can
access.  This is also intended only for testing, and should be removed
before moving into a production environment.

Remove test database and access to it? [Y/n] y
 - Dropping test database...
 ... Success!
 - Removing privileges on test database...
 ... Success!

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Reload privilege tables now? [Y/n] y
 ... Success!

Cleaning up...

All done!  If you' ve completed all of the above steps, your MariaDB
installation should now be secure.

Thanks for using MariaDB!

For Connecting to MySQL and create a new pydio user and database.

[root@linuxhelp ~]# mysql -u root -p
Enter password:
Welcome to the MariaDB monitor.  Commands end with   or g.
Your MariaDB connection id is 11
Server version: 5.5.47-MariaDB MariaDB Server

Copyright (c) 2000, 2015, Oracle, MariaDB Corporation Ab and others.

Type ' help '  or ' h'  for help. Type ' c'  to clear the current input statement.

MariaDB [(none)]>  create database pydio 
Query OK, 1 row affected (0.05 sec)

MariaDB [(none)]>  create user pydio@localhost identified by ' 123'  
Query OK, 0 rows affected (0.17 sec)

MariaDB [(none)]>  grant all privileges on pydio.* to pydio@' localhost'  identified by ' 123'  
Query OK, 0 rows affected (0.03 sec)

MariaDB [(none)]>  exit
Bye
[root@linuxhelp ~]# systemctl restart mariadb

Installation of Pydio File Hosting Server

Utilize the official Pydio repository for installing the recent version of Pydio package with the help of the following command.

[root@linuxhelp ~]# rpm -Uvh http://dl.ajaxplorer.info/repos/pydio-release-1-1.noarch.rpm
Retrieving http://dl.ajaxplorer.info/repos/pydio-release-1-1.noarch.rpm
Preparing...                          ################################# [100%]
Updating / installing...
   1:pydio-release-1-1                ################################# [100%]
[root@linuxhelp ~]# yum --disablerepo=pydio-testing install pydio
Loaded plugins: fastestmirror, langpacks
pydio-stable                                                                                                         |  951 B  00:00:00     
pydio-stable/primary                                                                                                 | 2.7 kB  00:00:01     
Loading mirror speeds from cached hostfile
 * base: mirror.dhakacom.com
 * epel: epel.mirror.net.in
 * extras: mirror.dhakacom.com
.
.
Installed:
  pydio.noarch 0:6.0.8-1                                                                                                                    
Complete!


Configuration of Pydio File Hosting Server

Inorder to enable Pydio access through web, add the below configuration to .htaccess file :

[root@linuxhelp ~]# vim /var/lib/pydio/public/.htaccess

Now Add the below configuration.

Order Deny,Allow
Allow from all
< Files " .ajxp_*" > 
deny from all

RewriteEngine on
RewriteBase pydio_public
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([a-zA-Z0-9_-]+).php$ share.php?hash=$1 [QSA]
RewriteRule ^([a-zA-Z0-9_-]+)--([a-z]+)$ share.php?hash=$1& lang=$2 [QSA]
RewriteRule ^([a-zA-Z0-9_-]+)$ share.php?hash=$1 [QSA]

You have to change and add the below lines in /etc/httpd/conf.d/pydio.conf file

Alias /pydio /usr/share/pydio
Alias /pydio_public /var/lib/pydio/public
< Directory " /usr/share/pydio" > 
Options FollowSymLinks
AllowOverride Limit FileInfo
Require all granted
php_value error_reporting 2
< /Directory> 

< Directory " /var/lib/pydio/public" > 
AllowOverride Limit FileInfo
Require all granted
php_value error_reporting 2
< /Directory> 

Inorder to allow max file upload, to increase memory_limit, and to disable php output buffering, configure php.ini :

[root@linuxhelp ~]# vim /etc/php.ini
post_max_size = 1G
upload_max_filesize = 1G
output_buffering = Off
memory_limit = 1024M

Now fix the suitable charset encoding in the form: en_us.UTF-8 in your locale definition.

Execute the below command to find out current charset lang of system:

[root@linuxhelp ~]# echo $LANG
en_US.UTF-8

Open /etc/pydio/bootstrap_conf.php file and insert the below line.

[root@linuxhelp ~]# vim /etc/pydio/bootstrap_conf.php
define(" AJXP_LOCALE" , " en_US.UTF-8" ) 

SSL encryption is mostly recommended to secure all Pydio data connections through secure HTTPS network.

Install the mod_ssl package and modify the following file as:

[root@linuxhelp ~]# yum install mod_ssl -y
Loaded plugins: fastestmirror, langpacks
pydio-testing                                                                                                        |  951 B  00:00:00     
pydio-testing/primary                                                                                                | 1.8 kB  00:00:01     
Loading mirror speeds from cached hostfile
Resolving Dependencies
-->  Running transaction check
--->  Package mod_ssl.x86_64 1:2.4.6-40.el7.centos.1 will be installed
.
.
.
Installed:
  mod_ssl.x86_64 1:2.4.6-40.el7.centos.1                                                                                                    
Dependency Updated:
  openssl.x86_64 1:1.0.1e-51.el7_2.5                    openssl-libs.x86_64 1:1.0.1e-51.el7_2.5                                

Complete!
[root@linuxhelp ~]# vim /etc/pydio/bootstrap_conf.php

Uncomment the line:

define(" AJXP_FORCE_SSL_REDIRECT" , true) 

To consider new changes into account, restart Apache web server

[root@linuxhelp ~]# systemctl restart httpd

Now open the web browser and type the url in your web browser to load the pydio web installer wizard.

http://localhost/pydio/
OR
http://ip-address/pydio/

In pydio installation wizard, select “ click here to continue to Pydio.” to continue

Select the “ Start Wizard” and follow the instructions on screen installer

Pydio Admin Account Creation

Global Options Setup

Configuration of Pydio MySQL Database

Now create some users for pydio and click “ install pydio now”


If you receive an error message as mentioned in below snap you need to copy the content as mentioned in the error report to the file /usr/share/pydio/.htaccess

Login to pydio with user credentials

Pydio welcome page

To utilize the workspace

To create new folder inside the current workspace of pydio


Now double click on the newly created folder to open it.

To create new file inside the created folder




To add content to the created file just right click on it and choose source editor as shown in below snap


To download files from pydio to local hard drive click “ download”


To upload files from local hard drive to the pydio workspace click “ upload” .




To share a folder to any user click share option and follow steps shown in below snaps.



FAQ
Q
Is there any Free alternative tools for dropbox?
A
Yes, there are plenty like owncloud,Next cloud, seafile and so on among this opencloud and nextcloud is way good
Q
Instead of downloading .deb file why you have added them in "/etc/apt/sources.list"?
A
"/etc/apt/sources.list" is the repolist file you can add the deb path and update the system by "apt-get update" and install the package
Q
Please let me know some open source cloud softwares
A
Owncloud,Nextcloud
Q
I couldn't able to access the web interface?
A
Make sure you have added http service in firewall or not.
Q
Is this could be installed in cloud surface!!
A
Yes you can install in cloud surface !!! Any open source you give a try