• Halloween is coming! To celebrate the occasion, we dusted off a couple of old skins, and even created a brand new one (Pixel).
    To get into the festive spirit, install the Skins extension.
  • The new Python extension is now available. It allows customers to deploy and manage WSGI-based Python applications on their websites directly from Plesk.
  • The Plesk Mobile apps for iOS and Android and the Plesk Mobile Center extension have been deprecated, and are no longer available for new installations. In Plesk Obsidian 18.0.84, the Plesk Mobile Center extension will be removed from servers during the upgrade, and the Plesk Mobile apps will lose their server management features.
  • The Social Login extension has been deprecated and will be removed in Plesk Obsidian 18.0.84. After that, it will no longer be possible to log in to Plesk with a Google, Facebook, GitHub account, or with a passkey. Plesk usernames and passwords, as well as logging in with a WebPros Account, are not affected.

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