ownCloud is the online data storage work as an online secure data backup for file sync and share data storage cloud just like Dropbox or Google Drive online file storage. We don’t need to worry about where or how to access our files. With ownCloud online data storage all our data is where ever we are; accessible on all devices, and any time. We can hosted ownCloud online data storage exclusively on our own private dedicated server, so we can rest assured that our data is under our control.
In this tutorial will show how to install ownCloud online data storage on CentOS 7 Linux dedicated server. At the time of writing this document, the latest ownCloud online data storage version that available to download is 10.0.4.
In this article of installing ownCloud online data storage on CentOS 7 Linux dedicated server, it is supposed that:
a. You have already install RHEL/CentOS 7 Linux server up and running. In case that you don’t, you would probably like to read this link. Minimal RHEL/CentOS 7 Installation With Logical Volume Manager (LVM).
b. You have already done the initial server setup. Please refer to this link Minimal RHEL/CentOS 7 Initial Server Setup.
3. Install and Configure Database for ownCloud Application
In CentOS 7 server, MySQl database program which mostly used by many software development company is moved to MariaDB, execute the following command to install MariaDB data base software.
# yum -y install mariadb-server mariadb-devel
Enable MariaDB data base software service to start it a the system boot and start its service.
# systemctl enable mariadb # systemctl start mariadb
Now let do the security hardening of MariaDB data base software by execute the following command.
We need to create a database and a user for ownCloud online data storage and grant it all database privileges.
# mysql -u root -p mysql> create database ownclouddb01; mysql> create user 'ownclouduser'@'localhost' identified by 'P@ssword01'; mysql> grant all privileges on ownclouddb01.* to ownclouduser@localhost; mysql> flush privileges;
4. Installing Apache Web Server
Before we can start to install ownCloud online data storage, we need to install Apache Web server and some mandatory packages as the following first.
# rpm -Uvh https://mirror.webtatic.com/yum/el7/epel-release.rpm # rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm # yum install -y httpd php56w php56w-opcache php56w-xml php56w-mcrypt php56w-gd php56w-devel php56w-mysql php56w-mbstring php56w-ldap
Enable Apache web service to start it a the system boot and start its service.
# systemctl enable httpd # systemctl start httpd
Now let move to the installation directory for ownCloud online data storage, /var/www, download it directly from ownCloud online data storage web site.
# wget https://download.owncloud.org/community/owncloud-10.0.4.tar.bz2 # tar xvf owncloud-10.0.4.tar.bz2
It is recommended to create a symbolic link to the extracted directory of ownCloud online secure data backup. So, it will make us easy to upgrades ownCloud online file storage to a newer versions.
# cd /var/www/ # mv owncloud owncloud-10.0.4 # ln -s owncloud-10.0.4 owncloud
Also, we need to make sure that the permissions on the ownCloud online data storage root directories are set correctly as the following.
# chmod -R 755 /var/www/owncloud-10.0.4 # chown -R apache:apache /var/www/owncloud-10.0.4
Next, we need to open HTTP port 80 on IPTables by edit file “/etc/sysconfig/iptables” as the following.
# vim /etc/sysconfig/iptables -A INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT # systemctl restart iptables # iptables -L -n -v
Usually, the default PHP installation has not configured the correct timezone or php error reporting. While not required to run ownCloud online data storage, it’s highly recommended to enable error reporting to syslog for troubleshooting issues with plugins or other scripts. Edit file “/etc/php.ini” as the following.
# vim /etc/php.ini date.timezone = Asia/Phnom_Penh log_errors = syslog
Then, we need to restart Apache service.
# systemctl restart httpd
We also need to disable SELinux.
# vim /etc/selinux/config SELINUX=disabled # reboot
5. Configure VHost and Install TeamPass Application
To create a VHost for ownCloud online data storage, we need to create a *.conf file in directory “/etc/httpd/conf.d” as the following.
# vim /etc/httpd/conf.d/owncloud.conf <VirtualHost *:80> ServerAdmin email@example.com ServerName owncloud.techspacekh.com DocumentRoot /var/www/owncloud ErrorLog "/var/log/httpd/owncloud.techspacekh.com.log" CustomLog "/var/log/httpd/owncloud.techspacekh.com.log" combined </VirtualHost>
Then, we need to restart Apache service.
# systemctl restart httpd
To access to ownCloud online data storage with domain as configured in the VHost above we need DNS record for this domain. If you don’t have a DNS record for this domain, we just edit the host file. The host file for Windows is located in “C:\Windows\System32\drivers\etc\host” and you can edit it with Notepad.
After editing the host file, we can test by ping to the domain name and make use the reply IP address for this domain name is IP of server that we install ownCloud online secure data backup.
>ping owncloud.techspacekh.com Pinging owncloud.techspacekh.com [192.168.150.132] with 32 bytes of data: Reply from 192.168.150.132: bytes=32 time<1ms TTL=64 Reply from 192.168.150.132: bytes=32 time<1ms TTL=64 Reply from 192.168.150.132: bytes=32 time<1ms TTL=64 Reply from 192.168.150.132: bytes=32 time<1ms TTL=64 Ping statistics for 192.168.150.132: Packets: Sent = 4, Received = 4, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 0ms, Maximum = 0ms, Average = 0ms
Finally, we are ready to install ownCloud online data storage web application.
In your browser, in the address box type in http://owncloud.techspacekh.com and the following windows appears. We will be presented with the following page, asking us to create an admin account, so we can enter a username and password for our admin account here.
Then click on the “Storage & database” drop down menu and leave the “Data folder” field information as it is. Click the “MySQL/MariaDB” button and then enter the information of the database database information that we create in the above step for ownCloud online data storage.
Click on “Finish setup” and our admin account for ownCloud online data storage will be created
Now we can try to login to ownCloud online data storage Web interface with the user admin and the password set in above step.
We should be able to successfully login to ownCloud online data storage web interface with our account and we will be welcomed by the ownCloud online data storage home page where you can start uploading your files.
That’s all about how to install ownCloud online secure data backup on CentOS 7 Linux dedicated server from Tech Space KH. ownCloud a very nice online data storage with privacy and works protection of our files. It ensures that access is controlled only by the one who should have control . Hopefully, you can find this guide informative. If you have any questions or suggestions you can always leave your comments below. I will try all of my best to review and reply them.