When you say Moon Base, I assume you mean Player Owned Stations, or POS for short. These are often used in lowsec to do various useful things that you can't do in a NPC Owned station, such as Moon mining, some types of capital ship construction, and other things that don't spring to mind.
There are two often used theories behind building a defense on a POS. The "Dickstar" and the "Deathstar" and all sorts of iterations between these two.
The "Dickstar" theory is to make it as annoying as possible for people to attack your POS. In practice this means having a Large POS to have as many hitpoints as possible, having plenty of shield hardeners online to have your resists up to give you more effective hitpoints, and then having lots of ECM batteries as well as a few neutralising batteries, and other assorted such as warp scrambling/disruptor batteries and webbing batteries. This should mean that if they bring a battleship heavy fleet to bash the POS, they will spend a long time being jammed and having to relock targets. Neutralising batteries mean that Laser Battleships (often the most common to bash POSes due to not having to worry about reloads) will often get capped out and not be able to fire.
The "Deathstar" theory is to have lots of guns so that it is possible that enemy ships that are assaulting the POS could be destroyed. This relies more on having lots of the turret batteries (most popular setups use mostly artillery, autocannons, and pulse and beam lasers, but it is a matter of taste sometimes as to what type of guns people use), and missile batteries too, but a lesser extent due to them not being able to used after the tower has gone into reinforced mode. Also webs, disruptors, scramblers could be useful here. This type of setup really benefits from having active people online who might be able to sit in the POS gunnery role and concentrate the battery fire onto specific targets rather than let the POS choose targets randomly.
There are also other theories around for how to fit towers, and also all of this has to be weighed up against how much fitting room you have available after you put on your required money making modules (moon miners, ship maintenance arrays, etc...). And also against how big your tower will be which will directly affect how much it will cost to run.
Keep in mind cost to fuel a tower currently (as of 16/11/2011) depends to an extent how much CPU and Powergrid you are using on the tower. More usage means more consumption of Ice products. When the next patch comes in (in December I think), the fuelling tactic will change, and this variable will be removed. That is to say it will cost the same to fuel your tower no matter how much CPU or Powergrid will be used, and you should probably anchor as many guns as will fit and you can afford to buy. In fact it's even worth having more guns anchored than will fit as well but offline (so that it doesn't count towards CPU/PG) so they can be onlined in the middle of an assault if other batteries are destroyed/disabled.
All of that said, all of these tactics can still be gotten around with bigger and bigger ships and fleets. ECM can be countered by using Dreadnoughts that are immune to it. Lots of guns can be countered by using lots of logistics ships or even carriers (which are also immune to ECM). The only real defence is to make it either not worth their fleet investment (having to bring bigger ships or more of them) or worth their time (having to deal with jams), but even then this is not a guarantee, as sometimes people just like to spend an inordinate amount of their time making other pretend spaceship lives hell :)