content:serverbasics
Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen der Seite angezeigt.
| Beide Seiten, vorherige ÜberarbeitungVorherige ÜberarbeitungNächste Überarbeitung | Vorherige Überarbeitung | ||
| content:serverbasics [2024/04/20 15:02] – [UMask- Approach] obel1x | content:serverbasics [2026/04/10 10:18] (aktuell) – [Mountoptions] obel1x | ||
|---|---|---|---|
| Zeile 1: | Zeile 1: | ||
| - | ====== Linux: | + | ====== Linux: |
| - | These setting here are an advice | + | ~~NOCACHE~~ |
| + | |||
| + | Welcome to my **Advanced Server Setup- Documentation**. | ||
| + | |||
| + | In these chapters, i will explain how to setup and configure a full featured Active Domain- Network with Kerberos Single-Sign-On and Domain Integration of Linux Clients on a rootless containerized Docker- Installation including Nextcloud as personal Cloud to store all your Data and PIM locally and safe. That way you get a fully managed, Cloud enabled Homeoffice Network at low costs and much space for your personal data on your own pc. | ||
| + | |||
| + | ===== Current State ===== | ||
| + | |||
| + | This Document is currently under developement and chapters are not final right now. This will change in the Future. | ||
| + | |||
| + | ===== Usecase ===== | ||
| + | |||
| + | This is not a slim Setup - so if you only have old hardware or you are trying | ||
| + | |||
| + | You should have at least | ||
| + | |||
| + | * Large Harddrives: If you have maybe 1.5 TB of Data all togehter, you will need: | ||
| + | * 3 TB of space on your working directory / raid5 = 3 Harddrives, each 1 TB at least | ||
| + | * 6 TB of space on your backup / raid5 = 3 Harddrives, each 2 TB at least | ||
| + | * about maybe 100GB for the system / raid1 = 2 Harddrives | ||
| + | * about maybe 100GB for the databases / raid1 = 2 Harddrives | ||
| + | * maybe two extra drives for external backups, each 6 TB (you can also store that in the internet, but you will need a large space there too) | ||
| + | * A Server, that has relyable, quite fast internet in Download and Upload rates - while Upload may be more Importen | ||
| + | * The Server should be reachable all the time | ||
| + | |||
| + | ===== How to Start ===== | ||
| + | |||
| + | First, read this Page, get the Hardware and install the system. You should understand the Hardwaresetup and the installation of Linux and Raid- Systems first (as decribend beneath). | ||
| + | |||
| + | Then, go on whith [[: | ||
| + | |||
| + | Next, setup docker as decribed in the Chapter. When you have portainer running, you can go like this: | ||
| + | |||
| + | - Nextcloud-AIO | ||
| + | - FreeIPA | ||
| + | - Authentik | ||
| + | |||
| + | Then glue them together with SSO, SPNEGO and Nextcloud-SSO. Then you should have understood everything, you can now play around on your own. | ||
| ===== Subpages ===== | ===== Subpages ===== | ||
| <catlist content: | <catlist content: | ||
| + | |||
| + | ===== Basic System ===== | ||
| + | |||
| + | As Hardware, you should have at least: | ||
| + | |||
| + | * a single standard Desktop- PC with 4 or more Cores | ||
| + | * equipped with at least 16 GB of RAM and | ||
| + | * for failure of Discs a swappable mounting Rack to contain at least 5 Discs (should not have Raid as Hardware, as Software Raid in Linux is much more efficient!) | ||
| + | * Additional at least one external Disk, you may use to copy your Backups to and store them on a different physikal location | ||
| ===== Mountpoints ===== | ===== Mountpoints ===== | ||
| Zeile 51: | Zeile 97: | ||
| So I would suggest to use two disks both partioned with GPT and same sized efi-partitions (as said, at least 500 Megabytes in Size to store Bios or UCODE updates for Firmware Updater) and before creating the FAT32 filesystem do software raid on it. E.g.: | So I would suggest to use two disks both partioned with GPT and same sized efi-partitions (as said, at least 500 Megabytes in Size to store Bios or UCODE updates for Firmware Updater) and before creating the FAT32 filesystem do software raid on it. E.g.: | ||
| - | |||
| < | < | ||
| + | |||
| ~ # mdadm --create --verbose / | ~ # mdadm --create --verbose / | ||
| Zeile 61: | Zeile 107: | ||
| You than install your Linux Bootmanager / EFIBOOT to that md- Device. If its not found in the beginning of the installation, | You than install your Linux Bootmanager / EFIBOOT to that md- Device. If its not found in the beginning of the installation, | ||
| + | === Recover faulty Disc === | ||
| - | ==== LVM ==== | + | If some Raid- Disc becomes faulty, it will show up like this (its for raid5, but raid1 will look alkie): |
| - | LVM is a powerful partition-management-layer and should always be used, when there is some none low-end hardware present. If you can use the **KDE Partitioning- Tool** (which means having Plasma=KDE Desktop compatible support), the support is very inuitive and opens a lot of flexibility whne handling partitions, like adding more disk space or moving partitions, but also on console this offers good functionality. OpenSuSE offer to create LVM- Styled system setup in installation optionally | + | < |
| + | obel1x:~ # mdadm -D / | ||
| + | / | ||
| + | Version : 1.0 | ||
| + | Creation Time : Fri Apr 10 11:44:19 2020 | ||
| + | Raid Level : raid5 | ||
| + | Array Size : 1460286976 (1392.64 GiB 1495.33 GB) | ||
| + | Used Dev Size : 730143488 (696.32 GiB 747.67 GB) | ||
| + | Raid Devices : 3 | ||
| + | Total Devices : 2 | ||
| + | Persistence : Superblock | ||
| + | |||
| + | Intent Bitmap : Internal | ||
| + | |||
| + | Update Time : Sat Oct 26 14:26:37 2024 | ||
| + | State : clean, degraded | ||
| + | | ||
| + | Working Devices : 2 | ||
| + | | ||
| + | Spare Devices : 0 | ||
| + | |||
| + | | ||
| + | Chunk Size : 128K | ||
| + | |||
| + | Consistency Policy : bitmap | ||
| + | |||
| + | Name : any: | ||
| + | UUID : 6542dc7c: | ||
| + | | ||
| + | |||
| + | | ||
| + | 0 | ||
| + | 1 | ||
| + | | ||
| + | |||
| + | </ | ||
| + | |||
| + | Maybe instead of removed you can see some entry like faulty instead of removed | ||
| + | |||
| + | To add a new device, | ||
| + | |||
| + | < | ||
| + | obel1x:~ # fdisk -l /dev/sdc | ||
| + | Disk /dev/sdc: 698.64 GiB, 750156374016 bytes, 1465149168 sectors | ||
| + | Disk model: WDC WD7500AAVS-0 | ||
| + | Units: sectors of 1 * 512 = 512 bytes | ||
| + | Sector size (logical/ | ||
| + | I/O size (minimum/ | ||
| + | Disklabel type: gpt | ||
| + | Disk identifier: 699DC7F4-D344-4447-8C5B-1F98E017A12B | ||
| + | |||
| + | Device | ||
| + | / | ||
| + | |||
| + | </ | ||
| + | |||
| + | That Partition should have the Type Linx Raid. If you don't have that, create it with partition- tool of kde or what you want. | ||
| + | |||
| + | Now you can simply add the device | ||
| + | |||
| + | < | ||
| + | obel1x:~ # mdadm / | ||
| + | mdadm: re-added /dev/sdc1 | ||
| + | |||
| + | obel1x:~ # mdadm -D / | ||
| + | / | ||
| + | Version : 1.0 | ||
| + | Creation Time : Fri Apr 10 11:44:19 2020 | ||
| + | Raid Level : raid5 | ||
| + | Array Size : 1460286976 | ||
| + | Used Dev Size : 730143488 (696.32 GiB 747.67 GB) | ||
| + | Raid Devices : 3 | ||
| + | Total Devices : 3 | ||
| + | Persistence : Superblock is persistent | ||
| + | |||
| + | Intent Bitmap : Internal | ||
| + | |||
| + | Update Time : Sat Oct 26 14:34:57 2024 | ||
| + | State : clean, degraded, recovering | ||
| + | | ||
| + | Working Devices : 3 | ||
| + | | ||
| + | Spare Devices : 1 | ||
| + | |||
| + | | ||
| + | Chunk Size : 128K | ||
| + | |||
| + | Consistency Policy : bitmap | ||
| + | |||
| + | | ||
| + | |||
| + | Name : any: | ||
| + | UUID : 6542dc7c: | ||
| + | | ||
| + | |||
| + | | ||
| + | 0 | ||
| + | 1 | ||
| + | 3 | ||
| + | |||
| + | </ | ||
| + | |||
| + | ==== LVM ==== | ||
| + | LVM is a powerful partition-management-layer and should always be used, when there is some none low-end hardware present. If you can use the **KDE Partitioning- Tool** (which means having Plasma=KDE Desktop compatible support), the support is very inuitive and opens a lot of flexibility whne handling partitions, like adding more disk space or moving partitions, but also on console this offers good functionality. OpenSuSE offer to create LVM- Styled system setup in installation optionally (not by default). If you can: use it. | ||
| === Mirror- Raided LVM- Volumes (RAID1) === | === Mirror- Raided LVM- Volumes (RAID1) === | ||
| Zeile 167: | Zeile 317: | ||
| </ | </ | ||
| + | |||
| + | === LVM Error Recovery === | ||
| + | |||
| + | In case on Harddrive is failing, the Array gets degraded. If you boot your system without that disk, it will not start due to inaktive volume groups. | ||
| + | |||
| + | To recover, do this: | ||
| + | |||
| + | 1. Get Volume Groups up, if degraded | ||
| + | |||
| + | vgchange -a y | ||
| + | |||
| + | 2. Add a new PV to the VG that is large enough to hold the Data | ||
| + | |||
| + | vgextend vgname /dev/sdX | ||
| + | |||
| + | 3. Repair the logical volume by searching for usable PVs automagically | ||
| + | |||
| + | lvconvert –repair vgname/ | ||
| + | |||
| + | This should rebuild your logical Volume | ||
| + | |||
| + | 4. After rebuild, remove the faild drive from the vg: | ||
| + | |||
| + | vgreduce –removemissing vgdata | ||
| + | |||
| + | Thats it, your System should become usable after that. | ||
| + | |||
| + | == Moving Data before Drive fails == | ||
| + | |||
| + | If you have the possibility to add a new PV before the array gets degraded, you can use the replace- method after adding the new pv to the VG: | ||
| + | |||
| + | lvconvert –replace /dev/sdX1 vgname/ | ||
| + | |||
| + | === More Info for LVMs === | ||
| + | |||
| + | https:// | ||
| + | |||
| ==== Filesystem ==== | ==== Filesystem ==== | ||
| Zeile 173: | Zeile 360: | ||
| And there is one Reason: Docker - at the current time of writing this (20.04.2024) you should NOT USE BTRFS with Docker. More is explained later. | And there is one Reason: Docker - at the current time of writing this (20.04.2024) you should NOT USE BTRFS with Docker. More is explained later. | ||
| - | |||
| ==== Mountoptions ==== | ==== Mountoptions ==== | ||
| Zeile 183: | Zeile 369: | ||
| While autodefrag should not be necessary on ssd- harddiscs. | While autodefrag should not be necessary on ssd- harddiscs. | ||
| - | For **Databases** | + | For **Databases** or files that need speed and __**are well backed up otherwise**__ |
| === Sources: === | === Sources: === | ||
| * [[https:// | * [[https:// | ||
| * [[https:// | * [[https:// | ||
| + | |||
| + | === Powermode settings === | ||
| + | |||
| + | Your Harddrives may have set a power level, that allows spindown. I personally would not let your harddrives spindown, because every start brings your harddrives mechanics nearer to death. In Fact there is not very much worse than spinning up and down every few minutes for a harddrive with physical discs. | ||
| + | |||
| + | To change that, create the following file: | ||
| + | < | ||
| + | |||
| + | pcserver2023:/ | ||
| + | ACTION==" | ||
| + | |||
| + | </ | ||
| + | |||
| + | That way, your harddrives will stay up all time. | ||
| + | |||
| ===== Quotas ===== | ===== Quotas ===== | ||
| Zeile 306: | Zeile 506: | ||
| So you should maybe think of setting a better umask than 022 - which would make all users of you group have read access to you files to lets say 077. Or - even better don't use the group " | So you should maybe think of setting a better umask than 022 - which would make all users of you group have read access to you files to lets say 077. Or - even better don't use the group " | ||
| - | On my system the umask can be defined in the file ''/ | + | On my system the umask can be defined in the file ''/ |
| But to go on directory- permissions: | But to go on directory- permissions: | ||
| - | |||
| ==== FACLs ==== | ==== FACLs ==== | ||
| Zeile 462: | Zeile 661: | ||
| And with FACLs there are powerful tools that should cover everything an administrator needs. | And with FACLs there are powerful tools that should cover everything an administrator needs. | ||
| + | |||
| + | ===== Firewall ===== | ||
| + | |||
| + | To check, which services are open, use: | ||
| + | |||
| + | PLEASE, Before opening the Ports, check the Services described at the Sub-Pages first to secure them! | ||
| + | |||
| + | < | ||
| + | servername: | ||
| + | 3478/tcp 3478/udp | ||
| + | servername: | ||
| + | 546/udp | ||
| + | 53/tcp 53/udp | ||
| + | 80/tcp | ||
| + | 443/tcp | ||
| + | 88/tcp 88/udp | ||
| + | 389/tcp | ||
| + | 636/tcp | ||
| + | 873/tcp 873/udp | ||
| + | 22/tcp | ||
| + | |||
| + | </ | ||
content/serverbasics.1713618139.txt.gz · Zuletzt geändert: von obel1x
