[SOLVED] Help with subdomain multisite path

Roshlin

Joined: 2004-09-14
Posts: 70
Posted: Sat, 2005-07-09 22:28

Hi,
I have sucesfully insatalled G2 on my site, and was trying the multisite on a subdomain.

I am getting this error :
Warning: is_dir(): Stat failed for /home/pedidos/public_html (errno=13 - Permiso denegado) in /var/www/html/g2/install/steps/MultisiteStep.class on line 68

I event tried uploading these files manually
main.php
index.php
embed.php
upgrade/index.php

but I get this error when I run upgrade/index.php
Warning: main(/home/pedidos/public_html/upgrade/UpgradeStep.class): failed to open stream: No such file or directory in /home/pedidos/public_html/upgrade/index.php on line 42

Fatal error: main(): Failed opening required '/home/pedidos/public_html/upgrade/UpgradeStep.class' (include_path='.:/php/includes:/usr/share/php') in /home/pedidos/public_html/upgrade/index.php on line 42

All the above files have write permissions

I type this in the path
/home/pedidos/public_html
/home/pedidos/public_html/

I've checked through FTP that the directory/subdomain exists but I get this error
The directory you entered does not exist

Where am I going wrong

Thanks for your support
Roshlin

----

Gallery URL (optional):
Gallery version: g2 b3
Webserver (with version):
Datatabase (with version): mySql
PHP version (eg 4.2.1):
phpinfo URL (optional):
Graphics Toolkit(s): GD imagmagick
Operating system:
Web browser/version: IE 6
G1 version (for migration bugs):

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Sat, 2005-07-09 22:31

perhaps an open basedir restriction is in effect.
could you provide a phpinfo link?

and if you can't access the paths with ftp, how should G2 do it?

 
Roshlin

Joined: 2004-09-14
Posts: 70
Posted: Sun, 2005-07-10 00:21

Hi Valiant,

Quote:
could you provide a phpinfo link?

How could I do that????

I CAN access the paths by ftp, as I mentioned earlier I have also uploaded the files mentioned above.

I did he system info in G" and got this info
Gallery version = 2.0-beta-3+ core 0.9.27
PHP version = 4.3.10 cgi
Webserver = Apache/2.0.50 (Fedora)
Database = mysql 3.23.58
Toolkits = ArchiveUpload, Exif, Gd, Thumbnail, ImageMagick
Operating system = Linux newhost59.newhost59-server.com 2.4.22-1.2199.nptlsmp #1 SMP Wed Aug 4 11:48:29 EDT 2004 i686
Browser = Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16503
Posted: Sun, 2005-07-10 00:28

create a file called phpinfo.php add the following code to it <?php phpinfo(); ?> Then upload it to the directory where you have G2 installed.

Then post a link to that file here. ;)

EDIT: (fixed typo)

 
Roshlin

Joined: 2004-09-14
Posts: 70
Posted: Sun, 2005-07-10 08:32

Hi nivekiam
this is the link to the http://www.pedidos.fotorima.com/phpinfo.php

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Sun, 2005-07-10 10:15

thanks. there's no open basedir restriction in effect. the problem is something else.

ok, back to your orginal post:

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Sun, 2005-07-10 10:16

multisite installation works like this:
You have a single "codebase" that is the directory where you have the gallery2 installation files which is several megabytes in size. You can install an unlimited number of G2 "multisite" installs with this single copy of the files.
So the primary advantage of using the multisite functionality of G2 instead of using normal installations is saving the disk space that is needed for each gallery2 folder.
The multisite installations don't share users or photos/items, they are completely separated and share only the same codebase.
Another advantage of multisite: You only have to update a single codebase. Once the codebase is replaced with a new G2 version, just visite the different multisites and each multisite will automatically start its upgrade process. So each multisite has to be upgraded independently, but you have to replace the underlying codebase only once.
The codebase can't be installed just anywhere. It needs to be installed in a directory that can be reached from the web. G2 has some static content, e.g. some icons etc. and this content is provided by the codebase install for all multisites.
But you don't have to run the installer for codebase itself, the codebase doesn't have to actually run a G2.
The codebase installation is just the central place to start a multisite installation. Each time you want to install a new multisite, you browse to the codebase install /install/ directory walk through the multisite install process steps.

So here are the instructions on how to run a multisite installation:

1. put your gallry2 code somewhere on the webserver, a place which is accessible from the web.
you chose:
/var/www/html/g2/ and it is accessible at: http://www.fotorima.com/g2/
that's correct and good.

2. for each multisite installation, you need another path that is accessible from a webbrowser
you chose:
/home/pedidos/public_html/ which can be accessed by http://www.pedidos.fotorima.com/ or http://www.fotorima.com/~pedidos/
that's good.

3. in the multisite step, enter /home/pedidos/public_html/ in the form field and before pressing ok, chmod /home/pedidos/public_html/ 777 (give the webserver write permission on the directory such that it can create the necessary dir structure.
it will create 4 files: index.php, embed.php, main.php, upgrade/index.php.
these 4 files are not the same files as the ones in your codebase install. they are much smaller and actually use your codebase install files in the background.
later on in the install process, a 5th file will be created in the multisite directory, the config.php file.

i don't know if you did this step correctly. make sure you do.

4. click ok in the multisite step. in the storage steup step, choose a new g2data directory for each multisite. each multisite needs its own storage directory.

WARNING: if you choose the same storage directory for multiple multisites, it will destroy the existing other installation.

5. in the database step, choose a new database (or a new table prefix) for each multisite install. each multisite install needs its own database tables.

WARNING: if you choose the same database + table prefix for multiple multisites, it will destroy the existing other installation.

6. finish all installation steps.

 
Roshlin

Joined: 2004-09-14
Posts: 70
Posted: Sun, 2005-07-10 11:13

Hi Valiant,

Thanks for your quick response.
I've done exactly as you have suggested and as you can see with the links everything is working, but I still get the same error
Warning: is_dir(): Stat failed for /home/pedidos/public_html (errno=13 - Permiso denegado) in /var/www/html/g2/install/steps/MultisiteStep.class on line 68

In the form I put /home/pedidos/public_html or /home/pedidos/public_html/
the foldder property is 777 and it exists but it still tells me that : The directory you entered does not exist

Any guess where I could be going wrong.
Thanks
Roshlin

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Sun, 2005-07-10 11:22

can you copy the phpinfo file to /var/www/html/g2/install/phpinfo.php ? thanks.

and please post the output of
ls -l /home/pedidos/public_html/

 
Roshlin

Joined: 2004-09-14
Posts: 70
Posted: Sun, 2005-07-10 12:03

Hi Valiant

Quote:
can you copy the phpinfo file to /var/www/html/g2/install/phpinfo.php ? thanks.

I've done that.

Quote:
and please post the output of
ls -l /home/pedidos/public_html/

How can i do that ???

If it means the contents of the folder, it is empty (only the default files which are created when you make a subdomain. I just made it to install G2)
Thanks
Roshlin

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Sun, 2005-07-10 12:27

ls -l, in the command line / shell.

do you have only ftp access? i assumed you have command line access to the box.

i've checked the phpinfo, thanks. but there's nothing suspecious. just the fact that it's php cgi, maybe suExec is used.

why do i get a apache error (500) for http://www.pedidos.fotorima.com/phpinfo.php ? have you removed the file?

 
Roshlin

Joined: 2004-09-14
Posts: 70
Posted: Sun, 2005-07-10 12:44

Hi Valiant,
really don't know why its not working, it was working earlier, I think even you saw it, the file was still there and now I have replaced it with a fresh copy and it gives the same errror

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Sun, 2005-07-10 12:56
Quote:
and please post the output of
ls -l /home/pedidos/public_html/

 
Roshlin

Joined: 2004-09-14
Posts: 70
Posted: Sun, 2005-07-10 13:18

Hi Valiant,

Quote:
and please post the output of
ls -l /home/pedidos/public_html/

How can I get this info, I genrally manage my site through ftp, browser and the admin panel (maybe ensim)

I've never tried any other method, if you could pleasse tell me how to access the command line, I'll do it

Thanks
Roshlin

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Sun, 2005-07-10 13:43

as i said, with a shell / command line.
ftp is the slowest method to do anything. as you have access to /var/www/html/g2/ and /home/pedidos, i assumed you have root access or shell (ssh) access to the box.

are you 100% sure that /home/pedidos/public_html/ has file permissions 777?

and have you tried the other method?
create the 4 files in /home/pedidos/public_html/ and chmod the 4 files 777.
do you get the same error?

and if you are not the admin, ask the admin why php is_dir returns a warning for you.

 
Roshlin

Joined: 2004-09-14
Posts: 70
Posted: Sun, 2005-07-10 15:28

Hi Valiant,

The problem was that the main folder pedidos did not have 777, so I changed it and continued with the install, chose another storage and new table prefix and completed the install.

But I inly get a 500 error

http://www.pedidos.fotorima.com/upgrade/index.php
http://www.pedidos.fotorima.com/main.php

This gives the placeholder http://www.pedidos.fotorima.com/

Through ftp I saw that it has created the config file and on the last line it it points to the main G2
$gallery->setConfig('galleryBaseUrl', 'http://www.fotorima.com/g2/');

Any guess

Thanks
Roshlin

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Sun, 2005-07-10 15:30

you'll have to take a look at the apache error log (not the access log) to see what the reason is for the 500 error.

 
Roshlin

Joined: 2004-09-14
Posts: 70
Posted: Sun, 2005-07-10 16:50

HI Valinat,
I reinstalled the whole thing, complete the whole process sucessfully, and the installer prompted me to go to the main.php. now I dont get the 500 error and can see the phpinfo, but when I go to main.php I get this error
Warning: mkdir(/home/fotorima/g2data): Permission denied in /var/www/html/g2/modules/core/classes/GalleryPlatform.class on line 593

Warning: rename(/tmp/0.inccFHoSg,/home/fotorima/g2data/pedidos/cache/module/core/0/0/0.inc): Permission denied in /var/www/html/g2/modules/core/classes/GalleryPlatform.class on line 465

Warning: mkdir(/home/fotorima/g2data): Permission denied in /var/www/html/g2/modules/core/classes/GalleryPlatform.class on line 593

Warning: rename(/tmp/0.inca0Mumr,/home/fotorima/g2data/pedidos/cache/module/core/0/0/0.inc): Permission denied in /var/www/html/g2/modules/core/classes/GalleryPlatform.class on line 465

Warning: mkdir(/home/fotorima/g2data): Permission denied in /var/www/html/g2/modules/core/classes/GalleryPlatform.class on line 593

Warning: rename(/tmp/GalleryFactoryHelper_loadRegistry.incOYnChA,/home/fotorima/g2data/pedidos/cache/module/_all/0/0/GalleryFactoryHelper_loadRegistry.inc): Permission denied in /var/www/html/g2/modules/core/classes/GalleryPlatform.class on line 465

Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/g2/modules/core/classes/GalleryPlatform.class:593) in /var/www/html/g2/main.php on line 472

Warning: rename(/tmp/ad0e2315ffad2e1e113b2af7e675789fiJVBY1,/home/fotorima/g2data/pedidos/sessions/ad0e2315ffad2e1e113b2af7e675789f): Permiso denegado in /var/www/html/g2/modules/core/classes/GalleryPlatform.class on line 465

I think it should be near now
http://www.pedidos.fotorima.com/main.php
http://www.pedidos.fotorima.com/phpinfo.php

Please help
Roshlin

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Sun, 2005-07-10 17:18

just read the warning:
Warning: mkdir(/home/fotorima/g2data): Permission denied in blablabla

g2data has wrong permissions, give it 777 or something, recursively.
chmod -R 777 /home/fotorima/g2data

 
Roshlin

Joined: 2004-09-14
Posts: 70
Posted: Sun, 2005-07-10 22:08

Hi Valiant,

I have changed the permissions for the g2data and all its subfolders to 777 and am still having the same problem, did not change it earlier because the main G2 was working with the other permissions.
as the message always contained this line: Permission denied in /var/www/html/g2/modules/core/classes/GalleryPlatform.class on line 593

I have also changed the permissions for thes file, but no progress.

What else can be done,

Thanks fo ryour help
Roshlin

Thanks
Roshlin

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16503
Posted: Sun, 2005-07-10 22:17

I'd bet your web host changed some things on you. You have major problems with permissions. Maybe g2data is 777 now, but it appears as though the user Apache runs as can't even get to g2data. What are the permissions on /home and /home/fotorima ?

It also appears as though the user Apache runs as can't write to or at least can't rename files in /tmp

Quote:
Warning: mkdir(/home/fotorima/g2data): Permission denied in /var/www/html/g2/modules/core/classes/GalleryPlatform.class on line 593

Warning: rename(/tmp/0.incKgF5dJ,/home/fotorima/g2data/pedidos/cache/module/core/0/0/0.inc): Permission denied in /var/www/html/g2/modules/core/classes/GalleryPlatform.class on line 465

Warning: mkdir(/home/fotorima/g2data): Permission denied in /var/www/html/g2/modules/core/classes/GalleryPlatform.class on line 593

Warning: rename(/tmp/0.inc8Um1ln,/home/fotorima/g2data/pedidos/cache/module/core/0/0/0.inc): Permission denied in /var/www/html/g2/modules/core/classes/GalleryPlatform.class on line 465

Warning: mkdir(/home/fotorima/g2data): Permission denied in /var/www/html/g2/modules/core/classes/GalleryPlatform.class on line 593

Warning: rename(/tmp/GalleryFactoryHelper_loadRegistry.incwVXnq2,/home/fotorima/g2data/pedidos/cache/module/_all/0/0/GalleryFactoryHelper_loadRegistry.inc): Permission denied in /var/www/html/g2/modules/core/classes/GalleryPlatform.class on line 465

Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/g2/modules/core/classes/GalleryPlatform.class:593) in /var/www/html/g2/main.php on line 472

Warning: rename(/tmp/2893a3f9169ec6505674c739bffb78c700ZL0E,/home/fotorima/g2data/pedidos/sessions/2893a3f9169ec6505674c739bffb78c7): Permiso denegado in /var/www/html/g2/modules/core/classes/GalleryPlatform.class on line 465

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Sun, 2005-07-10 22:26

you don't have to change the permissions of /var/www/html/g2/modules/core/classes/GalleryPlatform.class

that's the code which does something with your filesystem.
the other part of the warning / error message is the important part.

start from scratch.
then go to site admin
and change the "Filesystem Permissions"
choose 777 for files and directories and hit save.

then chmod -R 777 g2data (make all exisiting dirs and files writable).

i don't know why you have these problems, hope this helps.

 
Roshlin

Joined: 2004-09-14
Posts: 70
Posted: Wed, 2005-07-13 21:57

Thanks Valiant and Nivekiam, :D

I have my multisite working. The problems was with the permissions on the folders that G2 had created, when I manually changed the permissions on the g2data/cache folders etc, it started working but when I made any changes it started with other errors for other subfolders (lock/0/1 etc...) which had been by G2 itself. Surprisingly the main G2 worked well with the same folder settings. So I decided to delete everythig, deleted the subdomain the folder , everything and started from scratch again, and everything went fine .

Thanks for you help 8)
Roshlin

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Sat, 2005-07-30 00:47

for the interested mind, i've just created some multisite docs:

http://codex.gallery2.org/index.php/Gallery2:Multisite

it's a wiki, so feel free to improve the docs.