By default in Linux OpenLiteSpeed will be set up to run as user "nobody". Since we need Moodle to be able to write to moodledata, it needs a proper user and group. For me this has always been the standard www-data user and group. However, OpenLiteSpeed needs to be reinstalled when changing the user and group. Here are my steps:
- stop lsws: systemctl stop lsws
- change user and group in /etc/local/lsws/conf/httpd_config.conf to www-data
- remove the lsws temp directory: rm -rf /tmp/lshttpd
- apt-get -y install --reinstall openlitespeed
Further, make sure you install the lightspeed php curl and intl packages. I'm using php8.2:
- apt install lssphp82-curl lsphp82-intl
You also need to edit usr/local/lsws/lsphp82/etc/php/8.2/litespeed/php.ini and increase max_input_vars to Moodle's minimum (of 5000) or greater. While I was there I also uncommented extension=curl and extension=intl. I'm not sure if that was necessary or not.
It wasn't entirely clear to me at first where to put the "moodle" and "moodledata" directories with the way lsws handles VirtualHosts. I ended up going with:
- Virtual Host Name (VH_NAME) as my fully qualified host name (moodle.mysite.edu, etc)
- Virtual Host Root (VH_ROOT) set to $SERVER_ROOT/$VH_NAME
- and my Document Root set to $VH_ROOT/moodle/
I then put moodledata in $VN_ROOT/moodledata/
And I'll confirm Aadi's suspicions about cron: Using OpenLiteSpeed's version of php works perfectly fine in the crontab for me.
Finally, I specified my SSL certificates in the SSL tab. Putting them in the https Listener's SSL section resulted in getting an SSL warning periodically when I use the lsws web admin, which generates it's on certs. I haven't had time to resolve that issue yet, but perhaps the answer is to put them in the VirtualHost's SSL section instead? Maybe someone else can enlighten us.