0

Set up

So I am new to Docker and currently learning by following tutorials and docker official documentation online. So I have created a dummy project with only two files which are index.php and Dockerfile.

Dockerfile:

FROM php:7.2-apache

Background

  1. I have enabled the windows 10 virtualization option
  2. I have installed docker toolbox together with Oracle VM VirtualBox.
  3. Here is the result of running docker version
Client:
 Version:           19.03.1
 API version:       1.39 (downgraded from 1.40)
 Go version:        go1.12.7
 Git commit:        74b1e89e8a
 Built:             Wed Jul 31 15:18:18 2019
 OS/Arch:           windows/amd64
 Experimental:      false

Server: Docker Engine - Community
 Engine:
  Version:          18.09.9
  API version:      1.39 (minimum version 1.12)
  Go version:       go1.11.13
  Git commit:       039a7df9ba
  Built:            Wed Sep  4 16:55:50 2019
  OS/Arch:          linux/amd64
  Experimental:     false

So I am trying to set up an apache server for php development and here are the commands that I have run.

  1. build the image
docker build .
  1. create the container
docker container run -d -p 4000:80 [imageID]
  1. Accessing the server through browser, my VM IP address is 192.168.99.100. So I tried
http://192.168.99.100:4000

But I got this error:

Forbidden

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

Apache/2.4.38 (Debian) Server at 192.168.99.100 Port 4000

Questions

  1. Why the problem occurs? Is it because I haven't added myself to the server user group?

  2. if Q1's response is yes, then how can I grant permission? 2.1 I have tried to find an apache config file but since the apache server is created using docker I don't exactly know where to find it. I shouldn't change it, right?

2.2 I also tried to looked into window user group permissions through Computer Management Center, but I don't have that option in my version of windows

  1. (Option) I currently using the IP address that my vm running on instead of localhost. So how can I change that? again, I can't find config file for apache server.
Jay Blanchard
  • 34,243
  • 16
  • 77
  • 119
Yifan Lu
  • 23
  • 5
  • 1
    its really apache question: read [this](https://stackoverflow.com/questions/10873295/error-message-forbidden-you-dont-have-permission-to-access-on-this-server) – Dusan Gligoric Sep 23 '19 at 14:18
  • It is OK to change the Apache config file if you need to for a specific purpose, like adding virtual hosts and such. Can you copy and paste your config file by editing your question to include it? – Jay Blanchard Sep 23 '19 at 14:28
  • Typically the config file is in `etc/apache/` or `etc/apache2/` – Jay Blanchard Sep 23 '19 at 14:29
  • Thank you for replying, I realized that it is a apache problem but I do need help to find where is apache is installed. I don't have apache installed in my local machine. But instead, it is created through docker image. So I wonder where to find the config file -_- – Yifan Lu Sep 24 '19 at 08:37

0 Answers0