LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices



Reply
 
Search this Thread
Old 06-20-2006, 02:50 PM   #1
txtoolman
LQ Newbie
 
Registered: Mar 2003
Distribution: RH 7.2 and above
Posts: 18

Rep: Reputation: 0
Allow page requests from a given server


I've searched til my eyes are blood-shot, but could not find, so I'll try my luck here: I'd like a particular web folder(and its subfolders) on my apache server to only accept if those pages are referred to by a given windows server. It seems that a proxy may be needed, but I haven't been able to find something online to support this. I'd appreciate any input you all can provide.
 
Old 06-20-2006, 04:38 PM   #2
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,975

Rep: Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343
Have you try to use the deny/allow compination?
Code:
<Directory /some/proteced/dir
    Order Deny,Allow
    Deny from all
    Allow from xx.xx.xx.xx
</Directory>
You can also use a .htaccess with the above inside it.

Regards
 
Old 06-20-2006, 04:43 PM   #3
txtoolman
LQ Newbie
 
Registered: Mar 2003
Distribution: RH 7.2 and above
Posts: 18

Original Poster
Rep: Reputation: 0
I don't think that will work. I experimented with that. I think I may be close to what I need to do. Using rewrite statments, I need to check and see if the HTTP_REFERER is = to a particular URL. If not, then use the rewriterule (with flag 'F') to forbid access. I have programming experience, but have never dived into these waters. Any helpers out there ???
 
Old 06-20-2006, 05:08 PM   #4
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,975

Rep: Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343
If you want to allow access based on http-referer then take a look at the last example here
 
Old 06-20-2006, 05:52 PM   #5
txtoolman
LQ Newbie
 
Registered: Mar 2003
Distribution: RH 7.2 and above
Posts: 18

Original Poster
Rep: Reputation: 0
I've started looking at those docs. This is my first venture into this area, so I was hoping someone might be able to offer some sample code as a guide. Also, I'm using apache 2. Thanks for the input.
 
Old 06-21-2006, 09:55 PM   #6
txtoolman
LQ Newbie
 
Registered: Mar 2003
Distribution: RH 7.2 and above
Posts: 18

Original Poster
Rep: Reputation: 0
Talking Allow page requests from a given server -- RESOLVED

After my eyes healed, I finally found a tutorial online that was very similar to what I was looking for. Here is the code that worked:

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^http://server1.com.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://server2.com.*$ [NC]
RewriteRule ^.*$ - [F]

This rule tells apache that if the referer is not one of these two servers, forbid access.

Last edited by txtoolman; 06-21-2006 at 09:57 PM.
 
  


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
Why is Firefox sending DNS requests when no page is loaded ? carcassonne Linux - Networking 5 04-23-2006 05:39 PM
Can't get my http server to respond to requests... garydamm Linux - Networking 9 01-16-2005 11:00 AM
forward all dns requests to one page Moszer Linux - Networking 4 05-25-2004 02:34 PM
I cant change the default test page in apache server to add my page.y nhemapriya Linux - Newbie 3 05-13-2004 01:35 PM
Server refusing SMTP connection requests Lunch Linux - Networking 3 03-16-2004 10:06 AM


All times are GMT -5. The time now is 01:59 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration