Koozali.org: home of the SME Server

How to give apache write permission on ibay?

Offline Marco Hess

  • *
  • 149
  • +0/-0
    • http://www.through-ip.com
How to give apache write permission on ibay?
« on: January 04, 2012, 05:10:18 AM »
Hi All,

I am struggling with (permanently) setting the permissions on an ibay so that apache has write permissions on that ibay.

I installed a PHP app (elgg) in an ibay to serve the site for a subdomain. I go all the PHP settings configured to allow the file upload for the site:

Code: [Select]
db accounts show eastern
eastern=ibay
    AllowOverride=All
    CgiBin=enabled
    FollowSymLinks=enabled
    Gid=5059
    Group=shared
    Name=Eastern District Website
    PHPBaseDir=/home/e-smith/files/ibays/eastern/html:/home/e-smith/files/ibays/eastern/files:/tmp
    PasswordSet=no
    PublicAccess=global
    Uid=5059
    UserAccess=wr-admin-rd-group


However with these settings, PHP has no write permissions and I get PHP permission denied errors in /var/log/messages.

I can fix it with
Code: [Select]
chown -R www:www /home/e-smith/files/ibays/eastern/*
But after a reconfiguration, the permissions on the ibay revert to the configured ones on the ibay.

So what is the correct user/group configuration for an ibay through server-manager or through some "db accounts setprop" for an ibay so that a PHP app can have write permissions?

« Last Edit: January 04, 2012, 06:03:09 AM by Marco Hess »
Adelaide - Australia

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Re: How to give apache write permission on ibay?
« Reply #1 on: January 04, 2012, 01:07:16 PM »
You have set the ibay permissions to:

admin: write
group: read

which means only the admin is able to write to the ibay. It seems that it is not possible to modify this through the webinterface, but perhaps you might be able to add the www user to the admin group through the console using this:

Code: [Select]
usermod -a -G admin www
To verify if the user is (already) member of a group you can use:

Code: [Select]
groups www
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)

Offline mmccarn

  • *
  • 2,584
  • +8/-0
Re: How to give apache write permission on ibay?
« Reply #2 on: January 04, 2012, 02:39:53 PM »
You can give write access to an ibay from server-manager by setting 'group' to 'Everyone' and 'User access via file sharing or user ftp' to 'write=group, read=everyone'.

However, if you have local users with SMB/CIFS access to your SME server, all users would also have write access to the ibay.
« Last Edit: January 04, 2012, 02:53:02 PM by mmccarn »

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Re: How to give apache write permission on ibay?
« Reply #3 on: January 04, 2012, 02:46:44 PM »
However, if you have local users with SMB/CIFS access to your SME server, all users would also have write access to the ibay.
True, although I think based on the chosen setting OP does not want everyone to have access.
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)

Offline mmccarn

  • *
  • 2,584
  • +8/-0
Re: How to give apache write permission on ibay?
« Reply #4 on: January 04, 2012, 02:53:18 PM »
You could also grant write access for the web server to an ibay from the command line using
Code: [Select]
db accounts setprop <ibayname> Group www UserAccess wr-group-rd-everyone
signal-event ibay-modify <ibayname></code>

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Re: How to give apache write permission on ibay?
« Reply #5 on: January 04, 2012, 03:06:39 PM »
You could also grant write access for the web server to an ibay from the command line using
Code: [Select]
db accounts setprop <ibayname> Group www UserAccess wr-group-rd-everyone
signal-event ibay-modify <ibayname></code>
That would be the better proper SME Server solution, which in fact would do more or less the same. However I am not sure of the admin will be able to modify the ibay contents then as IIRC admin is not a member of the www or apache group.
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)