The harder you make it for an attacker to bring down your portal the conventional way (XMPs), the more likely they are to simply flip your portal with a virus. Ingress is a game of offence, and I've often read that the best defence is to draw the opponent's attention elsewhere with bigger threats. Portals that offer little reward for a lot of effort are the safest, especially if there are better options nearby. Taking down big fields or annoying links are big rewards. Taking out old guardians is another big reward. Hiking 2 miles to get to a portal is a lot of effort, but is also a big reward to some players.
One of the most persistent portals I've seen is very far past the "Employees Only" sign at a factory. Getting a job at the factory is a rediculously high effort for the small reward of disrupting a guardian portal.
That said, and ignoring the inevitability of virus weapons, the best conventional defence of a portal is other portals. Place only shields on the portal sustaining your long distance links (the shield effect caps out after about 2 shields, but having extras are nice in case the opponent attempts to neutralize the mods using Ultra Strikes). All other portals within 80 meters should be equipped with a balance of shields and turrent/force amp combinations. The weaponized portals will zap any player that fires an xmp within 40 meters of itself. If they are placed correctly, they will protect the linked portal by making it more time-consuming for the attacker.
If no other portals are present to defend your target portal, the effectiveness of the mods depends on the opponent's willingness to use Ultra Strikes to clear them. If not, use 2 shields and a Turret/Force Amp combo to guarantee maximum effectiveness against the attacker. If Ultra Strikes are in use, 4 shields are better at slowing the attacker down. Turret/Force Amp combinations are only effective if the portal is also shielded (shielding means more attacking, which means more retaliation), so if both shields drop, the portal is lost.
It's also worth mentioning that Turrets and Force Amps are only effective on high-level portals. Low-level portals have weaker zaps than high-level portals, and Turrets and Force Amps are multipliers. So, for low-level secret guardians, always opt for the 4-shield setup.