LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 03-08-2003, 06:43 PM   #1
Slancher
LQ Newbie
 
Registered: Mar 2003
Distribution: Slackware
Posts: 5

Rep: Reputation: 0
Question Apache http server


I am currently running apache on a slackware linux system with name based virtual hosting. I'm wondering if there is any way to deny acces to one of the websites based on an IP address without denying acces to the other site. If anyone can give me an example of how this can be done it would be much appreciated. Thanks in advance.

Last edited by Slancher; 03-08-2003 at 07:17 PM.
 
Old 03-08-2003, 08:30 PM   #2
im1crazyassmofo
Member
 
Registered: Jan 2003
Distribution: Slackware 13
Posts: 89

Rep: Reputation: 15
could you ask that in a different way..
 
Old 03-09-2003, 12:26 AM   #3
Slancher
LQ Newbie
 
Registered: Mar 2003
Distribution: Slackware
Posts: 5

Original Poster
Rep: Reputation: 0
Let's say your IP address is 165.8.0.1. Let us also assume the two sites being hosted on the server are www.a.com and www.b.com. When you type www.a.com into your browser I want it to say access denied but when you type in www.b.com I want you to be able to browse the site. For everyone else, I want them to have access to both sites.
 
Old 03-09-2003, 12:41 AM   #4
IceNineJon
Member
 
Registered: Jun 2002
Location: Los Angeles, Ca, USA
Distribution: Mandrake 9.1
Posts: 82

Rep: Reputation: 15
I'm new to Apache myself but I think you can use mod_access to do this:

http://httpd.apache.org/docs-2.0/mod/mod_access.html

Sorry I can't be more helpful!
 
Old 03-09-2003, 08:42 PM   #5
Slancher
LQ Newbie
 
Registered: Mar 2003
Distribution: Slackware
Posts: 5

Original Poster
Rep: Reputation: 0
I think I should just be able to modify the apache httpd.conf file in some way to get this done. Does anyone have an example of that configuration?
 
Old 03-10-2003, 12:23 PM   #6
BenCarlisle
LQ Newbie
 
Registered: Feb 2003
Distribution: RH7,RH8,Slack
Posts: 29

Rep: Reputation: 15
You can define Directory within a Vhost to limit access, but VHosts themselves don't have specific Deny/Allow rules.

Try this:

<VirtualHost *>
ServerName www.a.com
DocumentRoot /your/www.a.com/root
<Directory /your/www.a.com/root>
Deny from 165.8.0.1
Allow from all
</Directory>
</VirtualHost>

<VirtualHost *>
ServerName www.b.com
DocumentRoot /your/www.b.com/root
<Directory /your/www.b.com/root>
Allow from all
</Directory>
</VirtualHost>


good luck
 
  


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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
HTTP server carlosa52 Suse/Novell 1 07-05-2005 11:12 PM
Cant see http server xowl Linux - Networking 6 06-19-2005 01:15 AM
http server help jrmontg Linux - Newbie 2 04-11-2005 02:49 PM
apach Ammad Linux - Networking 1 09-02-2004 11:42 AM
Linux email server and some HTTP server questions Steven6282 Linux - General 7 02-19-2003 04:39 PM


All times are GMT -5. The time now is 11:19 AM.

Main Menu
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