• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

Ubuntu 12.04 + Apache 2.2 + PHP: No garbage collection for session files?

B_P

Regular Pleskian
Dear community,

on my (virtual) Ubuntu Server (12.04.5 LTS), I am running the latest Plesk version (12.0.18 Update #35). For "normal" web use, I am running Apache (2.2.22) and PHP (5.3.10-1ubuntu3.16) as a FastCGI module.

Since I was just checking a couple of other servers regarding PHP session management, I also checked this server. What I found out is that on this server probably no session file garbage collection takes place:

The basic PHP configuration (I didn't touch it so far) is done through files located /etc/php5/cgi with its basic PHP configuration file php.ini. Running phpinfo() confirmed the session settings done in php.ini:

[Session]
session.save_handler = files
session.save_path = /var/lib/php5
session.gc_divisor = 1000
session.gc_maxlifetime = 1440
session.gc_probability = 0

With these settings (gc_probability = 0), I assume that no automatic garbage collection is started from within PHP (see also http://serverfault.com/questions/51...s-with-a-cron-job-instead-of-using-phps-built). As posted in the link before, Debian and Ubuntu normally have their own scripts in /etc/cron.d/php5 to do this garbage collection.

On my Plesk server with no personal modifications towards PHP however, neither the automated garbage collection (in php.ini) is activated, nor does the (standard) Ubuntu/Debian cron job exists to delete outdated session files in /var/lib/php5. This results in many outdated files filling up that directory on my server.

My questions now are:
1) Is the removal of the cron job /etc/cron.d/php5 something specific that happened during the installation of Plesk? Why?
2) Is there another (Plesk-specific) script that should do the work?


Thanks in advance for your help!

Bastian
 
Update: I restored the corresponding cron job as it is normally installed under Ubuntu. However, I am still wondering why the file and cron job did not exist. Any ideas?
 
Hello,

Plesk installs it's own "garbage collection" hourly cron job:
/etc/cron.hourly/plesk-php-cleanuper
It's a simple shell script, so you can easily check how does it work.

Also please check: http://kb.odin.com/en/119500
 
Hello,

Plesk installs it's own "garbage collection" hourly cron job:
/etc/cron.hourly/plesk-php-cleanuper
It's a simple shell script, so you can easily check how does it work.

Hello dash,

thanks for the reply. I just checked my system and found out that the directory /etc/cron.hourly/ is completely empty, i.e., also plesk-php-cleanuper does not exist (it seems as if this file doesn't exist anywhere in my file system.

Which package would I need to re-install to also get that file?

Thanks for your support,

B_P
 
Hello,
yep, that's my mistake - plesk-php-cleanuper script is used on rpm systems like Centos.

I've checked my Plesk 12 on Ubuntu 12 instance:
/etc/cron.d/php5 is used to clean up php sessions.
This file belongs to php5-common package from Ubuntu repo.

# apt-file search /etc/cron.d/php5
php5-common: /etc/cron.d/php5

# apt-cache policy php5-common
php5-common:
Installed: 5.3.10-1ubuntu3.16
Candidate: 5.3.10-1ubuntu3.16
Version table:
*** 5.3.10-1ubuntu3.16 0
500 http://mirror.plesk.ru/ubuntu/ precise-updates/main amd64 Packages
500 http://mirror.plesk.ru/ubuntu/ precise-security/main amd64 Packages
100 /var/lib/dpkg/status
5.3.10-1ubuntu3 0
500 http://mirror.plesk.ru/ubuntu/ precise/main amd64 Packages
 
Back
Top