PDA

View Full Version : Debian and directory mod-tmp for sessions


stderr
10-14-2009, 03:58 PM
Hi,

I've got problem with ISPManager on Debian (5.0.3) and php sessions stored in /var/www/<user>/data/mod-tmp. Debian (I don't know about any other distribution now) doesn't know, how to delete old session files in this directories. It use /etc/cron.d/php5 for remove sessions from /var/lib/php5 and we must wrote special scripts (or add new dir to script) for every user.. Is there any ISPManager-like solution? Or is it bug?
edit: it's ISPManager 4.3 Lite...

Thanx.

slava
10-15-2009, 08:42 AM
ISPmanager add line to virtualhost php_admin_value session.save_path "/var/www/user/data/mod-tmp" for save sessions if PHP running as apache module and add to /var/www/user/data/php-bin/php.ini session.save_path = "/var/www/user/data/tmp" if PHP run as CGI or FastCGI.

This is not configurable.

stderr
10-15-2009, 10:47 AM
I know. But ISPManager don't change /etc/cron.d/php5 for erasing old sessions and there are (and that's my problem) a lot of files files in directory. And directory size is still growing (1,5GB per two days!)..

I changed cron file manually (if somebody has same problem):

USER="user1 user2 user3"

09,39 * * * * root for user in $USER ; do [ -x /usr/lib/php5/maxlifetime ] && [ -d /var/www/$user/data/mod-tmp ] && find /var/www/$user/data/mod-tmp/ -type f -cmin +$(/usr/lib/php5/maxlifetime) -print0 | xargs -n 200 -r -0 rm ; done


I had sent this as a ticket in BillManager and Sergey Klimov replayed, that it was sent to developers. I think, that it's solved.