dzamanakos

Well-Known Member
Feb 15, 2014
79
6
58
Larisa / Greece
cPanel Access Level
Root Administrator
Hi, i've two questions, and my setup is centos, cloudlinux, litespeed

1. I've read on litespeed optimization guide that i can use /dev/shm/phpXX as session.save_path folders for my php versions as a performance tweak. I could add to cagefs these folders through cagefs.mp in order to be accessible from the user.
I would like to know if, after a restart, cpanel creates /dev/shm/phpXX with the proper permissions if the folder is not found. I also thought that in busy servers, session files in memory could lower the disk overhead, if files (such as session that are not mandatory to exist after a reboot) are written in the ram.
Has anyone tried this, will that work?

2. i'm using cpanel's mod_security with the rules "COMODO ModSecurity LiteSpeed Rule Set" added as vendor.
When i disable/enable a rule, i get a message that i should deploy and restart apache and have to click it in order to apply the changes and get a reply that apache was notified to do a graceful restart. Does that restarts litespeed also, or should i restart afterwards the litespeed service through litespeed plugin?
Are there any symlinks that restarts litespeed if i click "restart services-> http server (apache)" or i should restart litespeed from that link?

best regards,
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,258
463
Hello @dzamanakos,

1. I've read on litespeed optimization guide that i can use /dev/shm/phpXX as session.save_path folders for my php versions as a performance tweak. I could add to cagefs these folders through cagefs.mp in order to be accessible from the user. I would like to know if, after a restart, cpanel creates /dev/shm/phpXX with the proper permissions if the folder is not found. I also thought that in busy servers, session files in memory could lower the disk overhead, if files (such as session that are not mandatory to exist after a reboot) are written in the ram.
Has anyone tried this, will that work?
I'm happy to perform these actions on a test server to verify what happens. Can you share the step-by-step instructions for the specific actions you'd like us to test so I can replicate them on a test server?

2. i'm using cpanel's mod_security with the rules "COMODO ModSecurity LiteSpeed Rule Set" added as vendor.
When i disable/enable a rule, i get a message that i should deploy and restart apache and have to click it in order to apply the changes and get a reply that apache was notified to do a graceful restart. Does that restarts litespeed also, or should i restart afterwards the litespeed service through litespeed plugin?
Are there any symlinks that restarts litespeed if i click "restart services-> http server (apache)" or i should restart litespeed from that link?
Using WHM >> Restart Services >> HTTP Server (Apache) or /scripts/restartsrv_httpd (via the command line) will automatically perform the necessary LiteSpeed service restart.

Thank you.
 

dzamanakos

Well-Known Member
Feb 15, 2014
79
6
58
Larisa / Greece
cPanel Access Level
Root Administrator
Hi, thank you for your reply.

My scenario is :

I want to store php session files to /dev/shm in order to have less overhead in my disks.

I can browse to WHM->multiphp ini editor -> phpXX and set session.save_path to /dev/shm/php/phpXX for all my php versions.
After save, will cpanel create these directories or should i create them myself?

When i restart my server /dev/shm will be erased, after boot will cpanel create these dirs before web server starts, or i'm going to get error messages because the folders will not exist?

best regards,
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,258
463
I can browse to WHM->multiphp ini editor -> phpXX and set session.save_path to /dev/shm/php/phpXX for all my php versions.
After save, will cpanel create these directories or should i create them myself?
You will need to create those directories before updating the session.save_path value in WHM >> MultiPHP INI Editor >> Basic Mode. The individual directories (e.g. /dev/shm/php/php72) should be owned by root and set to 1733 permissions.

When i restart my server /dev/shm will be erased, after boot will cpanel create these dirs before web server starts, or i'm going to get error messages because the folders will not exist?
cPanel & WHM will not automatically create those directories at boot time. You'll need to manually create them any time you boot the system or setup a script to automatically create them when the system boots. You may also want to consider posting directly to the LiteSpeed Forums to see if any other LiteSpeed administrators have implemented a similar setup.

Thank you.