× NETGEAR will be terminating ReadyCLOUD service by July 1st, 2023. For more details click here.
Orbi WiFi 7 RBE973
Reply

Re: owner + group php, apache, owncloud, dokuwiki

_ybi_
Aspirant

owner + group php, apache, owncloud, dokuwiki

Hi everyone

I hope I can find somebody here to help and explain to me what I can't find on the internet. All I can find is, same rights as "webserver" but nobody explains what it is.

I am trying to configure php, apache, owncloud and dokuwiki and a regular small website on my readynas ultra, radiator 4.2.26
I want to run a dokuwiki and owncloud server on my readynas ultra and and they should not be able to view/access each others files/any other file on the nas (seperate "websites, can only use http address to display each others webpages, as you would in a browser")
I downloaded the php 5.4.30, dokuwiki installer and owncloud 7.0.1 from the rnxtras website and installed them on my nas.

I am uneasy at running those services with root or admin privileges, however, I don't know which file should access what file in order to get it all working.
I never had any experience with setting up a webserver, php, apache, websites, ... so I am totally new at this and google (duckduckgo tbh) don't provide me with an answer I can understand.

I saw that readynas has a user and group www-data but as it can also be found in the etc/user- and etc/group- file, I presume you can't use it.
So my question is, which files do I have to add to the www-data/web user/goup, and how do I do this, do I have to delete them from the "user-" file?
and perform an "addgroup web"

Then, which folders do I need to change ownership?
c/DokuWiki
c/.owncloud
/owncloud
/etc/mysql
/etc/php5
/etc/apache2
? /etc/frontview/apache/

If I change all these folders, subfolders and files to www-data:web, will I be able to run them, and exploits can't get root/admin privileges on my nas?

A last question, as apt-get install php5-mysql((n)d) doesn't seem to work for my NAS, is mysql installed by installing php5.4.30?

With my greatest gratitude in advance for anybody who can and will help me finding an answer to my questions.
Message 1 of 5
mdgm-ntgr
NETGEAR Employee Retired

Re: owner + group php, apache, owncloud, dokuwiki

Not sure whether changing the ownership would be a good idea. Certainly you shouldn't change the ownership on at least some of those.

MySQL is already on the NAS and can be enabled using the MYSQLON add-on.
Message 2 of 5
_ybi_
Aspirant

Re: owner + group php, apache, owncloud, dokuwiki

I will have to tinker with the users/groups; as I installed owncloud, and haven't done anything yet, and when I go to the url, I receive:
Data directory (/owncloud/data) not writable by ownCloud
This can be fixed by giving the webserver write rights on the main directory

Again with the "webserver", is this apache or is this a user or group or ...?

owncloud is owned by root
drwxr-xr-x 3 root root 4096 Sep 18 16:54 owncloud

The mysqlon addon got installed, thanks for the pointer!
Message 3 of 5
WhoCares_
Mentor

Re: owner + group php, apache, owncloud, dokuwiki

Ok, let's take this one by one 😉

First, on the ReadyNAS a lot of processes that would normally run as separate users are run under the privileges of the user account "admin". This most likely was a design decision by NETGEAR, the reasons for which I don't know. Now that leaves us with the web server (apache2) and mysql running under the "admin" account and just as well I made my add-ons run and have their directories owned by that user as well.

Now, for everything that runs as a web service; like for example ownCloud and Dokuwiki; often there's a need for the web server (apache) to be able to write to at least some (ownCloud) or all (Dokuwiki) directories of the web application. The reason for that is that the web server is what you as a user interact with using your web browser. So everything that goes onto your ReadyNAS has to pass through the web server which in turn has to write the files, wiki pages, whatnotelse to the file system of your ReadyNAS. And to be able to do so, it needs to have proper permissions. The easiest way to achieve that is by using the "admin" account - which btw doesn't have nearly as much rights as the name would suggest. Of course you could try to change the ownerships/permissions of the different apps. Then you would have to fiddle with ACLs and stuff to give the web server read and write permissions to the changed directories again. So even if you managed to change the ownership properly, you wouldn't have gained anything since the web server would still be able to write to *every* web application you're running on the ReadyNAS.

Now for MySQL: I designed the ownCloud application in such a way that it would work with SQLite instead of MySQL out of the box. Since the ressources on the ReadyNAS are limited, it in my view doesn't make much sense to run yet another daemon (mysql) for the limited amount of users you're most likely to support on the ReadyNAS. Thus SQLite should be able to handle the job just fine. That said, ownCloud will of course run with either the included MySQL server or even an external one. However, when setting this up, you need to make sure that you're *not* changing the pre-defined path names for owncloud, since those given are already tuned to the installation on the ReadyNAS and aren't created by the integrated ownCloud installer itself (unless you by chance picked a path that already exists *and* has the proper ownerships/permissions).

Now, finally, if you were to change ownerships / permissions of the path names you listed above you'd most likely brick the web interface of your ReadyNAS since all the admin functions also need to be able to access and write to most of the directories you named. This is not only done through the web interface but also by internal scripts that are run periodically and other stuff. In short: Don't touch this 😉

To fix the permission problem with ownCloud, try running
chown -R admin:admin /c/.owncloud/.

Actually, this should have been done by the ownCloud add-on on installation (and I just checked, it does exactly that) so I currently have no idea why it seems to not have done this for you.

-Stefan
Message 4 of 5
Dom-Juan
Tutor

Re: owner + group php, apache, owncloud, dokuwiki

Hi there.

It's a pity that this conversation stopped. Seems hitting a problem that i have with my new RN516.

I got owncould 6.0.0 installed from the Netgear apps page. However, during the installation process of the NAS the system tell me that "ownclound could not be installed", as also recorded in the logs. Yet, i see it after this in the "installed apps"  page of the NAS.

Second, when I click on "launch" button of the opencloud app, it turns to the WebIF (URL: https://myIP/owncloud/index.php) but shows an error message as follows:

"Can't write into config directory!

This can usually be fixed by giving the webserver write access to the config directory."

 

the link is a pointer to the documentation page but is broken

 

let alone that I can't install opencloud 8.1.3 from RNXTRAS at all. Though it removes 6.0.0 when i attempt the upload/installation.

 

I am not a Unix Geek at all, just a readyNAS fan, been using an ULTRA6 for years happily. So if that ould be fixed within the ReadyNAS environment , would be great.

 

I hope this is related to this thread here, if not pelase advise otherwise.

 

Best,

JD

 

Message 5 of 5
Top Contributors
Discussion stats
  • 4 replies
  • 2802 views
  • 1 kudo
  • 4 in conversation
Announcements