Skip to main content


My #Pixelfed node is back up again. I had forgotten to reinstall the bcmath extension when I downgraded #PHP from 7.4 to 7.3 because #Nextcloud on the same machine isn't compatible, which prevented #Composer to pull the latest dependencies, which triggered a PHP Fatal Error. πŸ˜…

Ah, the joys of #selfhost without containers! I'm more and more tempted to look into #Docker, but I'm afraid of the learning curve before I get the same setup I have now. Also it probably would involve converting about 20 #Apache configuration files to #nginx which I'm not looking forward to either.

Does anyone have any pointers for either task, containerization and/or migration from Apache to nginx? #help
We have Nextcloud and all of it's ancillary services dockerized. You can look here for reference: https://gitlab.com/gibberfish/pancrypticon
Some of it may be fairly idiosyncratic but feel free to ask questions. It's really not that hard.
@Brian Γ“ 🐟 Thank you for the suggestion, however I have no idea what to do with the reference you provided. None of these files are familiar to me.
No need to switch to nginx if you use Docker. I'm running Apache in Docker on the machine where this pod is running, precisely because I didn't want the hassle of migrating a perfectly good configuration. On k8s I run nginx because it's the reference ingress, but it's nearly all self-configuring.

But the situation you describe is precisely why I switched to Docker: trading disk space and a bit of RAM (which are cheap) for my time (which is valuable). I run a tweaked version of the nextcloud image and the stock pixelfed image and never have to worry about shit like incompatible extensions ever again.

You don't even need to containerize apache (though eventually it's worth it), just containerize the apps for the time being since they're the trouble.
@Brad Koehn β˜‘οΈ I have no idea what "containerize the apps" entails. Also why did you have to tweak the nextcloud image?
Eh? you do not need containers to run several PHP versions on the same hosts. php-fpm is your friend (apache or nginx doesn't really matter ott).
Isn't running php-fpm and Apache the worst of both worlds? I've always strictly associated Apache with modphp and nginx/lighttpd with php-fpm. Otherwise it sounds like it would be the least impactful transition.
dude, that's biased 😜
It is, thanks to pro-nginx propaganda, i reckon. Given the other answers in this thread (from Diaspora, sorry you can't see them with your limited software), I clearly am not ready to delve into Docker. I will look into Apache/php-fpm combination, thank you!
In the case of nextcloud, you really just mount your data in /var/www/html to containerize it. For Pixelfed, you mount your config and data into the container. I'm happy to share my setup if that helps.

I added a few things to the nextcloud image that make it a bit easier for me to administer, and enables previews of PDFs.
Read up / experiment a little with Dockerfiles and docker-compose. It should make more sense after that.
@Brad Koehn β˜‘οΈ@Brian Γ“ 🐟 Thank you both, I'm not prepared to invest the time in learning how to use Docker at the time, I thought it was the only way of having multiple PHP versions running at the same time but I haven't had considered php-fpm with Apache before. I'm going to try this first and if it fails I'll bug you some more.
@Hypolite Petovan NC 19 is fully compatible with PHP 7.4. I run this combination successfully.
Thank you for the update, I admit I didn't look into updating my Nextcloud instance recently. I thought I was supposed to receive an admin email notifications when a new version is available but this isn't currently the case.
I'm listening to the stable channel, and the latest version offered to me is 17.0.7, I know you're a trailblazer but I'm not on the NC dev team so I'll wait for the official stable release!
Only wallabag doesn't work with php 7.4 for me. If you have enough ram you can also run php-fpm 7.3 AND php-fpm 7.4 at the same time and configure the virtual hosts to use one or the other. That is one of the best advantages of php-fpm
Thanks, I'll look into that. I may need a third php-fpm for my older websites that I do not intend on upgrading. The remaining quirk is that each site is served by a different user, which means I'll need as many php-fpm pools as there are users. I wonder if I can set the minimum children number to 0 to have a php-fpm process started only on a request to avoid memory shortage.
Memory is cheap, I used pm.min_spare_servers=1 without problems but if the memory is not enough to run all php at the same time it will eventually lead to some problems.
My server's memory is mostly used by the DBMS, and I'm already running into performance issue at the server level, but I don't know how to determine if memory is the bottleneck.
Well you can turn off swap and see if the OOM managers starts imediately killing processes πŸ˜‰ Ok that is a bit rude ... the pmap(1) command will show a lot of information about memory usage by processes, the same information can be found parsing /proc/{PID}/smaps. Ideally php and mysql/mariadb should never be swapped.
Also iostat can be used to see if the swap is being used too much.
Well, that project came to a quick stop. OndΕ™ej SurΓ½'s PHP DPA that allows to install multiple concurrent PHP versions on Debian doesn't work with the latest Devuan stable version and I'm definitely not building old versions of PHP from source. As an additional consequence, I cannot install PHP 7.4 anymore because it isn't available in the Devuan repo.
I've seen that systemd-less alternative, but I'm not sure I'm ready to try a different distribution yet. Thank you for the help though, much appreciated!
systemd in gentoo is mature and well supported, but the old openrc still works. The problems created by systemd-lessness are becoming worse than the problems caused by systemd.
I was mentining gentoo because it has a great multislot support and multiple versions of packages (php) can be installed without the need of an external repo.
So far for me systemd has been creating a problem I didn't have before, so going systemd-less on Debian restored the stability I'm longing for. I may have to look into containers because of this choice, but it looks better to me than learning to use a completely different distro. Still, I'm grateful for the knowledge you dispensed here.
Well actually you cannot install multiple versions of php because of the systemd-less. That is increasingly a problem since most software assumes it will run in a systemd environment. Nobody ships systemV init scripts for example but only systemd unit files for example. That is why I switched to systemd recently.
It is a problem of convenience when systemd brought a problem of general availability. When the systemd logger crashed for a reason I still don’t know, it was making my whole web server unavailable. Now, upgrading PHP has been making my oldest projects unavailable, but I know how to fix them, and it hasn’t been affecting the sites I expect traffic for.

I do not judge other people for their choice, I’ve assessed my particular situation and deemed systemd out of my reach. I do not know how to properly troubleshoot it and I’m not interested in learning it, so it closes some opportunities to me. It’s a trade-off I accept.
I used openrc until a few months ago, but I no longer see a future in the anti-systemd movement, expecially now that nobody supports alternative init systems.
I had a similar problem, a bug in image magick was causing crashes in php-cli while running friendica worker.php with certain png images, a lot of core dumps; the default configuration of systemd stores and compresses the coredumps in journald, a great feature for developers that might desire to analyze the dumps, an inconvenience for end users. Sometimes I had several journald threads compressing the large coredumps caused by php. I did not investigate further but removing the php-magick extension from php-cli fixes the problem, well systemd can also be configured to discard the coredums of course.
I don't know why only worker.php causes the crash while mod_php or php-fpm doesn't.
@Ermanno gz on taking that step πŸ˜€

I started embracing #systemd fully last year and it does make sysadmin life so much easier. Not just as "start this" replacement but with reading into all the features it does offer.

Wouldn't want to go back.
I'd think about LXC and leverage the nginx comunity.
Thanks for the suggestion! Do you have any personal experience with it?
I've only just begun exploring LXC (what docker is derived from) and cgroups in general. I've been using nginx since before 1.0, it's pretty much fire and forget β€” very lightweight and with lots of resources online.
⇧