Flask and Certbot - python

I am getting an error when trying to secure a Flask website with Certbot. I do not receive the following error on a normal site but when running Certbot on a Flask sudo certbot --apache
site I get:
Failed authorization procedure. example.com (http-01): urn:ietf:params:acme:error:unauthorized :: The client lacks sufficient authorization :: Invalid response from http://example.com/.well-known/acme-challenge/j7Q5mIX-Cmk9wevuSQxxfBV5KBBgyQuoG9HXUEbU2Gw:
I am running Apache on Ubuntu 18.04 and Python2.7

Related

Let's encrypt Failed authorization procedure

I'm using Debian 9 and NGINX to deploy my app Django.
When I type:
sudo certbot --nginx -d example.com -d www.example.com
I get the next error:
Failed authorization procedure. example.com (http-01):
urn:acme:error:tls :: The server experienced a TLS error during domain
verification :: Fetching https://example.com/.well-known/acme-
challenge/H9WJVzPYJ93jewGJjkUFFKQJBJ8-YT7t9z-Sw_PQQUg: remote error: tls:
internal error
IMPORTANT NOTES:
- The following errors were reported by the server:
Domain: example.com
Type: tls
Detail: Fetching
https://example.com/.well-known/acme-
challenge/H9WJVzPYJ93jewGJjkUFFKQJBJ8-YT7t9z-Sw_PQQUg:
remote error: tls: internal error
To fix these errors, please make sure that your domain name was
entered correctly and the DNS A/AAAA record(s) for that domain
contain(s) the right IP address. Additionally, please check that
you have an up-to-date TLS configuration that allows the server to
communicate with the Certbot client.
I do not know what I'm doing wrong...

Let's encrypt after installing Django has errors

After installing Django I tried to install SSL using Let's Encrypt with Nginx,
sudo certbot --nginx -d [mydomain.com]
But I get this error,
Domain: [mydomain.com]
Type: unknownHost
Detail: No valid IP addresses found for [mydomain.com]
My domain is accessible and there are A entries.
What is wrong?

Vagrant - Django server - Why is host redirecting to https?

I setup a vagrant VM with django installed, and setup the port forwarding like this:
config.vm.network "forwarded_port", guest: 8000, host: 8001
So in the guest machine I run the django server like this:
python manage.py 0.0.0.0:8000
And the server starts up and tells me its running on http://127.0.0.1:8000
When I open up firefox on the host machine and point it to http://127.0.0.1:8001, it automatically redirects to https://127.0.0.1:8001 and I get this error:
An error occurred during a connection to 127.0.0.1:8001. SSL received
a record that exceeded the maximum permissible length. Error code:
SSL_ERROR_RX_RECORD_TOO_LONG
Nowhere in the settings.py file does it force https. I don't know whats causing it to redirect to https, or how I can go about figuring that out. Is this a problem with virtualbox, vagrant or django?
These error messages appear in the terminal where I run the server:
[06/Jan/2017 05:17:22] code 400, message Bad request syntax ('\x16\x03\x01\x00¥\x01\x00\x00¡\x03\x03d')
You're accessing the development server over HTTPS, but it only supports HTTP.
[06/Jan/2017 05:17:31] code 400, message Bad HTTP/0.9 request type ("\x16\x03\x01\x00¥\x01\x00\x00¡\x03\x03É\x8aVY#¦Û2\x
9c'\x1a5n¬òðÿ𪪮pÛ%å\x15#8jÕQé\x00\x00")
You're accessing the development server over HTTPS, but it only supports HTTP.
So the question is why is my browser trying to access the server over HTTPS?
You need to add this in your settings.py file :
SECURE_SSL_REDIRECT = False
For further reading, Read from here.

Authentication Agent Error in OpenShift

I'm trying to deploy a simple python flask web application in OpenShift,
But after deploying the application I'm getting "500 Internal Server error" when i try to access the url and the following error is thrown in the server log,
rhc tail -a app -l mail -p password

uWSGI configuration for Apache for Galaxy instance

I want to setup a Galaxy instance in my server running on CentOS and I have an issue with configuring my Apache server with uWSGI. I have installed uwsgi with pip:
pip install uwsgi
and added in my Apache configuration file the following lines:
<Location "/galaxy">
Sethandler uwsgi-handler
uWSGISocket 127.0.0.1:4001
uWSGImaxVars 512
</Location>
as instructed by the Galaxy team. Nevertheless when I restart my web server I get the following error:
Invalid command 'uWSGISocket', perhaps misspelled or defined by a mod
and it fails to start again.
I'm very new to using Apache for proxying requests so I need any help I can get.
Thank you in advance.

Categories