Benutzer-Werkzeuge

Webseiten-Werkzeuge


webserver

Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.

Link zu dieser Vergleichsansicht

Beide Seiten der vorigen Revision Vorhergehende Überarbeitung
Nächste Überarbeitung
Vorhergehende Überarbeitung
webserver [2025/06/13 16:31]
jango
webserver [2025/06/13 20:50] (aktuell)
jango [Docker]
Zeile 1: Zeile 1:
-<code> + 
-RUN cat <<EOF > /etc/nginx/sites-available/default+=====Ubuntu===== 
 + 
 +<code bash
 +ln -snf /usr/share/zoneinfo/Europe/Vienna /etc/localtime && echo Europe/Vienna > /etc/timezone 
 +dpkg --configure -a 
 +DEBIAN_FRONTEND=noninteractive apt update && apt install -y nginx php8.1-fpm mariadb-server php-mysqli 
 +cat <<'EOF> /etc/nginx/sites-available/default
 server { server {
         listen 80 default_server;         listen 80 default_server;
-        listen [::]:80 default_server; 
- 
         root /var/www/html;         root /var/www/html;
- +        index index.php index.html index.nginx-debian.html;
-        index index.php index.html index.htm index.nginx-debian.html; +
         server_name _;         server_name _;
- 
         location / {         location / {
                 try_files $uri $uri/ =404;                 try_files $uri $uri/ =404;
         }         }
- 
-        # pass PHP scripts to FastCGI server 
         location ~ \.php$ {         location ~ \.php$ {
                 include snippets/fastcgi-php.conf;                 include snippets/fastcgi-php.conf;
                 fastcgi_pass unix:/run/php/php8.1-fpm.sock;                 fastcgi_pass unix:/run/php/php8.1-fpm.sock;
         }         }
- +        location ~ /\.ht { 
-        # deny access to .htaccess files +               deny all; 
-        #location ~ /\.ht { +        }
-        #       deny all; +
-        #}+
 } }
 EOF EOF
 </code> </code>
  
-=====Ubuntu=====+=====Docker=====
  
-<code bash+<code> 
-ln -snf /usr/share/zoneinfo/Europe/Vienna /etc/localtime && echo Europe/Vienna > /etc/timezone +#!/bin/bash
-dpkg --configure -a +
-DEBIAN_FRONTEND=noninteractive apt update && apt install -y nginx php8.3-fpm mariadb-server php-mysqli +
-</code>+
  
-=====Docker=====+# 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.1749825068.txt.gz · Zuletzt geändert: 2025/06/13 16:31 von jango