Server Dienste Minimal: Unterschied zwischen den Versionen

Aus Xinux Wiki
Zur Navigation springen Zur Suche springen
 
(7 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt)
Zeile 16: Zeile 16:
  
 
*[[Apache2 mit PHP (Debian)]]
 
*[[Apache2 mit PHP (Debian)]]
 
+
*[[Nginx mit PHP (Rocky)]]
= Nginx mit PHP (Rocky) =
 
*yum install nginx php-fpm -y
 
*systemctl enable --now nginx php-fpm
 
*echo "<?php phpinfo(); ?>" > /usr/share/nginx/html/info.php
 
*vi /etc/nginx/conf.d/default.conf
 
<pre>
 
server {
 
  listen 80;
 
  root /usr/share/nginx/html;
 
  index index.php index.html;
 
  location ~ \.php$ {
 
    fastcgi_pass 127.0.0.1:9000;
 
    include fastcgi.conf;
 
  }
 
}
 
</pre>
 
*systemctl reload nginx
 
*http://10.20.10.12/info.php prüfen
 
 
 
 
*[[Exim (Mailserver minimal)]]
 
*[[Exim (Mailserver minimal)]]
 
 
*[[NFS-Server Debian]]
 
*[[NFS-Server Debian]]
  
= Samba-Server =
+
*[[Samba-Server minimal]]
*apt install samba -y
 
*mkdir -p /srv/samba/share
 
*chmod 777 /srv/samba/share
 
*echo "[share]" >> /etc/samba/smb.conf
 
*echo "  path = /srv/samba/share" >> /etc/samba/smb.conf
 
*echo "  read only = no" >> /etc/samba/smb.conf
 
*echo "  guest ok = yes" >> /etc/samba/smb.conf
 
*systemctl enable --now smbd nmbd
 
 
 
= DHCP-Server =
 
*apt install isc-dhcp-server -y
 
*vi /etc/dhcp/dhcpd.conf
 
<pre>
 
subnet 10.20.10.0 netmask 255.255.255.0 {
 
  range 10.20.10.100 10.20.10.150;
 
  option routers 10.20.10.1;
 
  option domain-name-servers 10.20.10.11;
 
  option domain-name "lab.local";
 
}
 
</pre>
 
*systemctl enable --now isc-dhcp-server
 
  
= DNS-Server (Bind9) =
+
*[[KEA DHCP-Server minimal]]
*apt install bind9 -y
+
*[[DNS-Server (Bind9) kurz und knapp]]
*vi /etc/bind/named.conf.local
 
<pre>
 
zone "lab.local" {
 
  type master;
 
  file "/etc/bind/db.lab.local";
 
};
 
zone "10.20.10.in-addr.arpa" {
 
  type master;
 
  file "/etc/bind/db.10.20.10";
 
};
 
</pre>
 
*cp /etc/bind/db.local /etc/bind/db.lab.local
 
*vi /etc/bind/db.lab.local
 
<pre>
 
$TTL    604800
 
@      IN      SOA    debian-srv.lab.local. root.lab.local. (
 
                        2    ; Serial
 
                        604800 ; Refresh
 
                        86400  ; Retry
 
                        2419200 ; Expire
 
                        604800 ) ; Negative Cache TTL
 
@      IN      NS      debian-srv.lab.local.
 
debian-srv      IN      A      10.20.10.11
 
rocky-srv      IN      A      10.20.10.12
 
debian-client  IN      A      10.20.10.51
 
</pre>
 
*cp /etc/bind/db.127 /etc/bind/db.10.20.10
 
*vi /etc/bind/db.10.20.10
 
<pre>
 
$TTL 604800
 
@ IN SOA debian-srv.lab.local. root.lab.local. (
 
        2 604800 86400 2419200 604800 )
 
@ IN NS debian-srv.lab.local.
 
11 IN PTR debian-srv.lab.local.
 
12 IN PTR rocky-srv.lab.local.
 
51 IN PTR debian-client.lab.local.
 
</pre>
 
*systemctl enable --now bind9
 
*dig debian-srv.lab.local @10.20.10.11 prüfen
 
  
= SFTP-Server (Rocky) =
+
*[[SFTP-Server (Rocky)]]
*yum install openssh-server -y
 
*systemctl enable --now sshd
 
*adduser sftpuser
 
*passwd sftpuser
 
*mkdir -p /sftp/files
 
*chown root:root /sftp
 
*chown sftpuser:sftpuser /sftp/files
 
*vi /etc/ssh/sshd_config
 
<pre>
 
Subsystem sftp internal-sftp
 
Match User sftpuser
 
  ChrootDirectory /sftp
 
  ForceCommand internal-sftp
 
</pre>
 
*systemctl reload sshd
 
*sftp sftpuser@10.20.10.12
 
: cd files
 
: put test.txt
 
  
 
= Test vom Client =
 
= Test vom Client =

Aktuelle Version vom 10. November 2025, 19:54 Uhr

Minimales Linux-Server-Schulungsnetz

Netzplan

Bezeichnung IP-Adresse Rolle Beschreibung
debian-srv 10.20.10.11 Server (Debian) Apache2, PHP, Exim, NFS, Samba, DHCP, DNS
rocky-srv 10.20.10.12 Server (Rocky Linux) Nginx, PHP, SFTP
debian-client 10.20.10.51 Client (Debian) Testsystem für Zugriff und Validierung
Netzsegmente:
  • 10.20.10.0/24 – internes Labornetz
  • 172.22.0.0/16 – externes Netz (Internet)

Test vom Client

  • apt install nfs-common smbclient dnsutils isc-dhcp-client -y
  • mount -t nfs 10.20.10.11:/srv/nfs/share /mnt
  • smbclient //10.20.10.11/share -U guest
  • dig rocky-srv.lab.local @10.20.10.11
  • ping 10.20.10.11