I would suggest using Apache's SUExec wrapper
, and mod_fastcgi
(or mod_fastcgid).
mod_fastcgid is a dynamic worker pool, which executes the PHP interpreter as a specific user, and not under the web browsers user ID. this way, you can create different unix users for each website.
not only does this help separate each website, but it limits damage done by a potential break in, and also contributes to an overall elevated sense of privacy for each website.
using fastcgid, each site can have its own PHP.ini (located in the website users home directory, for example), and inside this individualized configuration you should be able to set a specific path for where to store saved sessions;
if you set this path to, for example, /home/website1/tmp/
, or /home/webiste2/tmp/
, each user will have their own personal path for store sessions, secured using unix file permissions.
if this is a personal server and all the websites belong to you, consider storing session cache inside a mysql DB. but this does not scale well for a multi homed server.
good luck!