The best solution to violence is, generally speaking, prevention. As have been pointed out, school shootings are rather rare occurrences. I will herein detail a number of steps for an educational institution to work to lower crime rates.
1. Educate your students and teachers.
The inclusion of this point may seem trivial, but there are simple steps individuals can take that will protect them from crime. Most noticeably is the importance of not being alone - a single person is a much easier target for crime than someone in a group. Sticking to brightly lit, well-traveled areas will also decrease the likelihood of being targeted. There are many more tips on a number of websites.
2. Invest in infrastructure.
A clean, open, well-lit space is much less likely to be the site of crime. Janitorial and groundskeeping staff are especially important to this effort. Paving common walking paths will encourage more people to use them, benefiting them of safety in numbers. Trim trees and install outdoor lights. If a casual observer can notice something is wrong, it's less likely for a crime to be committed there.
3. Invest in direct security.
Have security cameras installed so as to cover major public spaces. Make their presence visible, but not obtrusively so. The presence of cameras both act as a deterrent and can help after a crime. Note on visibility: A potential criminal will look for cameras, so simple visibility is all that is necessary; Obtrusive cameras will make users feel their privacy is violated.
Get either local police or a security service to routinely make circuits of campus. "Complete" coverage should mean that anyone standing in a public space should see police/security once every 15-30 minutes, even if they just drive slowly by. If an effort is made by officers to be helpful and not oppressive, this can even become an attractive feature to potential students and teachers.
4. Purely reactive measures.
While the steps above are either preventative or act as a deterrent, there are a few more measures that can be taken with a focus to respond to crimes after they happen.
Security call boxes can help a victim alert police or security to a crime and secure emergency services if necessary. Even in the age of cell phones, it is probable that a victim does not have other means to alert security. Dialing on a cell phone might be difficult, or their phone may have been stolen or lost in a scuffle.
Have a therapist on staff and give security training to facilitate an air of reassurance - this is especially important when dealing with victims of rape or sexual assault. There is much more information on this in security circles. Having this training will also make others more comfortable with the idea of going to security with their problems by assuaging their fears of a security investigation disturbing their life.
Ultimately, there must be an effort to both make the campus physically safer and to make the local culture more resistant to crime. These measures are not only focused on making crime harder but also making crime less accepted as "a reality of the community". Criminals ultimately pick on the lowest hanging fruit, and we have the possibility to move it out of reach.