LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 08-01-2012, 02:04 PM   #1
mangotree
LQ Newbie
 
Registered: Oct 2010
Location: Indonesia
Distribution: Slackware
Posts: 13

Rep: Reputation: 3
Question [ASK]How to make files inaccessible except for Flash with Apache?


Hi,

I need to people to unable to access my configuration files (.js & .xml) when they type direct link to that files. I already try these two situations:

1. The files already success to be inaccessible (by simply changing its permissions) but then my flash application is also cannot access them too so it can't load properly (which is the .swf and the .js and .xml is one folder). Is it possible to keep my flash app still work but people who want to reach the files .js & .xml (by direct link) get an error?

2. RedirectMatch ^/$ /real_working_folder/
I try "RedirectMatch" to redirect my DocumentRoot to the "real working folder". So, I thought when people go to mydomain.com/myfiles.xml (for example) they will get a not found error. But actually, if they go to mydomain.com at first, the browser will pointed to mydomain.com/real_working_folder/ in address bar on their browser instead. It's make them easily know to direct to mydomain.com/real_working_folder/myfiles.xml. Is there any way to make browser to keep pointed on / DocumentRoot even I do redirect?

I'm using Apache 2.2 and I dont think to use .htaccess,
Thanks a lot...
 
Old 08-01-2012, 02:47 PM   #2
lithos
Senior Member
 
Registered: Jan 2010
Location: SI : 45.9531, 15.4894
Distribution: CentOS, OpenNA/Trustix, testing desktop openSuse 12.1 /Cinnamon/KDE4.8
Posts: 1,144

Rep: Reputation: 217Reputation: 217Reputation: 217
I would say that you maybe need htaccess hotlink protection
google is full of examples so you may just need to change the extension of files to suit your needs.

good luck
 
Old 08-09-2012, 11:47 PM   #3
mangotree
LQ Newbie
 
Registered: Oct 2010
Location: Indonesia
Distribution: Slackware
Posts: 13

Original Poster
Rep: Reputation: 3
Thanks lithos

Now I'm success for hiding the files if it requested by direct typing on browser address while my flash application still can load properly on my homepage. But I'm doing little different from the link you pointed to me. The most important thing I figure out is that every direct typing request to any resource in webserver is has no referal, so we can use it. In my case, my flash application need to load the xml/js/and others to work properly. Actually, when my flash app request the files, the apache can served it because it has referal which is my homepage as the referal. So my flash app still works. This is the simplest rules:

RewriteCond %{HTTP_REFERER} ^$ -> is request has no referal?
RewriteRule .*\.(jpe?g|xml|js|txt)$ - [L,R=404] -> if Yes, then respond it by redirect to 404

But then I found if people use Request/Response HTTP analytic tools, the files can easily to be preview at last. I used "Chrome's development tool -> Network tab" and it brings me every files that my flash app need to load

Last edited by mangotree; 08-10-2012 at 12:14 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to make StayFocusd inaccessible? Aquarius_Girl General 0 01-04-2012 09:04 PM
i have apache web server locally accessible but inaccessible from other machine on la amolgupta Linux - Networking 5 07-08-2009 07:57 AM
Slackware 12.2 | Apache inaccessible outside lan anarxi Linux - Server 1 01-27-2009 12:01 AM
How can make may lan server inaccessible from the outside boyd98 Linux - Networking 1 05-12-2005 03:10 PM
CDRom mounted ok and suddenly all files become Inaccessible. Josequi Linux - Hardware 0 03-28-2003 06:17 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 06:06 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration