Thursday, January 8, 2015

How to install OwnCloud 7 on CentOS 7

I based this post on this, http://www.itzgeek.com/how-tos/linux/centos-how-tos/install-owncloud-7-on-centos-7-rhel-7.html , but with some changes, like installing OwnCloud through the repository instead of extracting the tar archive. This way we get yum updates. There are other some minor changes.

We install with yum the prerequisites,

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


I don't like SELinux as it gave me a big headache with Samba 4 AD, and have disabled it already. The howto I am based on mentions to run this command in order to allow OwnCloud to write data, but I have not tested it:

setsebool -P httpd_unified 1


Opening ports to 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. We first install the repo. It is the official one.

cd /etc/yum.repos.d/
wget http://download.opensuse.org/repositories/isv:ownCloud:community/CentOS_CentOS-7/isv:ownCloud:community.repo
yum install owncloud

Setting the owner to Apache:

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

Now we create the database and the user for MariaDB:

mysql -u root -p
create database clouddb;
grant all on clouddb.* to 'clouddbuser'@'localhost' identified by 'password';

Next is configure the virtual host Apache file,

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

Add the following,

<Directory /var/www/html/owncloud>
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
</Directory>

Restart Apache server,

systemctl restart httpd.service

And then you are good to go to https://yourserver/owncloud to further configuration. Select MySQL/MariaDB instead of SQLite.


No comments:

Post a Comment