Advertisement:

Author Topic: file and folder permissions  (Read 584 times)

Offline brynn

  • Full Member
  • ***
  • Posts: 459
  • Gender: Female
    • Inkscape Community
file and folder permissions
« on: May 13, 2018, 09:06:55 AM »
Hi Friends,
I seem to have what very well may be a near fatal problem.  My host, by doubling the price of one of my services, essentially forced me to migrate a to a new cloud server.  (which I did not want to do, but thought I could trust them)  The migration process has apparently changed permissions of many files and folders (which sounds like a really stupid oversight to me).  So far, I've tripped over at least 5 broken areas where the problem was  unwritable files or folders.

Is there any way I can find out which files and folders need which permissions, so I can go through and fix them all?  (And of course, then promptly move to a new host!)

If it matters, I'm using SMF version 2.0.15, with approx 45 mods in one forum and approx 35 to 40 in the other.

Glad to provide whatever other info you might need, to be able to answer.

Thank you very much!
Inkscape Community  (SMF with Tiny Portal)

Inkscape for Cutting Design  (originally a phpBB forum, converted to SMF, and using Simple Portal)

Offline Looking

  • SMF Hero
  • ******
  • Posts: 2,152
  • SMF Customization
    • jeanborde on Facebook
    • SMF Custom Themes
Re: file and folder permissions
« Reply #1 on: May 13, 2018, 09:12:31 AM »
Check the permissions section on this page: Installing - Online Manual. Personally, if your server is setup right with the most modern Cpanel software then you should not be worrying over permissions.

Offline Illori

  • Project Manager
  • SMF Master
  • *
  • Posts: 49,089
Re: file and folder permissions
« Reply #2 on: May 13, 2018, 09:18:10 AM »
Is there any way I can find out which files and folders need which permissions, so I can go through and fix them all?  (And of course, then promptly move to a new host!)


your hosts control panel should have a file manager that will show you all the permissions on each file/folder and allow you to easily change them.

Offline brynn

  • Full Member
  • ***
  • Posts: 459
  • Gender: Female
    • Inkscape Community
Re: file and folder permissions
« Reply #3 on: May 13, 2018, 10:33:04 AM »
Well yes, I know how to change them.  I just don't know what to change the to, or which ones to leave alone.

I agree that I should not have to be worrying, but yet, in the last 12 hours, I've found 5 areas where I can't edit options in the either SMF or CPG admin panels, where the error messages says this or that file is not writable.  The only thing that has changed is the migration.  I have no idea what might have caused this, except for that.

But I'm certainly open to other ideas or thoughts.
Inkscape Community  (SMF with Tiny Portal)

Inkscape for Cutting Design  (originally a phpBB forum, converted to SMF, and using Simple Portal)

Offline Illori

  • Project Manager
  • SMF Master
  • *
  • Posts: 49,089
Re: file and folder permissions
« Reply #4 on: May 13, 2018, 12:58:23 PM »
Check the permissions section on this page: Installing - Online Manual. Personally, if your server is setup right with the most modern Cpanel software then you should not be worrying over permissions.

that should tell you what they should be, or ask your host.

Offline Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 56,075
  • Gender: Male
    • Kindred-999 on GitHub
Re: file and folder permissions
« Reply #5 on: May 13, 2018, 12:59:12 PM »
Change files to 664 and directories to 755
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

Offline Sir Osis of Liver

  • SMF Hero
  • ******
  • Posts: 7,700
  • There's someone in my head but it's not me.
Re: file and folder permissions
« Reply #6 on: May 13, 2018, 05:59:40 PM »
I've always used 644/755, most installs set up that way.  They're easy to view/change in FileZilla.

Offline Chen Zhen

  • Sophist Member
  • *****
  • Posts: 1,072
  • Gender: Male
  • If you're going through hell, keep going!
    • Underdog-01 on GitHub
    • WebDev.ca
Re: file and folder permissions
« Reply #7 on: May 13, 2018, 10:46:02 PM »
re. Host: Hostwinds ~ Webserver software:  Apache
Does your panel give you access to the command line and if so which OS did you choose?
If you have access to the command line you can perform recursive permission and ownership changes to allow both your FTP platform and server software to operate.

Offline brynn

  • Full Member
  • ***
  • Posts: 459
  • Gender: Female
    • Inkscape Community
Re: file and folder permissions
« Reply #8 on: May 15, 2018, 02:50:01 PM »
Sorry for the delay.  I was about ready to blow a gasket, and had to take a day or so off.

I've always used 644/755, most installs set up that way.  They're easy to view/change in FileZilla.

Well, after I, and even some of their tech support people manually changed several files/folders to 777, they, with their heads in inappropriate places, and not paying attention to their own troubleshooting, went through the server, and changed everything to 644/755.  Of course, that promptly broke all the files and folders we had already fixed individually!

Here's the current info they have for me.  I want to check it with you, because for all I know, the change they propose won't work with SMF.

They say that the problem is because I'm using CGI for a php handler.  (Which, by the way, as far as I can tell, they installed.)  (Note that I don't really know what a "php handler" actually is.  I'll have to do some research, I guess.)  They want me to switch to SuPHP.

Will that work with SMF?  Or are they trying to feed me a pile of crap (which I would not be surprised, at this point).

re. Host: Hostwinds ~ Webserver software:  Apache
Does your panel give you access to the command line and if so which OS did you choose?
If you have access to the command line you can perform recursive permission and ownership changes to allow both your FTP platform and server software to operate.

Unfortunately, commandline access is almost all I have.  I say unfortunately, because I have extremely little experience with commandlines.  My OS is CENTOS 7.5, v70.0.39.  It's a VPS, but it's also a "cloud server".

Edit
CGI - Common Gateway Interface ??
Inkscape Community  (SMF with Tiny Portal)

Inkscape for Cutting Design  (originally a phpBB forum, converted to SMF, and using Simple Portal)

Offline Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 56,075
  • Gender: Male
    • Kindred-999 on GitHub
Re: file and folder permissions
« Reply #9 on: May 15, 2018, 03:09:21 PM »
you should be able to easily change the permissions using a recursive chmod commandline


Code: [Select]
N   Description                         ls   binary   
0   No permissions at all            ---  000
1   Only execute                       --x  001
2   Only write                           -w-  010
3   Write and execute               -wx  011
4   Only read                           r--  100
5   Read and execute               r-x  101
6   Read and write                   rw-  110
7   Read, write, and execute     rwx  111

Code: [Select]
To recursively give directories read&execute privileges:

find /path/to/base/dir -type d -exec chmod 755 {} \;

To recursively give files read privileges:

find /path/to/base/dir -type f -exec chmod 644 {} \;

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

Offline brynn

  • Full Member
  • ***
  • Posts: 459
  • Gender: Female
    • Inkscape Community
Re: file and folder permissions
« Reply #10 on: May 15, 2018, 03:29:17 PM »
Probably I don't understand what you're suggesting.  Before they changed all the permissions to 644/755, they made a backup.  And when they realized that 644/755 was the wrong thing to do, they reverted to their backup.

But in any case, 644/755 doesn't work.

Regarding their suggestion to use SuPHP, I started trying to learn something about CGI and php handlers.  The first thing I found was this http://suphp.org/Home.html, which says the SuPHP is no longer supported.

I'm thinking that I don't know what happened to Hostwinds.  When I first was searching for a new host (not even a year ago, I don't think), they were in the top 5 rated webhosts.  It seems that something must have recently happened, maybe sold to a new owner or something.  But those guys don't seem to know what they're doing anymore.

I'm starting a search for another new host! 

But I also would still be interested to hear you guys' comments on replacing or switching away from CGI.
Inkscape Community  (SMF with Tiny Portal)

Inkscape for Cutting Design  (originally a phpBB forum, converted to SMF, and using Simple Portal)

Offline Sir Osis of Liver

  • SMF Hero
  • ******
  • Posts: 7,700
  • There's someone in my head but it's not me.
Re: file and folder permissions
« Reply #11 on: May 15, 2018, 05:20:15 PM »
You wouldn't be having these problems on a shared server with a decent host.  Can't recall ever seeing a forum where 644/755 didn't work; 777 is blocked on some servers for security reasons.  I moved to Crocweb couple years ago, they've been very good, excellent support.  Several of my regulars have moved there, no complaints.  If you're running a vps they have that, too.


Offline brynn

  • Full Member
  • ***
  • Posts: 459
  • Gender: Female
    • Inkscape Community
Re: file and folder permissions
« Reply #12 on: May 15, 2018, 08:24:12 PM »
You wouldn't be having these problems on a shared server with a decent host.

Well, I'm not sure if that's a fair statement.  But I'm certainly not happy with what's been happening.

They say that 644/755 is going to work, but apparently only if I switch from CGI to SuPHP.  I have located at least one other host who does use SuPHP, and in fact they consider it to be the best choice.

But I just want to make sure that there won't be any conflict using SuPHP with SMF.  I mean, SMF seems to run on PHP, so I just want to be sure.

(Haha, crocweb sounds like hostgator's cousin!  I wonder what the connection between webhosting and amphibians is  ;D)

Edit
They have offered me a free month's hosting, for all this trouble.  I have the impression I'm being used as a guinea pig, here.  But I still might move to a new host.
« Last Edit: May 15, 2018, 08:36:16 PM by brynn »
Inkscape Community  (SMF with Tiny Portal)

Inkscape for Cutting Design  (originally a phpBB forum, converted to SMF, and using Simple Portal)

Offline GigaWatt

  • Jr. Member
  • **
  • Posts: 308
  • Gender: Male
    • Macedonian electronics forum
Re: file and folder permissions
« Reply #13 on: May 15, 2018, 08:52:18 PM »
https://www.suphp.org/Home.html

Quote
suPHP is not maintained any longer and will not receive any further updates not even security patches.
"This is really a generic concept about human thinking - when faced with large tasks we're naturally inclined to try to break them down into a bunch of smaller tasks that together make up the whole."

Offline brynn

  • Full Member
  • ***
  • Posts: 459
  • Gender: Female
    • Inkscape Community
Re: file and folder permissions
« Reply #14 on: May 16, 2018, 12:28:20 AM »
Thanks.  I did mention that I found that already.  But it's not clear to me exactly what it means.  Besides that note about it not being supported, there is also a note there about potential forks, with a link to a forked version, apparently.

That info does conflict with other info that I've found about it.  For example, this host claims SuPHP is the best choice for a php handler.
https://www.inmotionhosting.com/support/website/php/choosing-the-best-php-handler

My host must have an answer by now.  Let me see what they say....  Yes.  Ok, their reply is that cPanel does still support it, and they give a link to the documentation about it.

Well anyway, is there any reason to think using SuPHP as a php handler will have any effect on SMF?

Actually, as I'm slowly trying to understand what a php handler does, I'm not sure why using one rather than another should affect the permissions.  Not unless there's some kind of locking mechanism, where the permissions don't work at all until the proper handler is in place.  I just don't understand it well enough to know for sure.  I guess I should read that cPanel documentation....
Inkscape Community  (SMF with Tiny Portal)

Inkscape for Cutting Design  (originally a phpBB forum, converted to SMF, and using Simple Portal)

Offline brynn

  • Full Member
  • ***
  • Posts: 459
  • Gender: Female
    • Inkscape Community
Re: file and folder permissions
« Reply #15 on: May 16, 2018, 08:07:50 AM »
Update.  Well, since no one here was saying no, no, no, I went ahead an Ok'd the change.  They're working on it now, so I'll update again, with the results, later.
Inkscape Community  (SMF with Tiny Portal)

Inkscape for Cutting Design  (originally a phpBB forum, converted to SMF, and using Simple Portal)

Offline Chen Zhen

  • Sophist Member
  • *****
  • Posts: 1,072
  • Gender: Male
  • If you're going through hell, keep going!
    • Underdog-01 on GitHub
    • WebDev.ca
Re: file and folder permissions
« Reply #16 on: May 16, 2018, 09:28:47 AM »
Quote
Unfortunately, commandline access is almost all I have.  I say unfortunately, because I have extremely little experience with commandlines.  My OS is CENTOS 7.5, v70.0.39.  It's a VPS, but it's also a "cloud server".

re. CentOS 7

ownership ~ change "USERNAME" to your user name for the OS and change "/home/USERNAME/public_html" to your forum directory path:
Code: [Select]
sudo setfacl -R -m u:USERNAME:rwx /home/USERNAME/public_html

file/folder permissions ~ change "/home/USERNAME/public_html" to your forum directory path:
Code: [Select]
sudo find /home/USERNAME/public_html -type d -exec chmod 755 {} +
sudo find /home/USERNAME/public_html -type f -exec chmod 644 {} +

Omit "sudo" if you have root access by default.

Offline Aleksi "Lex" Kilpinen

  • Support Specialist
  • SMF Super Hero
  • *
  • Posts: 16,695
  • Gender: Male
  • Don't worry, I'm n00b friendly
    • Aleksi.Kilpinen on Facebook
    • aleksi-kilpinen on LinkedIn
Re: file and folder permissions
« Reply #17 on: May 18, 2018, 01:50:21 PM »
It all depends on the server setup, and the hosting control software you are running. For example I have a Plesk installation where I can just change the handler between 3 different options freely, and I know (from experience) that one of them will end up with permissions issues like those described in this topic.
A Finnish Support Specialist
 Happily running multiple SMF 2.0 installations.

"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum.
 Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

Offline brynn

  • Full Member
  • ***
  • Posts: 459
  • Gender: Female
    • Inkscape Community
Re: file and folder permissions
« Reply #18 on: Yesterday at 08:12:51 PM »
Well, it seems their solution did fix the issue.  You'd think they would have anticipated this, and switched the handler as part of the migration.  Or at least, then once the problems started, immediately realized what was happening.  I swear, not one of them knows what the other is doing!

But anyway, everything is working now.

Thanks for everyones comments and support!
Inkscape Community  (SMF with Tiny Portal)

Inkscape for Cutting Design  (originally a phpBB forum, converted to SMF, and using Simple Portal)