Setup Owncloud on CentOS 6


Introduction (from Wikipedia)

OwnCloud is very similar to the widely used Dropbox, with the primary difference being that ownCloud is free and open-source, and thereby allowing anyone to install and operate it without charge on a private server, with no limits on storage space (except for hard disk capacity) or the number of connected clients.

Disable Firewall

[root@server ~]# /etc/init.d/iptables stop
[root@server ~]# chkconfig --level 35 iptables off

Disable SELinux

[root@server ~]# vi /etc/selinux/config
SELINUX=disabled

Step 1: Install Prerequisites Package

[root@server ~]# yum install httpd php php-mysql mysql-server mysql sqlite php-dom php-mbstring php-gd php-pdo

Step 2: Create Database

[root@server ~]# mysql -u -p

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

mysql> create database clouddb;

mysql> grant all on clouddb.* to 'clouddbuser'@'localhost' identified by 'welcome';

mysql> exit

Step 3: Download and Install Owncloud

[root@server ~]# wget http://download.owncloud.org/community/owncloud-6.0.0a.tar.bz2

[root@server ~]# tar xvf owncloud-6.0.0a.tar.bz2

[root@server ~]# mv owncloud /var/www/html/

[root@server ~]# chown -R apache:apache /var/www/html/owncloud/

[root@server ~]# chmod 777 /var/www/html/owncloud/config/

[root@server ~]# vi /etc/http/conf.d/httpd.conf

Add the below lines;

Alias /cloud /var/www/html/owncloud/
Directory “/var/www/html/owncloud”
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
allow from all

Save and Exit (:wq!)

Restart Apache services

[root@server ~]# /etc/init.d/httpd restart

Step 4: Configure owncloud

Open web browser, type http://localhost/cloud. Enter the admin details and choose MySQL database.

MySQL Database details;

Username : clouddbuser
Password : welcome
Database : cloulddb
Server : localhost

That’s it. Now you can start upload a files via web browser.

Thanks!

Installing ProFTPD server


ProFTPD is an Open Source FTP Server with secure and reliable file transfer on Linux environments. The configurations are simple and easy to setup.

Step 1: Hostname definition

Put the hostname entry in your linux host file

[root@server.local ~]# vi /etc/hosts

Add this in end of file

192.168.1.5 server.local

Save and exit the file.

Step 2: Install EPEL

Check whether you have installed EPEL repoistory on your server, if not please check our previous post.

[root@server.local ~]# rpm -qa epel*
epel-release-6-8.noarch

In my server i’m already have EPEL repository. So we are ready to go.

Step 3: Install ProFTPD package

Now we want to install the main package called “ProFTPD” by issuing following command.

[root@server.local ~]# yum install proftpd proftpd-utils
Loaded plugins: fastestmirror, priorities
Loading mirror speeds from cached hostfile
* base: centos.excellmedia.net
* epel: epel.mirror.net.in
* extras: centos.excellmedia.net
* jpackage-generic: sunsite.rediris.es
* jpackage-generic-5.0: sunsite.rediris.es
* updates: centos.excellmedia.net
189 packages excluded due to repository priority protections
Setting up Install Process
No package proftpd-utils available.
Resolving Dependencies
--> Running transaction check
---> Package proftpd.x86_64 0:1.3.3g-4.el6 will be installed
--> Processing Dependency: libGeoIP.so.1()(64bit) for package: proftpd-1.3.3g-4.el6.x86_64
--> Running transaction check
---> Package GeoIP.x86_64 0:1.5.1-5.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
proftpd x86_64 1.3.3g-4.el6 epel 3.3 M
Installing for dependencies:
GeoIP x86_64 1.5.1-5.el6 epel 21 M

Transaction Summary
================================================================================
Install 2 Package(s)

Total download size: 24 M
Installed size: 50 M
Is this ok [y/N]: y
Downloading Packages:
(1/2): GeoIP-1.5.1-5.el6.x86_64.rpm | 21 MB 07:59
(2/2): proftpd-1.3.3g-4.el6.x86_64.rpm | 3.3 MB 01:43
--------------------------------------------------------------------------------
Total 42 kB/s | 24 MB 09:44
warning: rpmts_HdrFromFdno: Header V3 RSA/SHA256 Signature, key ID 0608b895: NOKEY
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
Importing GPG key 0x0608B895:
Userid : EPEL (6)
Package: epel-release-6-8.noarch (installed)
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
Is this ok [y/N]: y
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : GeoIP-1.5.1-5.el6.x86_64 1/2
Installing : proftpd-1.3.3g-4.el6.x86_64 2/2
Verifying : proftpd-1.3.3g-4.el6.x86_64 1/2
Verifying : GeoIP-1.5.1-5.el6.x86_64 2/2

Installed:
proftpd.x86_64 0:1.3.3g-4.el6

Dependency Installed:
GeoIP.x86_64 0:1.5.1-5.el6

Complete!

Step 4: Create FTP User

Create a vaild FTP user for authorized connection.

[root@server.local ~]# useradd john
[root@server.local ~]# passwd john
[root@server.local ~]# su - john

Create a directory

[john@server.local ~]$ mkdir Test

Step 5: Start ProFTPD service

Before starting FTP service please check twice whether your firewall services are disabled.

[root@server.local ~]# /etc/init.d/iptables stop
iptables: Flushing firewall rules: [ OK ]
iptables: Setting chains to policy ACCEPT: filter [ OK ]
iptables: Unloading modules: [ OK ]

[root@server.local ~]# chkconfig --level 35 iptables off

[root@server.local ~]# /etc/init.d/proftpd start
Starting proftpd: [ OK ]

[root@server.local ~]# chkconfig --level 35 proftpd on

Step 6: Access ProFTPD server

Open your web browser, type ftp://server.local or ftp://192.168.1.5. You will be asked to enter the username and password, here give john’s credentials.

It will access your account file which is your $HOME system path account, defined in /etc/passwd file. The created folder “Test” is visible on the browser now.

That’s all!! You made it. Now FTP server is ready to use in your environment.

Thanks!!