There are three potential avenues of attack, some of which have multiple ways to cause major damage to your (very fragile) space elevator.
1: Surface
For a direct attack the ground is the easiest to deal with. A large exclusion zone with very good surveillance will deter or flat out stop a terrorist (by terrorist I'm assuming not a major military incursion) attack.
The issue with the ground would come with the payloads being launched. Even a pipe-bomb could have massive destructive potential, as the space elevator would have to have exquisitely balanced and orchestrated payloads going up and down the ribbon in order to avoid destructive resonance etc. Stop one of the payloads for a few minutes: tower comes down. The security procedures for getting to the space elevator would have to make the Pentagon look a bit tame. Personally I'd be tempted to stop people travelling with their own possessions and undergo a week long quarantine to flush out any ahem foreign bodies.
Against a major military incursion: you've got nothing. As strong as the ribbon might be it's also under a lot of tension. A bullet striking the ribbon might be enough to tear, shatter or otherwise ruin the ribbon.
2: Air
There are 2 ways that the tower can reasonably be attacked from the air by a terrorist group. Hijacking and missiles.
Hijacking is easy to deal with, but would carry some major political flak. It's basically the same principle currently used to defend high profile buildings: Blow up the compromised aircraft. Brutal but would get the job done. Have a few radar stations and a couple of nearby fighter jets ready to scramble and hijacking is no longer a threat
Missiles are more of an issue. Even an indirect strike can carry major damage risk (shrapnel and concussive forces don't play well with the ribbon). The easiest way to prevent this being a risk is to make sure your ground based exclusion zone is wide enough that the terrorist missile launchers haven't got sufficient range to hit you. This might be an exorbitantly huge area. As a second line of defence you might consider point defence cannons similar to those used in naval warfare, or even explosively launched interceptor missiles. It all depends on how well funded your terrorist cell is.
Again: Against a military attack you've got nothing. Long range missiles, drone launches, stealth or high altitude bombers, or even good old 'throw planes at it until one of them gets lucky' means that your tower won't survive.
3: Space
The least likely for a terrorist attack, but also the hardest to defend. Space is Big. The capital letter is deserved there. Compared to the amount of ribbon you have to defend against aerial attack there's a ridiculous length of ribbon utterly exposed between the earth and the terminal point (the terminal point being 2x higher than geostationary orbit and a reasonable distance towards the moon). An impact here will almost certainly destroy the ribbon, and be almost impossible to repair even if it doesn't. Luckily your terrorists are terrorists. If space is in any way monitored, patrolled or governed you can restrict who has access to what, and deal with it from there.
If there is a determined attacker in space then high quality lenses are your friend. You'll need an awesome 360 degree sensor package (which is eminently doable for distances less than the moon) with as many bells and whistles as you can think of to ensure redundancy and spot anything on even a vague intercept course well before it gets to you. This sensor grid would have to extend around the world in order to watch for threats from the other side of the planet. Then you'll need several fancy missiles/ space fighters/ whatever you like in order to defend the ribbon in a similar manner to the air defence scenario. If it's on a path that will, at some point in the future, be able to intercept using current engine technologies, then you warn it off and blow it up if it doesn't immediately start a corrective burn. Finally you'll need an array of high power lasers on satellites in geostationary orbit to deflect/ deorbit any smaller pieces of junk/wreckage, as a bolt moving at orbital velocities will carry enough energy to punch a hole through the ribbon or at the very least destabilise the tower.
Preventing/ stopping space based attacks would be a real pain, but also be the foundation for the kind of orbital defence grid you'd need in order to stop people simply dropping rocks and letting kinetic energy do all the hard work. If the terrorists in space can drop a 2 tonne ceramic cone onto your space elevator's base station they also have the power to turn any city in the world into a kilometre wide crater.
Again: If the military gets involved you're boned. A few hundred light rockets with a grudge will tear down the tower like it's made of tissue paper. They don't even have to worry about re-entry criteria like an ICBM or getting up to orbital velocity like a spaceship.
Summary:
It's doable if you're sensible and already have infrastructure in place to prevent space terrorists from ending the world (you've got that, right?)
My suggestion: Find a nice tropical island somewhere (or build your own, if you've got the resources for a space elevator). Outfit it with it's own airstrip and enough defences to cover a half dozen Carrier groups, and let everyone know that there's a twenty mile wide exclusion zone with a 'trespassers will be killed to death' policy that has no exceptions. Create a security port somewhere nearby that specialises in stripping people of everything (like a Duty-Free Guantanamo Bay) before loading them onto high-security boats/helicopters for transfer to the elevator. In space: Kill anything that looks at you funny and then deorbit it using high powered lasers.
Oh, and pray that the terrorists aren't secretly backed by the military, or you're doomed.