[pmwiki-users] Permission problem

Tamara Temple tamouse.lists at tamaratemple.com
Wed Dec 7 09:59:23 CST 2011


Steve G. <wordz2u at gmail.com> wrote:
> I recently upgraded my server to a newer version. For the sake of getting the
> server up and running again most quickly, I simply copied the old pmwiki
> directory tree to /var/www
> 
> I find now that the only way I can make the file editable is to chmod every
> file in wiki.d to www-data - otherwise I get .flock issues. Changing the owner
> to nobody did not help here. 
> 
> 1. Is this normal behavior?

Yes. Your server (apache) runs with user www-data. You can check this
by looking in the httpd.conf file (usually /etc/apache, /etc/apache2, or
/etc/httpd) or using phpinfo().

This shouldn't really be onerous though. chown has a recursive option:
-R. The command is simply

  $ chown -R www-data wiki.d uploads

from the pmwiki root directory (apparently /var/www in your case?).

> 2. If I want to change it, what is the best way? Should I install pmwiki from
> scratch in /var/www or a user's home directory, then copy the content of
> wiki.d? How about images?

Change *what* exactly? The apache user? That might prove difficult if
you have other web apps on your server. Giving www-data ownership of the
wiki.d and uploads directories (recursively) is usually the best way to
go. Reinstalling pmwiki from scratch would no alleviate this as when you
copy the wiki.d directory, you're still copying it's existing
owner/group/permissions and they might need to be changed so apache+php
can write in the directory and rewrite existing files.

> I prefer not to have directories with world write privileges.

Before you reset ownership, you can set access with

  $ chmod -R o-w wiki.d uploads

from the wiki root directory. This ensures that it is only writeable by
user and possibly group. Note that if you do this command after the
previous one, and you don't have write+execute permissions on the
directories, you must run this as root.





More information about the pmwiki-users mailing list