Gallery version: 2.2.1 (but principle applies to any V2)
PHP version: 5.2.6
Webserver: Apache 1.3.41 (Unix)
Database: MySQL 5.0.81-community
Activated toolkits (e.g. NetPbm, GD):
Operating system: Linux
Browser: IE8
========================================================
This is more of a 'How To' than a 'Problem' as nothing is 'broken'...
I have searched already for possible solutions, but have not found anything that seems to help with this. If there is, please point me in the right direction, and sorry for the trouble.
The issue arises due to hacking attempts which have left an enormous amount of spurious files in the g2data Directory(s). Before the Server was upgraded with suPHP, there were many Directories with the 777 Permissions. In EACH Directory with the 777 Permission, there is a spurious PHP file, which while not 'dangerous' in themselves, should be removed. Now that suPHP is running, the Permissions (755) prevent this from happening again. However, with the enormous amount of Sub-Directories in the g2data structure which had the 777 Permissions, manually navigating each Directory to remove the spurious files is a nightmare, and I have more than one installation of Gallery 2 to deal with!
Unless someone can suggest a more elegant way to deal with this, my thoughts are to install another Gallery2 installation (using a different Directory/scheme/Database), and migrate the existing Gallery data. The issue with Users is not critical (though must ensure a single Admin Account to start with). The original installation can then be removed.
The new installation should then set up the Directories with the 755 Permissions, and free of these spurious files, saving hours and hours of work.
Although I have read through a number of how to's which involve migration etc, I can't see anything that helps with this in particular. Although I am no novice, I am no expert either! I am reasonably proficient with cPanel, MySQL etc.
Appreciate any guidance available.
C
Posts: 6138
There is a big link to the documentation in the upper right hand corner of every page on this site.
http://codex.gallery2.org/Gallery2:FAQ#How_can_I_move_my_gallery_installation_from_one_folder_to_another.3F
-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2
Posts: 5
Thank you for the very quick response. I did browse the documentation before posting. Unfortunately, this Help Topic does not (seem to) address the issue of removing the unwanted files, as it moves the entire Directory structure from one place to another, which means all the unwanted files are also moved. Or am I misunderstanding something?
What I need (I think) is a means to do a fresh install of Gallery2, and port the Data (Albums/Images/etc) to the new installation. In this way the spurious additional files are left in the original Gallery2 installation which can then be removed completely. Alternatively, I am looking for a another method which will do the same thing (discard the unwanted files without having to manually go through every Directory and deleting manually one by one).
If I could use Windows Explorer it would be relatively easy (do a Search for all files with a php extension, sort alphanumerically, and it would be easy to find all the rogue files (as they all have numeric only Names) and delete en masse. Short of ftp'ing the whole Gallery2 and subDirectories to my local disk, doing the business (Search/Delete), deleting the Directories on the Web Server, then uploading the whole shooting match again (would that even work?), I am not sure what else can be done. I do not have a particularly fast Internet Connection, and I am not sure whether there are any potential issues with copying all the files from the Web Server to local disk and then back to the Web Server again, so I am reluctant to go that route as well.
Does that make sense?
C
Posts: 16503
Run through this:
FAQ: How can I make sure that my installation files are all intact?
It'll give you a script you can run from the server via SSH to remove old files.
Or you can do this:
-First upgrade to 2.3:
FAQ: How to upgrade Gallery2?
-Move g2data outside of your gallery directory, it shouldn't be there anyway as it should be above your webroot
FAQ: How can I move my storage folder to another path?
-Extract a fresh install of Gallery into a new directory
Copy config.php and .htaccess over to that new directory from your old one
-Rename your old gallery directory to something like 'gallery_old' and your new directory to what your old gallery directory was.
Example
Gallery is currently at:
www.example.com/gallery
you put the "new" install at
www.example.com/gallery_new
Rename 'gallery' to 'gallery_old' and 'gallery_new' to 'gallery
A fresh clean install with no old files.
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here
Posts: 5
Thank you. I will try that.
If all else fails I *can* trudge through all the Directories and remove the rogue files by hand, so bottom line is it can be sorted with a long, hard, mind numbing slog...
I appreciate the suggestions. Thank you again.
C