News:

Wondering if this will always be free?  See why free is better.

Main Menu

file and folder permissions

Started by brynn, May 13, 2018, 09:06:55 AM

Previous topic - Next topic

brynn

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!

Looking

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.

Illori

Quote from: brynn on May 13, 2018, 09:06:55 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.

brynn

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.

Illori

Quote from: Looking 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.

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

Kindred

Change files to 664 and directories to 755
Слaва
Украинi

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

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Sir Osis of Liver

I've always used 644/755, most installs set up that way.  They're easy to view/change in FileZilla.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Chen Zhen

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.

My SMF Mods & Plug-Ins

WebDev

"Either you repeat the same conventional doctrines everybody is saying, or else you say something true, and it will sound like it's from Neptune." - Noam Chomsky

brynn

Sorry for the delay.  I was about ready to blow a gasket, and had to take a day or so off.

Quote from: Sir Osis of Liver 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.

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).

Quote from: Chen Zhen 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.

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 ??

Kindred

you should be able to easily change the permissions using a recursive chmod commandline



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



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 {} \;

Слaва
Украинi

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

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

brynn

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.

Sir Osis of Liver

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.

Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

brynn

#12
Quote from: Sir Osis of Liver on May 15, 2018, 05:20:15 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.

GigaWatt

https://www.suphp.org/Home.html

QuotesuPHP 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."

"A 500 error loosely translates to the webserver saying, "WTF?"..."

brynn

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....

brynn

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.

Chen Zhen

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:

sudo setfacl -R -m u:USERNAME:rwx /home/USERNAME/public_html


file/folder permissions ~ change "/home/USERNAME/public_html" to your forum directory path:

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.

My SMF Mods & Plug-Ins

WebDev

"Either you repeat the same conventional doctrines everybody is saying, or else you say something true, and it will sound like it's from Neptune." - Noam Chomsky

Aleksi "Lex" Kilpinen

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.
Slava
Ukraini!


"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

How you can help SMF

brynn

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!

Advertisement: