best clue I can give you is goto
http://www.tldp.org and start reading everything you can find there, iptables has a zillion options and it gets pretty complicated
I know a little, but not enough to really be of much help without making you really confused and lost, some of this will be part of your apache configuration though
try linuxquestions.org too, I think theyve got some tutorials and there's certainly a lot of really saavy guys there
your going to need to refine your questions a bit too, what your asking means some reading on your part first I think.......and being able to decide and explain exactly what you want, then after you think youve got it, testing it to be sure
wish I could help more with this