Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

opening port 80 to limited users

Status
Not open for further replies.

kaancho12

Technical User
Feb 22, 2005
191
is it possible to allow access to (http) port 80 to certain IP's only? we are running RH linux 9 here and i want the staff at the another location to view the server. Both the locations have static ip.
 
Please define 'allow access'.... Do you mean using apache web server (typically listening on port 80) to view web pages? Then yes, use the 'Allow' directive inside a Location or Directory container (or inside an .htaccess file). Start here for more info.
 
In the directory container for DocumentRoot use the following:

Order allow, deny
Allow from 192.168.1.10 (change to actual ip)

 
if you want to use iptables inserting a rule like this should work:

iptables -A INPUT -s 10.10.10.10 -p TCP --dport 80 -j ACCEPT

 
mragain is right, and that is probably the best solution. If one site has the IP address 192.168.0.102 and the other is 192.168.0.103 you can add these 2 rules:

iptables -A INPUT -s 192.168.0.102 -p TCP --dport 80 -j ACCEPT

iptables -A INPUT -s 192.168.0.103 -p TCP --dport 80 -j ACCEPT

Then you can add the drop rule to drop all other traffic.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top