donderdag 15 december 2016

nextcloud 10, centos 7 and rh-php56

nextcloud is a great alternative for dropbox.
It 's easy to run, manage and use.
It got great apps on android and linux.

I'v been running owncloud on debian but recently decided to change to centos 7.
Moving nextcloud was easy, but centos 7 comes with PHP54.
So Ive tried to upgrade PHP to 56, but that was not as easy as I tought.

In the end I got it running with these.

sudo yum install rh-php56-php-mbstring rh-php56-php-gd rh-php56-php-pdo rh-php56-php-xml rh-php56-php-pear wget bzip2 curl rh-php56-php rh-php56-php-mysqlnd

cd /etc/httpd/conf.d
sudo mv 10-php54-php.conf 10-php54-php.old

cd /etc/httpd/conf.modules.d
sudo mv 10-php54-php.conf 10-php54-php.old  
sudo mv 10-php.conf 10-php.old

cd /etc/httpd/modules
sudo ln -s /opt/rh/httpd24/root/usr/lib64/httpd/modules/ .

sudo apacheclt restart

I got the site running, then I got these errors
Can't write into config directory!
This can usually be fixed by giving the webserver write access to the config directory.

but these too saved my day.

semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/html/nextcloud(/.*)?'; restorecon -RF /var/www/html/nextcloud/

semanage fcontext -a -t httpd_sys_rw_content_t '/data(/.*)?'; restorecon -RF /data/