For those of you who didn’t know, OwnCloud is a free and open-source software which enables you to create a private “file-hosting” cloud. OwnCloud is similar to DropBox service with the diference of being free to download and install on your private server. Owncloud made by PHP and backend database MySQL (MariaDB), SQLLite or PostgreSQL. OwnCloud also enables you to easily view and sync address book, calendar events, tasks and bookmarks. You can access it via the good looking and easy to use web interface or install OwnCloud client on your Desktop or Laptop machine (supports Linux, Windows and Mac OSX).
This article assumes you have at least basic knowledge of linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple. I will show you through the step by step installation OwnCloud 8 on CentOS 6.
rpm -Uvh remi-release-6.rpm
rpm -ivh epel-release-6-8.noarch.rpm
Step 2. Install the necessary PHP components.
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 -y
Step 3. Install MySQL.
yum install mysql-server -y
service mysql start
By default, MySQL is not hardened. You can secure MySQL using the mysql_secure_installation script. you should read and below each steps carefully which will set root password, remove anonymous users, disallow remote root login, and remove the test database and access to secure MySQL.
Step 4. Create a new MySQL database using the following commands.
#mysql -uroot -p
CREATE DATABASE owncloud;
GRANT ALL PRIVILEGES ON owncloud.* TO 'owncloud_user'@'localhost' IDENTIFIED BY 'owncloud_user_pasword';
Step 5. Install OwnCloud and dependencies.
tar -xjf owncloud-8.0.0.tar.bz2
mv owncloud /var/www/html/owncloud/
Set the directory permissions:
chown -R apache.apache /var/www/html/owncloud/
Step 5. Configuring Apache for OwnCloud.
While configuring Apache web server, it is recommended that you to enable .htaccess to get a enhanced security features, by default .htaccess is disabled in Apache server. To enable it, open your virtual host file and make AllowOverride is set to All.For example, here i used external config file instead of modifying main file.
Alias /owncloud /var/www/html/owncloud
Options Indexes FollowSymLinks
allow from all
Remember to restart all services related to Apache server.
service httpd restart
Step 6. Access OwnCloud application.
Navigate to http://your-domain.com/ and follow the easy instructions. Enter username and password for the administrator user account, click on the ‘Advanced options’ hyperlink and enter the data directory (or leave the default setting), then enter database username, database password, database name, host (localhost) and click ‘Finish setup’.