So beheben Sie den Absturz von Apache2 ohne FehlermeldungApache

Apache verstehen
Guest
 So beheben Sie den Absturz von Apache2 ohne Fehlermeldung

Post by Guest »

Ich versuche, Apache2 als Reverse-Proxy mit meiner Gunicorn/Python Flask-App in einem Docker-Container zu verwenden, aber Apache2 stürzt ohne Fehlermeldung ab. Ich habe versucht, ChatGPT zu fragen

und im Internet recherchiert, aber keine Lösung gefunden ...
Dockerfile:

Code: Select all

FROM python:3.9-slim

WORKDIR /app

COPY . /app

RUN if [ -f requirements.txt ]; then \
pip install --no-cache-dir -r requirements.txt; \
else \
pip freeze > requirements.txt && pip install --no-cache-dir -r requirements.txt; \
fi

EXPOSE 8000

ENV FLASK_APP=app.py

CMD ["gunicorn", "-b", "0.0.0.0:8000", "app:app"]
docker-compose.yml:

Code: Select all

services:
web:
build: .
expose:
- "8000"
environment:
- FLASK_ENV=production

apache:
image: httpd:latest
ports:
- "443:443"
volumes:
- ./apache.conf:/usr/local/apache2/conf/httpd.conf
- ./cert.pem:/usr/local/apache2/certificates/cert.pem
- ./key.pem:/usr/local/apache2/certificates/key.pem
depends_on:
- web

memcached:
image: memcached:latest
container_name: memcached
ports:
- "11211:11211"
restart: always
apache.conf:

Code: Select all

LoadModule mpm_event_module modules/mod_mpm_event.so
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_http_module modules/mod_proxy_http.so
LoadModule ssl_module modules/mod_ssl.so
LoadModule headers_module modules/mod_headers.so
LoadModule log_config_module modules/mod_log_config.so

ServerAdmin webmaster@localhost
Listen 443
ServerName localhost



SSLEngine on
SSLCertificateFile /usr/local/apache2/certificates/cert.pem
SSLCertificateKeyFile /usr/local/apache2/certificates/key.pem

ProxyPass / http://web:8000/
ProxyPassReverse / http://web:8000/

Header always set X-Frame-Options "SAMEORIGIN"
Header always set X-XSS-Protection "1; mode=block"
Header always set X-Content-Type-Options "nosniff"

LogLevel warn
ErrorLog /usr/local/apache2/logs/error_log
CustomLog /usr/local/apache2/logs/access_log combined

Das Apache-Protokoll wird nur mit Code 1 beendet
Hinweis: Wenn Sie sehen Wenn die Ports falsch eingestellt sind, teilen Sie mir dies bitte mit.

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post