Hey,
I’ve got a running OC server in production running without issues. I need to migrate to a new server where I’ve installed CentOS 7 with PHP 7 + MariaDB.
I copied (rsync) the entire owncloud directory, and also made a mysql dump which I restored on the new server.
I also modified $ocpath/lib/private/appframework/http/request.php adding this code in order to make it work with php 7:
public function __isset($name) {
if (in_array($name, $this->allowedKeys, true)) {
return true;
}
return isset($this->items['parameters'][$name]);
}
The thing is I cannot access owncloud because of SELinux. When I go to http://domain.com/owncloud/index.php this message appears:
“Cannot write into “config” directory!
This can usually be fixed by giving the webserver write access to the config directory.”
This is selinux info for the config directory:
drwxrwxr-x. apache apache system_u:object_r:httpd_sys_rw_content_t:s0 config
And these are the files located into config dir:
-rw-r-----. apache apache system_u:object_r:httpd_sys_content_t:s0 config.php
-rwxr-xr-x. apache apache system_u:object_r:httpd_sys_content_t:s0 config.sample.php
I don’t know how to solve this because this is the exact way the files are in the previous (working) instance of ownCloud. The only difference is that the previous server has PHP 5.6.14
When I run disable SELinux (setenforce 0) I can access ownCloud normally.
I would appreciate very much your help!
Regards.
Damon H.
Steps to reproduce
- Copy owncloud directory from a funcional owncloud instance to a new server
- Update DB from a DB dump
- Running owncloud
Expected behaviour
OC should works
Actual behaviour
Cannot write into “config” directory! This can usually be fixed by giving the webserver write access to the config directory.
Server configuration
Operating system: CentOS 7
Web server: apache 2.4.6
Database: mysql Ver 15.1 Distrib 5.5.47-MariaDB
PHP version: PHP v7.0.9
ownCloud version (see ownCloud admin page): 8.2.1.4
Updated from an older ownCloud or fresh install: migrated from a runing instance
ownCloud log (data/owncloud.log, see How to find webserver or OC logfile / enable php logfile): empty
Special configuration: SELinux is enforcing