Which Linux server distro?  (rolling distro, LTS, or regular) - Page 1
Forum section: electronics / general

author: RoGeorge
author_rank: Super Contributor
timestamp: September 20, 2020, 03:56:04 pm
content: Which Linux server would you recommend in order to host a very small personal blog (less than 100 hits a day), possible with an attached forum for the blogged articles?Preferably to keep it under the desk, no renting cloud machines hosting or virtual private servers. The hardware must be small (because the electricity cost is about $1.5/year for each watt), so the two options for hardware will be either a Raspberry Pi (about 10W/64bit/4x1.5GHz/8GB) or an old HP laptop (about 35W/32bits/1x1.73GHz/2GB).So far familiar with Debian and Red Hat. Looking for a rolling distro, maybe, so I won't have to install yearly, or so. Not sure if I should rule out distros based on the Rolling/Long Time Support/Stable flavors?It will run headless, administered by SSH only. I'm familiar with networking and Linux, but I'n neither a sysadmin nor a netadmin by profession, so I'll prefer something that just works, without breaking at updates, and preferably without much compiling, fiddling and such.Main job of the server will be to host a webserver (Nginx?), a MySQL (or MariaDB) and a WordPress blog + SMF2.1 forum on top.- Which hardware would you recommend, Raspberry Pi 4 vs. old 32 bits HP Laptop, or maybe something else?- Which Linux distro would you go with for a headless server and minimal fuss?

author: brucehoult
author_rank: Super Contributor
timestamp: September 20, 2020, 06:42:12 pm
content: Have you measured the actual power use from those machines?I don't know how old your laptop is or what power it will use but I have a NUC with i7-8650U 32 GB RAM 512 GB SSD that draws 6W at idle (which your machine will be 99.99% of the time).I just measured my 4 GB Pi 4 and it's 3.9 W at idle.[Edit: oops .. that's not idle. One core is busy running "unattended-upgrade". It's been a while since I used it. I'll have to wait a bit for that to finish and check again]Both of those are measured at the wall, so include power supply losses.So by your power price figures that's $3 a year difference. Not much in it to worry about.As for distribution ... I keep it simple and use Ubuntu on everything, where available (that's what is on my Pi 4), and Debian elsewhere.Code:ubuntu@ubuntu:~$ uname -aLinux ubuntu 4.19.80-v8-james #16 SMP PREEMPT Thu Oct 31 02:46:08 MDT 2019 aarch64 aarch64 aarch64 GNU/Linuxubuntu@ubuntu:~$ lsb_release -aNo LSB modules are available.Distributor ID:UbuntuDescription:Ubuntu 18.04.3 LTSRelease:18.04Codename:bionicHere's another SBC I have that is also quad core 1.5 GHz also uses around 5W:Code:bruce@HiFiveU:~/programs$ uname -aLinux HiFiveU 4.15.0-00049-g79a9752848da #3 SMP Thu Mar 7 21:56:58 UTC 2019 riscv64 GNU/Linuxbruce@HiFiveU:~/programs$ lsb_release -aNo LSB modules are available.Distributor ID: DebianDescription: Debian GNU/Linux bullseye/sidRelease: unstableCodename: sid

author: brucehoult
author_rank: Super Contributor
timestamp: September 20, 2020, 11:25:47 pm
content: Ok, now it's finished updating (and I've woken up) the Pi 4 is using 2.95 W.

author: RoGeorge
author_rank: Super Contributor
timestamp: September 21, 2020, 09:13:49 pm
content: Quote from: brucehoult on September 20, 2020, 06:42:12 pmYes, measured with an old energy meter left from when the meters were replaced with digital ones. Anchored on 2 random wood boards instead of a wall, still measures correctly even if it looks barbaric.I've start measuring the power because, at first, I've tried a former motherboard/proc/RAM/HDD/GPU left from a former desktop upgrade. After installing and running for a couple of hours, the room went hotter than usual. It was an AMD Athlon64 3000+ with 1.256GB RAM, an 120GB IDE 7200 and a Radeon HD3850 AGP GPU that were drawing no less than 160W in idle running!!Most of those were for the video card, but even after removing the video card, it was still drawing about 60W. Given the price of electricity alone, it will totally make sense to buy a RPi.Then tried the old HP laptop, which was needing only half of those 60W, so not sure if to slowly spend money in time with electricity, or to put some money upfront for a new RPi.Those 5-6W measured are quite surprising, are you sure the meter is measuring correctly at low power? Asking because the standby of a power supply alone is expected to use about 5W or so.

author: brucehoult
author_rank: Super Contributor
timestamp: September 22, 2020, 02:54:26 am
content: I don't know how I'd check the accuracy of my power meter without trying it against another one, but then how would I know that one was correct?Kill-a-Watt have a pretty good reputation, I think?I haven't been able to quickly find official idle power specifications for Intel NUCs, but Apple does publish these numbers for Mac Mini and models since 2014 use 6W at idle.https://support.apple.com/en-us/HT201897

author: RoGeorge
author_rank: Super Contributor
timestamp: September 22, 2020, 12:42:16 pm
content: Such low power is quite impressive, good to know, thanks. I guess that power supply I was measuring must be really bad.For now a RPi 4 w 8GB of RAM and an 128GB uSD card seem like the most reasonable choice.Thought the SMF forum is reasonable usable even with a RPi B/700MHz/256MB. Before buying yet another board, maybe I should try to install everything on that 1.73GHz/32bits/2GB/30W laptop and see how responsive will be. It feels wasteful to buy more hardware while a laptop is just sitting there doing nothing.

author: madires
author_rank: Super Contributor
timestamp: September 22, 2020, 01:40:14 pm
content: The problem with old PCs and notebooks is that they are power-hungry. So better go for something modern. Anyhow, a RasPi should be fine for running a small blog, and it's a low-power device. Next point is about hits/day. If you calculate with about 100 real hits a day then add another 1000 for crawlers and bots scanning your webpage for known vulnerabilities. The internet isn't a friendly place. And regarding linux distris I'd recommend Debian or Devuan (w/o systemd).

author: perieanuo
author_rank: Frequent Contributor
timestamp: September 22, 2020, 02:39:28 pm
content: ubuntu is ok for lot of stuff, it just works out of the box, we lazy people love thatcentos is ok for some devs also.you like stability, debian or freebsd for sec stuff like firewallsregards,pierre

author: SeanB
author_rank: Super Contributor
timestamp: September 22, 2020, 02:57:05 pm
content: go with the LTS versions, as at least then you only will be upgrading every 3 to 4 years, and the software is reasonably well maintained, and security patches are rolled out quite fast. Rolling release you will probably get the same, but not quite as stable, but no regular updates that will stop and start services, though LTS is easy to automatically schedule updates for the middle of the night, apply and restart the unit without attention.Just gone from Mint 17 to Mint 20, and literally it was like changing the tablecloth, cutlery, crockery all at once, but keeping the food in the plate as is. New OS, now on a SSD, and the browser barely noticed it, my podcast software noticed it could now do SSL2 and higher, and caught up fast. Fixed a scanning issue, now no longer have to pull out an older distro to scan, and then had to fix the Canon D660U, as it snapped the belt. But used the HP scanjet 3400C instead, but the Canon has a built in film scanner, so fix it it was, than goodness for an online service manual showing how to open it.I still use an even older LTS on a laptop, because it has some software that I use every so often, but I need to keep the version of Virtualbox there stable for it, so it never connects via anything other than USB, so is very stable in operation. Yes, I hate upgrading, only do so after end of support, and it works, as the computer is a tool, an ends to a mean, not the system I want to work on, just with. Oh yes, I use a 32in colour TV set as monitor, it works well for me, not 4k, not 2k, but works well at a distance, and i no longer can focus to see flyspec anyway.

author: perieanuo
author_rank: Frequent Contributor
timestamp: September 22, 2020, 03:02:30 pm
content: regarding the hw, the pi should be the cheapest solution I guess, smallet power footprint also.just ssh into it and you're fine

author: newbrain
author_rank: Super Contributor
timestamp: September 24, 2020, 10:53:55 am
content: For the distro, I would go with an LTS e.g. Ubuntu Server 2004.1 LTS."I am not a sysadmin", fine, Ubuntu is easy.But think of security, if you are opening this to the world.As for the HW, I can confirm the power consumption of a NUC: one I have is IIRC about 5W in Idle (i5-4250U based), and orders of magnitude more powerful than any Pi.I have used it as a Hyper-V host and Windows Server VM for years, with months of uptime.Edit: 4250U, not 8250U

author: madires
author_rank: Super Contributor
timestamp: September 24, 2020, 11:10:46 am
content: There's also LTS for Debian:https://wiki.debian.org/LTS

author: tkamiya
author_rank: Super Contributor
timestamp: October 04, 2020, 04:14:35 am
content: I run Ubuntu LTS on all of my Linux boxes, servers and workstations included. I update them at my convenience.If I am going to do anything public can access, I will not put that on my network and expose that to outside. I'd rather pay monthly fee and have it hosted. If you look at your firewall logs, you'll see your IP is accessed dozens of times a second. That's how many automated hacking attacks there are. They are just looking for an easy hole to exploit. I don't want to give them a better chance by poking a hole on my firewalls.

author: Wuerstchenhund
author_rank: Super Contributor
timestamp: October 05, 2020, 11:30:38 am
content: Quote from: RoGeorge on September 20, 2020, 03:56:04 pmI would stick with the two largest Enterprise Linux vendors - Red Hat and SUSE. Either with their direct Enterprise Linux offerings (RHEL/SLE) or (if the budget isn't there) stick with their free derivates CentOS and openSUSE Leap.Many mentioned Ubuntu LTS but it's not in the same ballpark (only a small core set of packages is actually "LTS", and Canonical still sticks experimental stuff like ZFS support in what at the end of the day should be a stable distro).In my experience, sticking with the enterprise stuff usually pays off.QuoteNeither is a good option if reliability has any relevance for you.I'd have a look at the HPE MicroServers, either the new MicroServer Gen10 or if you're short on cash then get a 2nd hand MicroServer Gen8. Both also offer iLO, HPE's remote management processor which allows for remote management of the hardware and offers a built-in KVM option.QuoteIf you want stability (which is usually important for a server that hosts something) then stay away from any form of rolling release.Since you're familiar with RHEL then I'd go this route (RHEL or CentOS).QuoteIn this case I would seriously recommend you look at SUSE, either SLE or openSUSE Leap (stay away from Tumbleweed, though, as it's rolling release). SUSE Linux comes with YaST, an unique administration GUI which can be used in graphics and text mode and which allows you to make most administration tasks through a simple interface.YaST works fine on a SSH text console.I don't know any other Linux distro which offers something similar.

author: Nominal Animal
author_rank: Super Contributor
timestamp: October 06, 2020, 06:08:53 pm
content: (Admin hat on)If you want the machine to work reliably without monitoring it 24/7, an important "trick" is to reconfigure the web server to use completely different trees than the distro defaults use.The idea is that automatic updates and package installs work normally,but they do not actually change the behaviour of your web service. To change the behaviour of your web service, you need to copy the relevant details from the distro configuration to the actual configuration; the same for the actual document root. Also, instead of everything you might someday find useful being enabled, you only enable the services that are required right now. This minimizes the attack surface, as well as reduces the impact and complexity of installing new packages. (In particular, you don't need to check if a given package has an insecure web service component that is automatically enabled – see e.g. SageMath, many Java packages that include a Tomcat installation, etc.)If using Apache, I recommend a minimal configuration for the default server, and doing the actual configuration in virtual host configurations using a dedicated user and group accounts. (No, the virtual host does NOT run as that user and group. You never want that; the server itself should NEVER EVER be able to overwrite its own configuration files, even less its binaries or script files. Yes, this means you can no longer click on the web page to tell the web service to update itself, but it also makes it easy to detect and auto-remove script drops.)The only thing when configuring an Apache virtual host you need to do as root/via sudo is to reload or stop/restart/start the entire web service. (And that you can do with a trivial scriptlet pair, and sudo config that allows running the second one as root without password.) This reduces the impact of admin errors (except for server downtime; configuration changes should be done viareloadand not viarestartorstop-startcycle, because only reload allows the existing configuration to continue if the modified configuration contains errors.)I use Unix group permissions to manage maintainer access. There are several "tricks" here too, from marking directories setgid (which causes all files to inherit the group from the directory, and not the user), to usingnewgrpto change the currently active group. This way, users can modify the content as themselves. In your case, considering there is likely just one admin user ever, this may not be too relevant.I used to have a page about this, but other than being used as the Apache config on a few dozen public servers at my Uni, there wasn't that much interest in it, so it lapsed.

author: Doctorandus_P
author_rank: Super Contributor
timestamp: October 31, 2020, 06:22:14 am
content: I'd think you're probably best of with whatever Linux distro you're comfortable with, unless you think it's fun to learn package management and configuration for another Linux flavour. (Almost?) any Linux distro will have the packages you need for a web server.If needed you can simply add another EUD50 linux computer to make redundancy, and the secondary takes over if the primary fails.With two of them, you can also set them up to make daily or even hourly backups.This way you can also "test" updates on the secondary computer.Just make sure that "automatic" updates are rolled out on both systems at the same time.

author: Trader
author_rank: Frequent Contributor
timestamp: October 31, 2020, 07:36:50 am
content: MX Linux, it's Debian.https://distrowatch.com/table.php?distribution=mx

author: bd139
author_rank: Super Contributor
timestamp: October 31, 2020, 10:27:47 am
content: I use a Lenovo M600 box for Linux utility tasks like that. It’s small, silent and doesn’t take much energy. You can get them on eBay for about 100 GBP.I suggest not bothering with a rolling distro for servers. Make it cheap to dispose of the OS and start again using ansible or something instead. You need a careful balance between security and reliability in such environments. Thus I’d recommend CentOS.Good points from Nominal Animal about group isolation etc. I usually add the users allowed to write the web content into www-data group and set up the virtual hosts in /srv/http/vhost/htdocs. I tend to use nginx rather than Apache.But you could just say fuck it, throw all this away and pay digitalocean.com $5 a month to run this stuff on their cloud. Probably the best option.