thedark Second Lieutenant
Joined: 30 Jul 2005
Posts: 1074
|
Posted: Thu Aug 04, 2005 11:12 am Post subject: Allowing ip's |
|
|
Add the following line to the "/etc/inetd.conf":
http stream tcp nowait root /usr/local/sbin/httpd httpd
Do a "killall -HUP inetd" as root and you're set.
Allowing ip's
You can allow / disallow ip's from connecting to the httpd. This is done with
tcp wrappers. The configuration file is "/etc/hosts.allow".
Make sure the last line in this file is "ALL : ALL : DENY". This makes sure that all
ip's which don't match any line above this one are blocked. If you forget this line or
you don't want to do this then you have to make sure you specify 'deny' rules for
'httpd'.
Two setups:
1:
httpd : 1.1.1.1 2.2.2.2 3.3.3.3 : ALLOW
ALL : ALL : DENY
2:
httpd: 1.1.1.1 2.2.2.2 3.3.3.3 : ALLOW
httpd: ALL : DENY
Setup 1 just denies all connections (not just to httpd) except the httpd ones we
allow (this is the best setup IMHO). If you don't want to do this make sure you
specify a 'deny' line for httpd like setup 2. |
|