Benutzer-Werkzeuge

Webseiten-Werkzeuge


webserver

Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.

Link zu dieser Vergleichsansicht

Nächste Überarbeitung
Vorhergehende Überarbeitung
webserver [2025/06/13 16:22]
jango angelegt
webserver [2025/06/13 20:50] (aktuell)
jango [Docker]
Zeile 1: Zeile 1:
 +
 =====Ubuntu===== =====Ubuntu=====
  
Zeile 4: Zeile 5:
 ln -snf /usr/share/zoneinfo/Europe/Vienna /etc/localtime && echo Europe/Vienna > /etc/timezone ln -snf /usr/share/zoneinfo/Europe/Vienna /etc/localtime && echo Europe/Vienna > /etc/timezone
 dpkg --configure -a dpkg --configure -a
-DEBIAN_FRONTEND=noninteractive apt update && apt install -y nginx php8.3-fpm mariadb-server php-mysqli+DEBIAN_FRONTEND=noninteractive apt update && apt install -y nginx php8.1-fpm mariadb-server php-mysqli 
 +cat <<'EOF' > /etc/nginx/sites-available/default 
 +server { 
 +        listen 80 default_server; 
 +        root /var/www/html; 
 +        index index.php index.html index.nginx-debian.html; 
 +        server_name _; 
 +        location / { 
 +                try_files $uri $uri/ =404; 
 +        } 
 +        location ~ \.php$ { 
 +                include snippets/fastcgi-php.conf; 
 +                fastcgi_pass unix:/run/php/php8.1-fpm.sock; 
 +        } 
 +        location ~ /\.ht { 
 +               deny all; 
 +        } 
 +
 +EOF
 </code> </code>
  
 =====Docker===== =====Docker=====
 +
 +<code>
 +#!/bin/bash
 +
 +# User erstellen
 +RUN useradd -ms /bin/bash manager
 +RUN echo "manager:password" | chpasswd
 +
 +# Dienste starten
 +service mariadb start
 +service php8.1-fpm start
 +service nginx start
 +
 +# MySQL Root Passwort setzen
 +mysql -u root -e "use mysql; ALTER USER 'root'@'localhost' IDENTIFIED BY 'password'; FLUSH PRIVILEGES;"
 +</code>
  
 <code> <code>
 FROM ubuntu:22.04 FROM ubuntu:22.04
 +
 ARG DEBIAN_FRONTEND=noninteractive ARG DEBIAN_FRONTEND=noninteractive
 +
 RUN ln -snf /usr/share/zoneinfo/Europe/Vienna /etc/localtime && echo Europe/Vienna > /etc/timezone RUN ln -snf /usr/share/zoneinfo/Europe/Vienna /etc/localtime && echo Europe/Vienna > /etc/timezone
 RUN dpkg --configure -a RUN dpkg --configure -a
-RUN apt update && apt install -y nginx php-fpm mariadb-server php-mysqli+ 
 +RUN apt update && apt install -y nginx php8.1-fpm mariadb-server php-mysqli 
 + 
 +RUN cat <<'EOF' > /etc/nginx/sites-available/default 
 +server { 
 +        listen 80 default_server; 
 +        root /var/www/html; 
 +        index index.php index.html index.nginx-debian.html; 
 +        server_name _; 
 +        location / { 
 +                try_files $uri $uri/ =404; 
 +        } 
 +        location ~ \.php$ { 
 +                include snippets/fastcgi-php.conf; 
 +                fastcgi_pass unix:/run/php/php8.1-fpm.sock; 
 +        } 
 +        location ~ /\.ht { 
 +               deny all; 
 +        } 
 +
 +EOF 
 + 
 +# start.sh hinzufügen 
 +COPY start.sh /start.sh 
 +RUN chmod +x /start.sh 
 + 
 +# Containerstart 
 +CMD ["/start.sh"]
 </code> </code>
webserver.1749824563.txt.gz · Zuletzt geändert: 2025/06/13 16:22 von jango