Apache forbidden access with Docker

后端 未结 2 607
萌比男神i
萌比男神i 2021-01-19 19:42

I build this image on docker-compose.yml

version: \'2\'

services:
  webserver:
  build: ./docker/webserver
  image: image_name
  ports:
    - \"80:80\"
             


        
相关标签:
2条回答
  • 2021-01-19 20:02

    Looks like apache is not finding an index page to serve. Ensure your volume mapping is correct (enter the image with docker exec and check contents of /var/www/html folder). If your files are there, ensure that you have an index.html or index.php file for apache to be served.

    0 讨论(0)
  • 2021-01-19 20:06

    If you change to apache document root to something non-standard outside of /var/www you will need to grant access in your vhost:

    DocumentRoot /workspace/my-project
    
    <Directory /workspace/my-project>
        Require all granted
    </Directory>
    
    0 讨论(0)
提交回复
热议问题