Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
#1 2024-08-21 13:03:52
- Algaris
- Member
- From: England
- Registered: 2006-01-27
- Posts: 549
Adventures in Linux Land
I recently realised that I’ve been posting quite a bit about Linux and having discussions with Pete regarding its various aspects. I also noticed that the discussions were spread across multiple topics and threads.
In order to consolidate things (and not derail other topics) I thought I’d try to bring things under one roof. This way other people can contribute here if they want to, and if they find any of the information useful all the better.
So, from now on I’ll try to post all my Linux related questions, discoveries, and musings in this topic.
Ross talks about TrueNas and Ubuntu Server’s for Raspberry Pi’s
Ross and Pete talk about the differences between Ubuntu and Debian
Ross struggles to understand Linux permissions
* viewtopic.php?id=52076Ross tries (and fails) to understand Docker
Ross and Pete discuss freenginx, Nginx, Caddy, and migrating from Ubuntu to Debian
Ross discovers FrankenPHP
Last edited by Algaris (2024-08-21 13:46:08)
Offline
Re: Adventures in Linux Land
Offline
#3 2024-08-23 13:30:34
- Algaris
- Member
- From: England
- Registered: 2006-01-27
- Posts: 549
Re: Adventures in Linux Land
gaekwad wrote #337698:
Edit: get this in yer ears: selfhosted.show
Oooh. Something else to explore.
Last edited by Algaris (2024-08-23 13:43:47)
Offline
#4 2024-08-23 13:43:36
- Algaris
- Member
- From: England
- Registered: 2006-01-27
- Posts: 549
Re: Adventures in Linux Land
So it turns out the main way to use FrankenPHP is via Docker containers. I’m still trying to wrap my head around how Docker works.
Working with Docker containers is the opposite of my current workflow. For each project I spin up a new virtual machine, install Debian, configure Caddy, PHP, MySQL, etc. and then install the application I want to work with i.e. Textpattern. From my limited understanding Docker uses one server, one OS, and each component PHP, MySQL, Textpattern, etc. resides in its own container which can then communicate with each other. It allows you to run multiple projects on one server instead of having to spin a new one up for each project.
Until I can understand Docker I probably won’t move any current or near future projects over to FrankenPHP. I just don’t have the time to fully learn Docker and make the necessary changes to my workflow given my deadlines (the school I work for starts back in a matter of weeks).
Last edited by Algaris (2024-08-23 13:48:29)
Offline
#5 2024-08-28 13:30:51
- Algaris
- Member
- From: England
- Registered: 2006-01-27
- Posts: 549
Re: Adventures in Linux Land
gaekwad wrote “#337740”: ../viewtopic.php?pid=337740#p337740
Upcoming:
- PHP via Nginx Unit or other app server
So would Nginx Unit replace PHP-FPM? I’m guessing this is similar to how with FrankenPHP you don’t need PHP-FPM (except that FrankenPHP replaces the whole web server as well)?
Offline
Re: Adventures in Linux Land
Algaris wrote #337742:
So would Nginx Unit replace PHP-FPM?
Correct. I don’t have any data to know it’s more performant in real terms, but time will tell.
I’m guessing this is similar to how with FrankenPHP you don’t need PHP-FPM (except that FrankenPHP replaces the whole web server as well)?
That I don’t know – I haven’t looked at Caddy / FrankenPHP properly yet, so I’ll defer to your know-how there!
Offline
#7 2024-08-28 13:49:36
- Algaris
- Member
- From: England
- Registered: 2006-01-27
- Posts: 549
Re: Adventures in Linux Land
gaekwad wrote #337744:
That I don’t know – I haven’t looked at Caddy / FrankenPHP properly yet, so I’ll defer to your know-how there!
With Caddy you still need PHP-FPM. During my research I came across the following:
FrankenPHP simplifies your deployment process by eliminating the need for separate PHP-FPM and Nginx processes.
I just needed to dig a little deeper I guess.
Offline
#8 Yesterday 10:34:03
- Algaris
- Member
- From: England
- Registered: 2006-01-27
- Posts: 549
Re: Adventures in Linux Land
I’ve been on another rabbit hole research session this time regarding how to upgrade to a new server version of Debian. From my research I found that you need to edit the /etc/apt/sources.list
file before doing an upgrade.
The process seems quite different to Ubuntu. In Ubuntu you’re usually informed when SSHing into the server and can upgrade using the do-release-upgrade
.
To get another perspective on this I was wondering what people’s best practices are for upgrading to a new Debian server version are? I also have a few questions if anyone is able to offer advice on this matter.
1. Does Debian inform you when there’s a new server version when SSHing into the server or are you expected to keep abreast of the latest releases yourself?
2. What’s the best way to edit the sources.list
and specify the new Debian version? Can you just edit it with your text editor of choice (for example Nano)?
3. Once you’ve updated the sources.list
do you just upgrade with:
sudo apt-get update
sudo apt-get dist-upgrade
If anyone notices that I have any knowledge gaps in this process please let me know. Currently I don’t know what I don’t know. I’m having fun trying to plug the gaps.
Offline
Re: Adventures in Linux Land
Algaris wrote #338035:
To get another perspective on this I was wondering what people’s best practices are for upgrading to a new Debian server version are? I also have a few questions if anyone is able to offer advice on this matter.
For me, I don’t do in-place upgrades. I build new and ‘rotate’ servers every year or two to benefit from newer (better) hardware and general spring cleaning to de-cruft.
I did a few in-place upgrades when I was testing Debian 11 -> Debian 12, and they did work OK. Here’s what I did:
if \
[[ $(awk -F= '$1=="VERSION_CODENAME" { print $2 ;}' /etc/os-release) = "bullseye" ]] \
; then \
export DEBIAN_FRONTEND=noninteractive \
&& apt update \
&& apt -y dist-upgrade \
&& apt -y full-upgrade \
&& apt -y autoclean \
&& apt -y autoremove --purge \
&& sed -i 's/bullseye/bookworm/g' /etc/apt/sources.list \
&& sed -i -- 's/bullseye/bookworm/g' /etc/apt/sources.list.d/*.list \
&& apt clean \
&& apt update \
&& apt -y -o "Dpkg::Options::=--force-confdef" -o "Dpkg::Options::=--force-confold" dist-upgrade \
&& apt -y -o "Dpkg::Options::=--force-confdef" -o "Dpkg::Options::=--force-confold" full-upgrade \
&& apt -y autoclean \
&& apt -y autoremove --purge \
&& reboot \
; fi
This is old code that I haven’t touched in a while, so test in development first. Also, it was the first-run task on a new server, so no sudo
preface (i.e. I was raw dogging as root
). You’ll need to sudo
if you’re not root
.
1. Does Debian inform you when there’s a new server version when SSHing into the server or are you expected to keep abreast of the latest releases yourself?
That will be down to your server vendor’s motd
stuff. You can change all the login stuff you see by modifying the contents of /etc/update-motd.d/
. The numbers relate to the order in which they’re executed (shown to you).
2. What’s the best way to edit the
sources.list
and specify the new Debian version? Can you just edit it with your text editor of choice (for example Nano)?
I’d use sed
from the command line, but you can edit in your editor of choice, yes. The benefit of sed
is it’s not liable to you missing an instance.
3. Once you’ve updated the
sources.list
do you just upgrade with:
sudo apt-get update
sudo apt-get dist-upgrade
Yup, that’s about it. I embellish it a little bit (see code above) but you’re basically on the right track.
If anyone notices that I have any knowledge gaps in this process please let me know. Currently I don’t know what I don’t know. I’m having fun trying to plug the gaps.
Welcome to my world, amigo! See also “The Rumsfeld Matrix” – here’s the gist:
Reports that say that something hasn’t happened are always interesting to me, because as we know, there are known knowns; there are things we know we know. We also know there are known unknowns; that is to say we know there are some things we do not know. But there are also unknown unknowns—the ones we don’t know we don’t know. And if one looks throughout the history of our country and other free countries, it is the latter category that tends to be the difficult ones.
I’m up to 7,645 commits in my server build guide…ya kinda get used to iterating and learning, it’s good for the soul.
Last edited by gaekwad (Yesterday 12:45:45)
Offline
Pages: 1