Page 1 of 1

OCmod and folder CHmod Permissions

Posted: Thu Apr 06, 2017 3:56 pm
by maccadon
I hope somebody can tell me more about the OCMOD and the permissions it need.

I currently have the /system/modifications folder permissions on 777. To test if everything was working i renamed the folder with all files and made a new system/modification folder again with folder permission 777
When i do a refresh of the modifications it will add the folders admin - catalog - system and fill it with the modifications.

Error log
My log is now filling up with

Code: Select all

2017-04-04 20:59:05 - PHP Warning:  imagecopyresampled() expects parameter 1 to be resource, boolean given in public_html/system/library/image.php on line 99
2017-04-04 20:59:05 - PHP Warning:  imagecreatetruecolor(): Invalid image dimensions in /public_html/system/library/image.php on line 86
2017-04-04 20:59:05 - PHP Warning:  imagecolorallocate() expects parameter 1 to be resource, boolean given in /public_html/system/library/image.php on line 94
2017-04-04 20:59:05 - PHP Warning:  imagefilledrectangle() expects parameter 1 to be resource, boolean given in public_html/system/library/image.php on line 97
2017-04-04 20:59:05 - PHP Warning:  imagecopyresampled() expects parameter 1 to be resource, boolean given in /public_html/system/library/image.php on line 9
Permissions
I noticed that some older modifications were not put in that folder including /system/library/image.php
So i tried to copy that file from the older renamed folder into the new system/modification/system/library wit ftp but i got a error telling me i don't have the permission.
When i check the chmod of the files inside /system/modification it tells me they are 755 and i cannot chmod them in 777.

Direct Admin
I tried to use the file manager in Directadmin but it says it's not the owner. The owner of these folders are Apache but all the other opencart files are the normal owner (my loginnaam on the server).

The questions
1. Can i change the owner of the files and folders in the system/modification folder from apache to the user? Or does this block Opencart from adding new modifications?
2. How can i make the folders 777 if i cannot change the apache owner?
3. Is this an error in my opencart version?

My server
I'm running Opencart 2.0.3.1 on a VPS server with Directadmin.

Can anybody shine some light on this problem?

Re: OCmod and folder CHmod Permissions

Posted: Fri Apr 07, 2017 10:39 am
by IP_CAM
2. How can i make the folders 777 if i cannot change the apache owner?

I am not sure, if you plan, to create a download-server, or an online shop. Who in the world
told you, to chmod your Directories to 777 ?! :crazy:
Better fix this again, by use of this fine Tool!
And if you use OC v.2.3.x, you may have to rewrite some of the links, to make it work.
Good Luck
Ernie
---
https://www.opencart.com/index.php?rout ... n_id=26276
---
Image

Re: OCmod and folder CHmod Permissions

Posted: Fri Apr 07, 2017 12:53 pm
by maccadon
Hi Ernie,

I know that 777 isn't secure that why i wanted to know what would be the best settings for the /system/modification folder. Thanks for the link. I will run that script just to be sure.

Re: OCmod and folder CHmod Permissions

Posted: Tue Jun 05, 2018 6:55 am
by thomash2
Is there any reason not to be as restrictive as possible?

Would there be any problems if I set:
all folders to 0700 and all files to 0600
except config.php, php.ini to 0400 (both root and admin)
except index.php to 0404 (both root and admin)
vqmod.php, pathReplaces.php to 0400
except images, and view folder to 0704 and their files to 0604
except admin folder to 704, admin subfolders to 0700, admin files to 600

The only thing that the public needs to read is index.php, images, and view

I don't have any group users so I thought I'd set them all to 0, unless it's uneccessary.

Re: OCmod and folder CHmod Permissions

Posted: Tue Jun 05, 2018 8:17 am
by IP_CAM
Well, one can build a bunker, just to make sure. But if you only display your Content,
you may as well just build a set of finished Pages, to be called directly. It can be done
by the PAGECACHE Mod, as I recall, and this kind of doing things also add's to overall
Site + Page Load Performance.
https://github.com/IP-CAM?utf8=%E2%9C%9 ... Page+Cache
---
But I assume, that you will find out, by trail & error :D but if you don't have most of it in
'active' function, it should not hurt, to further go 'down' in values.
---
Good Luck! ;)
Ernie