|
-
Nov 24th, 2008, 09:21 AM
#1
Thread Starter
Arabic Poster
[RESOLVED] NooB question: Link to files outside apache's /var/www/ folder
Hi all,
I'm asking this question here because I didn't even know what terms to put in my google search.
My problem is: I have user files stored in a folder outside apache's documents root e.g. My project is in /var/www/ProjectName/ and the files are in /var/uploads/
I think you got it 
I want to be able to link to those files from within my project, doesn't really matter if the solution involves changing Apache's settings.
Oh and I don't want to rush you or anything but this is urgent
"I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
My Blog
-
Nov 25th, 2008, 05:25 AM
#2
Thread Starter
Arabic Poster
Re: NooB question: Link to files outside apache's /var/www/ folder
Ok, while waiting for any response I tried the following:
I added the following code to the "sites-enabled" settings file
Code:
<Directory "/usr/upload/">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
But it's not working and in the error log file I get "File does not exist: /var/www/usr" error which means what I've done was no help at all.
But seriously guys, I'm almost giving up on you
"I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
My Blog
-
Nov 25th, 2008, 08:16 PM
#3
Re: NooB question: Link to files outside apache's /var/www/ folder
What do you mean you want to link to it? Like have a hyperlink to go to that page? You cant do that since it isnt in your webroot.
I am pretty sure you can include it though.
PHP Code:
include('../uploads/myfile.txt');
//or
include('/var/uploads/myfile.txt');
Last edited by dclamp; Nov 25th, 2008 at 08:23 PM.
My usual boring signature: Something
-
Nov 25th, 2008, 08:47 PM
#4
Thread Starter
Arabic Poster
Re: NooB question: Link to files outside apache's /var/www/ folder
Yes I know all of this, but isn't there anyway I can add this path to my DocRoot?
"I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
My Blog
-
Nov 25th, 2008, 08:57 PM
#5
Re: NooB question: Link to files outside apache's /var/www/ folder
If you do that then it kind ruins the idea of having it outside of the document root... why dont you just move the file there yourself?
My usual boring signature: Something
-
Nov 26th, 2008, 07:45 AM
#6
Thread Starter
Arabic Poster
Re: NooB question: Link to files outside apache's /var/www/ folder
Good question. it has something to do with the hosting service. but you know what, I think I'll move the files there. The easy way.
Thanks
"I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
My Blog
-
Nov 26th, 2008, 01:45 PM
#7
Re: [RESOLVED] NooB question: Link to files outside apache's /var/www/ folder
My usual boring signature: Something
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|