read only permissions to g2data

cangsam

Joined: 2007-09-18
Posts: 9
Posted: Fri, 2012-12-28 04:47

Having lots of problems with getting through the install step 4 getting access to g2data folder.

I have done the following:
chmod -R 777 /var/www/html/gallery2/g2data

I have also tried to chown -R apache.apache /var.... so that it runs as the user running apache.

I'm not sure what I'm missing, I tried moving the directory up to root or into /usr/share. There continues to be a permissions problem. When I remove the folder gallery2 knows that I need to create the folder however after I create it gallery never gets enough access to create the subfolders or the .htaccess ...

Is there anything else I should be trying?

thanks guys.

Gallery version (not just "2"): 2.3.2
PHP version: 5.4.8
Webserver (e.g. Apache 1.3.33): Apache 2.2.22
Database (e.g. MySql 5.0.32): Mysql
Operating system (e.g. Linux): Fedora 17
Browser (e.g. Firefox 2.0): Chrome

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Fri, 2012-12-28 05:06

the suggested directory layout would be as follows:
/var/www/yoursite.com
-g2data
--public_html
---gallery2

this way g2data is within your site user's "zone" but out of the public domain

g2data should belong to the site's user:group and also be 0777 recursively

-s
________________________________
All New jQuery Minislideshow for G2/G3

 
cangsam

Joined: 2007-09-18
Posts: 9
Posted: Fri, 2012-12-28 05:18

Yeah, I tried to put it there first but it didn't work there either so I tried leaving it in the default area. I just want to get it working somewhere before moving it to /var/www/g2data ...

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Fri, 2012-12-28 05:22
 
cangsam

Joined: 2007-09-18
Posts: 9
Posted: Fri, 2012-12-28 05:54

Great tool!

Getting closer, just tried to use "Advanced: Choose the path and the permissions manually" to change the permissions on /var/www/g2data and it failed.

Details: [ERROR] /var/www/g2data

Tried this with folders in different places and it is always [ERROR] do you think this is an issue with the configuration of the apache server or php config?

thanks

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Fri, 2012-12-28 05:59
Quote:
Details: [ERROR] /var/www/g2data

Tried this with folders in different places and it is always [ERROR] do you think this is an issue with the configuration of the apache server or php config?

This is completely dependent on your server setup.

Are you using webmin, cpanel, plesk or another webspace manager?

-s
________________________________
All New jQuery Minislideshow for G2/G3

 
cangsam

Joined: 2007-09-18
Posts: 9
Posted: Fri, 2012-12-28 06:06

It's my own machine, fedora 17 everything is freshly installed using yum.

 
Dayo

Joined: 2005-11-04
Posts: 1642
Posted: Fri, 2012-12-28 07:02

Upload the attached modified php info file to your g2 folder, change the extension to "php" and run.

It will let you know if your php user and g2data folder permissions are aligned.

--
dakanji.com

 
cangsam

Joined: 2007-09-18
Posts: 9
Posted: Fri, 2012-12-28 07:58

hmmm, running your file it returns this:
Item G2Data PHP
User Name undefined apache
User ID undefined 48
Group Name undefined apache
Group ID undefined 48
Server Information

Webserver Apache/2.2.22 (Fedora)
Architecture i686

not sure what undefined means because it is under user: apache group: apache when I do an ls -l

 
Dayo

Joined: 2005-11-04
Posts: 1642
Posted: Fri, 2012-12-28 08:53

It means it cannot find a file, 'cache/module/core/0/0/0.inc', in your g2data folder.

This file should be in every G2 installation.

--
dakanji.com

 
cangsam

Joined: 2007-09-18
Posts: 9
Posted: Fri, 2012-12-28 09:10

Yeah, it's a new installation, I can't get through the step 4 of the installation, so it hasn't created that folder yet.

 
Dayo

Joined: 2005-11-04
Posts: 1642
Posted: Fri, 2012-12-28 09:49

May be open_basedir restrictions.

Copy and paste the stuff below into terminal (assumes your gallery installation is at "/var/www/html/gallery2"):

rm -fr /var/www/html/g2data \
&& mkdir /var/www/html/g2data \
&& cd /var/www/html \
&& find . -exec chown apache:apache {} \; \
&& find . -type d -exec chmod 755 {} \; \
&& find . -type f -exec chmod 644 {} \;

Use "/var/www/html/g2data" as your g2data path in the installation process and let us know how it goes.

You can also change "g2data" to something else to improve security.

--
dakanji.com

 
cangsam

Joined: 2007-09-18
Posts: 9
Posted: Sun, 2012-12-30 17:53

Thanks Dayo, tried this exact code to remove and readd the g2data folder in the directory you mentioned same problem. I've tried this exact list of steps multiple times in different ways I think there might be a problem somewhere else....

 
Dayo

Joined: 2005-11-04
Posts: 1642
Posted: Sun, 2012-12-30 18:16

If done exactly as said, then the issue is indeed something else.

Obviously though, IO operations on folders are basic things and with over 100k installations of G2, suspicion has to be that something is not getting done right or getting overlooked.

You will probably have to get someone else to take a fresh look for you.

--
dakanji.com