Fedora 28/29 docker LAMP

200 Views Asked by At

I'm new to docker, can someone help me with docker LAMP and Fedora 28/29. For some unknown reason when I run docker-compose up -d port 80 does not open or MySQL port 3306 but PHPMyAdmin on 0.0.0.0:8080 is accessible.

Here is docker lamp GitHub page what I'm using: https://github.com/sprintcube/docker-compose-lamp/tree/7.2.x

nmap scan

$ nmap -sT 0.0.0.0
Nmap scan report for 0.0.0.0

PORT     STATE SERVICE
631/tcp  open  ipp
8080/tcp open  http-proxy
1

There are 1 best solutions below

1
On

Looking at your logs apache won't run because it can't access conf file you have mounted:

7.1.x-webserver | apache2: Syntax error on line 225 of /etc/apache2/apache2.conf: Could not open config directory /etc/apache2/sites-enabled: Permission denied

This can be caused by a few reasons. In order to find the root cause I'll need more data.

  1. Which user runs docker-compose up command?
  2. Owner and group of volumes you're trying to mount (Show output of ls -la on each of those volumes).
  3. The user which is being used inside a container.

My guess is that files you're mounting dirs of UserA, and you're mounting them from UserB. Most probably files belong to root and you run from your local user henry@localhost right? Maby not a secure solution but try to execute docker-compose from root user.

There is also the case where the UID and GID are different on host and container even though permissions are correct. As a result, you will have permission denied error.

Moreover, how do you even start apache? because I don't see it nither in docker-compose nor Dockerfile of that image? (By looking at example you're using)

By the way, you have also problem with mysql container but that's another story:

5.7-mysql     | chown: cannot read directory '/var/lib/mysql/': Permission denied