Unable to get folder permissions to work for a fresh install

Ask all your questions regarding OC 8.2 Please read the Support Forum Rules
Forum rules
The forums were migrated over to https://central.owncloud.org which is based on the forum software Discourse. The forums here is put into read-only mode starting from today.

More background information about this move and the reasoning behind it is available in this blogpost:

https://daniel.molkentin.net/2016/07/20 ... d-central/
earthling
Newbie
Posts: 1
Joined: Thu Jan 21, 2016 1:36 pm
ownCloud version: 8.2.2
Webserver: Apache
Database: MySQL
OS: Linux
PHP version: 5.4

Unable to get folder permissions to work for a fresh install

Postby earthling » Thu Jan 21, 2016 1:45 pm

Hello,
I just did a fresh install of OC 8.2 on CentOS7. When I navigate to the link, I get a web-server permissions error page saying Can't write into config directory! This can usually be fixed by giving the webserver write access to the config directory.
web-perm.png
web-perm.png (12.94 KiB) Viewed 413 times


I've run the folder permissions scripts as shown in https://doc.owncloud.org/server/8.2/adm ... ermissions.

And here's my directory dump showing the folder perms (I've given full rwx permissions to config just to test when all else failed):

Code: Select all

drwxr-x---. 14 root   apache 4.0K 2016-01-21 18:22 .
drwxr-xr-x.  3 root   root     21 2016-01-21 18:10 ..
drwxr-x---. 28 apache apache 4.0K 2016-01-21 18:10 3rdparty
drwxr-x---. 20 apache apache 4.0K 2016-01-21 18:10 apps
drwxr-x---.  2 apache apache    6 2015-12-22 20:30 assets
-rw-r-----.  1 root   apache  477 2015-12-21 19:46 AUTHORS
drwxrwxr-x.  2 apache apache   70 2016-01-21 18:30 config
-rw-r-----.  1 root   apache 2.5K 2015-12-21 19:46 console.php
-rw-r-----.  1 root   apache  34K 2015-12-21 19:46 COPYING-AGPL
drwxr-x---. 19 root   apache 4.0K 2016-01-21 18:10 core
-rw-r-----.  1 root   apache 5.3K 2015-12-21 19:46 cron.php
drwxr-x---.  3 apache apache 4.0K 2016-01-21 18:30 data
-rw-r-----.  1 root   apache  24K 2015-12-21 19:46 db_structure.xml
-rw-r--r--.  1 root   apache 2.1K 2015-12-21 19:46 .htaccess
-rw-r-----.  1 root   apache  179 2015-12-21 19:46 index.html
-rw-r-----.  1 root   apache 2.0K 2015-12-21 19:46 index.php
drwxr-x---.  6 root   apache   93 2016-01-21 18:10 lib
-rwxr-x--x.  1 apache apache  283 2015-12-21 19:46 occ
drwxr-x---.  2 root   apache   69 2016-01-21 18:10 ocs
drwxr-x---.  2 root   apache   41 2016-01-21 18:10 ocs-provider
-rw-r--r--.  1 root   root     20 2016-01-21 18:22 php1.php
-rw-r-----.  1 root   apache 2.9K 2015-12-21 19:46 public.php
-rw-r-----.  1 root   apache  26K 2015-12-22 20:30 README
-rw-r-----.  1 root   apache 7.8K 2015-12-22 20:30 README.packaging
-rw-r-----.  1 root   apache 1.4K 2015-12-22 20:30 README.SELinux
-rw-r-----.  1 root   apache 4.5K 2015-12-21 19:46 remote.php
drwxr-x---.  3 root   apache   19 2016-01-21 18:10 resources
-rw-r-----.  1 root   apache   26 2015-12-22 20:30 robots.txt
drwxr-x---. 13 root   apache 4.0K 2016-01-21 18:10 settings
-rw-r-----.  1 root   apache 1.8K 2015-12-21 19:46 status.php
drwxr-x---.  3 apache apache   33 2016-01-21 18:10 themes
-rw-r-----.  1 root   apache  233 2015-12-21 19:56 version.php


Where am I going wrong?

Thanks.

User avatar
dimitrip
Starter
Posts: 99
Joined: Sat Jan 23, 2016 9:39 pm
ownCloud version: 8.2.2
Webserver: Apache
Database: MySQL
OS: Linux
PHP version: 5.6

Re: Unable to get folder permissions to work for a fresh install

Postby dimitrip » Sun Jan 31, 2016 5:48 pm

what about selinux?

# sestatus

# ll -Z /var/www/html/owncloud

# ll -Z /var/www/html/owncloud/*

what's the output?
Open Minds

deparra
Newbie
Posts: 2
Joined: Fri Jun 17, 2016 4:52 pm
ownCloud version: 9.0.2
Webserver: Apache
Database: MySQL
OS: Linux
PHP version: 5.4

Re: Unable to get folder permissions to work for a fresh install

Postby deparra » Fri Jun 17, 2016 5:18 pm

I have the same problem in CentOS 7 and installed by repository

dimitrip wrote:what about selinux?

# sestatus


Code: Select all

SELinux status:                 enabled
SELinuxfs mount:                /sys/fs/selinux
SELinux root directory:         /etc/selinux
Loaded policy name:             targeted
Current mode:                   enforcing
Mode from config file:          enforcing
Policy MLS status:              enabled
Policy deny_unknown status:     allowed
Max kernel policy version:      28


dimitrip wrote:# ll -Z /var/www/html/owncloud


Code: Select all

drwxr-x---. root   apache system_u:object_r:httpd_sys_content_t:s0 3rdparty
drwxr-x---. apache apache system_u:object_r:httpd_sys_content_t:s0 apps
drwxr-x---. apache apache unconfined_u:object_r:httpd_sys_content_t:s0 assets
-rw-r-----. root   apache system_u:object_r:httpd_sys_content_t:s0 AUTHORS
drwxr-x---. apache apache system_u:object_r:httpd_sys_content_t:s0 config
-rw-r-----. root   apache system_u:object_r:httpd_sys_content_t:s0 console.php
-rw-r-----. root   apache system_u:object_r:httpd_sys_content_t:s0 COPYING-AGPL
drwxr-x---. root   apache system_u:object_r:httpd_sys_content_t:s0 core
-rw-r-----. root   apache system_u:object_r:httpd_sys_content_t:s0 cron.php
drwxr-x---. apache apache system_u:object_r:httpd_sys_rw_content_t:s0 data
-rw-r-----. root   apache system_u:object_r:httpd_sys_content_t:s0 db_structure.xml
drwxr-x---. root   apache system_u:object_r:httpd_sys_content_t:s0 etc
-rw-r-----. root   apache system_u:object_r:httpd_sys_content_t:s0 index.html
-rw-r-----. root   apache system_u:object_r:httpd_sys_content_t:s0 index.php
drwxr-x---. root   apache system_u:object_r:httpd_sys_content_t:s0 l10n
drwxr-x---. root   apache system_u:object_r:httpd_sys_content_t:s0 lib
-rwxr-x--x. root   apache system_u:object_r:httpd_sys_content_t:s0 occ
drwxr-x---. root   apache system_u:object_r:httpd_sys_content_t:s0 ocs
drwxr-x---. root   apache system_u:object_r:httpd_sys_content_t:s0 ocs-provider
-rw-r-----. root   apache system_u:object_r:httpd_sys_content_t:s0 public.php
-rw-r-----. root   apache system_u:object_r:httpd_sys_content_t:s0 remote.php
drwxr-x---. root   apache system_u:object_r:httpd_sys_content_t:s0 resources
-rw-r-----. root   apache system_u:object_r:httpd_sys_content_t:s0 robots.txt
drwxr-x---. root   apache system_u:object_r:httpd_sys_content_t:s0 settings
-rw-r-----. root   apache system_u:object_r:httpd_sys_content_t:s0 status.php
drwxr-x---. apache apache system_u:object_r:httpd_sys_content_t:s0 themes
drwxr-x---. apache apache system_u:object_r:httpd_sys_content_t:s0 updater
-rw-r-----. root   apache system_u:object_r:httpd_sys_content_t:s0 version.php


dimitrip wrote:# ll -Z /var/www/html/owncloud/*


Code: Select all

-rw-r-----. root   apache system_u:object_r:httpd_sys_content_t:s0 /var/www/html/owncloud/AUTHORS
-rw-r-----. root   apache system_u:object_r:httpd_sys_content_t:s0 /var/www/html/owncloud/console.php
-rw-r-----. root   apache system_u:object_r:httpd_sys_content_t:s0 /var/www/html/owncloud/COPYING-AGPL
-rw-r-----. root   apache system_u:object_r:httpd_sys_content_t:s0 /var/www/html/owncloud/cron.php
-rw-r-----. root   apache system_u:object_r:httpd_sys_content_t:s0 /var/www/html/owncloud/db_structure.xml
-rw-r-----. root   apache system_u:object_r:httpd_sys_content_t:s0 /var/www/html/owncloud/index.html
-rw-r-----. root   apache system_u:object_r:httpd_sys_content_t:s0 /var/www/html/owncloud/index.php
-rwxr-x--x. root   apache system_u:object_r:httpd_sys_content_t:s0 /var/www/html/owncloud/occ
-rw-r-----. root   apache system_u:object_r:httpd_sys_content_t:s0 /var/www/html/owncloud/public.php
-rw-r-----. root   apache system_u:object_r:httpd_sys_content_t:s0 /var/www/html/owncloud/remote.php
-rw-r-----. root   apache system_u:object_r:httpd_sys_content_t:s0 /var/www/html/owncloud/robots.txt
-rw-r-----. root   apache system_u:object_r:httpd_sys_content_t:s0 /var/www/html/owncloud/status.php
-rw-r-----. root   apache system_u:object_r:httpd_sys_content_t:s0 /var/www/html/owncloud/version.php

/var/www/html/owncloud/3rdparty:
-rw-r-----. root apache system_u:object_r:httpd_sys_content_t:s0 autoload.php
drwxr-x---. root apache system_u:object_r:httpd_sys_content_t:s0 bantu
drwxr-x---. root apache system_u:object_r:httpd_sys_content_t:s0 composer
-rw-r-----. root apache system_u:object_r:httpd_sys_content_t:s0 composer.json
-rw-r-----. root apache system_u:object_r:httpd_sys_content_t:s0 composer.lock
drwxr-x---. root apache system_u:object_r:httpd_sys_content_t:s0 deepdiver1975
drwxr-x---. root apache system_u:object_r:httpd_sys_content_t:s0 doctrine
drwxr-x---. root apache system_u:object_r:httpd_sys_content_t:s0 guzzle
drwxr-x---. root apache system_u:object_r:httpd_sys_content_t:s0 guzzlehttp
drwxr-x---. root apache system_u:object_r:httpd_sys_content_t:s0 icewind
drwxr-x---. root apache system_u:object_r:httpd_sys_content_t:s0 interfasys
drwxr-x---. root apache system_u:object_r:httpd_sys_content_t:s0 ircmaxell
drwxr-x---. root apache system_u:object_r:httpd_sys_content_t:s0 james-heinrich
drwxr-x---. root apache system_u:object_r:httpd_sys_content_t:s0 jeremeamia
drwxr-x---. root apache system_u:object_r:httpd_sys_content_t:s0 kriswallsmith
drwxr-x---. root apache system_u:object_r:httpd_sys_content_t:s0 league
-rw-r-----. root apache system_u:object_r:httpd_sys_content_t:s0 LICENSE INFO
drwxr-x---. root apache system_u:object_r:httpd_sys_content_t:s0 mcnetic
drwxr-x---. root apache system_u:object_r:httpd_sys_content_t:s0 natxet
drwxr-x---. root apache system_u:object_r:httpd_sys_content_t:s0 nikic
drwxr-x---. root apache system_u:object_r:httpd_sys_content_t:s0 paragonie
-rw-r-----. root apache system_u:object_r:httpd_sys_content_t:s0 patches.txt
drwxr-x---. root apache system_u:object_r:httpd_sys_content_t:s0 patchwork
drwxr-x---. root apache system_u:object_r:httpd_sys_content_t:s0 pear
drwxr-x---. root apache system_u:object_r:httpd_sys_content_t:s0 phpseclib
drwxr-x---. root apache system_u:object_r:httpd_sys_content_t:s0 pimple
drwxr-x---. root apache system_u:object_r:httpd_sys_content_t:s0 punic
drwxr-x---. root apache system_u:object_r:httpd_sys_content_t:s0 rackspace
drwxr-x---. root apache system_u:object_r:httpd_sys_content_t:s0 react
-rw-r-----. root apache system_u:object_r:httpd_sys_content_t:s0 README.md
drwxr-x---. root apache system_u:object_r:httpd_sys_content_t:s0 sabre
drwxr-x---. root apache system_u:object_r:httpd_sys_content_t:s0 swiftmailer
drwxr-x---. root apache system_u:object_r:httpd_sys_content_t:s0 symfony

/var/www/html/owncloud/apps:
drwxr-x---. apache apache system_u:object_r:httpd_sys_content_t:s0 activity
drwxr-x---. apache apache system_u:object_r:httpd_sys_content_t:s0 comments
drwxr-x---. apache apache system_u:object_r:httpd_sys_content_t:s0 dav
drwxr-x---. apache apache system_u:object_r:httpd_sys_content_t:s0 encryption
drwxr-x---. apache apache system_u:object_r:httpd_sys_content_t:s0 external
drwxr-x---. apache apache system_u:object_r:httpd_sys_content_t:s0 federatedfilesharing
drwxr-x---. apache apache system_u:object_r:httpd_sys_content_t:s0 federation
drwxr-x---. apache apache system_u:object_r:httpd_sys_content_t:s0 files
drwxr-x---. apache apache system_u:object_r:httpd_sys_content_t:s0 files_external
drwxr-x---. apache apache system_u:object_r:httpd_sys_content_t:s0 files_pdfviewer
drwxr-x---. apache apache system_u:object_r:httpd_sys_content_t:s0 files_sharing
drwxr-x---. apache apache system_u:object_r:httpd_sys_content_t:s0 files_texteditor
drwxr-x---. apache apache system_u:object_r:httpd_sys_content_t:s0 files_trashbin
drwxr-x---. apache apache system_u:object_r:httpd_sys_content_t:s0 files_versions
drwxr-x---. apache apache system_u:object_r:httpd_sys_content_t:s0 files_videoplayer
drwxr-x---. apache apache system_u:object_r:httpd_sys_content_t:s0 firstrunwizard
drwxr-x---. apache apache system_u:object_r:httpd_sys_content_t:s0 gallery
drwxr-x---. apache apache system_u:object_r:httpd_sys_content_t:s0 notifications
drwxr-x---. apache apache system_u:object_r:httpd_sys_content_t:s0 provisioning_api
drwxr-x---. apache apache system_u:object_r:httpd_sys_content_t:s0 systemtags
drwxr-x---. apache apache system_u:object_r:httpd_sys_content_t:s0 templateeditor
drwxr-x---. apache apache system_u:object_r:httpd_sys_content_t:s0 updatenotification
drwxr-x---. apache apache system_u:object_r:httpd_sys_content_t:s0 user_external
drwxr-x---. apache apache system_u:object_r:httpd_sys_content_t:s0 user_ldap

/var/www/html/owncloud/assets:

/var/www/html/owncloud/config:
-rw-r-----. apache apache system_u:object_r:httpd_sys_content_t:s0 config.sample.php
-rw-r-----. apache apache system_u:object_r:httpd_sys_content_t:s0 disable-updatechecker.config.php

/var/www/html/owncloud/core:
drwxr-x---. root apache system_u:object_r:httpd_sys_content_t:s0 ajax
-rw-r-----. root apache system_u:object_r:httpd_sys_content_t:s0 application.php
drwxr-x---. root apache system_u:object_r:httpd_sys_content_t:s0 command
drwxr-x---. root apache system_u:object_r:httpd_sys_content_t:s0 controller
drwxr-x---. root apache system_u:object_r:httpd_sys_content_t:s0 css
drwxr-x---. root apache system_u:object_r:httpd_sys_content_t:s0 doc
drwxr-x---. root apache system_u:object_r:httpd_sys_content_t:s0 fonts
drwxr-x---. root apache system_u:object_r:httpd_sys_content_t:s0 img
drwxr-x---. root apache system_u:object_r:httpd_sys_content_t:s0 js
drwxr-x---. root apache system_u:object_r:httpd_sys_content_t:s0 l10n
-rw-r-----. root apache system_u:object_r:httpd_sys_content_t:s0 register_command.php
-rw-r-----. root apache system_u:object_r:httpd_sys_content_t:s0 routes.php
drwxr-x---. root apache system_u:object_r:httpd_sys_content_t:s0 search
-rw-r-----. root apache system_u:object_r:httpd_sys_content_t:s0 shipped.json
-rw-r-----. root apache system_u:object_r:httpd_sys_content_t:s0 signature.json
drwxr-x---. root apache system_u:object_r:httpd_sys_content_t:s0 skeleton
-rw-r-----. root apache system_u:object_r:httpd_sys_content_t:s0 strings.php
drwxr-x---. root apache system_u:object_r:httpd_sys_content_t:s0 tags
drwxr-x---. root apache system_u:object_r:httpd_sys_content_t:s0 templates
drwxr-x---. root apache system_u:object_r:httpd_sys_content_t:s0 vendor

/var/www/html/owncloud/data:
-rw-r-----. apache apache system_u:object_r:httpd_sys_rw_content_t:s0 owncloud.log

/var/www/html/owncloud/etc:

/var/www/html/owncloud/l10n:
-rw-r-----. root apache system_u:object_r:httpd_sys_content_t:s0 l10n.pl
-rw-r-----. root apache system_u:object_r:httpd_sys_content_t:s0 rm-old.sh

/var/www/html/owncloud/lib:
-rw-r-----. root apache system_u:object_r:httpd_sys_content_t:s0 autoloader.php
-rw-r-----. root apache system_u:object_r:httpd_sys_content_t:s0 base.php
drwxr-x---. root apache system_u:object_r:httpd_sys_content_t:s0 l10n
drwxr-x---. root apache system_u:object_r:httpd_sys_content_t:s0 private
drwxr-x---. root apache system_u:object_r:httpd_sys_content_t:s0 public

/var/www/html/owncloud/ocs:
-rw-r-----. root apache system_u:object_r:httpd_sys_content_t:s0 providers.php
-rw-r-----. root apache system_u:object_r:httpd_sys_content_t:s0 routes.php
-rw-r-----. root apache system_u:object_r:httpd_sys_content_t:s0 v1.php
-rw-r-----. root apache system_u:object_r:httpd_sys_content_t:s0 v2.php

/var/www/html/owncloud/ocs-provider:
-rw-r-----. root apache system_u:object_r:httpd_sys_content_t:s0 index.php
-rw-r-----. root apache system_u:object_r:httpd_sys_content_t:s0 provider.php

/var/www/html/owncloud/resources:
drwxr-x---. root apache system_u:object_r:httpd_sys_content_t:s0 codesigning
drwxr-x---. root apache system_u:object_r:httpd_sys_content_t:s0 config
drwxr-x---. root apache system_u:object_r:httpd_sys_content_t:s0 updater-fixes

/var/www/html/owncloud/settings:
-rw-r-----. root apache system_u:object_r:httpd_sys_content_t:s0 admin.php
drwxr-x---. root apache system_u:object_r:httpd_sys_content_t:s0 ajax
-rw-r-----. root apache system_u:object_r:httpd_sys_content_t:s0 application.php
drwxr-x---. root apache system_u:object_r:httpd_sys_content_t:s0 changepassword
drwxr-x---. root apache system_u:object_r:httpd_sys_content_t:s0 controller
drwxr-x---. root apache system_u:object_r:httpd_sys_content_t:s0 css
-rw-r-----. root apache system_u:object_r:httpd_sys_content_t:s0 help.php
drwxr-x---. root apache system_u:object_r:httpd_sys_content_t:s0 img
drwxr-x---. root apache system_u:object_r:httpd_sys_content_t:s0 js
drwxr-x---. root apache system_u:object_r:httpd_sys_content_t:s0 l10n
-rw-r-----. root apache system_u:object_r:httpd_sys_content_t:s0 languageCodes.php
drwxr-x---. root apache system_u:object_r:httpd_sys_content_t:s0 middleware
-rw-r-----. root apache system_u:object_r:httpd_sys_content_t:s0 personal.php
-rw-r-----. root apache system_u:object_r:httpd_sys_content_t:s0 routes.php
drwxr-x---. root apache system_u:object_r:httpd_sys_content_t:s0 templates
drwxr-x---. root apache system_u:object_r:httpd_sys_content_t:s0 tests
-rw-r-----. root apache system_u:object_r:httpd_sys_content_t:s0 users.php

/var/www/html/owncloud/themes:
drwxr-x---. apache apache system_u:object_r:httpd_sys_content_t:s0 example
-rw-r-----. apache apache system_u:object_r:httpd_sys_content_t:s0 README

/var/www/html/owncloud/updater:
drwxr-x---. apache apache system_u:object_r:httpd_sys_content_t:s0 app
-rw-r-----. apache apache system_u:object_r:httpd_sys_content_t:s0 application.php
-rw-r-----. apache apache system_u:object_r:httpd_sys_content_t:s0 box.json
-rw-r-----. apache apache system_u:object_r:httpd_sys_content_t:s0 composer.json
-rw-r-----. apache apache system_u:object_r:httpd_sys_content_t:s0 composer.lock
-rw-r-----. apache apache system_u:object_r:httpd_sys_content_t:s0 CONTRIBUTING.md
-rw-r-----. apache apache system_u:object_r:httpd_sys_content_t:s0 COPYING-AGPL
-rw-r-----. apache apache system_u:object_r:httpd_sys_content_t:s0 index.php
drwxr-x---. apache apache system_u:object_r:httpd_sys_content_t:s0 nbproject
drwxr-x---. apache apache system_u:object_r:httpd_sys_content_t:s0 pub
-rw-r-----. apache apache system_u:object_r:httpd_sys_content_t:s0 README.md
drwxr-x---. apache apache system_u:object_r:httpd_sys_content_t:s0 src
drwxr-x---. apache apache system_u:object_r:httpd_sys_content_t:s0 vendor

Raegar
Beginner
Posts: 25
Joined: Tue Jan 12, 2016 4:12 pm
ownCloud version: 9.0.2
Webserver: Apache
Database: MySQL
OS: Linux
PHP version: 7

Re: Unable to get folder permissions to work for a fresh install

Postby Raegar » Fri Jun 17, 2016 7:48 pm

What happens on a fresh install without running the script? Just...

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

*correction forgot CentOS has owncloud further in

deparra
Newbie
Posts: 2
Joined: Fri Jun 17, 2016 4:52 pm
ownCloud version: 9.0.2
Webserver: Apache
Database: MySQL
OS: Linux
PHP version: 5.4

Re: Unable to get folder permissions to work for a fresh install

Postby deparra » Fri Jun 17, 2016 8:18 pm

I try with all apache:apache and permision 777 but nothing

User avatar
dimitrip
Starter
Posts: 99
Joined: Sat Jan 23, 2016 9:39 pm
ownCloud version: 8.2.2
Webserver: Apache
Database: MySQL
OS: Linux
PHP version: 5.6

Re: Unable to get folder permissions to work for a fresh install

Postby dimitrip » Wed Jun 29, 2016 10:40 pm

Hi
I think that it is selinux. try cat /var/log/audit/audit.log | grep avc and check if you have denials. If they are related to apache processes that try to disable selinux and reboot server if it will start working and you are going to use selinux you will have to troubleshoot it. I think that is selinux problem. when selinux is enable you have to watch for audit.log for denials. it is also possible to put selinux in permissive mode that means it will not be disabled, it will just log denials but wont stop processes working. read this also just for case http://danwalsh.livejournal.com/
Open Minds


  • Similar Topics
    Replies
    Views
    Last post

Return to “ownCloud Server 8.2”

Who is online

Users browsing this forum: No registered users and 1 guest