You only fight wars you can win; you only fight wars for good causes; you only fight those wars the end result of which would be less bad than the result of not fighting them; you use no method which compromises your righteousness.
As my Quaker friend Farah points out, the trouble with this is that it includes no mechanism for being sure you are right in the first place - but at least it offers some ways of examining your conscience.
Now, setting aside the issue of idiocies like describing a war in which you need Islamic allies as a crusade, anyone who wants to fight a war against terrorism has a lot of problems.
For one thing, none of us in the West/North can be described as entirely righteous while things like the debt issue remain unresolved. For another, there is the legacy of imperialism.
The point is that people do not wake up one morning and decide 'I am going to be a total shit and be a terrorist'; they decide that things in the world around them are so intolerable that something must be done, and terrorism is proposed to them as an answer. And many of the things about which they are worried are intolerable - the oppression of the Palestinian people, the corruption of regimes like the Saudis and the preparedness of the Americans to fund them.
You cannot 'fight a war on terrorism' without sorting out at least some of the just causes many terrorists are motivated by. Of course, there would still be bin Laden, whose major grievances are religious - the presence of Americans on sacred soil, the existence of democracy -, but if there were not real grievances, people would be less inclined to listen to him. He is, after all, a crank; like the Taliban, even fundamentalist theologians disapprove of him.
And then there is the question of fighting a war in Afghanistan - not generally a good idea. The only people who do anyhow at all there are the ones who 1) go in from the West and 2) make it clear that they are on the way somewhere else; this essentially means Alexander and the 1580s Iranians.
Right now, the country is a ruin in which people are starving. They put up with the Taliban because they have no energy left for fighting them. Civilian bombing is always a crime, because the people you kill are not as a rule the people doing the bad stuff. It would especially be a crime right now.
Ground troops are not an option - the place is littered with landmines and even the opposition to the Taliban would probably fight invaders on general principles. You would also risk destroying Pakistan in civil war
This might well mean a Taliban-like group coming to power - Taliban with nukes?
Also, everyone is making the assumption of a direct line of command - my impression is that Bin Laden is less the Old Man of the Mountains sending out his minions,rather more like someone who makes inspirational videos and brokers fund-raising for likely young chaps.
He is loathsome in the extreme, but there is probably a sense in which he didn't do it. I am not convinced that terrorism works like that - it is significant that a group who were in some sense religious fanatics were in others loose enough in their Islamic morals that they spent the night before the crime on the piss in a strip club.
It is for the discovery of complicated truths that we have courts of international law. If the US and the UK start acts of violence without knowing the truth, that too is terrorism. You cannot bomb cities and not kill children - even bombing Bin Laden's mountain camp will probably kill children.
Something has to be done, but slowly, surely and carefully.