Конфигурация Apache/нет доступа к localhost:8080 в DockerApache

Ответить
Anonymous
 Конфигурация Apache/нет доступа к localhost:8080 в Docker

Сообщение Anonymous »

Проблемы с Docker при попытке установить Moodle через образ php8.5.3-apache.
Вот мой Dockerfile:

Код: Выделить всё

FROM php:8.5.3-apache
WORKDIR /var/www/html/

# COPY ./moodle.conf /etc/apache2/conf-available/moodle.conf to set up the Apache configuration for Moodle. This file should contain the necessary directives to serve the Moodle application correctly.
COPY ./moodle_listener.conf /etc/apache2/moodle_listener.conf
COPY ./moodle_listeners.conf /etc/apache2/sites-available/moodle_listeners.conf

# Installe les dépendances
RUN apt-get update && \
apt-get install -y --no-install-recommends \
git \
unzip \
libzip-dev \
libjpeg-dev \
libpng-dev \
libfreetype6-dev \
libpq-dev \
libicu-dev \
libxml2-dev \
libonig-dev && \
docker-php-ext-configure gd --with-freetype --with-jpeg && \
docker-php-ext-install -j$(nproc) zip gd pgsql pdo_pgsql intl soap

# Clone Moodle 5.1+ et configure la structure
RUN mkdir /var/www/html/moodle && \
cd /var/www/html/moodle && \
git clone -b MOODLE_501_STABLE git://git.moodle.org/moodle.git . && \
chown -R root /var/www/html/moodle/ && \
chmod -R 0755 /var/www/html/moodle/

# Create data directory
RUN mkdir -p /var/www/html/moodledata && \
chown -R www-data:www-data /var/www/html/moodledata && \
chmod -R 0777 /var/www/html/moodledata

# Ensure the default site is enabled
RUN ln -sf /etc/apache2/sites-available/moodle_listeners.conf /etc/apache2/sites-enabled/

CMD ["apache2ctl", "-D", "FOREGROUND"]

EXPOSE 8080
Вот файл «moodle_listeners.conf» :

Код: Выделить всё

Include /etc/apache2/moodle_listener.conf

И здесь находится файл «moodle_listener.conf», скопированный из статьи «Реструктуризация кода Moodle».
Это код ошибки, когда я запускаю Docker -p 8080:8080 --name Moudle_setup Moudle5.1 :

Код: Выделить всё

AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.17.0.2. Set the 'ServerName' directive globally to suppress this message
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.17.0.2. Set the 'ServerName' directive globally to suppress this message
[Tue Mar 03 14:21:37.735910 2026] [mpm_prefork:notice] [pid 8:tid 8] AH00163: Apache/2.4.66 (Debian) PHP/8.5.3 configured -- resuming normal operations
[Tue Mar 03 14:21:37.735943 2026] [core:notice] [pid 8:tid 8] AH00094: Command line: '/usr/sbin/apache2 -D FOREGROUND'
Я пробовал кое-что в Интернете, но ничего не получилось. Спасибо за помощь.
Репозиторий здесь.

Подробнее здесь: https://stackoverflow.com/questions/799 ... -on-docker
Ответить

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

Вернуться в «Apache»