I’m trying to set up Jam.py on a Ubuntu system that has an Apache server. I want it to use HTTPS instead of HTTP, but have had no success so far. The server has a valid digital certificate via Certbot. I tried to follow the steps shown at https://jam-py.com/docs/how_to/deploy/how_to_deploy_to_linux_apache.html and pass the 443 command line argument to server.py, but attempting to start it causes this error: OSError: [Errno 98] Address already in use Running server.py if the Apache server isn’t running doesn’t cause an error, but it still uses HTTP in spite of listening on port 443.
What should I do next to diagnose this problem?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.
This promotional offer applies to new account only.
Hello there! For other readers, since been a while from the OP question, there is a way to run gunicorn over SSL: https://groups.google.com/g/jam-py/c/M0GzXl1J3Gc/m/RPQ_u2FJAQAJ
However, the problem with gunicorn and Jam (or any wsgi app), is seeing the log files. And log files are really needed. Also, after the reboot, the app will not work unless there is a startup file created for gunicorn. Which is fiddly.
Hence, since Jam is a wsgi app, Apache can happily run on ssl with it. There is no need to start the application on port 8080 with gunicorn or to run “python server.py”, or as OP mentioned “pass the 443 command line argument to server.py”.
As per OP link, just set the SSL options and off you go.
Before even trying SSL, make sure Apache actually works: https://groups.google.com/g/jam-py/c/Zv5JfkLRFy4/m/JnoLSg3uGQAJ
Good luck
If you want to use
Jam.py
with HTTPS behind an Apache server, it’s typically best to utilize Apache as a reverse proxy for theJam.py
application. Instead of running the Jam.py application directly on port 443 (which will cause a conflict if Apache is already using that port), you should:Here’s a step-by-step guide:
This configuration tells Apache to accept HTTPS requests on port 443 and forward (proxy) them to your Jam.py application running on port 8080.
Now, when you access your domain via HTTPS (https://yourdomain.com), Apache will handle the SSL/TLS encryption and then proxy the requests to the Jam.py application.
Hi there,
You can not have two services listening on the same port. If your Apache service is already listening on port 443 with a valid SSL, you will not be able to start your Jam app on the same port.
You should start your app as normal and not on port 443.
An alternative option, would be to use Nginx as described here:
https://www.digitalocean.com/community/tutorials/how-to-set-up-django-with-postgres-nginx-and-gunicorn-on-ubuntu-16-04
The article uses Django as an example, but the setup will be the same.
Let me know how it goes!
Best,
Bobby