Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I'm trying to upgrade to the latest version of DokuWiki, and I'm finding that the easiest way to do this is to install the upgrade plugin and just click a few buttons. But there are permissions issues writing some of the files.

How can I briefly change the permissions so that the plugin can work its magic without compromising security?

share|improve this question
    
You probably need to change ownership of some files, or run a command as the right user. I don't know anything about installing DokuWiki, so have no idea which files or which commands or which users. –  Gilles Apr 29 '11 at 22:52

1 Answer 1

up vote 2 down vote accepted

I don't know anything about DokuWiki, but I can give you some hints with permissions.

DokuWiki is a PHP application thus running in a web server. This web server can be Apache, Lighttpd, ngingx and maybe another one.

The webserver doesn't run as root. It runs either as the "nobody" user or on Debian servers for example the user is "www-data". It can also be "apache".

Ubuntu and Debian use www-data as I said.

You can also figure out the permissions in /var/www. Just "cd" to this directory, then type "ls -l" at prompt, and it will give you the list of files with the owner and the group. (there's a www-data group as well).

Now that you know which system user the web server runs as, try that:

Go to your mediawiki installation directory :

cd /var/www/mediawiki

Set permissions to the webserver user / group :

chown www-data:www-data . -R

(-R means "recursive" => all files and subfolders)

Finally :

chmod 775 . -R

Then the webserver user and members of the group can read, write and execute files.

As you were wondering for security, the permissions should not be 775 but weaker on most of the files except for some directories like "upload" or "temp" ones that could even be 777. But again, I don't know about mediawiki

share|improve this answer
    
You went from talking about DokuWiki to MediaWiki halfway through your response, but otherwise it was very helpful :) Thank you for your very helpful comment. –  user7089 Apr 30 '11 at 17:04
    
There's no need to cd into a directory in order to work with it. That's the inefficiency from the GUI way of doing things. Just do, for example, chown www-data:www-data -R /var/www/mediawiki. –  Tshepang May 1 '11 at 8:23
    
Why are changing the group? Isn't just changing the owner sufficient? –  Tshepang May 1 '11 at 8:24
    
Update: Combining the above suggestions, this worked for me: 'chown apache:apache -R /path/to/dokuwiki'. The username for the webserver was found in Apache's 'httpd.conf' file. Thanks to both of you for the tips. –  user7089 May 2 '11 at 15:19
    
I don't know why I switched to Mediawiki. Sorry for that! I "changed directory" because most of the time you spare quite a lot of time in the directory of such an application. You will have to configure it, and hence loose a lot of time if you had to rewrite for this. I like the concepts of tabs as well (or many ttyS), one for each task. –  tiktak May 16 '11 at 20:23

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.