Reda
Reda

Reputation: 55

Deploying Flask app on own Ubuntu Server Error

GOAL : I am trying to deploy my Flask app to make it public on the web. I have my own server which runs on Ubuntu 18.04

TUTORIAL : As it is the first time I am doing this, I am following this tutorial. All his steps are perfectly working for me except the last one. However, in this tutorial he used Linode and I use my own server so I directly code on my terminal

PROBLEM : In his last step after systemctl reload apache2 when I go on the my browser and type my ip address (found using ifconfig) that I put in webApp.conf (192.168.1.25) I get the following error : enter image description here

ERROR LOGS : As asked I went into the error.log which outputs the following : enter image description here You can find the code here : https://pastebin.com/g2rzRUXE

POTENTIAL PROBLEMS: From what I understand I am having two issues :

  1. Set the 'ServerName' directive globally to suppress this message . So I tried to solve it using this tutorial and I changed my private ip address to my public ip address (found on whatismyip.com) but when doing so I received the following error: error

    1. It does not seem to like my prints: error2 . Am I not allowed to keep prints

Please let me know how I could solve these problems or the other ones in the error log that I might not have seen.

I hope I was clear enough. If you need any additional info I can edit my question. I am running out of ideas so if you have any tips I would be grateful.

Upvotes: 0

Views: 310

Answers (1)

Laurent LAPORTE
Laurent LAPORTE

Reputation: 22952

In the logs, I can read:

Apache/2.4.29 (Ubuntu) mod_wsgi/4.5.17 Python/2.7 configured -- resuming normal operations

So, you are using Python 2 instead of Python 3.

You need to install a mod_wsgi module compatible with Python 3.

Follow the instruction available here : https://modwsgi.readthedocs.io/en/develop/user-guides/quick-installation-guide.html

The following link can also help: https://stackoverrun.com/fr/q/12335951 (in French).

Upvotes: 1

Related Questions