Results 1 to 7 of 7

Thread: [RESOLVED] NooB question: Link to files outside apache's /var/www/ folder

  1. #1

    Thread Starter
    Arabic Poster ComputerJy's Avatar
    Join Date
    Nov 2005
    Location
    Happily misplaced
    Posts
    2,513

    Resolved [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

  2. #2

    Thread Starter
    Arabic Poster ComputerJy's Avatar
    Join Date
    Nov 2005
    Location
    Happily misplaced
    Posts
    2,513

    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

  3. #3
    WiggleWiggle dclamp's Avatar
    Join Date
    Aug 2006
    Posts
    3,527

    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

  4. #4

    Thread Starter
    Arabic Poster ComputerJy's Avatar
    Join Date
    Nov 2005
    Location
    Happily misplaced
    Posts
    2,513

    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

  5. #5
    WiggleWiggle dclamp's Avatar
    Join Date
    Aug 2006
    Posts
    3,527

    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

  6. #6

    Thread Starter
    Arabic Poster ComputerJy's Avatar
    Join Date
    Nov 2005
    Location
    Happily misplaced
    Posts
    2,513

    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

  7. #7
    WiggleWiggle dclamp's Avatar
    Join Date
    Aug 2006
    Posts
    3,527

    Re: [RESOLVED] NooB question: Link to files outside apache's /var/www/ folder

    Your welcome sir.
    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
  •  



Click Here to Expand Forum to Full Width