Have a look at Drupal (free and open source), which runs on (eg) a LAMP stack. It also offers various "distributions", and "contributed modules" related to "calendar"-stuff.
These would be the "users" defined in Drupal (whereas multiple "roles" can be used for all types of "permissions").
- A set of sessions in one week
Each of those sessions could be implemented as nodes of a custom content type, with all sorts of fields corresponding to the data (attributes) to each session. Pretty sure a date/time "from" and "to" would be one of such fields, typically handled by the Date module. And with the Calendar module to show a visualization of all such sessios in calendar format.
- Some weeks we don't teach (holidays)
No problem, there are various techniques to prevent sessions to be scheduled in such weeks. That's what typically boils down to "reservations" and/or "bookings" of a resource (= your teachers and/or your classrooms?).
- Over one year the teachers have to teach the same amount of sessions
Makes sense, that's what "repeating dates" is all about ...
- Some teachers have additional constraints, like "I cannot teach on Monday" or "I can teach only on Monday and Tuesday" ...
Now that is where it really gets interesting. That sounds like implementing some business logic. There are a few approaches possible, but my favourite one is the approach where the site administrator does not have to be a PHP expert. But instead only has to know about how to use the admin UI of the "Rules" module. To make it work, you'd have to think of a way to have your teachers "enter their constraints" in their profile somehow. There are multiple ways to implement such things (Drupal is like "Lego" ...). A possible (simplistic?) solution could be to use the Flag module so that each teach could "flag" the days that they are either available or not available
To make what is above work requires "Drupal site building" experience, NOT a (more expensive) "Drupal developer" who writes all sorts of custom code (which in the long run will be hard, and expensive, to maintain also).
Read on for more details (ie: this is the TL;DR mark ...).
The (contributed) Calendar module is commonly perceived as "the" module (plugin) for anything related to calendar-requirements. Here are some details about it (from its project page):
This module will display any Views date field in calendar formats, including CCK date fields, node created or updated dates, etc. Switch between year, month, and day views. Back and next navigation is provided for all views. Lots of the Calendar functionality comes from the Date module, so any time you update the Calendar module you should be sure you also update to the latest version of the Date module at the same time.
And a screenprint about it:
Making Booking (or Reservations)
That's about creating, editing, etc all sorts of things that should be part of such calendar, which is possible too (hang on a bit for an updated version of this answer).
Implementing Business logic
That's about adding all sorts of "Rules", e.g. for somebody who is not available on any Monday, which is possible too (hang on a bit for an updated version of this answer).
PS: Wait, there is even more ... a SO site dedicated to Drupal, located at Drupal Answers.