search
top

How To Install ownCloud 5 on CentOS 6

So you want to be part of the “Cloud”, how about your own personal cloud? Enter ownCloud, ownCloud is a free Open Source

software, used to setup your own personal cloud for file sharing, Calender, Contact and Bookmark sharing and Personal

Audio/Video Streaming. It is pretty easy to setup and manage.

In this post I will be using CentOS 6.3 minimal server to setup ownCloud.
Install the necessary packages for ownCloud

[root@owncloud ~]# yum -y install mysql-server httpd php php-mysql wget php-json php-xml php-mbstring php-zip php-gd curl php-curl php-pdo

Start mysql and httpd services and let them to start automatically on every reboot.

[root@owncloud ~]# /etc/init.d/mysqld start
[root@owncloud ~]# /etc/init.d/httpd start
[root@owncloud ~]# chkconfig mysqld on
[root@owncloud ~]# chkconfig httpd on

Adjust iptables to access owncloud server from outside of the network.

Add the following lines to the iptables config file and restart iptables.

[root@owncloud ~]# vi /etc/sysconfig/iptables
-A INPUT -p tcp -m state –state NEW –dport 80 -j ACCEPT
-A INPUT -p tcp -m state –state NEW –dport 80 -j ACCEPT
[root@owncloud ~]# service iptables restart

Now install and create mysql user and database for owncloud.

Note: In this tutorial i use password as “centos” for mysql database, owncloud admin account.

[root@owncloud ~]# /usr/bin/mysql_secure_installation
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!
In order to log into MySQL to secure it, we’ll need the current
password for the root user. If you’ve just installed MySQL, 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 MySQL
root user without the proper authorisation.
Set root password? [Y/n] y
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
… Success!
By default, a MySQL installation has an anonymous user, allowing anyone
to log into MySQL 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, MySQL 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 MySQL
installation should now be secure.

Thanks for using MySQL!

[root@owncloud ~]# mysql -u root -p
Enter password:
mysql> CREATE DATABASE owncloud;
Query OK, 1 row affected (0.01 sec)
mysql> GRANT ALL ON owncloud.* TO ‘owncloud’@’localhost’ IDENTIFIED BY ‘centos’;
Query OK, 0 rows affected (0.01 sec)
mysql> GRANT ALL ON owncloud.* TO ‘owncloud’@’localhost.localdomain’ IDENTIFIED BY ‘centos’;
Query OK, 0 rows affected (0.00 sec)
mysql> exit

Getting and installing ownCloud

Goto to Apache root document folder and download the latest version of owncloud.

[root@owncloud ~]# cd /var/www/html/
[root@owncloud html]# wget http://download.owncloud.org/community/owncloud-5.0.13.tar.bz2

Expand the archive
[root@owncloud html]# tar xvf owncloud-5.0.13.tar.bz2
[root@owncloud html]# rm owncloud-5.0.13.tar.bz2
[root@owncloud html]# chown -R apache:apache owncloud
[root@owncloud html]# chmod 750 owncloud/data/
[root@owncloud html]# chmod 777 owncloud/config/

Find and edit the lines as shown below in “/etc/httpd/conf/httpd.conf” file.

[root@owncloud html]# vi /etc/httpd/conf/httpd.conf

<Directory “/var/www/html”>
     Options Indexes FollowSymLinks
     AllowOverride All
     Order allow,deny
     Allow from all
</Directory>

Restart the httpd and mysqld services.

[root@owncloud html]# /etc/init.d/mysqld restart
[root@owncloud html]# /etc/init.d/httpd restart

Now goto any client system if your owncloud server doesn’t has GUI mode and access it by “http://ip-address/owncloud or http://domain name/owncloud. The index page of own cloud will open now. Create the administrator username and password for your cloud server.

Thats it. You can upload/download your images, files and Audio/Video here and you can access them from your network. Make

it easier and install the desktop and mobile client from http://owncloud.org/install/.

Leave a Reply

Your email address will not be published. Required fields are marked *

top