logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: allow only apache access to folder
Author
johnnygri



Joined: 16 Jan 2008
Posts: 3

PostPosted: Wed 16 Jan '08 18:32    Post subject: allow only apache access to folder Reply with quote

hi there, i have an mp3 file playing via a XSPF playlist, which contains the location of the file. i need to allow the flash movie mp3 player that plays the playlist contents, but i need to prevent direct access to the files.

from what i can gather, this means i need to allow only the localhost access to a folder, right?

So the idea is that http://www.myserver.com/audio/file.mp3 will gladly load when the request is made by the flash mp3 player, as the request is made from the localhost. Entering the URL into a browser will result in access denied, due to a request from a different IP.

I've RTFM and cannot figure this out - or maybe I'm going about it the wrong way? Here's what I've put into the vhost definition:
Code:

<Location "/audio">
    Order allow,deny
    Allow from 127
</Location>


It doesn't seem to have any effect though Crying or Very sad I have tried changing the Order directive to read "deny,allow".

If it is helpful, this is an .htaccess file in my web root:

Code:

Options +FollowSymLinks +ExecCGI

<IfModule mod_rewrite.c>
  RewriteEngine On

  # uncomment the following line, if you are having trouble
  # getting no_script_name to work
  #RewriteBase /

  # we skip all files with .something
  RewriteCond %{REQUEST_URI} \..+$
  RewriteCond %{REQUEST_URI} !\.html$
  RewriteRule .* - [L]

  # we check if the .html version is here (caching)
  RewriteRule ^$ index.html [QSA]
  RewriteRule ^([^.]+)$ $1.html [QSA]
  RewriteCond %{REQUEST_FILENAME} !-f

  # no, so we redirect to our front web controller
  RewriteRule ^(.*)$ index.php [QSA,L]
</IfModule>

# big crash from our front web controller
ErrorDocument 500 "<h2>Application error</h2>symfony application failed to start properly"


Any advice would be very gratefully received, thanks.
John


Last edited by johnnygri on Wed 16 Jan '08 18:45; edited 2 times in total
Back to top
johnnygri



Joined: 16 Jan 2008
Posts: 3

PostPosted: Wed 16 Jan '08 18:35    Post subject: Reply with quote

<edit>
Merged two posts into one.
Back to top
glsmith
Moderator


Joined: 16 Oct 2007
Posts: 2268
Location: Sun Diego, USA

PostPosted: Thu 17 Jan '08 21:51    Post subject: Reply with quote

quick and dirty response for now.

You need to find something other than local IP. The flash mp3 player loads on the browsers end, so the file/s is/are requested from trhe remote side.

Is there a special user agent or referer you can limit to?
check you access log. Make sure access logging is set to "combined" this will put referrers and useragents in the log.
Back to top
johnnygri



Joined: 16 Jan 2008
Posts: 3

PostPosted: Fri 18 Jan '08 13:21    Post subject: Reply with quote

great idea, i'll look into that, thanks v much.
Back to top


Reply to topic   Topic: allow only apache access to folder View previous topic :: View next topic
Post new topic   Forum Index -> Apache