LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Symbolic Link to solve my out-of-space problem? (https://www.linuxquestions.org/questions/linux-newbie-8/symbolic-link-to-solve-my-out-of-space-problem-478508/)

LSOsheriff 08-29-2006 02:22 PM

Symbolic Link to solve my out-of-space problem?
 
Hi all:

I have spent the past three work days trying to determine how to solve an out-of-space problem. And -- in advance -- I realize that my solution isn't the correct way. But I need for this to work in the short term, while I otherwise fix the problem correctly. So please bear with me.

I am using Mandrake 10.1 / Apache / PHP

I am low on space on /var/www/html/lsopix/ whereas I have oodles of space on /home/garyjuilfs/lsopix/ which is where I have copied all the (photo) data.

My PHP code looks for the photos in the first directory. I would like to be able to set a symbolic link that says "if a browser is looking for the /var/www/html/lsopix/ directory, please point it to /home/garyjuilfs/lsopix/ instead.

Would that work?

Could someone tell me how to make that 'alias' or 'symbolic link' or whatever work.

Many thanks

Matir 08-30-2006 12:20 AM

First, you'd need to do "ln -s /home/garyjuilfs/lsopix /var/www/html/lsopix". Make sure /var/www/html/lsopix does not exist before doing this. You might need to set "Options +FollowSymlinks" in your httpd.conf.

LSOsheriff 08-30-2006 09:08 AM

Symbolic Link
 
Matir -- thanks for the prompt reply; much appreciated.

The creation of the symbolic link seems to have worked, at least in part. With my browser (on the development box)I can open the location of /var/www/html/lsopix/ and see yet another 'folder' entitled /var/www/html/lsopix/lsopix/ -- AND all the photos show up there, without impacting at all on the amount of space left in the itty bitty original directory. This is good.

O.T.O.H., I haven't figured out how to get the code to "see" the photos in the linked folder. I get a "You don't have permission to access /lsopix/lsopix/672IMG_1124.JPG on this server"

And yet, the permissions show rwx for all and the group shows as "apache" which is what I would expect.

What might I be missing here?

Apparently, the pictures are being seen, except for the permissions thing, right?

Thanks again

haertig 08-30-2006 09:53 AM

Quote:

Originally Posted by LSOsheriff
...and see yet another 'folder' entitled /var/www/html/lsopix/lsopix/

You didn't get the symlink quite right if you're seeing the redundant "lsopix/lsopix" directory. As Matir said, "Make sure /var/www/html/lsopix does not exist before doing this." My guess is that the directory DID exist, and you therefore created your symlink IN that existing directory, not REPLACING it as Matir suggested.

That may or may not be a problem for you, the webserver will work just fine with it if your users are willing to type in the redundant directory name. But this is not the direct source of your permissions problem.
Quote:

O.T.O.H., I haven't figured out how to get the code to "see" the photos in the linked folder. I get a "You don't have permission to access /lsopix/lsopix/672IMG_1124.JPG on this server"
Did you add "Options +FollowSymlinks" to your httpd.conf file as Matir said? My guess is not, or maybe you added it in the wrong place in the file.

Look at Apache's error_log for more details of why you can't access the JPG's. I'll bet it's complaining that it can't follow symlinks.

hpladd 08-30-2006 10:13 AM

Hey LSOsheriff,

You wrote:
Quote:

O.T.O.H., I haven't figured out how to get the code to "see" the photos in the linked folder. I get a "You don't have permission to access /lsopix/lsopix/672IMG_1124.JPG on this server"
It seems as if that the file access permissions are fine -- at the OS level. I'm guessing that some application -- most likely Apache -- is denying users access to the data (photos) on /home/garyjuilfs/lsopix .

I've never used Apache, so this is a hunch, but I'm guessing that Apache's user permissions are set to allow access to /var/www/html/lsopix/. Perhaps those user access permission settings do not automatically follow with the synlink, and they need to be set for /home/garyjuilfs/lsopix as well.


All times are GMT -5. The time now is 12:38 AM.