ownCloud is open source file sync and share software for everyone from individuals operating the free ownCloud Server edition, to large enterprises and service providers operating the ownCloud Enterprise Subscription. ownCloud provides a safe, secure, and compliant file synchronization and sharing solution on servers that you control.
You can share one or more files and folders on your computer, and synchronize them with your ownCloud server. Place files in your local shared directories, and those files are immediately synchronized to the server and to other devices using the ownCloud Desktop Sync Client, Android app, or iOS app. To learn more about the ownCloud desktop and mobile clients, please refer to their respective manuals:
Hostname and ip address of my CentOS 7 machine is “owncloud.hackthesec.co.in” & “192.168.1.101″
Following are the prerequisites for ownCloud.
- PHP
- Apache Web Server ( Apache )
- Database Server ( MariaDB or SQLite or Oracle or PostgreSQL )
Step:1 Install PHP and Web Server (HTTPD)
Use below yum command to install php and apache web server (httpd) and other PHP dependencies.
[root@hackthesec ~]# yum install httpd php php-mysql sqlite php-dom php-mbstring php-gd php-pdo php-json php-xml php-zip php-gd curl php-curl php-mcrypt php-pear
Start the Web Server service
[root@hackthesec ~]# systemctl start httpd.service
[root@hackthesec ~]# systemctl enable httpd.service
ln -s '/usr/lib/systemd/system/httpd.service' '/etc/systemd/system/multi-user.target.wants/httpd.service'
Step:2 Install and Configure Database for ownCloud.
In CentOS 7 MariaDB is the default database server.
[root@hackthesec ~]# yum install mariadb-server mariadb
Start the Database Service
[root@hackthesec ~]# systemctl start mariadb.service
[root@hackthesec ~]# systemctl enable mariadb.service
ln -s '/usr/lib/systemd/system/mariadb.service' '/etc/systemd/system/multi-user.target.wants/mariadb.service'
Set the Root password and other database parameters using below command :
[root@hackthesec ~]# mysql_secure_installation
Create the database (owncloud_db).
[root@hackthesec ~]# mysql -u root -p
Enter password:
MariaDB [(none)]> create database owncloud_db;
Query OK, 1 row affected (0.00 sec)
MariaDB [(none)]>
Create a database user(dbuser) and grant all the privileges on the database (owncloud_db)
MariaDB [(none)]> grant all on owncloud_db.* to 'dbuser'@'localhost' identified by 'Owncloud@123#';
Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]> exit
Bye
Step:3 Install ownCloud package using yum command.
ownCloud Package is not available in the default yum repositories so we will set below
EPEL and ownlcoud repositories.
Note : Install wget package in case it is not installed on your system.
[root@hackthesec ~]# yum install wget
[root@hackthesec ~]# rpm -Uhv http://dl.fedoraproject.org/pub/epel/7/$(uname -i)/e/epel-release-7-5.noarch.rpm
[root@hackthesec ~]# wget http://download.owncloud.org/download/repositories/stable/CentOS_7/ce:stable.repo -O /etc/yum.repos.d/ce:stable.repo
[root@hackthesec ~]# yum install owncloud
Allow Web Server’s port in the OS(Operating System) firewall.
[root@hackthesec ~]# firewall-cmd --permanent --zone=public --add-service=http
success
[root@hackthesec ~]# firewall-cmd --permanent --zone=public --add-service=httpssuccess
[root@hackthesec ~]# firewall-cmd --reload
success
Set the required permissions on ownlcoud folder “/var/www/html/owncloud”
[root@hackthesec ~]# chown -R apache.apache /var/www/html/owncloud/
Set the below SELinux Rules if SELinux is enabled on your system
[root@hackthesec ~]# semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/html/owncloud/data'
[root@hackthesec ~]# restorecon '/var/www/html/owncloud/data'
[root@hackthesec ~]# semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/html/owncloud/config'
[root@hackthesec ~]# restorecon '/var/www/html/owncloud/config'
[root@hackthesec ~]# semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/html/owncloud/apps'
[root@hackthesec ~]# restorecon '/var/www/html/owncloud/apps'
Step:4 Start ownCloud Installation from the Browser.
To start the ownCloud installation open the web browser and type :
http://192.168.1.101/owncloud/
Replace the ip address as per your setup.
Specify the User name as ‘admin’ and give password that you want set for admin user. Data Folder as ‘/var/www/html/owncloud/data’ and Database name (owncloud_db) and database user (dbuser) credentials that we created in above steps.
Click on ‘Finish setup’
Get ownCloud Clients and aaps to sync your data.
Home Page of Our ownCloud will look like below.
Installation and Configuration of ownCloud is completed. Now upload data and share it among users.
By Default only 513MB data file can be uploaded in case you want to change this limit , edit the file ‘/var/www/html/owncloud/.htaccess‘ and set the limit as per requirement.
<IfModule mod_php5.c>
php_value upload_max_filesize 513M
php_value post_max_size 513M
php_value memory_limit 513M
php_value mbstring.func_overload 0
php_value always_populate_raw_post_data -1
php_value default_charset 'UTF-8'
php_value output_buffering 0
<IfModule mod_env.c>
HackTheSecurity
HackTheSec Twitter
LinuxTutorial.net