LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices

Reply
 
Search this Thread
Old 08-17-2010, 12:00 PM   #1
lasantha
Member
 
Registered: Oct 2005
Location: Sri Lanka
Distribution: Red Hat, Cent OS
Posts: 38

Rep: Reputation: 16
block particular web site form multiple site hosted web server and allow others


Dear All,

I am having a web server (apache) hosted with 3 web sites, named as www.web1.com, www.web2.com and www.web3.com.

I need to restrict access www.web2.com to internet users and allow to LAN users.

At same time I need to allow www.web1.com and www.web3.com to both internet and LAN users.

more clearly
www.web1.com allow internet and LAN users
www.web2.com allow LAN and Block internet users
www.web3.com allow internet and LAN users


How can I do this.

(iptables rules, apache configuration or any other method?)


Thanks and rgds,

Lasantha
 
Old 08-17-2010, 12:09 PM   #2
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,908

Rep: Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326
Hi,

Assuming your LAN is 192.168.0.0/24, you can put into the 2nd virtualhost definition the following:
Code:
Order deny,allow
Deny from all
Allow from 192.168.0
 
  


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
block particular web site form multiple site hosted web server and allow others lasantha Linux - Security 2 08-17-2010 01:49 PM
Can't access Fedora Hosted Web Site jcargile Linux - Server 4 04-22-2008 09:57 AM
best way to build a web site hosted by linux? heatherbegazo Programming 7 10-10-2006 10:08 PM
Web site hosted on Linux Robinxh Linux - Newbie 2 06-26-2006 03:46 AM
How to view the web site hosted on win2k server which is a client machine? gogo Linux - Networking 10 10-19-2002 10:48 PM


All times are GMT -5. The time now is 03:02 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