Post by Soma123 » Wed Nov 05, 2008 8:11 am

I'm having some problems uploading opencart. The Problem is below.

"/public_html/store/images/" , it is called "cache" , the current script i am trying to install "open cart" would like me to mod this to 666 but whenever i go to do it, it stays modded to 777

Please Help! How Can I solve this problem?

Newbie

Posts

Joined
Wed Nov 05, 2008 8:04 am

Post by hm2k » Wed Nov 05, 2008 9:39 am

Are you using 0.7.9-RC3?

UK Web Hosting


User avatar
Global Moderator

Posts

Joined
Tue Mar 11, 2008 9:06 am
Location - UK

Post by Qphoria » Wed Nov 05, 2008 12:04 pm

there should be no problem leaving it 777. Often webhosts don't allow chmod to be inflicted via FTP... try doing it through the cpanel file manager

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by jty » Wed Nov 05, 2008 12:37 pm

When I set the permissions to 666 for images and cache, using cPanel, my webhost bans my IP  >:(
I have to leave it as 777, otherwise, I am reported as trying to do sql injection attacks on my own website. LOL.
I also noticed that if I set the permissions to 666 for cache (and maybe images), the files in that folder have a permission of 000

Edited
This is the log file of my SQL Injection attack when I set permissions to 666

Code: Select all

Pattern match "\\b(?:(?:s(?:ys(?:(?:(?:process|tabl)e|filegroup|object)s|c(?:o(?:nstraint|lumn)s|at)|dba|ibm)|ubstr(?:ing)?)|user_(?:(?:(?:constrain|objec)t|tab(?:_column|le)|ind_column|user)s|password|group)|a(?:tt(?:rel|typ)id|ll_objects)|object_(?:(?:nam|typ)e|id)| ..." at REQUEST_FILENAME. [file "/usr/local/apache/conf/modsec2.user.conf"] [line "72"] [id "950904"] [msg "Blind SQL Injection Attack. Matched signature <user_group>"] [severity "CRITICAL"] [hostname "www.mydomain.com"] [uri "/admin/javascript/JSCookMenu/default/user_group.png"] [unique_id "SPH9qxxxxxxxxxxxxxxxAAAK"] [Mon Oct 13 00:38:49 2008] [error] [client xxx.xxx.xx.xx] ModSecurity: Access denied with code 406 (phase 2).
Note: Smiley fix.
Last edited by hm2k on Wed Nov 05, 2008 10:40 pm, edited 1 time in total.

jty
Active Member

Posts

Joined
Sat Aug 30, 2008 8:19 am

Post by hm2k » Wed Nov 05, 2008 10:41 pm

They won't have the perms of 000, it'll likely be unreadable, that's why it's saying 000...

Contact your admin...

UK Web Hosting


User avatar
Global Moderator

Posts

Joined
Tue Mar 11, 2008 9:06 am
Location - UK

Post by fido-x » Thu Nov 06, 2008 3:27 pm

The installation instructions for OpenCart 0.7.9 are wrong and have been so since 0.7.8.

Permissions of 666 give read and write access to a pre-existing FILE for everybody. However, the server user needs to be able to write files that do not already exist on the server to a DIRECTORY. To do this the DIRECTORY needs to be readable, writable AND executable, hence permissions of 777 need to be set on the cache, download, image and image/cache directories.

Image
Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool

If you're not living on the edge ... you're taking up too much space!


User avatar
Expert Member

Posts

Joined
Sat Jun 28, 2008 1:09 am
Location - Tasmania, Australia

Post by hm2k » Thu Nov 06, 2008 10:39 pm

The instructions in 0.7.9 don't tell you to use a numeric system, but instead tell you which permissions to add, as follows:
2. Make sure the following folders and files are writable. For Linux/Unix use the following:
  chmod a+w image/
  chmod a+w image/cache/
  chmod a+w cache/
  chmod a+w download/
  chmod a+w config.php
  chmod a+w admin/config.php
So you're suggesting we make it +wx instead of just +w?

However, I tested the instructions myself, on my setup they worked as expected.

UK Web Hosting


User avatar
Global Moderator

Posts

Joined
Tue Mar 11, 2008 9:06 am
Location - UK

Post by Qphoria » Thu Nov 06, 2008 10:57 pm

hm2k wrote: So you're suggesting we make it +wx instead of just +w?

However, I tested the instructions myself, on my setup they worked as expected.
Another side note. some hosts have their apache server on a diff server than the host... (like GoDiddy)
and Im not sure if that will work or not with 666 or just +w.. but I'm not sure.

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by fido-x » Fri Nov 07, 2008 7:41 am

hm2k wrote: The instructions in 0.7.9 don't tell you to use a numeric system,
Sorry, my mistake on that one.
So you're suggesting we make it +wx instead of just +w?
Yep, that's right.
However, I tested the instructions myself, on my setup they worked as expected.
Is your setup running apache on a  linux box or are you using IIS or XAMPP on a Windows box? If using apache on a linux box, are your pages being served from the apache user's "DocumentRoot" (ie. the default directory), or are the pages being served from a user's "public_html" directory? While the apache user is generally the owner of the "DocumentRoot" and, subsequently, has permission to do anything within this directory, the same is not true for the user's "public_html" directory. This directory (and any subdirectory) needs to be executable by the apache user, so that pages can actually be served from them. Since the apache user needs permission to write to the cache, download, image and image/cache directories, when setting permissions to allow the apache user to write to the directory, the executable bit needs to be retained.

On Windows systems (either IIS or XAMPP), it it not necessary to set the executable bit.
Last edited by fido-x on Fri Nov 07, 2008 7:55 am, edited 1 time in total.

Image
Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool

If you're not living on the edge ... you're taking up too much space!


User avatar
Expert Member

Posts

Joined
Sat Jun 28, 2008 1:09 am
Location - Tasmania, Australia

Post by hm2k » Fri Nov 07, 2008 7:59 am

I suspected this might be the case, on my linux box it tested fine, but that's windows for you!

The question is though, do you need +x once the directory is created, or just while you create the directories?

UK Web Hosting


User avatar
Global Moderator

Posts

Joined
Tue Mar 11, 2008 9:06 am
Location - UK

Post by fido-x » Fri Nov 07, 2008 8:09 am

hm2k wrote: I suspected this might be the case, on my linux box it tested fine, but that's windows for you!

The question is though, do you need +x once the directory is created, or just while you create the directories?
You need to retain the +x so that the apache user can execute processes within the directories, eg. the creation of the cache files, or writing the uploaded images files, etc.

Image
Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool

If you're not living on the edge ... you're taking up too much space!


User avatar
Expert Member

Posts

Joined
Sat Jun 28, 2008 1:09 am
Location - Tasmania, Australia

Post by jty » Fri Nov 07, 2008 8:41 am

While we're on the topic, I see that admin/config.php now calls the root config.php
Given this, is there still a need to set permissions for admin/config.php to 777, as nothing is written to it (or is there something I'm missing)
Also, in control panel, the language is 777, 666, 775 etc. Could the install instructions speak this language because I had to google to work out what a+w means.
Even then I got it wrong and set things to 666 which made my webhost think I was the devil doing sql injection attacks

jty
Active Member

Posts

Joined
Sat Aug 30, 2008 8:19 am

Post by fido-x » Fri Nov 07, 2008 10:38 am

jty wrote: While we're on the topic, I see that admin/config.php now calls the root config.php
Given this, is there still a need to set permissions for admin/config.php to 777, as nothing is written to it (or is there something I'm missing)
That's right, nothing is written to this file any more, therefore, there shouldn't be any need for permissions of 777 on this file, 444 (read only) should do fine.
Also, in control panel, the language is 777, 666, 775 etc. Could the install instructions speak this language because I had to google to work out what a+w means.
This link might help you with the understanding of linux permissions http://linuxcommand.org/lts0070.php

Image
Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool

If you're not living on the edge ... you're taking up too much space!


User avatar
Expert Member

Posts

Joined
Sat Jun 28, 2008 1:09 am
Location - Tasmania, Australia

Post by jty » Fri Nov 07, 2008 11:06 am

fido-x wrote:
jty wrote: While we're on the topic, I see that admin/config.php now calls the root config.php
Given this, is there still a need to set permissions for admin/config.php to 777, as nothing is written to it (or is there something I'm missing)
That's right, nothing is written to this file any more, therefore, there shouldn't be any need for permissions of 777 on this file, 444 (read only) should do fine.
The install script still forces me to make admin/config.php writeable
I did argue with the script but the isntall script was adamant so I obliged  >:(
Also, in control panel, the language is 777, 666, 775 etc. Could the install instructions speak this language because I had to google to work out what a+w means.
This link might help you with the understanding of linux permissions http://linuxcommand.org/lts0070.php
Too hard, Fido
I'm a user. I don't want to learn too much about Linux. My job is to sell product  :D
Thanks. I'd better get out of here soon before I become a techno geek  :P

jty
Active Member

Posts

Joined
Sat Aug 30, 2008 8:19 am

Post by fido-x » Fri Nov 07, 2008 11:20 am

jty wrote: The install script still forces me to make admin/config.php writeable
Try changing the following line of "install/index.php" from (line 33):-

Code: Select all

$files=array('config.php','admin'.SLASH.'config.php','cache'.SLASH,'image'.SLASH,'image'.SLASH.'cache'.SLASH,'download'.SLASH);
to

Code: Select all

$files=array('config.php','cache'.SLASH,'image'.SLASH,'image'.SLASH.'cache'.SLASH,'download'.SLASH);
then you should be able to set the permissions on the "admin/config.php" file to read-only before you install.

Image
Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool

If you're not living on the edge ... you're taking up too much space!


User avatar
Expert Member

Posts

Joined
Sat Jun 28, 2008 1:09 am
Location - Tasmania, Australia

Post by fido-x » Fri Nov 07, 2008 4:36 pm

No worries.

Image
Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool

If you're not living on the edge ... you're taking up too much space!


User avatar
Expert Member

Posts

Joined
Sat Jun 28, 2008 1:09 am
Location - Tasmania, Australia

Post by hm2k » Fri Nov 07, 2008 6:40 pm

The admin config needs to be writeable for upgrading, as old versions of the file will need to be redirected to the new file.

I did it in both install and upgrade, just in case there was an issue.

UK Web Hosting


User avatar
Global Moderator

Posts

Joined
Tue Mar 11, 2008 9:06 am
Location - UK

Post by fido-x » Fri Nov 07, 2008 9:17 pm

hm2k wrote: The admin config needs to be writeable for upgrading, as old versions of the file will need to be redirected to the new file.
Aaah, there had to be a reason for it. Of course, you're right, the "admin/config.php" would need to be writeable for this to occur. I hadn't been thinking about the upgrade scenario.

Image
Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool

If you're not living on the edge ... you're taking up too much space!


User avatar
Expert Member

Posts

Joined
Sat Jun 28, 2008 1:09 am
Location - Tasmania, Australia
Who is online

Users browsing this forum: No registered users and 2 guests