saasitive / django-react-boilerplate

DIY Django + React Boilerplate for starting your SaaS
https://saasitive.com
MIT License
596 stars 89 forks source link

Not working with aws ec2 instance #15

Open bonn2327 opened 3 years ago

bonn2327 commented 3 years ago

working with docker-compose-dev.yml but with another ec2 instance and docker-compose giving error

Certbot failed to authenticate some domains (authenticator: webroot). The Certificate Authority reported these problems: Domain: mydomain.com Type: unauthorized Detail: Invalid response from http://mydomain.com/.well-known/acme-challenge/sklMcsF8-vKNJkzKqo95shFDXqdr7uiaOpWDiGspyrs [13.233.108.169]: "<!doctype html><html lang=\"en\"><meta charset=\"utf-8\"/><link rel=\"icon\" href=\"/favicon.ico\"/><meta name=\"viewport\" content="

Domain: www.mydomain.com Type: unauthorized Detail: During secondary validation: Invalid response from http://www.mydomain.com/.well-known/acme-challenge/LH-LaBi42ZGOZAeTHycKAEKN670LF5m-ErwbXYzpeNs [13.233.108.169]: "<!doctype html><html lang=\"en\"><meta charset=\"utf-8\"/><link rel=\"icon\" href=\"/favicon.ico\"/><meta name=\"viewport\" content="

Hint: The Certificate Authority failed to download the temporary challenge files created by Certbot. Ensure that the listed domains serve their content from the provided --webroot-path/-w and that files created there can be downloaded from the internet.

Some challenges have failed. Ask for help or search for solutions at https://community.letsencrypt.org. See the logfile /var/log/letsencrypt/letsencrypt.log or re-run Certbot with -v for more details.

Reloading nginx ...

2021/08/04 06:39:21 [emerg] 31#31: cannot load certificate "/etc/letsencrypt/live/mydomain.com/fullchain.pem": BIO_new_file() failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen('/etc/letsencrypt/live/mydomain.com/fullchain.pem','r') error:2006D080:BIO routines:BIO_new_file:no such file) nginx: [emerg] cannot load certificate "/etc/letsencrypt/live/mydomain.com/fullchain.pem": BIO_new_file() failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen('/etc/letsencrypt/live/mydomain.com/fullchain.pem','r') error:2006D080:BIO routines:BIO_new_file:no such file)

5h44n commented 2 years ago

did you find a solution to this? running into the same issue

pplonski commented 2 years ago

You need to set the routing of EC2 instance IP to your domain name in Route 53 to make it work.

5h44n commented 2 years ago

yeah solved this by 1) making sure you're pointing your domain at your server's public IP by adding a DNS record using your domain manager (GoDaddy, Route53, etc) and 2) making sure your server is configured to accept HTTP requests on port 80, HTTPS on port 443. In my case on Digital Ocean, had to delete my Cloud Firewall and recreate it (it was not working properly blocking all traffic at first weirdly)

pplonski commented 2 years ago

@shanexavier313 great! Did you manage to build your project or just starting?

5h44n commented 2 years ago

yes i did, thank you for the guide, was a lifesaver