You don't have permission to access / on this server.

Hey there!
I have a container running a php service with the following settings in docker-compose.yml

version: ‘2’
volumes:
laisdb-data:
services:
supervisorio:
image: eltonssilva/supervisorio:armv7_1.0
restart: always
ports:
- 80:80
- 443:443
volumes:
- laisdb-data:/php/www/var/www/html/
- laisdb-data:/homekit/accessories/home/pi/HAP-NodeJS/accessories/
- laisdb-data:/configs/home/node/app/configs
- laisdb-data:/php/localcerts/etc/ssl/localcerts/
- laisdb-data:/php/sites-available/etc/apache2/sites-available/
- laisdb-data:/php/sites-enabled/etc/apache2/sites-enabled/
- laisdb-data:/php/mods-enabled/ssl.conf/etc/apache2/mods-enabled/ssl.conf
- laisdb-data:/php/mods-enabled/ssl.load/etc/apache2/mods-enabled/ssl.load
- laisdb-data:/php/mods-enabled/socache_shmcb.load/etc/apache2/mods-enabled/socache_shmcb.load
- laisdb-data:/mosquitto/config/etc/mosquitto/config
- laisdb-data:/mosquitto/data/etc/mosquitto/data

but i am getting the following a 403 forbidden message

“You do not have permission to access / on this server.”

Is there any configuration I need to do to solve this?

Hello, that message from the Apache web server could indicate incorrect file or directory permissions or a misconfiguration of one of the Apache config files. First though I would make sure that there is a default web page (such as index.html or index.php) for the server to serve at the web root, usually /var/www/html/. (Note that path is inside the container)

the file does not exist

image

Hello,

Since here is no home page (e.g. index.html) in the /var/www/html directory in the container, apache is trying to list all files, but directory listing is disabled in Apache by default, this is why you’re seeing the 403 error. You would need to place the home page in that directory to fix that problem. You can quickly test it by running echo hello > /var/www/html/index.html inside the container, then reloading the page. If you see ‘hello’ in the browser, then you’ll just need to ensure your Dockerfile copies appropriate files into the container (or mounts appropriate directory). If you still see 403 error, then you’d need to look at the file permissions and apache config (perhaps it has a different root directory specified), to see where the problem is.

Yes this is my service which was working

image

according to the documentation it still doesn’t support link volumes so i’m trying to fix the mount points but still no success

Hello,
Can you please link us that documentation for reference? This would probably help us in reproducing this issue. Additionally if you can give a link to a public GitHub repo for this then that would be really helpful for us to get the correct idea.