Hey All,
I am testing a LAMP deployment via AWS. I had to make some modifications to the traefik.yml docker compose file in order to to secure my domain. The addition I made is below.
services:
<the service>:
...
dns:
- 1.1.1.1
- 1.0.0.1
...
This allowed the traefik container to ping DNS addresses (i.e. letsencrypt.com to get the certificates). See this stack overflow post where I found this solution.
Continuing to the lamp compose file. In the docs, I am using the first compose file without the addition of self hosting the dashboard. After deployment, access to the api domain is secure and successful. Looking at the server logs, it also seemse like my database is initialized successfully.
Unfortunately when I try the database and admin sign in commands I get the following responses…
Command: curl -k https://admin:DB_PASSSWORD_HERE@db.example.com/
(changing the password and domain)
Response: 404 page not found
Command: curl -k https://api.devprechlamp.com/researcher -H 'Authorization: Basic admin:admin'
Response: {"error": "403.no-such-credentials"}
Command: curl -k https://api.devprechlamp.com/researcher -H 'Authorization: Basic admin:<admin password here>'
Response: { "error": "403.no-such-credentials"}
It seems like communication from the server container to the database container is not working. I also checked to see if port 27017 (used by the database provided in the lamp compose file) was in use. Running the command: sudo lsof -i -P -n | grep LISTEN
did not show port 27017 in use. So on a second iteration of deployment I added the following to the compose file:
database:
...
ports:
- "27017:27017"
...
After deploying and running the same lsof
command, port 27017 was now in use. Unfortunately this did not change the outcome of any of the database/admin commands above.
Is there a final step I’m missing? Does there need to be additional parameters in the lamp compose file? Let me know if you need any more information, happy to help anyway I can! I was reading through the lamp_database
logs as well but I don’t know how to decipher any of them.
Thanks in advance,
Steve