After taring a dir the images become inaccesable

Whether you are using Linux on the desktop or as a server, it's still good that you're using Linux. Linux related questions go here.

Moderator: General Moderators

Post Reply
pinehead18
Forum Contributor
Posts: 329
Joined: Thu Jul 31, 2003 9:20 pm

After taring a dir the images become inaccesable

Post by pinehead18 »

Ok, i have a website and when i run the backup i run and i tar it. And tar while doing so gives me a message saying it was unable to add the images (all the images in my pics) folder to the tar file.

Then when i go to my website even though the link to the image and the image name on the server are the same and was working before i ran my backup. The image does not display. it only displays one of those things that shows an image is suppose to show up.

Any ideas?

Thank you
Anthony
User avatar
markl999
DevNet Resident
Posts: 1972
Joined: Thu Oct 16, 2003 5:49 pm
Location: Manchester (UK)

Post by markl999 »

If you right click on the image and view it's 'properties' is the path to it ok ?
pinehead18
Forum Contributor
Posts: 329
Joined: Thu Jul 31, 2003 9:20 pm

Post by pinehead18 »

yes, that is one of the first thigns i checked. See i was working on it.. and it worked right beofre the backup. Then when i backed up all the images stopped working. Just the ones that i uploaded with my upload script though.

First thing I thought was i was stupid and somehow changed the path. Yet it is correct.
pinehead18
Forum Contributor
Posts: 329
Joined: Thu Jul 31, 2003 9:20 pm

Post by pinehead18 »

Forbidden
You don't have permission to access /pics/image20040121094637.jpg on this server.

HMM i'm thinking some sort of permissions problem cuased by something? Its weird it happens only after i tar my dir.

That is what i get when i copy and past the link on the image.. After right hand clicking on it
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

When you upload them through a form, it is the user under which your webserver runs (typically nobody/www-data) that owns the files.

Solution:
You execute a script through the webserver to chmod to 777 (so user foo gets access rights)
pinehead18
Forum Contributor
Posts: 329
Joined: Thu Jul 31, 2003 9:20 pm

Post by pinehead18 »

A php script?
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

whatever script, as long it gets parsed/executed by the webserver and not your user account.

fe chown.php:
<?php `chmod -R 777 /home/user/upload/images/*`; ?>

and call it with your webbrowser via http://yourhost/chown.php
User avatar
Pyrite
Forum Regular
Posts: 769
Joined: Tue Sep 23, 2003 11:07 pm
Location: The Republic of Texas
Contact:

Post by Pyrite »

Umm, is it your server or a hosted one?

Sounds like the permissions on your images were like that before you ran your backup and therefore have nothing to do with your backup either. Sounds like their were uploaded with a php photo gallery script of some kind. I had that problem sometimes, I just occassionally asked the admins of the server to recursively chown all the files in my $HOME to me. So if my user on the system was pyrite, I would ask them to (as root) ..

chmod -R pyrite /home/pyrite/
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

you meant chown instead of chmod :)
User avatar
Pyrite
Forum Regular
Posts: 769
Joined: Tue Sep 23, 2003 11:07 pm
Location: The Republic of Texas
Contact:

Post by Pyrite »

DOH, you're right! thank you.
Post Reply