Install OwnCloud 7 on CentOS 7 / RHEL 7


Here is the small guide to setup ownCloud 7 on CentOS 7.

Prerequisites:

As mentioned earlier, it is based on PHP and database combination, database can be any of the above four. So install PHP, Apache web server and MySQL server on CentOS 7. For demo purpose i installed both SQLite and MySQL on CentOS, we will talk about reason behind later.

yum install httpd php php-mysql mariadb-server mariadb sqlite php-dom php-mbstring php-gd php-pdo wget

Set SELinux to allow OwnCloud to write the data.

setsebool -P httpd_unified 1

Allow apache in firewall.

firewall-cmd --permanent --zone=public --add-service=http
firewall-cmd --permanent --zone=public --add-service=https
firewall-cmd --reload

Start Apache and MariaDB.

systemctl start httpd.service
systemctl start mariadb.service

Auto start the service at system start-up.

systemctl enable httpd.service
systemctl enable mariadb.service

Download and Setup:

Download ownCloud from official website or enter the fallowing command on terminal.

wget https://download.owncloud.org/community/owncloud-7.0.0.tar.bz2

Extract the archive.

tar -jxvf owncloud-7.0.0.tar.bz2 -C /var/www/html/

Allow the web server to read and write the files on cloud directory.

chown -R apache.apache /var/www/html/owncloud/

Create Database:

If you are setting up a MariaDB for the first time, here is the tutorial on Securing MariaDB.  MariaDB server must be started before creating the database, login to MySQL server.

mysql -u root -p

Create database called “clouddb”

create database clouddb;

Allow “clouddbuser” to access the “clouddb” database on localhost with predefined password.

grant all on clouddb.* to 'clouddbuser'@'localhost' identified by 'password';

Configure Apache server:

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.

vi /etc/httpd/conf.d/owncloud.conf

Add the following.

<IfModule mod_alias.c>
Alias /owncloud /var/www/html/owncloud
</IfModule>
<Directory “/var/www/html/owncloud”>
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
allow from all
</Directory>

Remember to restart all services related to Apache server.

systemctl restart httpd.service

Configure ownCloud:
Open up web browser, point a URL to http://your-ip-address/owncloud ( http://Your-custom-domain). Browser will automatically take you to ownCloud setup page where it must be configured before going to live. Enter admin user name, password, data folder location and database details. You can choose any one of the database from SQLite or MySQL. If you choose SQLite database, you do not require to enter database details. where as MySQL database requires database user, password and data base name.

CentOS 7 - OwnCloud 7 DB Details
CentOS 7 – OwnCloud 7 DB Details

Alternately you can download ownCloud client to upload the files.

CentOS 7 - OwnCloud 7 Sync Options
CentOS 7 – OwnCloud 7 Sync Options

Home page will look like this, you can start uploading the contents using upload button.

CentOS 7 - OwnCloud 7 Home Page
CentOS 7 – OwnCloud 7 Home Page

That’s All!.


답글 남기기

이메일 주소는 공개되지 않습니다.