Koozali.org: home of the SME Server

Permission Errors On SME Server

Offline JRBATM20192021

  • ***
  • 111
  • +0/-0
Permission Errors On SME Server
« on: June 02, 2019, 09:18:16 AM »
HI,

I am having trouble changing permissions on the Primary I-Bay on SME Server it is Set to 644 and it needs to be 755. I'm not sure why it came up like this when I installed the program on to the new server. When I say Primary I-Bay I mean the one that Has the website on it I watched a video about setting up SME Server and the Primary I-Bay was there and working fine on the video. But when I load SME Server up the primary I-Bay Doesn't Work it says HTTP 403 Forbidden when I go visit the website attached to The SME Server I recently loaded. Is There Something I am doing wrong? Or is my copy of SME Server corrupt?
 

Offline janet

  • ****
  • 4,812
  • +0/-0
Re: Permission Errors On SME Server
« Reply #1 on: June 02, 2019, 09:55:39 AM »
JRBATM20192021

Did you copy the web site files to the html folder of Primary ibay ?
What type of content did you put there eg php code or html or .... ?
Also did you delete or remove the fefault index.htm file ?

General SME server usage recommendation is not to use the Primary ibay, & instead use a purpose specific ibay you create. You can direct the main domain name to the ibay.
Use server manager to configure the above.
Ibays have more control possibilities than the Primary.

You need to look in the log files for more specific error messages,
See the View log files panel in server manager.
Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.

Offline ReetP

  • *
  • 3,722
  • +5/-0
Re: Permission Errors On SME Server
« Reply #2 on: June 02, 2019, 11:33:50 AM »
Be careful manually setting permissions.

There is a lot of code behind the scenes that automates a lot of things and helps to keep your server safe and secure.

So you may change a permission, but a reconfigure/reboot may change it back.

So, explain what you are actually trying to do, and the steps you have taken, and we may be able to help you.
...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions of software
4. I have a job, wife, and kids and do this in my spare time. If you want something fixed, please help.

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation

Offline mmccarn

  • *
  • 2,626
  • +10/-0
Re: Permission Errors On SME Server
« Reply #3 on: June 02, 2019, 02:02:20 PM »
Ibay permissions are updated by the "ibay-modify" event using /etc/e-smith/events/ibay-modify/S15ibay-modify which is a symlink to /etc/e-smith/actions/ibay-modify.

Here is the section of that script that adjusts ibay permissions whenever an ibay is created or updated:
Code: [Select]
#--------------------------------------------------
# fix ownership of subdirectories
#--------------------------------------------------

#--------------------------------------------------
# Set the group as www if it was admin, since
# while set as admin, the web server no longer has
# access to the ibay HTML directory, and web pages.
#--------------------------------------------------

my %properties = $ibay->props;
$::group = ($properties{'Group'} eq "admin") ? "www" : $properties {'Group'};

# Make sensible defaults
$::owner = undef;
$::fileperm = 0600;
$::dirperm = 0550;

if ($properties {'UserAccess'} eq 'wr-admin-rd-group')
{
    $::owner = "admin";
    $::fileperm = 0640;
    $::dirperm = 02750;
}
elsif ($properties {'UserAccess'} eq 'wr-group-rd-group')
{
    $::fileperm = 0660;
    $::dirperm = 02770;
}
elsif ($properties {'UserAccess'} eq 'wr-group-rd-everyone')
{
    $::fileperm = 0664;
    $::dirperm = 02775;
}
else
{
    warn("Value of UserAccess bad or unset");
}

sub process
{

    if (-l)
    {
        $File::Find::prune = 1;
    }
    else
    {
        esmith::util::chownFile($::owner, $::group, $_);
        if (-d)
        {
            chmod $::dirperm, $_;
        }
        elsif (-f)
        {
            # Preserve execute permissions on files
            my $experm = (stat($_))[2] & 0111;
            $experm |= $::fileperm;
            chmod $experm, $_;
        }
    }
}

From looking at the code, it looks like files with the executable bit set will be left executable, and you can otherwise set 664 on files and 775 on directories by setting UserAccess to 'wr-group-rd-everyone'.

To get every file and folder set to 775 you need to change the ibay UserAccess setting and make every file executable:
Code: [Select]
cd /home/e-smith/ibays/primary
chmod -R +x html
db accounts setprop Primary UserAccess 'wr-group-rd-everyone'
signal-event ibay-modify Primary

If you really need every file in the ibay to be executable (and not just the folders), you'll have to script something to change the setting for any newly uploaded files.

[edit]
correction - wr-group-rd-everyone sets 664, not 644 as originally stated
« Last Edit: June 02, 2019, 02:09:53 PM by mmccarn »

Offline ReetP

  • *
  • 3,722
  • +5/-0
Re: Permission Errors On SME Server
« Reply #4 on: June 02, 2019, 02:19:03 PM »
It would still be good if the OP would tell us what they are actually trying to achieve.

Do they really need something set executable?

That may explain a lot more than we currently know.
...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions of software
4. I have a job, wife, and kids and do this in my spare time. If you want something fixed, please help.

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation

Offline JRBATM20192021

  • ***
  • 111
  • +0/-0
Re: Permission Errors On SME Server
« Reply #5 on: July 17, 2019, 01:55:47 AM »
Thank You Guys For your Help!