Skip to content

.conf files in /etc/apache2/mods-enabled/ directory instead of being symlinked #427

Closed
@jcollings

Description

@jcollings

Hi,

Not sure if this is an issue with the wordpress image, or the base apache image, but i thought i would mention it here.

When Using wordpress:php7.2-apache as an example and any other wordpress apache images, installing an ssl certificate for local development using:

RUN apt-get install -y --no-install-recommends ssl-cert && \
    a2enmod ssl && \
    a2ensite default-ssl

Use to work fine until i came across this issue the other day, it now throws the error:

ERROR: Config file setenvif.conf not properly enabled: ... is a real file, not touching it.

A work around for this i had to find all non symlinked files in the /etc/apache2/mods-enabled/ folder and move them to /etc/apache2/mods-available/ and create the symlink.

After this it worked again as normal, Working code (dont know if this is a good or bad thing what i have done, but it allows me to get my development environment back up and working):

#
# TMP symbolic link conf files
# 
RUN mv /etc/apache2/mods-enabled/alias.conf /etc/apache2/mods-available/alias.conf && ln -s /etc/apache2/mods-available/alias.conf /etc/apache2/mods-enabled/alias.conf && \
    mv /etc/apache2/mods-enabled/autoindex.conf /etc/apache2/mods-available/autoindex.conf && ln -s /etc/apache2/mods-available/autoindex.conf /etc/apache2/mods-enabled/autoindex.conf && \
    mv /etc/apache2/mods-enabled/deflate.conf /etc/apache2/mods-available/deflate.conf && ln -s /etc/apache2/mods-available/deflate.conf /etc/apache2/mods-enabled/deflate.conf && \
    mv /etc/apache2/mods-enabled/dir.conf /etc/apache2/mods-available/dir.conf && ln -s /etc/apache2/mods-available/dir.conf /etc/apache2/mods-enabled/dir.conf && \
    mv /etc/apache2/mods-enabled/mime.conf /etc/apache2/mods-available/mime.conf && ln -s /etc/apache2/mods-available/mime.conf /etc/apache2/mods-enabled/mime.conf && \
    mv /etc/apache2/mods-enabled/mpm_prefork.conf /etc/apache2/mods-available/mpm_prefork.conf && ln -s /etc/apache2/mods-available/mpm_prefork.conf /etc/apache2/mods-enabled/mpm_prefork.conf && \
    mv /etc/apache2/mods-enabled/negotiation.conf /etc/apache2/mods-available/negotiation.conf && ln -s /etc/apache2/mods-available/negotiation.conf /etc/apache2/mods-enabled/negotiation.conf && \
    mv /etc/apache2/mods-enabled/reqtimeout.conf /etc/apache2/mods-available/reqtimeout.conf && ln -s /etc/apache2/mods-available/reqtimeout.conf /etc/apache2/mods-enabled/reqtimeout.conf && \
    mv /etc/apache2/mods-enabled/setenvif.conf /etc/apache2/mods-available/setenvif.conf && ln -s /etc/apache2/mods-available/setenvif.conf /etc/apache2/mods-enabled/setenvif.conf && \
    mv /etc/apache2/mods-enabled/status.conf /etc/apache2/mods-available/status.conf && ln -s /etc/apache2/mods-available/status.conf /etc/apache2/mods-enabled/status.conf
#
# Install SSL Cert
# 
RUN apt-get install -y --no-install-recommends ssl-cert && \
    a2enmod ssl && \
    a2ensite default-ssl

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions