download symbolic link in /var/www/html

Ehsan

Verified User
Joined
Jul 13, 2011
Messages
30
I've created a symbolic link in /var/www/html for a backup in admin_backups:

Code:
lrwxrwxrwx  1 root    root      70 Sep  2 12:57 user.admin.xxx.tar.gz -> /home/admin/admin_backups/user.admin.xxx.tar.gz

I tried to download the link through: http://IP/user.admin.xxx.tar.gz
But I got the 403 error,
I tried to change the owner of file to apache or webapps, but It didn't work either.
I know I can put the file to public_html of a user and download it, But I want to download it on this way.
Is there any problem with this way?

Any help would be much appreciated.
 
I suppose is cause symlink have permission 777.

Try move the file in /var/www/html/ and check if in that way it work.

Also should be permission error for access group.

I would suggest not to use this way for security reason.

Regards
 
I know if I move the file, that's probably will work fine, But I want to download it through symbolic link, Is there any way to do that? May be some apache configuration or something?

Regards
 
Symlinks 'always' have permission 777, that's how symlinks work.
But that does not mean the file itself had the permisson 777.
Check your file and the directory where the file is in, is readable by apache.
 
I know that symlink have always 777. And also php-cgi and mod_ruid2 should return error on running 777 files, that's why i sayd that.

I dont think is a good idea change user owners (and folders aswell) to fix this, would be much better create a subdomain (ex. backups.domain.tld) and put backups there.

Regards
 
I've created a symbolic link in /var/www/html for a backup in admin_backups:

Try to use Alias instead, just add this into /etc/httpd/conf/extra/httpd-includes.conf

Code:
Alias "/admin_backups" "/home/admin/admin_backups/"

and run this

Code:
chmod 644 /home/admin/admin_backups/*

so you could access them via apache.

Then go and get http://SERVER-IP/admin_backups/user.admin.xxx.tar.gz
 
Back
Top