[SOLVED] Moved server - G2 died

mixel

Joined: 2003-03-15
Posts: 35
Posted: Fri, 2005-04-22 04:56

Hi again, sorry for all the daft questions.

I'm using WestHost, and they moved my page to a new server. Everything seems to work perfectly sofar apart from my G2 installation..

On osX I get "Safari can’t open the page “http://mixelmagic.com/gallery/main.php

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Fri, 2005-04-22 06:16

Definitely better to fix what's wrong first and think about upgrading later.
Try turning on immediate debug output in config.php and see if you get anything when you access the site.

 
mixel

Joined: 2003-03-15
Posts: 35
Posted: Fri, 2005-04-22 06:37

Nothing came up in immediate debug, but it did log a lot of useful looking information when I put it in logged mode.

http://mixelmagic.com/debug.txt

Hopefully nothing too serious. Ty. :)

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Fri, 2005-04-22 07:14

here are some things to try:
1) look at your config.php and see if any paths or database settings need to be updated for your new server.
2) skim thru that debug output and see if any paths look wrong (maybe you fixed that when editing config.php)
3) if you have a .htaccess file check to make sure any paths/urls in there are correct, or try temporarily removing/renaming the .htaccess

 
mixel

Joined: 2003-03-15
Posts: 35
Posted: Fri, 2005-04-22 07:53

Thanks.. I just tried your suggestions..

1) They all look fine - I have a drawing board and forums using mySQL and they were unaffected by the move, so the database can't have changed too much.. The paths seem right as far as i can deduce from looking around on ftp anyway. looking in phpmyadmin, it looks as though everything's still there and ok.
2) All the paths *seem* right in the debug, apart from maybe "file_exists(/var/www/html/pictures//versions.dat" - '//' doesn't sound right? if I remove one of the / from pictures in config.php it makes no difference though..
3) Ive tried renaming the htaccess now, and that didn't do anything either.

I'm being a bit unlucky with this recently, sorry to distract from developing time. :D

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Fri, 2005-04-22 08:03

When you moved G2, did you follow the steps described in the FAQ? (last 2 questions ATM).
http://gallery.menalto.com/index.php?name=PNphpBB2&file=viewtopic&t=21599

 
mixel

Joined: 2003-03-15
Posts: 35
Posted: Fri, 2005-04-22 12:18

Well, I didn't move it, Westhost carbon copied everything on my space to another VPS, so all the paths and SQL information is still right (theoretically).. That being so - there doesn't seem to be anything for me to fix in config.php..

I'm guessing I should do these steps from the FAQ:
"6. Have your webhosting partner change the owner of the g2data dir recursively to the webserver user, unless php cgi + suexec is used. If you don't understand this instruction, forward it directly to your webhosting partner. The webhost has to do this only once, I'm sure they will do it.
7. I guess I wouldn't copy the config.php from the old host to the new host. Just run the installer, i.e. browse to newhost/gallery/install/. Make sure you choose "reuse existing database tables" in the database step. Point the installer in the appropriate step to the g2data folder (which is now not empty). And finish the installer. "

Fingers crossed.. :)

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Fri, 2005-04-22 13:55

Another thing to try:
access lib/tools/test/index.php
and click FlushCache test.. if this gets a permission error it may confirm that step 6 above is what you need to do.

 
mixel

Joined: 2003-03-15
Posts: 35
Posted: Fri, 2005-04-22 14:18

Odd.. It doesn't let me log in to test/index.php - I put the password in, but then it gives me the same 'doc contains no data'/'timed out' error I got at main.php.

I know you probably would've said so in the FAQ if there was a way, but just in case; is there a straightforward(ish) way to do step 6 with SSH or FTP? Westhost have said they'd charge me by the hour for support with non-recommended apps before, and it sounds like a one command job, doh. :)

I could give you server access again if that would be better, but I don't want to use up lots of your time either..

michael

 
mixel

Joined: 2003-03-15
Posts: 35
Posted: Fri, 2005-04-22 14:49

Hoo, I'm in over my head. :D I got an explanation of chown from the westhost forums.. But also (from jalal):

Quote:
However, I think that the webserver runs as the regular user on a WH server, so the files should all be correctly owned, but it won't hurt to run the command and change them to yourself... (assuming that you have the permissions to do that of course).

if I "ls -l" the pictures directory it says everything is owned by vuser - so they're probably right.. So would it be sensible to do step 5 and 7? (copy the files over the top and run the installer again)

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Fri, 2005-04-22 15:02

to find out which user creates/managed your g2data files:

<?php   
$path_to_g2data = '/var/www/localhost/g2data/'; /* please enter here the path to your g2data directory */
print "whoami: ";    
exec("whoami", $ret);
print join('<br>', $ret);

exec("ls -l $path_to_g2data*", $ret);
print "<br>g2data listing: <br><pre>";
print_r($ret);
print "</pre>";

?>

create a file, put the above code in it, upload it to your webserver and browse to it.
what does it say?

 
mixel

Joined: 2003-03-15
Posts: 35
Posted: Fri, 2005-04-22 16:42

That php file didn't work for some reason, and came up blank (i made it executable etc), but I tried "ls -l /path/to/g2data" manually using SSH again, but reading the output properly.. (oops)

drwxrwxrwx 10 myusername* vuser 4096 Apr 21 02:01 pictures

They're owned by 'myusername' (edited out) - the same one I use to FTP to the site.. It's my main account and it has root access to the vps.

.. :)

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Fri, 2005-04-22 17:06

mixel, so it is resolved?
however, i removed the typos in my script above, try it again.
if the result of the whoami call isn't the same user as the owner of the files/dirs in g2data, then you have a problem.

 
mixel

Joined: 2003-03-15
Posts: 35
Posted: Fri, 2005-04-22 17:37

Not resolved quite yet.. Thanks though! That version of the script worked nicely, they're all the same username..

Should I reupload B2 and run the installer? You've all been super helpful! :D

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Fri, 2005-04-22 18:17

if you use the installer, choose "reuse existing tables" in the db step of the installer.
if you do so, the installer can't / shouldn't destroy anything. it should only create a new config.php and flush the caches.

 
mixel

Joined: 2003-03-15
Posts: 35
Posted: Fri, 2005-04-22 19:36

Woohoo!

That fixed it.. One of the things that I think was messing it up was "zend.ze1_compatibility_mode = On" - they must've changed the php.ini when they copied everything over. I changed it back as the installer told me to, told it to reuse tables, and now everything's back to normal.

Thanks so much. :) G2 is great!