# Web server and it's IPFW configs.



## abarmot (Nov 17, 2008)

Dear friends,
currently I am trying to learn a building web server (Apache, PHP, MySQL, etc.) with FreeBSD 7 and now my "topic" is IPFW.
Would you be so kind to post here your examples of IPFW configuration files suitable for web servers? :stud
Thanks for any help!


----------



## anomie (Nov 17, 2008)

Have you read the handbook chapter on IPFW? 

IPFW rulesets I've used have been adaptations of the example in 31.6.5.6.


----------



## komeylian (Dec 2, 2008)

hi, abarmot

if your web server should seen from internet you just need to do below:



> ipfw add 1 allow tcp from any to me 80


----------



## sT4k3 (Dec 2, 2008)

and if you use https than - ipfw add 2 allow ip from any to me 443


----------



## blackjack (Dec 2, 2008)

ipfw add 3 allow ip from <some ip> to me 22
ipfw add 4 deny ip from any to me


----------



## paulfrottawa (Dec 23, 2008)

I take it the "me" is the destination IP address of the server.


----------



## sT4k3 (Dec 23, 2008)

if server have one ip address, then you can use "me"...


----------



## paulfrottawa (Dec 23, 2008)

The above example 


> ipfw add 1 allow tcp from any to me 80



What if "me" was on another computer or ip (like a jail). Me is for the router I'm guessing.

Right now I'm reading the hand book about the fire wall, and continually locking myself out setting up a firewall.

 Thankfully I have a monitor and key board down there.

___________________________________--

Doing that I haven't had a chance to play with redirect but your short answer will get me going for the night thanks


----------

