Hello,
I am having trouble understanding how variable substitution works in the drupal.conf file.
When I build my Docker image from the Dockerfile, the drupal.conf file is correctly present inside the container, but it still contains the variables, for example:
DocumentRoot /var/www/html/${DOCROOT_FOLDER}
The values are not being substituted with the environment variables.
Inside the container, if I run:
echo ${DOCROOT_FOLDER}
I correctly get:
web
However, when I make a request to the Apache server, it attempts to serve index.php from:
/var/www/html
instead of:
/var/www/html/web
It seems as if Apache is not taking the environment variable into account.
Do you have any idea what I might be missing?
Thank you.
Comments
Comment #2
cedrxcHi,
I’ve figured out the cause of the issue.
It’s not related to variable substitution. The reason is that there is another file in the sites-enabled folder called 000-default.conf. My request was being handled by this file instead of drupal.conf when I left localhost as the APP_DOMAIN.
When I changed APP_DOMAIN to a name like drupal.local and updated my /etc/hosts with:
127.0.0.1 drupal.localI was able to reach the correct configuration via drupal.local.
So as I understand it, it’s not possible to use localhost as APP_DOMAIN. This makes sense, but for testing the module I hadn’t bothered to create a local DNS entry.
Comment #3
cedrxcComment #4
jonhattanyou're right, we want to `RUN rm a2dissite 000-default` for APP_DOMAIN=localhost to work.
Comment #5
jonhattanFixed.