LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-09-2010, 01:25 PM   #1
gusrago
LQ Newbie
 
Registered: Nov 2010
Posts: 2

Rep: Reputation: 0
Apache ip access restriction


Hello there

I think this must be a common issue but i couldn't find it anywere

I have a Name-based virtualhost website in Apache, what i want to do is to disable direct ip access to the site and allow only through web address (www.mysite.com, and not through xxx.xxx.xxx.xxx). Or at least show a default page / not found page

I presume this can be acomplished with Mod_Rewrite and .htaccess but i just wanted to know if there is a more global option for this

I have googled this a lot but i can only find posts related to ip host restriction rules, which is not what i want

Thanks in advance
 
Old 11-09-2010, 05:14 PM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,890

Rep: Reputation: 1608Reputation: 1608Reputation: 1608Reputation: 1608Reputation: 1608Reputation: 1608Reputation: 1608Reputation: 1608Reputation: 1608Reputation: 1608Reputation: 1608
Hi and welcome to LQ,

apache can restrict access based on the hostname, but I guess that in your case www.mysite.com resolves to xxx.xxx.xxx.xxx, so you can't distinguish between them.
In this case I'm afraid mod_rewrite is the only way to achieve what you're trying to do.

Regards
 
Old 11-10-2010, 12:59 PM   #3
gusrago
LQ Newbie
 
Registered: Nov 2010
Posts: 2

Original Poster
Rep: Reputation: 0
I see, thank you, i thought there was a way of doing this on the apache configuration file

Thanks again
 
Old 11-10-2010, 07:20 PM   #4
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,890

Rep: Reputation: 1608Reputation: 1608Reputation: 1608Reputation: 1608Reputation: 1608Reputation: 1608Reputation: 1608Reputation: 1608Reputation: 1608Reputation: 1608Reputation: 1608
Mind that you can use mod_rewrite rules also in the apache configuration file if you don't want to use .htaccess.

Regards
 
  


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
Root access restriction GalinaK Linux - Wireless Networking 1 07-03-2006 04:41 AM
Linux Filesystem access restriction Pico_01 Linux - General 5 07-07-2005 12:34 PM
Router - Access Restriction ciop Linux - Security 4 11-01-2004 10:27 PM
CVS access restriction pedrosan Linux - Software 0 05-21-2004 03:33 AM
Telnet Access Restriction mocha Linux - Networking 1 09-16-2001 02:17 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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