Community @ The Turning Gate

Support community for TTG plugins and products.

NOTICE

The Turning Gate's Community has moved to a new home, at https://discourse.theturninggate.net.

This forum is now closed, and exists here as a read-only archive.

  • New user registrations are disabled.
  • Users cannot create new topics.
  • Users cannot reply to existing topics.

You are not logged in.

#1 2019-12-03 21:01:56

speacock110
Member
Registered: 2013-04-11
Posts: 169

File and folder permissions

I am trying to check/tidy up permissions on my local web server, then I will check my hosts.

What are the permission requirements on backlight folders and files. Currently i have reset my site to use 644 do i need 744 on the backlight folder

Offline

#2 2019-12-03 21:05:10

speacock110
Member
Registered: 2013-04-11
Posts: 169

Re: File and folder permissions

Sorry to be more accurate 744 on folders and 644 on files

Offline

#3 2019-12-03 22:10:14

rod barbee
Moderator
From: Port Ludlow, WA USA
Registered: 2012-09-24
Posts: 17,830
Website

Re: File and folder permissions


Rod 
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site

Offline

#4 2019-12-03 22:48:51

speacock110
Member
Registered: 2013-04-11
Posts: 169

Re: File and folder permissions

I have cleaned the permissions on my local site to 755 on all folders, 744 on all files but to run Update Albums I had to put 777 on the backlight folder and Galleries.777 just on data allowed me to do some things but not update albums in backlight settings. This is no problem for my Local versions but i would like to know the bare minimum for more public versions

Offline

#5 2019-12-03 22:57:16

rod barbee
Moderator
From: Port Ludlow, WA USA
Registered: 2012-09-24
Posts: 17,830
Website

Re: File and folder permissions

This is no problem for my Local versions but i would like to know the bare minimum for more public versions

Ben will need to address that.


Rod 
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site

Offline

#6 2019-12-04 05:21:50

Ben
Moderator
From: Melbourne, Australia
Registered: 2012-09-29
Posts: 4,399

Re: File and folder permissions

In recent years it usually hasn't been necessary to alter permissions at all; hosts are configured to be able to write to locations as needed.
There's no universally correct set of permissions that will work across all environments.  The permissions and ownership needed for the server to create files and directories as-needed can vary from host-to-host.

A reasonably-safe set, if you do need to change them is:
All directories: 755
All files: 644

1) Safer still would be these for these directories and contents within them for backlight/data, backlight/modules, 'galleries' (and other top-level gallery directories):
directories: 755
files: 644

2) And all other backlight/ locations
directories: 555
files: 444

777 is dangerous, especially on shared hosting.  Any rogue script or user under any user account on that server can overwrite your directories and files.

A good way to test what your server is configured to set writeable locations, is to create an album through Publisher or Backlight admin, then log in via FTP and check the permissions of directories and files within the newly-created album.

Offline

#7 2019-12-23 02:30:38

speacock110
Member
Registered: 2013-04-11
Posts: 169

Re: File and folder permissions

Finally Got back at looking at this. I have set Backlight permissions as above Dir to 755 and files 644.
when trying to login to admin I get this error message (first part only)

session_start(): open(../backlight/data/sessions/sess_6iquib9b94ecpfsikmtpjkjncv, O_RDWR) failed: Permission denied (13)|#0 [internal function]: ErrorHandler::handleError(2, 'session_start()...'

then tried 755 and 666 still same message

Offline

#8 2019-12-23 05:47:53

Ben
Moderator
From: Melbourne, Australia
Registered: 2012-09-29
Posts: 4,399

Re: File and folder permissions

Check that data and data/sessions have the same permissions and ownership. If not, change those for data/settings to match data.

Offline

#9 2019-12-28 08:30:22

speacock110
Member
Registered: 2013-04-11
Posts: 169

Re: File and folder permissions

the issue appears to be ownership files created by backlight have _www as the owner but all other files have me as the owner. this stems from apache config I think but trying to change its config file owner and user stopped it working altogether. I currently have a script that I run to change the owner. it solves the problem but more of a hack than a fix

Offline

#10 2019-12-29 06:47:50

Ben
Moderator
From: Melbourne, Australia
Registered: 2012-09-29
Posts: 4,399

Re: File and folder permissions

As the systems administrator on a dedicated machine, my approach would be to do the following for all directories that a site (e.g. Backlight) has to be able to write to:

1. Change the group of the directory to the group that Apache is configured to write files as.  On my local setup, that group is specified in the Group setting in httpd.conf
2. Change the permissions recursively to allow users in the group to write to those directories

e.g., if the group name is apache:

sudo chgrp -R apache /var/www/html/mysite.com/backlight/data /var/www/html/mysite.com/galleries
sudo chmod -R g+w /var/www/html/mysite.com/backlight/data /var/www/html/mysite.com/galleries

This assumes that you have the necessary permissions to become the root user, in order to run those commands and in order to delete or move the directories and files that Backlight has created as-needed in the future.

Offline

Board footer

Powered by FluxBB