Closed innovaweb-dev closed 6 years ago
You are actualy writing to the wrong file. vhost.common.d/vhost.conf is only used in the vhost.conf The used vhost is: /opt/docker/etc/httpd/vhost.conf
But simply copying it there will not cut it completely. Here is the actual vhost.conf inside the container:
#######################################
# Vhost
#######################################
<VirtualHost *:80>
ServerName docker.vm
ServerAlias *.vm
DocumentRoot "/var/www/html"
UseCanonicalName Off
<IfVersion < 2.4>
Include /opt/docker/etc/httpd/vhost.common.d/*.conf
</IfVersion>
<IfVersion >= 2.4>
IncludeOptional /opt/docker/etc/httpd/vhost.common.d/*.conf
</IfVersion>
</VirtualHost>
<VirtualHost *:443>
ServerName docker.vm
ServerAlias *.vm
DocumentRoot "/var/www/html"
UseCanonicalName Off
<IfVersion < 2.4>
Include /opt/docker/etc/httpd/vhost.common.d/*.conf
</IfVersion>
<IfVersion >= 2.4>
IncludeOptional /opt/docker/etc/httpd/vhost.common.d/*.conf
</IfVersion>
Include /opt/docker/etc/httpd/vhost.ssl.conf
</VirtualHost>
I think it helps using docker exec -it
Is this answer sufficient?
Closed due to inactivity
Hi all and thanks you for your assitance. I create my first docker-compose.yml and it works correctly with image
webdevops/php-apache:debian-8-php7
. But now I need to add a lot vhost in my apache server and Docker displays this messageAH00526: Syntax error on line 1 of /opt/docker/etc/httpd/vhost.common.d/vhost.conf:
<VirtualHost> cannot occur within <VirtualHost> section
Do you know why ? my docker-compose.yml
my vhost.conf
And if you need the guide of the image that I use: http://dockerfile.readthedocs.io/en/latest/content/DockerImages/dockerfiles/php-apache-dev.html#apache-layout
Thanks all for your help