I'm having three errors when i run docker:
ERROR: for learningphp7_web_1 Cannot create container for service web: invalid mode: /etc/apache2/sites-enabled/virtualhosts.conf
ERROR: for web Cannot create container for service web: invalid mode: /etc/apache2/sites-enabled/virtualhosts.conf
ERROR: Encountered errors while bringing up the project.
How can i solve these issues and finally start using docker?
My virtualhosts.conf
:
<VirtualHost *:80>
ServerName localhost
DocumentRoot /var/www/html/web
DirectoryIndex index.php
<Directory /var/www/html/web>
AllowOverride None
Require all granted
Allow from All
Options FollowSymLinks
<IfModule mod_rewrite.c>
Options -MultiViews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php [QSA,L]
</IfModule>
</Directory>
</VirtualHost>
Check your docker-compose.yml file. I recently had the same error, due to an extra space in the volume config:
volumes:
- ./www:/home/distressedpro/public_html
- ./conf:/etc/apache2/sites-available
Note the extra space on the last line, that was causing the error. Correcting it to:
volumes:
- ./www:/home/distressedpro/public_html
- ./conf:/etc/apache2/sites-available
fixed it
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With